184 lines
5.9 KiB
Python
184 lines
5.9 KiB
Python
|
|
#!/usr/bin/env python3
|
||
|
|
import os
|
||
|
|
ROOT = os.path.join(os.path.dirname(__file__), "..")
|
||
|
|
|
||
|
|
def w(rel, c):
|
||
|
|
p = os.path.join(ROOT, rel.replace('/', os.sep))
|
||
|
|
os.makedirs(os.path.dirname(p), exist_ok=True)
|
||
|
|
open(p, 'w', encoding='utf-8', newline='\n').write(c)
|
||
|
|
|
||
|
|
# Save cmd - generic with all fields as optional for copy from client
|
||
|
|
def gen_save_cmd(name):
|
||
|
|
w(f"safety-eval-client/src/main/java/org/qinan/safetyeval/client/dto/institution/{name}SaveCmd.java", f"""package org.qinan.safetyeval.client.dto.institution;
|
||
|
|
|
||
|
|
import lombok.Data;
|
||
|
|
|
||
|
|
import java.time.LocalDate;
|
||
|
|
import java.time.LocalDateTime;
|
||
|
|
|
||
|
|
@Data
|
||
|
|
public class {name}SaveCmd {{
|
||
|
|
private String id;
|
||
|
|
private String projectId;
|
||
|
|
private String riskId;
|
||
|
|
private String surveyId;
|
||
|
|
private String signTaskId;
|
||
|
|
private LocalDate analysisDate;
|
||
|
|
private String evalTypeCode;
|
||
|
|
private String evalTypeName;
|
||
|
|
private String industryCode;
|
||
|
|
private String industryName;
|
||
|
|
private String evalScope;
|
||
|
|
private Integer inBizScopeFlag;
|
||
|
|
private String unitOverview;
|
||
|
|
private String industryRiskDesc;
|
||
|
|
private Integer staffMatchCode;
|
||
|
|
private Integer needExpertCode;
|
||
|
|
private Integer capabilityCode;
|
||
|
|
private Integer feasibleCode;
|
||
|
|
private Integer economicCode;
|
||
|
|
private Integer riskLevelCode;
|
||
|
|
private String riskLevelName;
|
||
|
|
private Integer signContractCode;
|
||
|
|
private String conclusionContent;
|
||
|
|
private String approverName;
|
||
|
|
private Integer approvalOpinionCode;
|
||
|
|
private String approvalOpinionName;
|
||
|
|
private LocalDate approvalDate;
|
||
|
|
private Integer statusCode;
|
||
|
|
private String personnelId;
|
||
|
|
private String personnelName;
|
||
|
|
private String deptName;
|
||
|
|
private Integer signStatusCode;
|
||
|
|
private String signFileUrl;
|
||
|
|
private Integer sortOrder;
|
||
|
|
private String orgName;
|
||
|
|
private String contractNo;
|
||
|
|
private String projectName;
|
||
|
|
private String projectIntro;
|
||
|
|
private Long amountFen;
|
||
|
|
private String projectTypeCode;
|
||
|
|
private String projectTypeName;
|
||
|
|
private String riskSummary;
|
||
|
|
private String projectRegion;
|
||
|
|
private String projectAddress;
|
||
|
|
private LocalDate contractStartDate;
|
||
|
|
private LocalDate contractEndDate;
|
||
|
|
private Integer toxicFlag;
|
||
|
|
private Integer precursorFlag;
|
||
|
|
private Integer crossProvinceFlag;
|
||
|
|
private String businessScope;
|
||
|
|
private String enterpriseName;
|
||
|
|
private String industryCategory;
|
||
|
|
private String officeAddress;
|
||
|
|
private String creditCode;
|
||
|
|
private String postCode;
|
||
|
|
private String enterprisePhone;
|
||
|
|
private String fax;
|
||
|
|
private String legalPerson;
|
||
|
|
private String contactName;
|
||
|
|
private Integer staffCount;
|
||
|
|
private String scanFileUrl;
|
||
|
|
private String leaderPersonnelId;
|
||
|
|
private String leaderName;
|
||
|
|
private String controlPersonnelId;
|
||
|
|
private String controlName;
|
||
|
|
private Integer memberCount;
|
||
|
|
private LocalDate planSurveyDate;
|
||
|
|
private String surveyPlace;
|
||
|
|
private Integer noticeDoneFlag;
|
||
|
|
private Integer inspectDoneFlag;
|
||
|
|
private Integer rectifyDoneFlag;
|
||
|
|
private Integer enterpriseDoneFlag;
|
||
|
|
private Integer reviewDoneFlag;
|
||
|
|
private String noticeContent;
|
||
|
|
private String memberSnapshot;
|
||
|
|
private String stampFileUrl;
|
||
|
|
private Integer taskStatusCode;
|
||
|
|
private LocalDateTime planTime;
|
||
|
|
private Integer checkinTypeCode;
|
||
|
|
private String checkinTypeName;
|
||
|
|
private LocalDateTime checkinTime;
|
||
|
|
private java.math.BigDecimal longitude;
|
||
|
|
private java.math.BigDecimal latitude;
|
||
|
|
private String address;
|
||
|
|
private Integer facePassFlag;
|
||
|
|
private String photoUrls;
|
||
|
|
private String signImageUrl;
|
||
|
|
private String attachTypeCode;
|
||
|
|
private String attachTypeName;
|
||
|
|
private String fileName;
|
||
|
|
private String fileUrl;
|
||
|
|
private Integer reviewResultCode;
|
||
|
|
private String reviewResultName;
|
||
|
|
private String reviewContent;
|
||
|
|
private String templateCode;
|
||
|
|
private String templateName;
|
||
|
|
private String contentUrl;
|
||
|
|
private String hintContent;
|
||
|
|
private String draftId;
|
||
|
|
private String reviewerPersonnelId;
|
||
|
|
private String reviewerName;
|
||
|
|
private Integer resultCode;
|
||
|
|
private String resultName;
|
||
|
|
private String opinionContent;
|
||
|
|
private LocalDateTime reviewTime;
|
||
|
|
private String controllerPersonnelId;
|
||
|
|
private String controllerName;
|
||
|
|
private Integer precheckPassFlag;
|
||
|
|
private Integer archiveFlag;
|
||
|
|
private LocalDateTime controlTime;
|
||
|
|
private String nodeCode;
|
||
|
|
private String nodeName;
|
||
|
|
private String bizTypeCode;
|
||
|
|
private String bizTypeName;
|
||
|
|
private String bizRefId;
|
||
|
|
private String signerPersonnelId;
|
||
|
|
private String signerName;
|
||
|
|
private String taskTitle;
|
||
|
|
private LocalDateTime expireTime;
|
||
|
|
private LocalDateTime signTime;
|
||
|
|
private Integer clientTypeCode;
|
||
|
|
private String clientTypeName;
|
||
|
|
private String remarks;
|
||
|
|
}}
|
||
|
|
""")
|
||
|
|
|
||
|
|
def gen_page_query(name):
|
||
|
|
w(f"safety-eval-client/src/main/java/org/qinan/safetyeval/client/dto/institution/{name}PageQuery.java", f"""package org.qinan.safetyeval.client.dto.institution;
|
||
|
|
|
||
|
|
import lombok.Data;
|
||
|
|
import lombok.EqualsAndHashCode;
|
||
|
|
import org.qinan.safetyeval.client.dto.BasePageQuery;
|
||
|
|
|
||
|
|
@Data
|
||
|
|
@EqualsAndHashCode(callSuper = true)
|
||
|
|
public class {name}PageQuery extends BasePageQuery {{
|
||
|
|
private String projectId;
|
||
|
|
}}
|
||
|
|
""")
|
||
|
|
|
||
|
|
def gen_archive_cmd():
|
||
|
|
w("safety-eval-client/src/main/java/org/qinan/safetyeval/client/dto/institution/EvalProcessArchiveCmd.java", """package org.qinan.safetyeval.client.dto.institution;
|
||
|
|
|
||
|
|
import lombok.Data;
|
||
|
|
|
||
|
|
import javax.validation.constraints.NotBlank;
|
||
|
|
|
||
|
|
@Data
|
||
|
|
public class EvalProcessArchiveCmd {
|
||
|
|
@NotBlank
|
||
|
|
private String projectId;
|
||
|
|
}
|
||
|
|
""")
|
||
|
|
|
||
|
|
# Generate save cmds for all
|
||
|
|
for n in ["EvalRiskAnalysis","EvalRiskParticipant","EvalContract","EvalTeam","EvalSurvey","EvalSurveyNotice",
|
||
|
|
"EvalSurveyCheckin","EvalSurveyAttach","EvalReportDraft","EvalInternalReview","EvalTechReview",
|
||
|
|
"EvalProcessControl","EvalSignTask","EvalSignRecord"]:
|
||
|
|
gen_save_cmd(n)
|
||
|
|
gen_page_query("EvalReportDraft")
|
||
|
|
gen_page_query("EvalSignTask")
|
||
|
|
gen_archive_cmd()
|
||
|
|
print("cmds done")
|