Commit 6c8f42bf by yukang

合同管理

parent b1447e8f
...@@ -101,6 +101,8 @@ public class HGConstant { ...@@ -101,6 +101,8 @@ public class HGConstant {
public static final String INSPEC_CODE = "INSPEC_CODE"; public static final String INSPEC_CODE = "INSPEC_CODE";
// 保养单号 // 保养单号
public static final String UPKEEP_CODE = "UPKEEP_CODE"; public static final String UPKEEP_CODE = "UPKEEP_CODE";
public static final String CW_CONTRACT_NO = "CW_CONTRACT_NO";
} }
/** /**
......
...@@ -118,14 +118,14 @@ public class HGCW002 extends DaoEPBase { ...@@ -118,14 +118,14 @@ public class HGCW002 extends DaoEPBase {
private String projName = " "; /* 项目名称*/ private String projName = " "; /* 项目名称*/
private String contractNumber = " "; /* 合同号*/ private String contractNumber = " "; /* 合同号*/
private String contractName = " "; /* 合同名称*/ private String contractName = " "; /* 合同名称*/
private Boolean contractType; /* 合同类型;1销售合同2劳务合同3补充协议4合同外用工*/ private Integer contractType; /* 合同类型;1销售合同2劳务合同3补充协议4合同外用工*/
private Boolean contractCategory; /* 合同类别;1支出2收入*/ private Integer contractCategory; /* 合同类别;1支出2收入*/
private String partyA = " "; /* 甲方名称*/ private String partyA = " "; /* 甲方名称*/
private String partyB = " "; /* 乙方名称*/ private String partyB = " "; /* 乙方名称*/
private String partyC = " "; /* 丙方名称*/ private String partyC = " "; /* 丙方名称*/
private String planStartDate = " "; /* 计划开工日期*/ private String planStartDate = " "; /* 计划开工日期*/
private String planEndDate = " "; /* 计划竣工日期*/ private String planEndDate = " "; /* 计划竣工日期*/
private Boolean contractStatus; /* 合同状态;1草签2签约*/ private Integer contractStatus; /* 合同状态;1草签2签约*/
private String partyAName = " "; /* 甲方联系人姓名*/ private String partyAName = " "; /* 甲方联系人姓名*/
private String partyAPhoneNumber = " "; /* 甲方联系人电话*/ private String partyAPhoneNumber = " "; /* 甲方联系人电话*/
private String alreadyName = " "; /* 已方联系人姓名*/ private String alreadyName = " "; /* 已方联系人姓名*/
...@@ -135,14 +135,14 @@ public class HGCW002 extends DaoEPBase { ...@@ -135,14 +135,14 @@ public class HGCW002 extends DaoEPBase {
private String mainContractNumber = " "; /* 主合同号*/ private String mainContractNumber = " "; /* 主合同号*/
private String contractContent = " "; /* 合同内容*/ private String contractContent = " "; /* 合同内容*/
private String contractingMethod = " "; /* 承包方式*/ private String contractingMethod = " "; /* 承包方式*/
private Boolean paymentMethod; /* 付款方式;1一次性付款2分期付款*/ private Integer paymentMethod; /* 付款方式;1一次性付款2分期付款*/
private Boolean pricingMethod; /* 计价方式;1固定单价合同2固定总价合同*/ private Integer pricingMethod; /* 计价方式;1固定单价合同2固定总价合同*/
private BigDecimal taxPoints = new BigDecimal("0"); /* 税点*/ private Integer taxPoints; /* 税点*/
private BigDecimal totalContractPriceExcluding = new BigDecimal("0"); /* 合同总价(不含税)*/ private BigDecimal totalContractPriceExcluding = new BigDecimal("0"); /* 合同总价(不含税)*/
private BigDecimal valueAddedTax = new BigDecimal("0"); /* 税点*/ private BigDecimal valueAddedTax = new BigDecimal("0"); /* 税点*/
private BigDecimal totalContractPriceIncluding = new BigDecimal("0"); /* 合同总价(含税)*/ private BigDecimal totalContractPriceIncluding = new BigDecimal("0"); /* 合同总价(含税)*/
private Boolean reviewStatus; /* 审核状态*/ private Integer reviewStatus; /* 审核状态*/
private Boolean balanceStatus; /* 结算状态;1未结算2部分结算3最终结算*/ private Integer balanceStatus; /* 结算状态;1未结算2部分结算3最终结算*/
private String createdBy = " "; /* 记录创建者*/ private String createdBy = " "; /* 记录创建者*/
private String createdName = " "; /* 记录创建名称*/ private String createdName = " "; /* 记录创建名称*/
private String createdTime = " "; /* 记录创建时间*/ private String createdTime = " "; /* 记录创建时间*/
...@@ -472,7 +472,7 @@ public class HGCW002 extends DaoEPBase { ...@@ -472,7 +472,7 @@ public class HGCW002 extends DaoEPBase {
* get the contractType - 合同类型;1销售合同2劳务合同3补充协议4合同外用工. * get the contractType - 合同类型;1销售合同2劳务合同3补充协议4合同外用工.
* @return the contractType * @return the contractType
*/ */
public Boolean getContractType() { public Integer getContractType() {
return this.contractType; return this.contractType;
} }
...@@ -481,14 +481,14 @@ public class HGCW002 extends DaoEPBase { ...@@ -481,14 +481,14 @@ public class HGCW002 extends DaoEPBase {
* *
* @param contractType - 合同类型;1销售合同2劳务合同3补充协议4合同外用工 * @param contractType - 合同类型;1销售合同2劳务合同3补充协议4合同外用工
*/ */
public void setContractType(Boolean contractType) { public void setContractType(Integer contractType) {
this.contractType = contractType; this.contractType = contractType;
} }
/** /**
* get the contractCategory - 合同类别;1支出2收入. * get the contractCategory - 合同类别;1支出2收入.
* @return the contractCategory * @return the contractCategory
*/ */
public Boolean getContractCategory() { public Integer getContractCategory() {
return this.contractCategory; return this.contractCategory;
} }
...@@ -497,7 +497,7 @@ public class HGCW002 extends DaoEPBase { ...@@ -497,7 +497,7 @@ public class HGCW002 extends DaoEPBase {
* *
* @param contractCategory - 合同类别;1支出2收入 * @param contractCategory - 合同类别;1支出2收入
*/ */
public void setContractCategory(Boolean contractCategory) { public void setContractCategory(Integer contractCategory) {
this.contractCategory = contractCategory; this.contractCategory = contractCategory;
} }
/** /**
...@@ -584,7 +584,7 @@ public class HGCW002 extends DaoEPBase { ...@@ -584,7 +584,7 @@ public class HGCW002 extends DaoEPBase {
* get the contractStatus - 合同状态;1草签2签约. * get the contractStatus - 合同状态;1草签2签约.
* @return the contractStatus * @return the contractStatus
*/ */
public Boolean getContractStatus() { public Integer getContractStatus() {
return this.contractStatus; return this.contractStatus;
} }
...@@ -593,7 +593,7 @@ public class HGCW002 extends DaoEPBase { ...@@ -593,7 +593,7 @@ public class HGCW002 extends DaoEPBase {
* *
* @param contractStatus - 合同状态;1草签2签约 * @param contractStatus - 合同状态;1草签2签约
*/ */
public void setContractStatus(Boolean contractStatus) { public void setContractStatus(Integer contractStatus) {
this.contractStatus = contractStatus; this.contractStatus = contractStatus;
} }
/** /**
...@@ -744,7 +744,7 @@ public class HGCW002 extends DaoEPBase { ...@@ -744,7 +744,7 @@ public class HGCW002 extends DaoEPBase {
* get the paymentMethod - 付款方式;1一次性付款2分期付款. * get the paymentMethod - 付款方式;1一次性付款2分期付款.
* @return the paymentMethod * @return the paymentMethod
*/ */
public Boolean getPaymentMethod() { public Integer getPaymentMethod() {
return this.paymentMethod; return this.paymentMethod;
} }
...@@ -753,14 +753,14 @@ public class HGCW002 extends DaoEPBase { ...@@ -753,14 +753,14 @@ public class HGCW002 extends DaoEPBase {
* *
* @param paymentMethod - 付款方式;1一次性付款2分期付款 * @param paymentMethod - 付款方式;1一次性付款2分期付款
*/ */
public void setPaymentMethod(Boolean paymentMethod) { public void setPaymentMethod(Integer paymentMethod) {
this.paymentMethod = paymentMethod; this.paymentMethod = paymentMethod;
} }
/** /**
* get the pricingMethod - 计价方式;1固定单价合同2固定总价合同. * get the pricingMethod - 计价方式;1固定单价合同2固定总价合同.
* @return the pricingMethod * @return the pricingMethod
*/ */
public Boolean getPricingMethod() { public Integer getPricingMethod() {
return this.pricingMethod; return this.pricingMethod;
} }
...@@ -769,14 +769,14 @@ public class HGCW002 extends DaoEPBase { ...@@ -769,14 +769,14 @@ public class HGCW002 extends DaoEPBase {
* *
* @param pricingMethod - 计价方式;1固定单价合同2固定总价合同 * @param pricingMethod - 计价方式;1固定单价合同2固定总价合同
*/ */
public void setPricingMethod(Boolean pricingMethod) { public void setPricingMethod(Integer pricingMethod) {
this.pricingMethod = pricingMethod; this.pricingMethod = pricingMethod;
} }
/** /**
* get the taxPoints - 税点. * get the taxPoints - 税点.
* @return the taxPoints * @return the taxPoints
*/ */
public BigDecimal getTaxPoints() { public Integer getTaxPoints() {
return this.taxPoints; return this.taxPoints;
} }
...@@ -785,7 +785,7 @@ public class HGCW002 extends DaoEPBase { ...@@ -785,7 +785,7 @@ public class HGCW002 extends DaoEPBase {
* *
* @param taxPoints - 税点 * @param taxPoints - 税点
*/ */
public void setTaxPoints(BigDecimal taxPoints) { public void setTaxPoints(Integer taxPoints) {
this.taxPoints = taxPoints; this.taxPoints = taxPoints;
} }
/** /**
...@@ -840,7 +840,7 @@ public class HGCW002 extends DaoEPBase { ...@@ -840,7 +840,7 @@ public class HGCW002 extends DaoEPBase {
* get the reviewStatus - 审核状态. * get the reviewStatus - 审核状态.
* @return the reviewStatus * @return the reviewStatus
*/ */
public Boolean getReviewStatus() { public Integer getReviewStatus() {
return this.reviewStatus; return this.reviewStatus;
} }
...@@ -849,14 +849,14 @@ public class HGCW002 extends DaoEPBase { ...@@ -849,14 +849,14 @@ public class HGCW002 extends DaoEPBase {
* *
* @param reviewStatus - 审核状态 * @param reviewStatus - 审核状态
*/ */
public void setReviewStatus(Boolean reviewStatus) { public void setReviewStatus(Integer reviewStatus) {
this.reviewStatus = reviewStatus; this.reviewStatus = reviewStatus;
} }
/** /**
* get the balanceStatus - 结算状态;1未结算2部分结算3最终结算. * get the balanceStatus - 结算状态;1未结算2部分结算3最终结算.
* @return the balanceStatus * @return the balanceStatus
*/ */
public Boolean getBalanceStatus() { public Integer getBalanceStatus() {
return this.balanceStatus; return this.balanceStatus;
} }
...@@ -865,7 +865,7 @@ public class HGCW002 extends DaoEPBase { ...@@ -865,7 +865,7 @@ public class HGCW002 extends DaoEPBase {
* *
* @param balanceStatus - 结算状态;1未结算2部分结算3最终结算 * @param balanceStatus - 结算状态;1未结算2部分结算3最终结算
*/ */
public void setBalanceStatus(Boolean balanceStatus) { public void setBalanceStatus(Integer balanceStatus) {
this.balanceStatus = balanceStatus; this.balanceStatus = balanceStatus;
} }
/** /**
...@@ -996,14 +996,14 @@ public class HGCW002 extends DaoEPBase { ...@@ -996,14 +996,14 @@ public class HGCW002 extends DaoEPBase {
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName)); setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setContractNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACT_NUMBER)), contractNumber)); setContractNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACT_NUMBER)), contractNumber));
setContractName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACT_NAME)), contractName)); setContractName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACT_NAME)), contractName));
setContractType(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_CONTRACT_TYPE)), contractType)); setContractType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_CONTRACT_TYPE)), contractType));
setContractCategory(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_CONTRACT_CATEGORY)), contractCategory)); setContractCategory(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_CONTRACT_CATEGORY)), contractCategory));
setPartyA(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_A)), partyA)); setPartyA(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_A)), partyA));
setPartyB(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_B)), partyB)); setPartyB(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_B)), partyB));
setPartyC(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_C)), partyC)); setPartyC(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_C)), partyC));
setPlanStartDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_START_DATE)), planStartDate)); setPlanStartDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_START_DATE)), planStartDate));
setPlanEndDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_END_DATE)), planEndDate)); setPlanEndDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_END_DATE)), planEndDate));
setContractStatus(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_CONTRACT_STATUS)), contractStatus)); setContractStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_CONTRACT_STATUS)), contractStatus));
setPartyAName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_A_NAME)), partyAName)); setPartyAName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_A_NAME)), partyAName));
setPartyAPhoneNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_A_PHONE_NUMBER)), partyAPhoneNumber)); setPartyAPhoneNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_A_PHONE_NUMBER)), partyAPhoneNumber));
setAlreadyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ALREADY_NAME)), alreadyName)); setAlreadyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ALREADY_NAME)), alreadyName));
...@@ -1013,14 +1013,14 @@ public class HGCW002 extends DaoEPBase { ...@@ -1013,14 +1013,14 @@ public class HGCW002 extends DaoEPBase {
setMainContractNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MAIN_CONTRACT_NUMBER)), mainContractNumber)); setMainContractNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MAIN_CONTRACT_NUMBER)), mainContractNumber));
setContractContent(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACT_CONTENT)), contractContent)); setContractContent(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACT_CONTENT)), contractContent));
setContractingMethod(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACTING_METHOD)), contractingMethod)); setContractingMethod(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACTING_METHOD)), contractingMethod));
setPaymentMethod(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_PAYMENT_METHOD)), paymentMethod)); setPaymentMethod(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_PAYMENT_METHOD)), paymentMethod));
setPricingMethod(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_PRICING_METHOD)), pricingMethod)); setPricingMethod(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_PRICING_METHOD)), pricingMethod));
setTaxPoints(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_TAX_POINTS)), taxPoints)); setTaxPoints(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_TAX_POINTS)), taxPoints));
setTotalContractPriceExcluding(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_TOTAL_CONTRACT_PRICE_EXCLUDING)), totalContractPriceExcluding)); setTotalContractPriceExcluding(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_TOTAL_CONTRACT_PRICE_EXCLUDING)), totalContractPriceExcluding));
setValueAddedTax(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_VALUE_ADDED_TAX)), valueAddedTax)); setValueAddedTax(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_VALUE_ADDED_TAX)), valueAddedTax));
setTotalContractPriceIncluding(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_TOTAL_CONTRACT_PRICE_INCLUDING)), totalContractPriceIncluding)); setTotalContractPriceIncluding(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_TOTAL_CONTRACT_PRICE_INCLUDING)), totalContractPriceIncluding));
setReviewStatus(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_REVIEW_STATUS)), reviewStatus)); setReviewStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_REVIEW_STATUS)), reviewStatus));
setBalanceStatus(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_BALANCE_STATUS)), balanceStatus)); setBalanceStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_BALANCE_STATUS)), balanceStatus));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy)); setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName)); setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime)); setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
......
...@@ -34,6 +34,9 @@ public class HGCW999 extends DaoEPBase { ...@@ -34,6 +34,9 @@ public class HGCW999 extends DaoEPBase {
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 修改人*/ public static final String FIELD_UPDATED_BY = "updatedBy"; /* 修改人*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 修改人名称*/ public static final String FIELD_UPDATED_NAME = "updatedName"; /* 修改人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 修改时间*/ public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 修改时间*/
public static final String FIELD_DOC_NAME = "docName"; /* 文件ID*/
public static final String FIELD_BIZ_TYPE = "bizType"; /* 业务类型*/ public static final String FIELD_BIZ_TYPE = "bizType"; /* 业务类型*/
public static final String COL_ID = "ID"; /* 主键ID*/ public static final String COL_ID = "ID"; /* 主键ID*/
...@@ -43,6 +46,7 @@ public class HGCW999 extends DaoEPBase { ...@@ -43,6 +46,7 @@ public class HGCW999 extends DaoEPBase {
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码 预留*/ public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码 预留*/
public static final String COL_MAT_ID = "MAT_ID"; /* 物料ID*/ public static final String COL_MAT_ID = "MAT_ID"; /* 物料ID*/
public static final String COL_DOC_ID = "DOC_ID"; /* 文件ID*/ public static final String COL_DOC_ID = "DOC_ID"; /* 文件ID*/
public static final String COL_DOC_NAME = "DOC_NAME"; /* 文件ID*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/ public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/ public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/ public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
...@@ -64,6 +68,7 @@ public class HGCW999 extends DaoEPBase { ...@@ -64,6 +68,7 @@ public class HGCW999 extends DaoEPBase {
private String depCode = " "; /* 部门编码 预留*/ private String depCode = " "; /* 部门编码 预留*/
private Long matId = new Long(0); /* 物料ID*/ private Long matId = new Long(0); /* 物料ID*/
private String docId = " "; /* 文件ID*/ private String docId = " "; /* 文件ID*/
private String docName = " "; /* 文件ID*/
private String createdBy = " "; /* 创建人*/ private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/ private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/ private String createdTime = " "; /* 创建时间*/
...@@ -107,6 +112,10 @@ public class HGCW999 extends DaoEPBase { ...@@ -107,6 +112,10 @@ public class HGCW999 extends DaoEPBase {
eiColumn.setDescName("文件ID"); eiColumn.setDescName("文件ID");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_NAME);
eiColumn.setDescName("文件名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY); eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("创建人"); eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -384,6 +393,7 @@ public class HGCW999 extends DaoEPBase { ...@@ -384,6 +393,7 @@ public class HGCW999 extends DaoEPBase {
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode)); setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setMatId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_MAT_ID)), matId)); setMatId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_MAT_ID)), matId));
setDocId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_ID)), docId)); setDocId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_ID)), docId));
setDocName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_NAME)), docName));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy)); setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName)); setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime)); setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
...@@ -407,6 +417,7 @@ public class HGCW999 extends DaoEPBase { ...@@ -407,6 +417,7 @@ public class HGCW999 extends DaoEPBase {
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE))); map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_MAT_ID, StringUtils.toString(matId, eiMetadata.getMeta(FIELD_MAT_ID))); map.put(FIELD_MAT_ID, StringUtils.toString(matId, eiMetadata.getMeta(FIELD_MAT_ID)));
map.put(FIELD_DOC_ID, StringUtils.toString(docId, eiMetadata.getMeta(FIELD_DOC_ID))); map.put(FIELD_DOC_ID, StringUtils.toString(docId, eiMetadata.getMeta(FIELD_DOC_ID)));
map.put(FIELD_DOC_NAME, StringUtils.toString(docName, eiMetadata.getMeta(FIELD_DOC_NAME)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY))); map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME))); map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME))); map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
...@@ -417,4 +428,12 @@ public class HGCW999 extends DaoEPBase { ...@@ -417,4 +428,12 @@ public class HGCW999 extends DaoEPBase {
return map; return map;
} }
public String getDocName() {
return docName;
}
public void setDocName(String docName) {
this.docName = docName;
}
} }
...@@ -3,7 +3,10 @@ package com.baosight.hggp.hg.cw.service; ...@@ -3,7 +3,10 @@ package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.cw.domain.HGCW002; import com.baosight.hggp.hg.cw.domain.HGCW002;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils; import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
...@@ -11,6 +14,8 @@ import com.baosight.iplat4j.core.ei.EiConstant; ...@@ -11,6 +14,8 @@ import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
...@@ -66,12 +71,30 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -66,12 +71,30 @@ public class ServiceHGCW002 extends ServiceBase {
public EiInfo save(EiInfo inInfo) { public EiInfo save(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据 List<Map> detail1Rows = inInfo.getBlock("detail1").getRows();
for (int i = 0; i < resultRows.size(); i++) { List<Map> detail2Rows = inInfo.getBlock("detail2").getRows();
if (CollectionUtils.isNotEmpty(resultRows)) {
HGCW002 HGCW002 = new HGCW002(); HGCW002 HGCW002 = new HGCW002();
HGCW002.fromMap(resultRows.get(i)); HGCW002.fromMap(resultRows.get(0));
if (HGCW002.getId() == null || HGCW002.getId() == 0) { if (HGCW002.getId() == null || HGCW002.getId() == 0) {
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
String contractNumber =userVO.getUsercode() +
HGCW002.getContractType() +
SequenceGenerator.getNextSequence(HGConstant.SequenceId.CW_CONTRACT_NO);
HGCW002.setCompanyCode(userVO.getUsercode());
HGCW002.setCompanyName(userVO.getUsername());
HGCW002.setContractNumber(contractNumber);
HGCW002.setReviewStatus(0);
HGCW002.setBalanceStatus(1);
HGCW002.setPlanStartDate(DateUtils.formatShort(HGCW002.getPlanStartDate()));
HGCW002.setPlanEndDate(DateUtils.formatShort(HGCW002.getPlanEndDate()));
HGCW002.setSigningDate(DateUtils.formatShort(HGCW002.getSigningDate()));
this.add(HGCW002); this.add(HGCW002);
// 写入其他数据
HGCWTools.HgCw003.save(detail1Rows,contractNumber,userVO);
HGCWTools.HgCw999.batchUpdate(detail2Rows,HGCW002.getId());
} else { } else {
this.modify(HGCW002); this.modify(HGCW002);
} }
......
...@@ -39,8 +39,8 @@ public class ServiceHGCW002A extends ServiceBase { ...@@ -39,8 +39,8 @@ public class ServiceHGCW002A extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJECT_CODE_BOX_BLOCK_ID), null, false); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJECT_CODE_BOX_BLOCK_ID), null, false);
inInfo.addBlock("result1").addBlockMeta(new HGCW002().eiMetadata); inInfo.addBlock("detail1").addBlockMeta(new HGCW002().eiMetadata);
inInfo.addBlock("result2").addBlockMeta(new HGCW002().eiMetadata); inInfo.addBlock("detail2").addBlockMeta(new HGCW002().eiMetadata);
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败"); LogUtils.setDetailMsg(inInfo, e, "初始化失败");
} }
......
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.hg.cw.domain.HGCW002;
import com.baosight.hggp.hg.cw.domain.HGCW003;
import com.baosight.hggp.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.pz.domain.HGPZ002;
import com.baosight.hggp.hg.pz.domain.HGPZ003;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import org.apache.commons.collections.CollectionUtils;
import java.util.*;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW002B extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "修改合同",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
String id = inInfo.getString("id");
HGCW002 HGCW002 = HGCWTools.HgCw002.getId(id);
inInfo.addBlock(EiConstant.resultBlock).addRow(HGCW002);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJECT_CODE_BOX_BLOCK_ID),
new HashMap<String,Object>(){
{put("projCode",HGCW002.getProjCode());}
}, false);
//获取清单
List<HGCW003> hgcw003List = HGCWTools.HgCw003.queryByContractNumber(HGCW002.getContractNumber());
inInfo.addBlock("detail1").addRows(hgcw003List);
List<HGCW999> hgcw999List = HGCWTools.HgCw999.queryByBiz(HGCW002.getId(),"HT");
inInfo.addBlock("detail2").addRows(hgcw999List);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
/**
*
*/
public class ServiceHGCW099 extends ServiceBase {
/**
* 画面初始化.
*/
@OperationLogAnnotation(operModul = "附件上传",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
return inInfo;
}
/**
* 附件上传.
*/
@OperationLogAnnotation(operModul = "附件上传",operType = "上传",operDesc = "附件上传")
public EiInfo form(EiInfo inInfo) {
return inInfo;
}
}
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.ds.domain.HGDS002;
import com.baosight.hggp.util.FileUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/1/25,15:25
*/
public class ServiceHGCW999 extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "查询",operDesc = "物料清单-附件清单A-初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW999().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "查询",operDesc = "物料清单-附件清单A-查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (CommonConstant.projectEnv.RUN.equalsIgnoreCase(projectEnv)) {
inInfo = super.query(inInfo, "HGCW999.queryRun", new HGCW999());
} else {
inInfo = super.query(inInfo, "HGCW999.queryDev", new HGCW999());
}
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
public EiInfo queryDoc(EiInfo inInfo) {
try {
String docId = inInfo.getString("docId");
HGCW999 HGCW999 = new HGCW999();
List<HGCW999> list = new ArrayList<>();
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (CommonConstant.projectEnv.RUN.equalsIgnoreCase(projectEnv)) {
list = this.dao.query("HGCW999.queryRun",map);
} else {
list = this.dao.query("HGCW999.queryDev",map);
}
if (CollectionUtils.isNotEmpty(list)) {
HGCW999 = list.get(0);
inInfo.set("data",HGCW999);
}
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "新增",operDesc = "物料清单-附件清单A-新增操作")
@Override
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGCW999 fSc002A = new HGCW999();
fSc002A.fromMap(resultRows.get(i));
DaoUtils.insert(HGCW999.INSERT, fSc002A);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "删除",operDesc = "物料清单-附件清单A-删除操作")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGCW999 fSc002A = new HGCW999();
fSc002A.fromMap(resultRows.get(i));
DaoUtils.update(HGCW999.DELETE, fSc002A);
// if (!fSc002A.getDocId().isEmpty()) {
// this.delectDoc(fSc002A.getDocId());
// }
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 删除文件
* @param docId 文件ID
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "删除",operDesc = "删除附件文件")
public void delectDoc(String docId){
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
List<HGDS002> list = this.dao.query(HGDS002.QUERY,map);
if (list.size() > 0) {
String realPath = list.get(0).getRealPath();
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (projectEnv.equals(CommonConstant.projectEnv.RUN)) {
EiInfo queryInfo = new EiInfo();
queryInfo.set(HGCW999.FIELD_DOC_ID,list.get(0).getDocId());
//获取文档信息
queryInfo.set(EiConstant.serviceId,"S_EU_0102");
EiInfo docInfo = XServiceManager.call(queryInfo);
//数据库
Map docInfoMap = docInfo.getMap("docMap");
if (docInfoMap.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("data",docInfoMap.get("url")+"-"+0);
eiInfo.set(EiConstant.serviceId,"S_EU_0105");
//调用接口
EiInfo outInfo = XServiceManager.call(eiInfo);
if(outInfo.getStatus() == EiConstant.STATUS_FAILURE){
LogUtils.setDetailMsg(outInfo, new Throwable(), "查询部件类型失败");
outInfo.setMsg("失败");
}
}
}else {
FileUtils.deleteFile(realPath);
}
this.dao.delete(HGDS002.DELETE,map);
}
}
}
...@@ -23,27 +23,8 @@ ...@@ -23,27 +23,8 @@
--> -->
<sqlMap namespace="HGCW001"> <sqlMap namespace="HGCW001">
<sql id="authCondition">
<!-- 无权限时使用 -->
<isNotEmpty prepend=" AND " property="authDepCode">
DEP_CODE = #authDepCode#
</isNotEmpty>
<!-- 仅本人和部门组合 -->
<isEqual prepend=" AND " property="authCombination" compareValue="1">
(CREATED_BY = #authOnlyPeople# OR DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>)
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual prepend=" AND " property="authCombination" compareValue="1">
<isNotEmpty property="authOnlyPeople">
CREATED_BY = #authOnlyPeople#
</isNotEmpty>
<isNotEmpty property="authDepCodes">
DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
</isNotEmpty>
</isNotEqual>
</sql>
<sql id="condition"> <sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# ID = #id#
</isNotEmpty> </isNotEmpty>
......
...@@ -47,27 +47,9 @@ ...@@ -47,27 +47,9 @@
--> -->
<sqlMap namespace="HGCW002"> <sqlMap namespace="HGCW002">
<sql id="authCondition">
<!-- 无权限时使用 -->
<isNotEmpty prepend=" AND " property="authDepCode">
DEP_CODE = #authDepCode#
</isNotEmpty>
<!-- 仅本人和部门组合 -->
<isEqual prepend=" AND " property="authCombination" compareValue="1">
(CREATED_BY = #authOnlyPeople# OR DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>)
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual prepend=" AND " property="authCombination" compareValue="1">
<isNotEmpty property="authOnlyPeople">
CREATED_BY = #authOnlyPeople#
</isNotEmpty>
<isNotEmpty property="authDepCodes">
DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
</isNotEmpty>
</isNotEqual>
</sql>
<sql id="condition"> <sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# ID = #id#
</isNotEmpty> </isNotEmpty>
...@@ -417,6 +399,9 @@ ...@@ -417,6 +399,9 @@
DEP_CODE <!-- 部门编码 --> DEP_CODE <!-- 部门编码 -->
) )
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #projCode#, #projName#, #contractNumber#, #contractName#, #contractType#, #contractCategory#, #partyA#, #partyB#, #partyC#, #planStartDate#, #planEndDate#, #contractStatus#, #partyAName#, #partyAPhoneNumber#, #alreadyName#, #alreadyPhoneNumber#, #engineeringAddress#, #signingDate#, #mainContractNumber#, #contractContent#, #contractingMethod#, #paymentMethod#, #pricingMethod#, #taxPoints#, #totalContractPriceExcluding#, #valueAddedTax#, #totalContractPriceIncluding#, #reviewStatus#, #balanceStatus#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#) VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #projCode#, #projName#, #contractNumber#, #contractName#, #contractType#, #contractCategory#, #partyA#, #partyB#, #partyC#, #planStartDate#, #planEndDate#, #contractStatus#, #partyAName#, #partyAPhoneNumber#, #alreadyName#, #alreadyPhoneNumber#, #engineeringAddress#, #signingDate#, #mainContractNumber#, #contractContent#, #contractingMethod#, #paymentMethod#, #pricingMethod#, #taxPoints#, #totalContractPriceExcluding#, #valueAddedTax#, #totalContractPriceIncluding#, #reviewStatus#, #balanceStatus#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGCW002
</selectKey>
</insert> </insert>
<delete id="delete"> <delete id="delete">
......
...@@ -28,27 +28,9 @@ ...@@ -28,27 +28,9 @@
--> -->
<sqlMap namespace="HGCW003"> <sqlMap namespace="HGCW003">
<sql id="authCondition">
<!-- 无权限时使用 -->
<isNotEmpty prepend=" AND " property="authDepCode">
DEP_CODE = #authDepCode#
</isNotEmpty>
<!-- 仅本人和部门组合 -->
<isEqual prepend=" AND " property="authCombination" compareValue="1">
(CREATED_BY = #authOnlyPeople# OR DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>)
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual prepend=" AND " property="authCombination" compareValue="1">
<isNotEmpty property="authOnlyPeople">
CREATED_BY = #authOnlyPeople#
</isNotEmpty>
<isNotEmpty property="authDepCodes">
DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
</isNotEmpty>
</isNotEqual>
</sql>
<sql id="condition"> <sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# ID = #id#
</isNotEmpty> </isNotEmpty>
......
...@@ -21,6 +21,33 @@ ...@@ -21,6 +21,33 @@
--> -->
<sqlMap namespace="HGCW999"> <sqlMap namespace="HGCW999">
<sql id="column">
A.ID as "id", <!-- 主键ID -->
A.ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
A.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
A.COMPANY_NAME as "companyName", <!-- 公司名称 -->
A.DEP_CODE as "depCode", <!-- 部门编码 预留 -->
A.MAT_ID as "matId", <!-- 物料ID -->
A.DOC_ID as "docId", <!-- 文件ID -->
A.CREATED_BY as "createdBy", <!-- 创建人 -->
A.CREATED_NAME as "createdName", <!-- 创建人名称 -->
A.CREATED_TIME as "createdTime", <!-- 创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 修改人 -->
A.UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
A.UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
A.BIZ_TYPE as "bizType" <!-- 业务类型 -->
</sql>
<sql id="columnDev">
<include refid="column"/>,
B.DOC_NAME as "docName" <!-- 文件名称 -->
</sql>
<sql id="columnRun">
<include refid="column"/>,
B.RES_CNAME as "docName" <!-- 文件名称 -->
</sql>
<sql id="condition"> <sql id="condition">
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# ID = #id#
...@@ -66,85 +93,77 @@ ...@@ -66,85 +93,77 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <!-- 开发环境 -->
resultClass="com.baosight.hggp.hg.cw.domain.HGCW999"> <sql id="conditionDev">
SELECT AND A.DOC_ID = B.DOC_ID
ID as "id", <!-- 主键ID --> <include refid="condition"/>
ACCOUNT_CODE as "accountCode", <!-- 企业编码 --> <isNotEmpty prepend=" AND " property="docName">
COMPANY_CODE as "companyCode", <!-- 公司编码 --> B.DOC_NAME LIKE CONCAT('%', #docName#, '%')
COMPANY_NAME as "companyName", <!-- 公司名称 --> </isNotEmpty>
DEP_CODE as "depCode", <!-- 部门编码 预留 --> </sql>
MAT_ID as "matId", <!-- 物料ID -->
DOC_ID as "docId", <!-- 文件ID --> <!-- 正式环境 -->
CREATED_BY as "createdBy", <!-- 创建人 --> <sql id="conditionRun">
CREATED_NAME as "createdName", <!-- 创建人名称 --> AND A.DOC_ID = B.RES_ID
CREATED_TIME as "createdTime", <!-- 创建时间 --> <include refid="condition"/>
UPDATED_BY as "updatedBy", <!-- 修改人 --> <isNotEmpty prepend=" AND " property="docName">
UPDATED_NAME as "updatedName", <!-- 修改人名称 --> B.RES_CNAME LIKE CONCAT('%', #docName#, '%')
UPDATED_TIME as "updatedTime", <!-- 修改时间 --> </isNotEmpty>
BIZ_TYPE as "bizType" <!-- 业务类型 --> </sql>
FROM ${hggpSchema}.HGCW999 WHERE 1=1
<include refid="condition" /> <sql id="customCondition">
<isNotEmpty prepend=" AND " property="createdDateFrom">
A.CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateTo">
A.CREATED_TIME &lt;= CONCAT(REPLACE(#createdDateTo#, '-', ''), '235959')
</isNotEmpty>
</sql>
<sql id="order">
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy"> <isNotEmpty property="order">
$orderBy$ $order$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="order">
ID asc A.ID DESC
</isEmpty> </isEmpty>
</dynamic> </dynamic>
</sql>
<select id="queryDev" resultClass="com.baosight.hggp.hg.cw.domain.HGCW999">
SELECT
<include refid="columnDev"/>
FROM ${hggpSchema}.HGCW999 A, ${platSchema}.TEUDM02 B
WHERE 1=1
<include refid="conditionDev"/>
<include refid="customCondition"/>
<include refid="order"/>
</select> </select>
<select id="count" resultClass="int"> <select id="countDev" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGCW999 WHERE 1=1 SELECT COUNT(*) FROM ${hggpSchema}.HGCW999 A, ${platSchema}.TEUDM02 B
<include refid="condition" /> WHERE 1=1
<include refid="conditionDev"/>
<include refid="customCondition"/>
</select> </select>
<!-- <select id="queryRun" resultClass="com.baosight.hggp.hg.cw.domain.HGCW999">
<isNotEmpty prepend=" AND " property="id"> SELECT
ID = #id# <include refid="columnRun"/>
</isNotEmpty> FROM ${hggpSchema}.HGCW999 A, ${platSchema}.TEUDM05 B
<isNotEmpty prepend=" AND " property="accountCode"> WHERE 1=1
ACCOUNT_CODE = #accountCode# <include refid="conditionRun"/>
</isNotEmpty> <include refid="customCondition"/>
<isNotEmpty prepend=" AND " property="companyCode"> <include refid="order"/>
COMPANY_CODE = #companyCode# </select>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName"> <select id="countRun" resultClass="int">
COMPANY_NAME = #companyName# SELECT COUNT(*) FROM ${hggpSchema}.HGCW999 A, ${platSchema}.TEUDM05 B
</isNotEmpty> WHERE 1=1
<isNotEmpty prepend=" AND " property="depCode"> <include refid="conditionRun"/>
DEP_CODE = #depCode# <include refid="customCondition"/>
</isNotEmpty> </select>
<isNotEmpty prepend=" AND " property="matId">
MAT_ID = #matId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="bizType">
BIZ_TYPE = #bizType#
</isNotEmpty>
-->
<insert id="insert"> <insert id="insert">
INSERT INTO ${hggpSchema}.HGCW999 (ID, <!-- 主键ID --> INSERT INTO ${hggpSchema}.HGCW999 (ID, <!-- 主键ID -->
...@@ -189,5 +208,14 @@ ...@@ -189,5 +208,14 @@
WHERE WHERE
ID = #id# ID = #id#
</update> </update>
<update id="batchUpdate">
UPDATE ${hggpSchema}.HGCW999
SET
MAT_ID = #matId#, <!-- 物料ID -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime# <!-- 修改时间 -->
WHERE
DOC_ID IN <iterate close=")" open="(" conjunction="," property="docIds">#docIds[]#</iterate>
</update>
</sqlMap> </sqlMap>
package com.baosight.hggp.hg.cw.tools;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW002;
import com.baosight.hggp.hg.cw.domain.HGCW003;
import com.baosight.hggp.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.sc.domain.HGSC001A;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.iplat4j.core.ProjectInfo;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class HGCWTools {
public static class HgCw002 {
public static UserVO getUserCompany() {
UserVO userVO = new UserVO();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (CollectionUtils.isNotEmpty(orgList)) {
Org org = orgList.get(0);
if (!org.getOrgType().equals("company")) {
//如果不是公司公司,则找到上一级
Org org1 = HGXSTools.XsOrg.queryCompany(org.getOrgId());
userVO.setUsercode(org1.getOrgId());
userVO.setUsername(org1.getOrgCname());
} else {
userVO.setUsercode(org.getOrgId());
userVO.setUsername(org.getOrgCname());
}
}
return userVO;
}
public static HGCW002 getId(String id) {
AssertUtils.isNull(id, "合同ID不能为空!");
List<HGCW002> results = DaoBase.getInstance().query(HGCW002.QUERY,new HashMap<String,Object>(){
{put("id",id);}
});
return results.get(0);
}
}
public static class HgCw003{
public static void save(List<Map> rows, String contractNumber, UserVO userVO) {
AssertUtils.isNull(contractNumber, "合同号不能为空!");
rows.forEach(row -> {
HGCW003 HGCW003 = new HGCW003();
HGCW003.fromMap(row);
HGCW003.setCompanyCode(userVO.getUsercode());
HGCW003.setCompanyName(userVO.getUsername());
HGCW003.setContractNumber(contractNumber);
DaoUtils.insert(HGCW003.INSERT, HGCW003);
});
}
/**
* 根据合同号获取合同清单
* @param contractNumber
* @return
*/
public static List<HGCW003> queryByContractNumber(String contractNumber) {
AssertUtils.isNull(contractNumber, "合同号不能为空!");
List<HGCW003> results = DaoBase.getInstance().query(HGCW003.QUERY,new HashMap<String,Object>(){
{put("contractNumber",contractNumber);}
});
return results;
}
}
public static class HgCw999 {
public static void batchUpdate(List<Map> rows, Long id) {
AssertUtils.isNull(id, "业务ID不能为空!");
String[] docIds = rows.stream().map(row -> row.get("docId").toString()).toArray(String[]::new);
DaoUtils.update("HGCW999.batchUpdate", new HashMap<String,Object>(){
{put("docIds",docIds);}
{put("matId",id);}
});
}
public static List<HGCW999> queryByBiz(Long matId, String bizType) {
AssertUtils.isNull(matId, "业务ID不能为空!");
AssertUtils.isNull(bizType, "业务类型不能为空!");
List<HGCW999> results = new ArrayList<>();
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (CommonConstant.projectEnv.RUN.equalsIgnoreCase(projectEnv)) {
results = DaoBase.getInstance().query("HGCW999.queryRun",new HashMap<String,Object>(){
{put("matId",matId);}
{put("bizType",bizType);}
});
} else {
results = DaoBase.getInstance().query("HGCW999.queryDev",new HashMap<String,Object>(){
{put("matId",matId);}
{put("bizType",bizType);}
});
}
return results;
}
}
}
...@@ -25,4 +25,9 @@ ...@@ -25,4 +25,9 @@
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC001A.xml"/> <sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC001A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC002.xml"/> <sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC002.xml"/>
<!-- 財務 -->
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW001.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW002.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW003.xml"/>
</sqlMapConfig> </sqlMapConfig>
...@@ -51,4 +51,4 @@ ...@@ -51,4 +51,4 @@
<script> <script>
var ctx = "${ctx}"; var ctx = "${ctx}";
</script> </script>
<script src="${ctx}/HP/PZ/HGCW001.js"></script> <script src="${ctx}/HG/CW/HGCW001.js"></script>
\ No newline at end of file \ No newline at end of file
$(function() { $(function() {
// 查询 // 查询
...@@ -11,7 +12,16 @@ $(function() { ...@@ -11,7 +12,16 @@ $(function() {
pageSize: 20, pageSize: 20,
pageSizes: [10,20,30,50,100,200], pageSizes: [10,20,30,50,100,200],
}, },
columns: [ columns: [{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + contractDetailFunc(item.id) + '" target="_blank">合同详情</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + fileDetailFunc(item.id) + '" target="_blank">附件详情</a>';
return template;
}
}
], ],
loadComplete: function (e) { loadComplete: function (e) {
$("#BTN_INSERT").on("click",addFunc); $("#BTN_INSERT").on("click",addFunc);
...@@ -69,7 +79,18 @@ function addFunc() { ...@@ -69,7 +79,18 @@ function addFunc() {
* 修改 * 修改
*/ */
function updateFunc() { function updateFunc() {
console.log("修改"); let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
return;
}
JSColorbox.open({
href: "HGCW002B?methodName=initLoad&id=" + rows[0].id + "&efParentFormEname=HGCW002",
title: "<div style='text-align: center;'>修改合同</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
} }
/** /**
* 删除 * 删除
...@@ -105,4 +126,11 @@ function windowCallback() { ...@@ -105,4 +126,11 @@ function windowCallback() {
JSColorbox.close(); JSColorbox.close();
} }
function contractDetailFunc(id) {
return "";
}
function fileDetailFunc(id) {
return "";
}
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<EF:EFRegion id="result" title="记录集"> <EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false"> <EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/> <EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="200" align="center"/>
<EF:EFColumn ename="companyName" cname="所属公司" align="center" enable="false"/> <EF:EFColumn ename="companyName" cname="所属公司" align="center" enable="false"/>
<EF:EFColumn ename="projCode" cname="项目编号" align="center" enable="false"/> <EF:EFColumn ename="projCode" cname="项目编号" align="center" enable="false"/>
<EF:EFColumn ename="projName" cname="项目名称" align="center" enable="false"/> <EF:EFColumn ename="projName" cname="项目名称" align="center" enable="false"/>
...@@ -90,4 +90,4 @@ ...@@ -90,4 +90,4 @@
<script> <script>
var ctx = "${ctx}"; var ctx = "${ctx}";
</script> </script>
<script src="${ctx}/HP/PZ/HGCW002.js"></script> <script src="${ctx}/HG/CW/HGCW002.js"></script>
\ No newline at end of file \ No newline at end of file
$(function() { $(function() {
IPLATUI.EFGrid.result1 = { $("#cancel").on("click", function () {
cancelFunc();
});
$("#btn_save").on("click", function () {
btnSaveFunc();
});
IPLATUI.EFGrid.detail1 = {
pageable: { pageable: {
pageSize: 20, pageSize: 20,
pageSizes: [10,20,30,50,100,200], pageSizes: [10,20,30,50,100,200],
...@@ -14,14 +21,14 @@ $(function() { ...@@ -14,14 +21,14 @@ $(function() {
// 获取此model元素信息 // 获取此model元素信息
var item = e.items[0]; var item = e.items[0];
// 计算总金额 // 计算总金额
var taxPoints = $("#detail-0-taxPoints").val() ? $("#detail-0-taxPoints").val() : 0; var taxPoints = $("#result-0-taxPoints").val() ? $("#result-0-taxPoints").val() / 100 : 0;
var totalPriceExcluding = item.provisionalQuantity * item.unitPriceExcludingTax; var totalPriceExcluding = item.provisionalQuantity * item.unitPriceExcludingTax;
var totalPriceIncluding = totalPriceExcluding * (1 + parseFloat(taxPoints)); var totalPriceIncluding = totalPriceExcluding * (1 + parseFloat(taxPoints));
result1Grid.setCellValue(item, 'totalPriceExcluding', totalPriceExcluding); detail1Grid.setCellValue(item, 'totalPriceExcluding', totalPriceExcluding);
result1Grid.setCellValue(item, 'totalPriceIncluding', totalPriceIncluding); detail1Grid.setCellValue(item, 'totalPriceIncluding', totalPriceIncluding);
console.log(grid.dataSource._data); console.log(grid.dataSource._data);
console.log(result1Grid.getDataItems()); console.log(detail1Grid.getDataItems());
var allRows = result1Grid.getDataItems(); var allRows = detail1Grid.getDataItems();
var totalPriceExcluding = 0; var totalPriceExcluding = 0;
var totalPriceIncluding = 0; var totalPriceIncluding = 0;
var valueAddedTax = 0; var valueAddedTax = 0;
...@@ -30,9 +37,9 @@ $(function() { ...@@ -30,9 +37,9 @@ $(function() {
totalPriceIncluding += row.totalPriceIncluding; totalPriceIncluding += row.totalPriceIncluding;
}); });
valueAddedTax = totalPriceIncluding - totalPriceExcluding; valueAddedTax = totalPriceIncluding - totalPriceExcluding;
$("#detail-0-totalContractPriceExcluding").val(totalPriceExcluding) $("#result-0-totalContractPriceExcluding").val(totalPriceExcluding.toFixed(3))
$("#detail-0-totalContractPriceIncluding").val(totalPriceIncluding) $("#result-0-totalContractPriceIncluding").val(totalPriceIncluding.toFixed(3))
$("#detail-0-valueAddedTax").val(valueAddedTax) $("#result-0-valueAddedTax").val(valueAddedTax.toFixed(3))
} }
}); });
}, },
...@@ -55,7 +62,7 @@ $(function() { ...@@ -55,7 +62,7 @@ $(function() {
$("#DELETE_FILE").on("click", function () { $("#DELETE_FILE").on("click", function () {
deleteFileFunc(); deleteFileFunc();
}); });
IPLATUI.EFGrid.result2 = { IPLATUI.EFGrid.detail2 = {
pageable: { pageable: {
pageSize: 20, pageSize: 20,
pageSizes: [10,20,30,50,100,200], pageSizes: [10,20,30,50,100,200],
...@@ -66,7 +73,7 @@ $(function() { ...@@ -66,7 +73,7 @@ $(function() {
/** /**
* 下拉框事件 * 下拉框事件
* @type {{"detail-0-contractType": {select: IPLATUI.EFSelect.detail-0-contractType.select}, projCodeBox: {select: IPLATUI.EFSelect.projCodeBox.select}}} * @type {{"result-0-contractType": {select: IPLATUI.EFSelect.result-0-contractType.select}, projCodeBox: {select: IPLATUI.EFSelect.projCodeBox.select}}}
*/ */
IPLATUI.EFSelect = { IPLATUI.EFSelect = {
"projCodeBox": { "projCodeBox": {
...@@ -78,14 +85,14 @@ $(function() { ...@@ -78,14 +85,14 @@ $(function() {
var textField = ""; var textField = "";
if (valueField) { if (valueField) {
textField = dataItem['textField'].split("-")[1]; textField = dataItem['textField'].split("-")[1];
$("#detail-0-projCode").val(valueField); $("#result-0-projCode").val(valueField);
$("#detail-0-projName").val(textField); $("#result-0-projName").val(textField);
} else { } else {
$("#detail-0-projName").val(textField); $("#result-0-projName").val(textField);
} }
} }
}, },
"detail-0-contractType": { "result-0-contractType": {
/** /**
* 销售合同和补充协议合同类别为收入,其余的为支出 * 销售合同和补充协议合同类别为收入,其余的为支出
* @param e * @param e
...@@ -95,19 +102,19 @@ $(function() { ...@@ -95,19 +102,19 @@ $(function() {
console.log(dataItem) console.log(dataItem)
var valueField = dataItem['valueField']; var valueField = dataItem['valueField'];
if (valueField == "1" || valueField == "3") { if (valueField == "1" || valueField == "3") {
$("#detail-0-contractCategory").val("1"); $("#result-0-contractCategory").val("1");
$("#contractCategoryName").val("收入"); $("#contractCategoryName").val("收入");
} else if (valueField == "2" || valueField == "4"){ } else if (valueField == "2" || valueField == "4"){
$("#detail-0-contractCategory").val("2"); $("#result-0-contractCategory").val("2");
$("#contractCategoryName").val("支出"); $("#contractCategoryName").val("支出");
} else { } else {
$("#detail-0-contractCategory").val(""); $("#result-0-contractCategory").val("");
} }
//清除甲乙方 //清除甲乙方
IPLAT.EFPopupInput.clear(("#popupInputPartyA"), true) IPLAT.EFPopupInput.clear(("#popupInputPartyA"), true)
IPLAT.EFPopupInput.clear(("#popupInputPartyB"), true) IPLAT.EFPopupInput.clear(("#popupInputPartyB"), true)
$("#detail-0-partyA").val(""); $("#result-0-partyA").val("");
$("#detail-0-partyB").val(""); $("#result-0-partyB").val("");
} }
} }
} }
...@@ -123,8 +130,8 @@ $(function() { ...@@ -123,8 +130,8 @@ $(function() {
query: function (e) { query: function (e) {
console.log("Step" + (++i) + ": ----query----"); console.log("Step" + (++i) + ": ----query----");
// 将自定义div中的字段构造成查询条件 EiInfo // 将自定义div中的字段构造成查询条件 EiInfo
// var queryInfo = EiInfo.build("#detail-0-contractCategory"); // var queryInfo = EiInfo.build("#result-0-contractCategory");
var contractCategory = $("#detail-0-contractCategory").val(); var contractCategory = $("#result-0-contractCategory").val();
if (!contractCategory) { if (!contractCategory) {
message("请先选择合同类型!"); message("请先选择合同类型!");
// 阻止弹窗 // 阻止弹窗
...@@ -148,7 +155,7 @@ $(function() { ...@@ -148,7 +155,7 @@ $(function() {
// var data = model.toJSON(); // var data = model.toJSON();
console.log(model); console.log(model);
var partyA = model.usercode + "-" + model.username; var partyA = model.usercode + "-" + model.username;
$("#detail-0-partyA").val(partyA); $("#result-0-partyA").val(partyA);
IPLAT.EFPopupInput.text( $("#popupInputPartyA") , partyA) IPLAT.EFPopupInput.text( $("#popupInputPartyA") , partyA)
e.preventDefault(); // 不使用默认的回填逻辑 e.preventDefault(); // 不使用默认的回填逻辑
} }
...@@ -163,8 +170,8 @@ $(function() { ...@@ -163,8 +170,8 @@ $(function() {
query: function (e) { query: function (e) {
console.log("Step" + (++i) + ": ----query----"); console.log("Step" + (++i) + ": ----query----");
// 将自定义div中的字段构造成查询条件 EiInfo // 将自定义div中的字段构造成查询条件 EiInfo
// var queryInfo = EiInfo.build("#detail-0-contractCategory"); // var queryInfo = EiInfo.build("#result-0-contractCategory");
var contractCategory = $("#detail-0-contractCategory").val(); var contractCategory = $("#result-0-contractCategory").val();
if (!contractCategory) { if (!contractCategory) {
message("请先选择合同类型!"); message("请先选择合同类型!");
// 阻止弹窗 // 阻止弹窗
...@@ -188,7 +195,7 @@ $(function() { ...@@ -188,7 +195,7 @@ $(function() {
// var data = model.toJSON(); // var data = model.toJSON();
console.log(model); console.log(model);
var partyB = model.usercode + "-" + model.username; var partyB = model.usercode + "-" + model.username;
$("#detail-0-partyB").val(partyB); $("#result-0-partyB").val(partyB);
IPLAT.EFPopupInput.text( $("#popupInputPartyB") , partyB) IPLAT.EFPopupInput.text( $("#popupInputPartyB") , partyB)
e.preventDefault(); // 不使用默认的回填逻辑 e.preventDefault(); // 不使用默认的回填逻辑
} }
...@@ -211,7 +218,7 @@ function saveResult1Func() { ...@@ -211,7 +218,7 @@ function saveResult1Func() {
function uploadFileFunc() { function uploadFileFunc() {
JSColorbox.open({ JSColorbox.open({
href: "HGCW099?methodName=initLoad&inqu_status-0-bizType=", href: "HGCW099?methodName=initLoad&inqu_status-0-bizType=HT",
title: "<div style='text-align: center;'>附件上传</div>", title: "<div style='text-align: center;'>附件上传</div>",
width: "60%", width: "60%",
height: "50%", height: "50%",
...@@ -225,12 +232,36 @@ function uploadFileFunc() { ...@@ -225,12 +232,36 @@ function uploadFileFunc() {
*/ */
function uploadFileCallback(docId) { function uploadFileCallback(docId) {
let inEiInfo = new EiInfo(); let inEiInfo = new EiInfo();
inEiInfo.set("result-0-matId", $("#inqu_status-0-matId").val());
inEiInfo.set("result-0-docId", docId); inEiInfo.set("result-0-docId", docId);
inEiInfo.set("result-0-bizType", $("#inqu_status-0-bizType").val()); inEiInfo.set("result-0-bizType", $("#inqu_status-0-bizType").val());
EiCommunicator.send('HPSC002A', 'insert', inEiInfo, { EiCommunicator.send('HGCW999', 'insert', inEiInfo, {
onSuccess(response) { onSuccess(response) {
resultGrid.dataSource.page(1); if (response.status === 0) {
EiCommunicator.send('HGCW999', 'queryDoc', inEiInfo, {
onSuccess(e) {
console.log(e);
if (e.status === 0) {
let data = e.extAttr.data;
detail2Grid.dataSource.insert();
detail2Grid.setCellValue(0, "rowNo", 0);
detail2Grid.setCellValue(0, "id", data.id);
detail2Grid.setCellValue(0, "docId", data.docId);
detail2Grid.setCellValue(0, "docName", data.docName);
detail2Grid.setCellValue(0, "createdTime", data.createdTime);
detail2Grid.refresh();
} else {
NotificationUtil("执行失败!", "error");
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
} else {
NotificationUtil("执行失败!", "error");
}
}, },
onFail(errorMessage, status, e) { onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error"); NotificationUtil("执行失败!", "error");
...@@ -239,26 +270,47 @@ function uploadFileCallback(docId) { ...@@ -239,26 +270,47 @@ function uploadFileCallback(docId) {
async: false async: false
}); });
} }
function deleteFileFunc() {
function cancelFunc() {
// 关闭弹窗
parent.JSColorbox.setValueCallback();
}
function btnSaveFunc() {
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGrid("detail1,detail2", "HGCW002", "save", {isAlldata:true,onSuccessCallback:parent.windowCallback});
}
});
}
function deleteFileFunc() {
let rows = detail2Grid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
rows.forEach(function (row) {
detail2Grid.removeRows([rows.rowNo]);// 刷新行号
})
refreshRowNo();
} }
function deleteResult1Func() { function deleteResult1Func() {
let rows = result1Grid.getCheckedRows(); let rows = detail1Grid.getCheckedRows();
if (rows.length < 1) { if (rows.length < 1) {
message("请选择数据"); message("请选择数据");
return; return;
} }
rows.forEach(function (row) { rows.forEach(function (row) {
result1Grid.removeRows([rows.rowNo]);// 刷新行号 detail1Grid.removeRows([rows.rowNo]);// 刷新行号
}) })
refreshRowNo(); refreshRowNo();
} }
let refreshRowNo = function () { let refreshRowNo = function () {
let allRows = result1Grid.getDataItems(); let allRows = detail1Grid.getDataItems();
for (let i = 0; i < allRows.length; i++) { for (let i = 0; i < allRows.length; i++) {
result1Grid.setCellValue(i, "rowNo", i); detail1Grid.setCellValue(i, "rowNo", i);
result1Grid.refresh(); detail1Grid.refresh();
} }
} }
......
...@@ -14,20 +14,20 @@ ...@@ -14,20 +14,20 @@
<EF:EFOptions <EF:EFOptions
blockId="projectCodeBox_block_id" valueField="valueField" textField="textField"/> blockId="projectCodeBox_block_id" valueField="valueField" textField="textField"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFInput ename="detail-0-projCode" cname="项目编号" type="hidden"/> <EF:EFInput ename="result-0-projCode" cname="项目编号" type="hidden"/>
<EF:EFInput ename="detail-0-projName" cname="项目简称" colWidth="4" readonly="true"/> <EF:EFInput ename="result-0-projName" cname="项目简称" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-contractNumber" cname="合同号" colWidth="4" readonly="true" /> <EF:EFInput ename="result-0-contractNumber" cname="合同号" colWidth="4" readonly="true" />
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput ename="detail-0-contractName" cname="合同名称" colWidth="4" required="true"/> <EF:EFInput ename="result-0-contractName" cname="合同名称" colWidth="4" required="true"/>
<EF:EFSelect cname="合同类型" ename="detail-0-contractType" colWidth="4" filter="contains" required="true"> <EF:EFSelect cname="合同类型" ename="result-0-contractType" colWidth="4" filter="contains" required="true">
<EF:EFOption label="-- 请选择 --" value=""/> <EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractType"/> <EF:EFCodeOption codeName="hggp.cw.contractType"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFInput ename="detail-0-contractCategory" cname="合同类别" type="hidden"/> <EF:EFInput ename="result-0-contractCategory" cname="合同类别" type="hidden"/>
<EF:EFInput ename="contractCategoryName" cname="合同类别" colWidth="4" readonly="true"/> <EF:EFInput ename="contractCategoryName" cname="合同类别" colWidth="4" readonly="true"/>
<%-- <EF:EFSelect cname="合同类别" ename="detail-0-contractCategory" colWidth="4" filter="contains" readonly="true" required="true">--%> <%-- <EF:EFSelect cname="合同类别" ename="result-0-contractCategory" colWidth="4" filter="contains" readonly="true" required="true">--%>
<%-- <EF:EFOption label="-- 请选择 --" value=""/>--%> <%-- <EF:EFOption label="-- 请选择 --" value=""/>--%>
<%-- <EF:EFCodeOption codeName="hggp.cw.contractCategory"/>--%> <%-- <EF:EFCodeOption codeName="hggp.cw.contractCategory"/>--%>
<%-- </EF:EFSelect>--%> <%-- </EF:EFSelect>--%>
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
readonly="true" readonly="true"
resizable="true" popupTitle="甲方名称" popupWidth="400"> resizable="true" popupTitle="甲方名称" popupWidth="400">
</EF:EFPopupInput> </EF:EFPopupInput>
<EF:EFInput ename="detail-0-partyA" cname="甲方名称" type="hidden" /> <EF:EFInput ename="result-0-partyA" cname="甲方名称" type="hidden" />
<EF:EFPopupInput ename="popupInputPartyB" cname="乙方名称" colWidth="4" <EF:EFPopupInput ename="popupInputPartyB" cname="乙方名称" colWidth="4"
serviceName="HGCW002A" methodName="partyBQuery" serviceName="HGCW002A" methodName="partyBQuery"
resultId="partyAResult" resultId="partyAResult"
...@@ -54,63 +54,63 @@ ...@@ -54,63 +54,63 @@
readonly="true" readonly="true"
resizable="true" popupTitle="乙方名称" popupWidth="400"> resizable="true" popupTitle="乙方名称" popupWidth="400">
</EF:EFPopupInput> </EF:EFPopupInput>
<EF:EFInput ename="detail-0-partyB" cname="乙方名称" type="hidden"/> <EF:EFInput ename="result-0-partyB" cname="乙方名称" type="hidden"/>
<EF:EFInput ename="detail-0-partyC" cname="丙方" colWidth="4" /> <EF:EFInput ename="result-0-partyC" cname="丙方" colWidth="4" />
</div> </div>
<div class="row"> <div class="row">
<EF:EFDateSpan startCname="计划开工/竣工日期" endCname="至" required="true" colWidth="8" blockId="detail" <EF:EFDateSpan startCname="计划开工/竣工日期" endCname="至" required="true" colWidth="8" blockId="result"
startName="planStartDate" endName="planEndDate" row="0" role="date" startName="planStartDate" endName="planEndDate" row="0" role="date"
format="yyyy-MM-dd" ratio="4:4" satrtRatio="4:8" endRatio="4:8"> format="yyyy-MM-dd" ratio="4:4" satrtRatio="4:8" endRatio="4:8">
</EF:EFDateSpan> </EF:EFDateSpan>
<EF:EFSelect cname="合同状态" ename="detail-0-contractStatus" colWidth="4" filter="contains"> <EF:EFSelect cname="合同状态" ename="result-0-contractStatus" colWidth="4" filter="contains">
<EF:EFOption label="-- 请选择 --" value=""/> <EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractStatus"/> <EF:EFCodeOption codeName="hggp.cw.contractStatus"/>
</EF:EFSelect> </EF:EFSelect>
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput ename="detail-0-partyAName" cname="甲方联系人姓名" colWidth="4" /> <EF:EFInput ename="result-0-partyAName" cname="甲方联系人姓名" colWidth="4" />
<EF:EFInput ename="detail-0-partyAPhoneNumber" cname="甲方联系人电话" colWidth="4" /> <EF:EFInput ename="result-0-partyAPhoneNumber" cname="甲方联系人电话" colWidth="4" />
<EF:EFInput ename="detail-0-alreadyName" cname="已方联系人姓名" colWidth="4" /> <EF:EFInput ename="result-0-alreadyName" cname="已方联系人姓名" colWidth="4" />
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput ename="detail-0-alreadyPhoneNumber" cname="已方联系人电话" colWidth="4" /> <EF:EFInput ename="result-0-alreadyPhoneNumber" cname="已方联系人电话" colWidth="4" />
<EF:EFInput ename="detail-0-engineeringAddress" cname="工程地址" colWidth="8" ratio="2:10" required="true"/> <EF:EFInput ename="result-0-engineeringAddress" cname="工程地址" colWidth="8" ratio="2:10" required="true"/>
</div> </div>
<div class="row"> <div class="row">
<EF:EFDatePicker cname="会计期" ename="detail-0-signingDate" row="0" colWidth="4" <EF:EFDatePicker cname="签约日期" ename="result-0-signingDate" colWidth="4"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/> format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFInput ename="detail-0-mainContractNumber" cname="主合同号" colWidth="8" ratio="2:10"/> <EF:EFInput ename="result-0-mainContractNumber" cname="主合同号" colWidth="8" ratio="2:10"/>
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput type="textarea" row="6" ename="detail-0-contractContent" cname="合同内容" colWidth="8" ratio="2:10" required="true"/> <EF:EFInput type="textarea" ename="result-0-contractContent" cname="合同内容" colWidth="8" ratio="2:10" required="true"/>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="inqu2" title="承包方式及合同价款"> <EF:EFRegion id="inqu2" title="承包方式及合同价款">
<div class="row"> <div class="row">
<EF:EFInput ename="detail-0-contractingMethod" cname="承包方式" colWidth="4" /> <EF:EFInput ename="result-0-contractingMethod" cname="承包方式" colWidth="4" />
<EF:EFSelect cname="付款方式" ename="detail-0-paymentMethod" colWidth="4" filter="contains"> <EF:EFSelect cname="付款方式" ename="result-0-paymentMethod" colWidth="4" filter="contains">
<EF:EFOption label="-- 请选择 --" value=""/> <EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.paymentMethod"/> <EF:EFCodeOption codeName="hggp.cw.paymentMethod"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFSelect cname="计价方式" ename="detail-0-pricingMethod" colWidth="4" filter="contains"> <EF:EFSelect cname="计价方式" ename="result-0-pricingMethod" colWidth="4" filter="contains">
<EF:EFOption label="-- 请选择 --" value=""/> <EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.pricingMethod"/> <EF:EFCodeOption codeName="hggp.cw.pricingMethod"/>
</EF:EFSelect> </EF:EFSelect>
</div> </div>
<div class="row"> <div class="row">
<EF:EFSelect cname="税点" ename="detail-0-taxPoints" colWidth="4" filter="contains"> <EF:EFSelect cname="税点" ename="result-0-taxPoints" colWidth="4" filter="contains">
<EF:EFOption label="-- 请选择 --" value=""/> <EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.taxPoints"/> <EF:EFCodeOption codeName="hggp.cw.taxPoints"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFInput ename="detail-0-totalContractPriceExcluding" cname="合同总价(不含税)" colWidth="4" readonly="true"/> <EF:EFInput ename="result-0-totalContractPriceExcluding" cname="合同总价(不含税)" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-valueAddedTax" cname="增值税" colWidth="4" readonly="true"/> <EF:EFInput ename="result-0-valueAddedTax" cname="增值税" colWidth="4" readonly="true"/>
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput ename="detail-0-totalContractPriceIncluding" cname="合同总价(含税)" colWidth="4" readonly="true"/> <EF:EFInput ename="result-0-totalContractPriceIncluding" cname="合同总价(含税)" colWidth="4" readonly="true"/>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result1" title="合同清单"> <EF:EFRegion id="detail1" title="合同清单">
<EF:EFGrid blockId="result1" autoDraw="override" checkMode="row" isFloat="true"> <EF:EFGrid blockId="detail1" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/> <EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="inventory" cname="清单" align="center" /> <EF:EFColumn ename="inventory" cname="清单" align="center" />
...@@ -124,8 +124,9 @@ ...@@ -124,8 +124,9 @@
<EF:EFColumn ename="laborCosts" cname="其中人工费、元" format="{0:N3}" align="center"/> <EF:EFColumn ename="laborCosts" cname="其中人工费、元" format="{0:N3}" align="center"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result2" title="附件信息"> <EF:EFRegion id="detail2" title="附件信息">
<EF:EFGrid blockId="result2" autoDraw="override" checkMode="row" isFloat="true"> <EF:EFGrid blockId="detail2" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="id" cname="ID" hidden="true"/> <EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/> <EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/> <EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
...@@ -143,4 +144,4 @@ ...@@ -143,4 +144,4 @@
<script> <script>
var ctx = "${ctx}"; var ctx = "${ctx}";
</script> </script>
<script src="${ctx}/HP/PZ/HGCW002A.js"></script> <script src="${ctx}/HG/CW/HGCW002A.js"></script>
\ No newline at end of file \ No newline at end of file
$(function() {
initDate();
$("#cancel").on("click", function () {
cancelFunc();
});
$("#btn_save").on("click", function () {
btnSaveFunc();
});
IPLATUI.EFGrid.detail1 = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
columns: [
],
loadComplete: function (grid) {
grid.dataSource.bind("change", function(e) {
if (e.field == "unitPriceExcludingTax") {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
// 计算总金额
var taxPoints = $("#result-0-taxPoints").val() ? $("#result-0-taxPoints").val() : 0;
var totalPriceExcluding = item.provisionalQuantity * item.unitPriceExcludingTax;
var totalPriceIncluding = totalPriceExcluding * (1 + parseFloat(taxPoints));
detail1Grid.setCellValue(item, 'totalPriceExcluding', totalPriceExcluding);
detail1Grid.setCellValue(item, 'totalPriceIncluding', totalPriceIncluding);
console.log(grid.dataSource._data);
console.log(detail1Grid.getDataItems());
var allRows = detail1Grid.getDataItems();
var totalPriceExcluding = 0;
var totalPriceIncluding = 0;
var valueAddedTax = 0;
allRows.forEach(function (row, index) {
totalPriceExcluding += row.totalPriceExcluding;
totalPriceIncluding += row.totalPriceIncluding;
});
valueAddedTax = totalPriceIncluding - totalPriceExcluding;
$("#result-0-totalContractPriceExcluding").val(totalPriceExcluding.toFixed(3))
$("#result-0-totalContractPriceIncluding").val(totalPriceIncluding.toFixed(3))
$("#result-0-valueAddedTax").val(valueAddedTax.toFixed(3))
}
});
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
saveResult1Func();
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteResult1Func();
},
}
$("#UPLOAD_FILE").on("click", function () {
uploadFileFunc();
});
$("#DELETE_FILE").on("click", function () {
deleteFileFunc();
});
IPLATUI.EFGrid.detail2 = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
columns: [
]
}
/**
* 下拉框事件
* @type {{"result-0-contractType": {select: IPLATUI.EFSelect.result-0-contractType.select}, projCodeBox: {select: IPLATUI.EFSelect.projCodeBox.select}}}
*/
IPLATUI.EFSelect = {
"projCodeBox": {
// 点击下拉选项时触发
select: function (e) { //获取勾选值
var dataItem = e.dataItem;
console.log(dataItem)
var valueField = dataItem['valueField'];
var textField = "";
if (valueField) {
textField = dataItem['textField'].split("-")[1];
$("#result-0-projCode").val(valueField);
$("#result-0-projName").val(textField);
} else {
$("#result-0-projName").val(textField);
}
}
},
"result-0-contractType": {
/**
* 销售合同和补充协议合同类别为收入,其余的为支出
* @param e
*/
select: function (e) {
var dataItem = e.dataItem;
console.log(dataItem)
var valueField = dataItem['valueField'];
if (valueField == "1" || valueField == "3") {
$("#result-0-contractCategory").val("1");
$("#contractCategoryName").val("收入");
} else if (valueField == "2" || valueField == "4"){
$("#result-0-contractCategory").val("2");
$("#contractCategoryName").val("支出");
} else {
$("#result-0-contractCategory").val("");
}
//清除甲乙方
IPLAT.EFPopupInput.clear(("#popupInputPartyA"), true)
IPLAT.EFPopupInput.clear(("#popupInputPartyB"), true)
$("#result-0-partyA").val("");
$("#result-0-partyB").val("");
}
}
}
IPLATUI.EFPopupInput = {
"popupInputPartyA": {
/**
* EFGrid 查询时触发的事件,通常在此处,设置查询条件
* 注意: 必须返回一个EiInfo,作为初始查询条件
* 配置了query时,默认每次打开窗口都会进行一次查询
*/
query: function (e) {
console.log("Step" + (++i) + ": ----query----");
// 将自定义div中的字段构造成查询条件 EiInfo
// var queryInfo = EiInfo.build("#result-0-contractCategory");
var contractCategory = $("#result-0-contractCategory").val();
if (!contractCategory) {
message("请先选择合同类型!");
// 阻止弹窗
e.preventDefault();
}
var info = new EiInfo();
info.set("contractCategory",contractCategory)
return info;
},
/**
* grid中的数据回填时触发的事件
* @param e 回填数据事件
* e.sender 弹出窗口对象
* e.grid 弹出的grid对象
* e.model 选中的数据行model
*/
backFill: function (e) {
console.log("Step" + (++i) + ": ----backFill----");
// 回填数据
var model = e.model;
// var data = model.toJSON();
console.log(model);
var partyA = model.usercode + "-" + model.username;
$("#result-0-partyA").val(partyA);
IPLAT.EFPopupInput.text( $("#popupInputPartyA") , partyA)
e.preventDefault(); // 不使用默认的回填逻辑
}
},
"popupInputPartyB": {
/**
* EFGrid 查询时触发的事件,通常在此处,设置查询条件
* 注意: 必须返回一个EiInfo,作为初始查询条件
* 配置了query时,默认每次打开窗口都会进行一次查询
*/
query: function (e) {
console.log("Step" + (++i) + ": ----query----");
// 将自定义div中的字段构造成查询条件 EiInfo
// var queryInfo = EiInfo.build("#result-0-contractCategory");
var contractCategory = $("#result-0-contractCategory").val();
if (!contractCategory) {
message("请先选择合同类型!");
// 阻止弹窗
e.preventDefault();
}
var info = new EiInfo();
info.set("contractCategory",contractCategory)
return info;
},
/**
* grid中的数据回填时触发的事件
* @param e 回填数据事件
* e.sender 弹出窗口对象
* e.grid 弹出的grid对象
* e.model 选中的数据行model
*/
backFill: function (e) {
console.log("Step" + (++i) + ": ----backFill----");
// 回填数据
var model = e.model;
// var data = model.toJSON();
console.log(model);
var partyB = model.usercode + "-" + model.username;
$("#result-0-partyB").val(partyB);
IPLAT.EFPopupInput.text( $("#popupInputPartyB") , partyB)
e.preventDefault(); // 不使用默认的回填逻辑
}
}
};
window.document.addEventListener("keyup",function (event) {
if(event.keyCode === 13){
var grid = $("#ef_grid_result").data("kendoGrid");
// 回填
//grid.addRows(returnRows);
grid.closeCell();
}
})
});
function initDate() {
setTimeout(function() {
var projCode = $("#result-0-projCode").val();
$("#projCodeBox").val(projCode)
var contractCategory = $("#result-0-contractCategory").val()
if (contractCategory == "1" || contractCategory == "3") {
$("#contractCategoryName").val("收入");
} else if (contractCategory == "2" || contractCategory == "4"){
$("#contractCategoryName").val("支出");
} else {
$("#contractCategoryName").val("");
}
}, 3000);
}
function saveResult1Func() {
}
function uploadFileFunc() {
JSColorbox.open({
href: "HGCW099?methodName=initLoad&inqu_status-0-bizType=HT",
title: "<div style='text-align: center;'>附件上传</div>",
width: "60%",
height: "50%",
callbackName: uploadFileCallback
});
}
/**
* 附件上传回调
*
* @param docId
*/
function uploadFileCallback(docId) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-docId", docId);
inEiInfo.set("result-0-bizType", $("#inqu_status-0-bizType").val());
EiCommunicator.send('HGCW999', 'insert', inEiInfo, {
onSuccess(response) {
if (response.status === 0) {
EiCommunicator.send('HGCW999', 'queryDoc', inEiInfo, {
onSuccess(e) {
console.log(e);
if (e.status === 0) {
let data = e.extAttr.data;
detail2Grid.dataSource.insert();
detail2Grid.setCellValue(0, "rowNo", 0);
detail2Grid.setCellValue(0, "id", data.id);
detail2Grid.setCellValue(0, "docId", data.docId);
detail2Grid.setCellValue(0, "docName", data.docName);
detail2Grid.setCellValue(0, "createdTime", data.createdTime);
detail2Grid.refresh();
} else {
NotificationUtil("执行失败!", "error");
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
} else {
NotificationUtil("执行失败!", "error");
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
function cancelFunc() {
// 关闭弹窗
parent.JSColorbox.setValueCallback();
}
function btnSaveFunc() {
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGrid("detail1,detail2", "HGCW002", "save", {isAlldata:true,onSuccessCallback:parent.windowCallback});
}
});
}
function deleteFileFunc() {
let rows = detail2Grid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
rows.forEach(function (row) {
detail2Grid.removeRows([rows.rowNo]);// 刷新行号
})
refreshRowNo();
}
function deleteResult1Func() {
let rows = detail1Grid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
rows.forEach(function (row) {
detail1Grid.removeRows([rows.rowNo]);// 刷新行号
})
refreshRowNo();
}
let refreshRowNo = function () {
let allRows = detail1Grid.getDataItems();
for (let i = 0; i < allRows.length; i++) {
detail1Grid.setCellValue(i, "rowNo", i);
detail1Grid.refresh();
}
}
$(window).load(function () {
refreshRowNo();
});
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<head>
</head>
<EF:EFPage title="修改合同">
<EF:EFRegion id="inqu1" title="基本信息">
<div class="row">
<EF:EFSelect cname="项目编号" ename="projCodeBox" colWidth="4" required="true" filter="contains">
<EF:EFOption label="-- 请选择 --" value="" />
<EF:EFOptions
blockId="projectCodeBox_block_id" valueField="valueField" textField="textField"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-projCode" cname="项目编号" type="hidden"/>
<EF:EFInput ename="result-0-projName" cname="项目简称" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-contractNumber" cname="合同号" colWidth="4" readonly="true" />
</div>
<div class="row">
<EF:EFInput ename="result-0-contractName" cname="合同名称" colWidth="4" required="true"/>
<EF:EFSelect cname="合同类型" ename="result-0-contractType" colWidth="4" filter="contains" required="true">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractType"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-contractCategory" cname="合同类别" type="hidden"/>
<EF:EFInput ename="contractCategoryName" cname="合同类别" colWidth="4" readonly="true"/>
<%-- <EF:EFSelect cname="合同类别" ename="result-0-contractCategory" colWidth="4" filter="contains" readonly="true" required="true">--%>
<%-- <EF:EFOption label="-- 请选择 --" value=""/>--%>
<%-- <EF:EFCodeOption codeName="hggp.cw.contractCategory"/>--%>
<%-- </EF:EFSelect>--%>
</div>
<div class="row">
<EF:EFPopupInput ename="popupInputPartyA" cname="甲方名称" colWidth="4"
serviceName="HGCW002A" methodName="partyAQuery"
resultId="partyAResult"
required="true" save="false" popupType="ServiceGrid"
valueField="username" textField="username"
columnEnames="username,usercode"
columnCnames="名称,编码"
readonly="true"
resizable="true" popupTitle="甲方名称" popupWidth="400">
</EF:EFPopupInput>
<EF:EFInput ename="result-0-partyA" cname="甲方名称" type="hidden" />
<EF:EFPopupInput ename="popupInputPartyB" cname="乙方名称" colWidth="4"
serviceName="HGCW002A" methodName="partyBQuery"
resultId="partyAResult"
save="false" popupType="ServiceGrid"
valueField="username" textField="username"
columnEnames="username,usercode"
columnCnames="名称,编码"
readonly="true"
resizable="true" popupTitle="乙方名称" popupWidth="400">
</EF:EFPopupInput>
<EF:EFInput ename="result-0-partyB" cname="乙方名称" type="hidden"/>
<EF:EFInput ename="result-0-partyC" cname="丙方" colWidth="4" />
</div>
<div class="row">
<EF:EFDateSpan startCname="计划开工/竣工日期" endCname="至" required="true" colWidth="8" blockId="result"
startName="planStartDate" endName="planEndDate" row="0" role="date"
format="yyyy-MM-dd" ratio="4:4" satrtRatio="4:8" endRatio="4:8">
</EF:EFDateSpan>
<EF:EFSelect cname="合同状态" ename="result-0-contractStatus" colWidth="4" filter="contains">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractStatus"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFInput ename="result-0-partyAName" cname="甲方联系人姓名" colWidth="4" />
<EF:EFInput ename="result-0-partyAPhoneNumber" cname="甲方联系人电话" colWidth="4" />
<EF:EFInput ename="result-0-alreadyName" cname="已方联系人姓名" colWidth="4" />
</div>
<div class="row">
<EF:EFInput ename="result-0-alreadyPhoneNumber" cname="已方联系人电话" colWidth="4" />
<EF:EFInput ename="result-0-engineeringAddress" cname="工程地址" colWidth="8" ratio="2:10" required="true"/>
</div>
<div class="row">
<EF:EFDatePicker cname="签约日期" ename="result-0-signingDate" colWidth="4"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFInput ename="result-0-mainContractNumber" cname="主合同号" colWidth="8" ratio="2:10"/>
</div>
<div class="row">
<EF:EFInput type="textarea" ename="result-0-contractContent" cname="合同内容" colWidth="8" ratio="2:10" required="true"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="inqu2" title="承包方式及合同价款">
<div class="row">
<EF:EFInput ename="result-0-contractingMethod" cname="承包方式" colWidth="4" />
<EF:EFSelect cname="付款方式" ename="result-0-paymentMethod" colWidth="4" filter="contains">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.paymentMethod"/>
</EF:EFSelect>
<EF:EFSelect cname="计价方式" ename="result-0-pricingMethod" colWidth="4" filter="contains">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.pricingMethod"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect cname="税点" ename="result-0-taxPoints" colWidth="4" filter="contains">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.taxPoints"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-totalContractPriceExcluding" cname="合同总价(不含税)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-valueAddedTax" cname="增值税" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-totalContractPriceIncluding" cname="合同总价(含税)" colWidth="4" readonly="true"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="detail1" title="合同清单">
<EF:EFGrid blockId="detail1" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="inventory" cname="清单" align="center" />
<EF:EFColumn ename="unit" cname="单位" align="center" />
<EF:EFColumn ename="provisionalQuantity" cname="暂定工程量" format="{0:N3}" align="center"/>
<EF:EFColumn ename="measurementMethod" cname="计量方式" align="center" />
<EF:EFColumn ename="supplyMethod" cname="材料供应方式" align="center"/>
<EF:EFColumn ename="unitPriceExcludingTax" cname="除税单价/元" format="{0:N3}" align="center"/>
<EF:EFColumn ename="totalPriceExcluding" cname="不含税总价" enable="false" format="{0:N3}" align="center"/>
<EF:EFColumn ename="totalPriceIncluding" cname="含税总价" enable="false" format="{0:N3}" align="center"/>
<EF:EFColumn ename="laborCosts" cname="其中人工费、元" format="{0:N3}" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
<EF:EFRegion id="detail2" title="附件信息">
<EF:EFGrid blockId="detail2" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
</EF:EFGrid>
</EF:EFRegion>
<div class="row" style="display:flex;justify-content:center;">
<EF:EFButton ename="cancel" cname="取消" type="button" class="btn-center"/>
<EF:EFButton ename="btn_save" cname="保存" type="button" class="btn-center"/>
</div>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HG/CW/HGCW002B.js"></script>
\ No newline at end of file
...@@ -34,7 +34,7 @@ $(function () { ...@@ -34,7 +34,7 @@ $(function () {
result.set("result-0-realPath",docUrl); result.set("result-0-realPath",docUrl);
result.set("result-0-bizType",$("#inqu_status-0-bizType").val()); result.set("result-0-bizType",$("#inqu_status-0-bizType").val());
result.set("result-0-matId",$("#inqu_status-0-matId").val()); result.set("result-0-matId",$("#inqu_status-0-matId").val());
EiCommunicator.send("HPDS002", "insert", result, { EiCommunicator.send("HGDS002", "insert", result, {
onSuccess: function (ei) { onSuccess: function (ei) {
if (ei.getStatus() >= 0) { if (ei.getStatus() >= 0) {
if (ei.getStatus() == 0) { if (ei.getStatus() == 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment