Commit f590823c by liuyang

Merge branch 'dev' of http://git.pseer.com:8800/platform/hg-smart into dev-ly

 Conflicts:
	src/main/java/com/baosight/hggp/hg/constant/HGConstant.java
parents ab2d23c6 62bcb9ac
package com.baosight.hggp.common;
/**
* @author wwl
* @version 1.0 2024/5/21
*/
public enum CheckStatusEnum {
CHECKING(0,"质检中"),
CHECKED(1,"质检完成");
private Integer code;
private String value;
CheckStatusEnum(Integer code, String value) {
this.code = code;
this.value = value;
}
public static CheckStatusEnum getEnumByCode(Integer code){
for (CheckStatusEnum en : CheckStatusEnum.values()){
if(code.compareTo(en.code)==0){
return en;
}
}
return null;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
...@@ -91,7 +91,7 @@ public enum DdynamicEnum { ...@@ -91,7 +91,7 @@ public enum DdynamicEnum {
* 用途:存货档案下拉框,带id名称等信息 * 用途:存货档案下拉框,带id名称等信息
* 编写: * 编写:
*/ */
PRODUCT_BLOCK_ID("product_block_id","inventCode","inventName","id","inventType","length","width","thick","HGPZ005.queryProductComboBox"), PRODUCT_BLOCK_ID("product_block_id","inventCode","inventName","id","inventType","length","width","thick","inventTypeDetail","HGPZ005.queryProductComboBox"),
/** /**
* 模块:存货档案(ALL) * 模块:存货档案(ALL)
* 用途:存货档案下拉框 * 用途:存货档案下拉框
......
...@@ -74,7 +74,7 @@ public class DaoUtils { ...@@ -74,7 +74,7 @@ public class DaoUtils {
} }
/** /**
* update method. * updateBatch method.
* *
* @param sql * @param sql
* @param parameters * @param parameters
...@@ -91,6 +91,23 @@ public class DaoUtils { ...@@ -91,6 +91,23 @@ public class DaoUtils {
} }
/** /**
* insertBatch method.
*
* @param sql
* @param parameters
*/
public static int insertBatch(String sql, Collection parameters) {
parameters.forEach(obj->{
if (obj instanceof DaoEPBase) {
setRevisor((DaoEPBase) obj, true);
} else if (obj instanceof Map) {
setRevisor((Map) obj, true);
}
});
return DaoBase.getInstance().insertBatch(sql, parameters);
}
/**
* 创建人工号 创建人姓名 创建人岗号 创建时刻 * 创建人工号 创建人姓名 创建人岗号 创建时刻
* *
* @param bean * @param bean
......
...@@ -71,6 +71,10 @@ public class HGConstant { ...@@ -71,6 +71,10 @@ public class HGConstant {
public static final String HGSC006_ORDER_CODE = "HGSC006_ORDER_CODE"; public static final String HGSC006_ORDER_CODE = "HGSC006_ORDER_CODE";
//生产任务 //生产任务
public static final String HGSC007_TASK_CODE = "HGSC007_TASK_CODE"; public static final String HGSC007_TASK_CODE = "HGSC007_TASK_CODE";
//生产报工
public static final String HGSC008_WORK_CODE = "HGSC008_WORK_CODE";
//工序质检
public static final String HGZL002_CHECK_CODE = "HGZL002_CHECK_CODE";
//生产任务订单 //生产任务订单
public static final String PROD_TASK_NO = "PROD_TASK_NO"; public static final String PROD_TASK_NO = "PROD_TASK_NO";
//售后维修单号 //售后维修单号
...@@ -113,6 +117,9 @@ public class HGConstant { ...@@ -113,6 +117,9 @@ public class HGConstant {
public static final String SALE_OUT_CODE = "SALE_OUT_CODE"; public static final String SALE_OUT_CODE = "SALE_OUT_CODE";
// 调拨单号 // 调拨单号
public static final String ALLOT_NO = "ALLOT_NO"; public static final String ALLOT_NO = "ALLOT_NO";
public static final String CW_COLLECTION_NO = "CW_COLLECTION_NO";
} }
/** /**
......
...@@ -94,10 +94,10 @@ public class HGCW010 extends DaoEPBase { ...@@ -94,10 +94,10 @@ public class HGCW010 extends DaoEPBase {
private String settlementNumber = " "; /* 来源单号*/ private String settlementNumber = " "; /* 来源单号*/
private String billTybe = " "; /* 票据类型*/ private String billTybe = " "; /* 票据类型*/
private String billNumber = " "; /* 发票号*/ private String billNumber = " "; /* 发票号*/
private String billState = " "; /* 开票状态*/ private Integer billState; /* 开票状态*/
private String signingDate = " "; /* 开票日期*/ private String signingDate = " "; /* 开票日期*/
private String partyA = " "; /* 客户名称*/ private String partyA = " "; /* 客户名称*/
private Boolean reviewStatus; /* 审批状态*/ private Integer reviewStatus; /* 审批状态*/
private String thisSettlementTax = " "; /* 税额*/ private String thisSettlementTax = " "; /* 税额*/
private String thisSettlementAmount = " "; /* 不含税金额*/ private String thisSettlementAmount = " "; /* 不含税金额*/
private String taxPoints = " "; /* 税率*/ private String taxPoints = " "; /* 税率*/
...@@ -381,7 +381,7 @@ public class HGCW010 extends DaoEPBase { ...@@ -381,7 +381,7 @@ public class HGCW010 extends DaoEPBase {
* get the billState - 开票状态. * get the billState - 开票状态.
* @return the billState * @return the billState
*/ */
public String getBillState() { public Integer getBillState() {
return this.billState; return this.billState;
} }
...@@ -390,7 +390,7 @@ public class HGCW010 extends DaoEPBase { ...@@ -390,7 +390,7 @@ public class HGCW010 extends DaoEPBase {
* *
* @param billState - 开票状态 * @param billState - 开票状态
*/ */
public void setBillState(String billState) { public void setBillState(Integer billState) {
this.billState = billState; this.billState = billState;
} }
/** /**
...@@ -429,7 +429,7 @@ public class HGCW010 extends DaoEPBase { ...@@ -429,7 +429,7 @@ public class HGCW010 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;
} }
...@@ -438,7 +438,7 @@ public class HGCW010 extends DaoEPBase { ...@@ -438,7 +438,7 @@ public class HGCW010 extends DaoEPBase {
* *
* @param reviewStatus - 审批状态 * @param reviewStatus - 审批状态
*/ */
public void setReviewStatus(Boolean reviewStatus) { public void setReviewStatus(Integer reviewStatus) {
this.reviewStatus = reviewStatus; this.reviewStatus = reviewStatus;
} }
/** /**
...@@ -642,10 +642,10 @@ public class HGCW010 extends DaoEPBase { ...@@ -642,10 +642,10 @@ public class HGCW010 extends DaoEPBase {
setSettlementNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SETTLEMENT_NUMBER)), settlementNumber)); setSettlementNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SETTLEMENT_NUMBER)), settlementNumber));
setBillTybe(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BILL_TYBE)), billTybe)); setBillTybe(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BILL_TYBE)), billTybe));
setBillNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BILL_NUMBER)), billNumber)); setBillNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BILL_NUMBER)), billNumber));
setBillState(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BILL_STATE)), billState)); setBillState(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_BILL_STATE)), billState));
setSigningDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SIGNING_DATE)), signingDate)); setSigningDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SIGNING_DATE)), signingDate));
setPartyA(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_A)), partyA)); setPartyA(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_A)), partyA));
setReviewStatus(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_REVIEW_STATUS)), reviewStatus)); setReviewStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_REVIEW_STATUS)), reviewStatus));
setThisSettlementTax(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_THIS_SETTLEMENT_TAX)), thisSettlementTax)); setThisSettlementTax(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_THIS_SETTLEMENT_TAX)), thisSettlementTax));
setThisSettlementAmount(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_THIS_SETTLEMENT_AMOUNT)), thisSettlementAmount)); setThisSettlementAmount(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_THIS_SETTLEMENT_AMOUNT)), thisSettlementAmount));
setTaxPoints(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_TAX_POINTS)), taxPoints)); setTaxPoints(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_TAX_POINTS)), taxPoints));
......
package com.baosight.hggp.hg.cw.domain; package com.baosight.hggp.hg.cw.domain;
import com.baosight.iplat4j.core.util.NumberUtils; import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.baosight.iplat4j.core.ei.EiColumn; import com.baosight.iplat4j.core.ei.EiColumn;
...@@ -16,8 +17,9 @@ import com.baosight.iplat4j.core.util.StringUtils; ...@@ -16,8 +17,9 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br> * Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
* *
* @version 1.0 * @version 1.0
* @history 2024-05-27 16:53:39 create * @history 2024-05-30 14:16:59 create
*/ */
public class HGCW012 extends DaoEPBase { public class HGCW012 extends DaoEPBase {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -44,6 +46,7 @@ public class HGCW012 extends DaoEPBase { ...@@ -44,6 +46,7 @@ public class HGCW012 extends DaoEPBase {
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_DEP_CODE = "depCode"; /* 部门编码*/ public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_REMAINING_AMOUNT = "remainingAmount"; /* 剩余开票/收票金额*/
public static final String COL_ID = "ID"; public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/ public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
...@@ -67,6 +70,7 @@ public class HGCW012 extends DaoEPBase { ...@@ -67,6 +70,7 @@ public class HGCW012 extends DaoEPBase {
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 记录修改名称*/ public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 记录修改名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 记录修改时间*/ public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 记录修改时间*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/ public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_REMAINING_AMOUNT = "REMAINING_AMOUNT"; /* 剩余开票/收票金额*/
public static final String QUERY = "HGCW012.query"; public static final String QUERY = "HGCW012.query";
public static final String COUNT = "HGCW012.count"; public static final String COUNT = "HGCW012.count";
...@@ -84,7 +88,7 @@ public class HGCW012 extends DaoEPBase { ...@@ -84,7 +88,7 @@ public class HGCW012 extends DaoEPBase {
private Integer billState = new Integer(0); /* 开票状态*/ private Integer billState = new Integer(0); /* 开票状态*/
private String signingDate = " "; /* 开票日期*/ private String signingDate = " "; /* 开票日期*/
private String partyA = " "; /* 供应商名称*/ private String partyA = " "; /* 供应商名称*/
private Boolean reviewStatus; /* 审批状态*/ private Integer reviewStatus; /* 审批状态*/
private Integer taxPoints = new Integer(0); /* 税率*/ private Integer taxPoints = new Integer(0); /* 税率*/
private String thisSettlementTax = " "; /* 税额*/ private String thisSettlementTax = " "; /* 税额*/
private String thisSettlementAmount = " "; /* 不含税金额*/ private String thisSettlementAmount = " "; /* 不含税金额*/
...@@ -96,6 +100,7 @@ public class HGCW012 extends DaoEPBase { ...@@ -96,6 +100,7 @@ public class HGCW012 extends DaoEPBase {
private String updatedName = " "; /* 记录修改名称*/ private String updatedName = " "; /* 记录修改名称*/
private String updatedTime = " "; /* 记录修改时间*/ private String updatedTime = " "; /* 记录修改时间*/
private String depCode = " "; /* 部门编码*/ private String depCode = " "; /* 部门编码*/
private BigDecimal remainingAmount = new BigDecimal("0"); /* 剩余开票/收票金额*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -145,7 +150,6 @@ public class HGCW012 extends DaoEPBase { ...@@ -145,7 +150,6 @@ public class HGCW012 extends DaoEPBase {
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REVIEW_STATUS); eiColumn = new EiColumn(FIELD_REVIEW_STATUS);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName("审批状态"); eiColumn.setDescName("审批状态");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -196,6 +200,13 @@ public class HGCW012 extends DaoEPBase { ...@@ -196,6 +200,13 @@ public class HGCW012 extends DaoEPBase {
eiColumn.setDescName("部门编码"); eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REMAINING_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("剩余开票/收票金额");
eiMetadata.addMeta(eiColumn);
} }
...@@ -370,7 +381,7 @@ public class HGCW012 extends DaoEPBase { ...@@ -370,7 +381,7 @@ public class HGCW012 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;
} }
...@@ -379,7 +390,7 @@ public class HGCW012 extends DaoEPBase { ...@@ -379,7 +390,7 @@ public class HGCW012 extends DaoEPBase {
* *
* @param reviewStatus - 审批状态 * @param reviewStatus - 审批状态
*/ */
public void setReviewStatus(Boolean reviewStatus) { public void setReviewStatus(Integer reviewStatus) {
this.reviewStatus = reviewStatus; this.reviewStatus = reviewStatus;
} }
/** /**
...@@ -559,6 +570,22 @@ public class HGCW012 extends DaoEPBase { ...@@ -559,6 +570,22 @@ public class HGCW012 extends DaoEPBase {
this.depCode = depCode; this.depCode = depCode;
} }
/** /**
* get the remainingAmount - 剩余开票/收票金额.
* @return the remainingAmount
*/
public BigDecimal getRemainingAmount() {
return this.remainingAmount;
}
/**
* set the remainingAmount - 剩余开票/收票金额.
*
* @param remainingAmount - 剩余开票/收票金额
*/
public void setRemainingAmount(BigDecimal remainingAmount) {
this.remainingAmount = remainingAmount;
}
/**
* get the value from Map. * get the value from Map.
* *
* @param map - source data map * @param map - source data map
...@@ -576,7 +603,7 @@ public class HGCW012 extends DaoEPBase { ...@@ -576,7 +603,7 @@ public class HGCW012 extends DaoEPBase {
setBillState(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_BILL_STATE)), billState)); setBillState(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_BILL_STATE)), billState));
setSigningDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SIGNING_DATE)), signingDate)); setSigningDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SIGNING_DATE)), signingDate));
setPartyA(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_A)), partyA)); setPartyA(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_A)), partyA));
setReviewStatus(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_REVIEW_STATUS)), reviewStatus)); setReviewStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_REVIEW_STATUS)), reviewStatus));
setTaxPoints(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_TAX_POINTS)), taxPoints)); setTaxPoints(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_TAX_POINTS)), taxPoints));
setThisSettlementTax(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_THIS_SETTLEMENT_TAX)), thisSettlementTax)); setThisSettlementTax(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_THIS_SETTLEMENT_TAX)), thisSettlementTax));
setThisSettlementAmount(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_THIS_SETTLEMENT_AMOUNT)), thisSettlementAmount)); setThisSettlementAmount(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_THIS_SETTLEMENT_AMOUNT)), thisSettlementAmount));
...@@ -588,6 +615,7 @@ public class HGCW012 extends DaoEPBase { ...@@ -588,6 +615,7 @@ public class HGCW012 extends DaoEPBase {
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName)); setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime)); setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode)); setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setRemainingAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_REMAINING_AMOUNT)), remainingAmount));
} }
/** /**
...@@ -619,6 +647,7 @@ public class HGCW012 extends DaoEPBase { ...@@ -619,6 +647,7 @@ public class HGCW012 extends DaoEPBase {
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME))); map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME))); map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
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_REMAINING_AMOUNT, StringUtils.toString(remainingAmount, eiMetadata.getMeta(FIELD_REMAINING_AMOUNT)));
return map; return map;
} }
......
...@@ -31,7 +31,7 @@ public class ServiceHGCW001 extends ServiceBase { ...@@ -31,7 +31,7 @@ public class ServiceHGCW001 extends ServiceBase {
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化") @OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW001().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW001().eiMetadata);
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败"); LogUtils.setDetailMsg(inInfo, e, "初始化失败");
......
...@@ -2,22 +2,24 @@ package com.baosight.hggp.hg.cw.service; ...@@ -2,22 +2,24 @@ 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.hg.cw.domain.HGCW010; import com.baosight.hggp.hg.cw.domain.HGCW010;
import com.baosight.hggp.hg.cw.domain.HGCW010A;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO; 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.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
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.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.util.StringUtils;
import org.apache.commons.collections.CollectionUtils;
import java.util.*; import java.util.Arrays;
import java.util.List;
import java.util.Map;
/** /**
* @author yukang * @author yukang
...@@ -31,129 +33,38 @@ public class ServiceHGCW010A extends ServiceBase { ...@@ -31,129 +33,38 @@ public class ServiceHGCW010A extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化") @OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化")
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); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW010A().eiMetadata);
inInfo.addBlock("detail1").addBlockMeta(new HGCW010().eiMetadata);
inInfo.addBlock("detail2").addBlockMeta(new HGCW010().eiMetadata);
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败"); LogUtils.setDetailMsg(inInfo, e, "初始化失败");
} }
return inInfo; return inInfo;
} }
/** /**
* 甲方名称查询 * 查询操作
* 合同类别为收入时,乙方为组织机构中的公司,甲方选择客户档案里的客户;数据提交之后需要把客户档案中的客户类别更新为正式客户 *
* 合同类别为支出时,甲方为组织机构中的公司,乙方选择供应商档案里面的供应商 *
* @param inInfo
* @return
*/
public EiInfo partyAQuery(EiInfo inInfo) {
try {
List<UserVO> userVOList = new ArrayList<>();
String contractCategory = inInfo.getString("contractCategory");
if (contractCategory.equals("1")) {
List<HGPZ002> hgpz002List = HGPZTools.HgPz002.list(1);
if (CollectionUtils.isNotEmpty(hgpz002List)) {
hgpz002List.forEach(hgpz002 -> {
UserVO userVO = new UserVO();
userVO.setUsercode(hgpz002.getCustCode());
userVO.setUsername(hgpz002.getCustName());
userVOList.add(userVO);
});
}
} else if (contractCategory.equals("2")) {
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 userVO = new UserVO();
userVO.setUsercode(org1.getOrgId());
userVO.setUsername(org1.getOrgCname());
userVOList.add(userVO);
} else {
UserVO userVO = new UserVO();
userVO.setUsercode(org.getOrgId());
userVO.setUsername(org.getOrgCname());
userVOList.add(userVO);
}
}
}
inInfo.addBlock("partyAResult").addRows(userVOList);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "甲方名称查询失败");
}
return inInfo;
}
/**
* 乙方名称查询
* @param inInfo * @param inInfo
* @return * @return
*/ */
public EiInfo partyBQuery(EiInfo inInfo) { @OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try { try {
List<UserVO> userVOList = new ArrayList<>(); inInfo = super.query(inInfo, HGCW010A.QUERY, new HGCW010A());
String contractCategory = inInfo.getString("contractCategory"); } catch (Exception e) {
if (contractCategory.equals("1")) { LogUtils.setDetailMsg(inInfo, e, "查询失败");
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 userVO = new UserVO();
userVO.setUsercode(org1.getOrgId());
userVO.setUsername(org1.getOrgCname());
userVOList.add(userVO);
} else {
UserVO userVO = new UserVO();
userVO.setUsercode(org.getOrgId());
userVO.setUsername(org.getOrgCname());
userVOList.add(userVO);
}
}
} else if (contractCategory.equals("2")) {
List<HGPZ003> hgpz003List = HGPZTools.HgPz003.list(4);
if (CollectionUtils.isNotEmpty(hgpz003List)) {
hgpz003List.forEach(hgpz003 -> {
UserVO userVO = new UserVO();
userVO.setUsercode(hgpz003.getSupCode());
userVO.setUsername(hgpz003.getSupName());
userVOList.add(userVO);
});
}
}
inInfo.addBlock("partyAResult").addRows(userVOList);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "乙方名称查询失败");
} }
return inInfo; return inInfo;
} }
public EiInfo queryconteractComboBox(EiInfo inInfo){
Map<String, Object> map = new HashMap<>();
List<String> contractTypArray = new ArrayList<>();
if (StringUtils.isNotEmpty(inInfo.getString("contractNumber"))) {
map.put("contractNumber", inInfo.getString("contractNumber"));
}
if (StringUtils.isNotEmpty(inInfo.getString("settlementNumber"))) {
map.put("settlementNumber", inInfo.getString("settlementNumber"));
}
if (StringUtils.isNotEmpty(inInfo.getString("settlementNumbers"))) {
String[] settlementNumbers = inInfo.getString("settlementNumbers").split(",");
for (String c : settlementNumbers) {
contractTypArray.add(c);
}
map.put("settlementNumbers", contractTypArray);
}
List<HGCW010> HGCW010List = dao.query("HGCW010.queryconteractComboBox", map);
inInfo.addBlock("conteract_combo_box").setRows(HGCW010List);
return inInfo;
}
} }
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW011;
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.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 java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW011 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID,
DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW011().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGCW011.QUERY, new HGCW011());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGCW011 HGCW011 = new HGCW011();
HGCW011.fromMap(resultRows.get(i));
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
HGCW011.setCompanyCode(userVO.getUsercode());
HGCW011.setCompanyName(userVO.getUsername());
if (HGCW011.getId() == null || HGCW011.getId() == 0) {
this.add(HGCW011);
} else {
this.modify(HGCW011);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param HGCW011
* @return
*/
public void add(HGCW011 HGCW011) {
DaoUtils.insert("HGCW011.insert", HGCW011);
}
/**
* 修改操作
*
* @param HGCW011
* @return
*/
public void modify(HGCW011 HGCW011) {
DaoUtils.update("HGCW011.update", HGCW011);
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
DaoUtils.update("HGCW011.delete", resultRows.get(i));
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.cw.service;
import com.baosight.eplat.utils.StringUtils;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW010;
import com.baosight.hggp.hg.cw.domain.HGCW011;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
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 com.baosight.iplat4j.core.util.NumberUtils;
import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW012 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "销售开票",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUP_RECORD_BLOCK_ID,
DdynamicEnum.PROJ_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW010().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "销售开票",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGCW010.QUERY, new HGCW010());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "收款单",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGCW010 HGCW010 = new HGCW010();
HGCW010.fromMap(resultRows.get(i));
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
HGCW010.setCompanyCode(userVO.getUsercode());
HGCW010.setCompanyName(userVO.getUsername());
HGCW010.setBillState(1);
HGCW010.setReviewStatus(0);
HGCW010.setSigningDate(DateUtils.formatShort(HGCW010.getSigningDate()));
// 获取项目名称
HGSC001 HGSC001 = HGSCTools.Hgsc001.queryByCode(HGCW010.getProjCode());
HGCW010.setProjName(HGSC001.getProjName());
if (HGCW010.getId() == null || HGCW010.getId() == 0) {
this.add(HGCW010);
} else {
this.modify(HGCW010);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param HGCW010
* @return
*/
public void add(HGCW010 HGCW010) {
DaoUtils.insert("HGCW010.insert", HGCW010);
}
/**
* 修改操作
*
* @param HGCW010
* @return
*/
public void modify(HGCW010 HGCW010) {
DaoUtils.update("HGCW010.update", HGCW010);
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "收款单",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
DaoUtils.update("HGCW010.delete", resultRows.get(i));
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "收款单",operType = "插入",operDesc = "生成收款单")
public EiInfo select(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<Map> queryRows = inInfo.getBlock(EiConstant.queryBlock).getRows();
String mainId = "";
if (CollectionUtils.isNotEmpty(queryRows)) {
mainId = queryRows.get(0).get("mainId").toString();
}
//获取相应的数据
List<HGCW011> hgcw011List = HGCWTools.HgCw011.mapToList(resultRows, NumberUtils.toLong(mainId));
DecimalFormat decimalFormat = new DecimalFormat("#.000");
if (CollectionUtils.isNotEmpty(hgcw011List)) {
if (StringUtils.isEmpty(mainId)) {
//先生成主表
HGCW010 HGCW010 = new HGCW010();
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
HGCW010.setCompanyCode(userVO.getUsercode());
HGCW010.setCompanyName(userVO.getUsername());
HGCW010.setBillState(1);
HGCW010.setReviewStatus(0);
HGCW010.setSigningDate(DateUtils.shortDate());
BigDecimal totalContractPriceIncluding = BigDecimal.ZERO;
StringBuffer contractNumber = new StringBuffer();
for (HGCW011 hgcw011 : hgcw011List) {
totalContractPriceIncluding = totalContractPriceIncluding.add(hgcw011.getTotalContractPriceIncluding());
}
HGCW010.setTotalContractPriceIncluding(new BigDecimal(decimalFormat.format(totalContractPriceIncluding)));
HGCW010.setPartyA(hgcw011List.get(0).getPartyA());
this.add(HGCW010);
//生成明细表
for (HGCW011 hgcw011 : hgcw011List) {
hgcw011.setMainId(HGCW010.getId());
DaoUtils.insert(HGCW011.INSERT, hgcw011);
}
} else {
// 更新主表
HGCW010 HGCW010 = HGCWTools.HgCw010.getId(mainId);
BigDecimal totalContractPriceIncluding = BigDecimal.ZERO;
StringBuffer contractNumber = new StringBuffer();
for (HGCW011 hgcw011 : hgcw011List) {
totalContractPriceIncluding = totalContractPriceIncluding.add(hgcw011.getTotalContractPriceIncluding());
}
HGCW010.setTotalContractPriceIncluding(new BigDecimal(decimalFormat.format(totalContractPriceIncluding)));
this.modify(HGCW010);
// 生成明细表
for (HGCW011 hgcw011 : hgcw011List) {
hgcw011.setMainId(HGCW010.getId());
DaoUtils.insert(HGCW011.INSERT, hgcw011);
}
}
}
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "生成收款单失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW013;
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.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 java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW013 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID,
DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW013().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGCW013.QUERY, new HGCW013());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGCW013 HGCW013 = new HGCW013();
HGCW013.fromMap(resultRows.get(i));
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
HGCW013.setCompanyCode(userVO.getUsercode());
HGCW013.setCompanyName(userVO.getUsername());
if (HGCW013.getId() == null || HGCW013.getId() == 0) {
this.add(HGCW013);
} else {
this.modify(HGCW013);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param HGCW013
* @return
*/
public void add(HGCW013 HGCW013) {
DaoUtils.insert("HGCW013.insert", HGCW013);
}
/**
* 修改操作
*
* @param HGCW013
* @return
*/
public void modify(HGCW013 HGCW013) {
DaoUtils.update("HGCW013.update", HGCW013);
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
DaoUtils.update("HGCW013.delete", resultRows.get(i));
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW010;
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.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
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.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW014A extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW010().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGCW010.QUERY, new HGCW010());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
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.HGCW008;
import com.baosight.hggp.hg.cw.domain.HGCW009;
import com.baosight.hggp.hg.cw.domain.HGCW015;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
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 java.util.Arrays;
import java.util.List;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW014B extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID,
DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW015().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGCW015.QUERY, new HGCW015());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
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.HGCW015;
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 java.util.Arrays;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW014C extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID,
DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW015().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGCW015.QUERY, new HGCW015());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW015;
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.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 java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW015 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID,
DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW015().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGCW015.QUERY, new HGCW015());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
Long mainId = null;
for (int i = 0; i < resultRows.size(); i++) {
HGCW015 HGCW015 = new HGCW015();
HGCW015.fromMap(resultRows.get(i));
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
HGCW015.setCompanyCode(userVO.getUsercode());
HGCW015.setCompanyName(userVO.getUsername());
mainId = HGCW015.getMainId();
if (HGCW015.getId() == null || HGCW015.getId() == 0) {
this.add(HGCW015);
} else {
// 回写数据
HGCW015 oldHGCW015 = HGCWTools.HgCw015.getId(HGCW015.getId());
//先加再扣
HGCWTools.HgCw010.cutAmount(oldHGCW015.getContractNumber(),
oldHGCW015.getTotalContractPriceIncluding().multiply(new BigDecimal(-1)));
this.modify(HGCW015);
HGCWTools.HgCw010.cutAmount(HGCW015.getContractNumber(),
HGCW015.getTotalContractPriceIncluding());
}
}
// 更新主表
HGCWTools.HgCw014.updateAmount(mainId);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param HGCW015
* @return
*/
public void add(HGCW015 HGCW015) {
DaoUtils.insert("HGCW015.insert", HGCW015);
}
/**
* 修改操作
*
* @param HGCW015
* @return
*/
public void modify(HGCW015 HGCW015) {
DaoUtils.update("HGCW015.update", HGCW015);
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
Long mainId = null;
for (int i = 0; i < resultRows.size(); i++) {
HGCW015 HGCW015 = new HGCW015();
HGCW015.fromMap(resultRows.get(i));
mainId = HGCW015.getMainId();
DaoUtils.update("HGCW015.delete", HGCW015);
HGCWTools.HgCw010.cutAmount(HGCW015.getContractNumber(),
HGCW015.getTotalContractPriceIncluding().multiply(new BigDecimal(-1)));
}
// 更新主表
HGCWTools.HgCw014.updateAmount(mainId);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.hg.cw.domain.HGCW012;
import com.baosight.hggp.hg.cw.domain.HGCW012;
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;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW016A extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW012().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGCW012.QUERY, new HGCW012());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
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.HGCW017;
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 java.util.Arrays;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW016B extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUP_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW017().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGCW017.QUERY, new HGCW017());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
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.HGCW015;
import com.baosight.hggp.hg.cw.domain.HGCW017;
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 java.util.Arrays;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW016C extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUP_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW017().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGCW017.QUERY, new HGCW017());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
...@@ -104,6 +104,9 @@ ...@@ -104,6 +104,9 @@
<isNotEmpty prepend=" AND " property="depCode"> <isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode# DEP_CODE = #depCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="hiddenConditions">
REMAINING_AMOUNT > 0
</isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
...@@ -126,6 +129,7 @@ ...@@ -126,6 +129,7 @@
THIS_SETTLEMENT_AMOUNT as "thisSettlementAmount", <!-- 不含税金额 --> THIS_SETTLEMENT_AMOUNT as "thisSettlementAmount", <!-- 不含税金额 -->
TAX_POINTS as "taxPoints", <!-- 税率 --> TAX_POINTS as "taxPoints", <!-- 税率 -->
TOTAL_CONTRACT_PRICE_INCLUDING as "totalContractPriceIncluding", <!-- 开票总额 --> TOTAL_CONTRACT_PRICE_INCLUDING as "totalContractPriceIncluding", <!-- 开票总额 -->
REMAINING_AMOUNT as "remainingAmount",
CREATED_BY as "createdBy", <!-- 记录创建者 --> CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 --> CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 --> CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
...@@ -244,6 +248,7 @@ ...@@ -244,6 +248,7 @@
THIS_SETTLEMENT_AMOUNT, <!-- 不含税金额 --> THIS_SETTLEMENT_AMOUNT, <!-- 不含税金额 -->
TAX_POINTS, <!-- 税率 --> TAX_POINTS, <!-- 税率 -->
TOTAL_CONTRACT_PRICE_INCLUDING, <!-- 开票总额 --> TOTAL_CONTRACT_PRICE_INCLUDING, <!-- 开票总额 -->
REMAINING_AMOUNT,
CREATED_BY, <!-- 记录创建者 --> CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 --> CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 --> CREATED_TIME, <!-- 记录创建时间 -->
...@@ -252,7 +257,7 @@ ...@@ -252,7 +257,7 @@
UPDATED_TIME, <!-- 记录修改时间 --> UPDATED_TIME, <!-- 记录修改时间 -->
DEP_CODE <!-- 部门编码 --> DEP_CODE <!-- 部门编码 -->
) )
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #projName#, #projCode#, #settlementNumber#, #billTybe#, #billNumber#, #billState#, #signingDate#, #partyA#, #reviewStatus#, #thisSettlementTax#, #thisSettlementAmount#, #taxPoints#, #totalContractPriceIncluding#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#) VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #projName#, #projCode#, #settlementNumber#, #billTybe#, #billNumber#, #billState#, #signingDate#, #partyA#, #reviewStatus#, #thisSettlementTax#, #thisSettlementAmount#, #taxPoints#, #totalContractPriceIncluding#,#remainingAmount#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -289,30 +294,15 @@ ...@@ -289,30 +294,15 @@
WHERE WHERE
ID = #id# ID = #id#
</update> </update>
<select id="queryconteractComboBox" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap"> <update id="updateDeductionAmount">
SELECT DISTINCT UPDATE ${hggpSchema}.HGCW010
A.COMPANY_NAME as "companyName", <!-- 所属公司 --> SET
A.PROJ_CODE as "projCode", <!-- 项目编号 --> REMAINING_AMOUNT = #remainingAmount#, <!-- 审核状态 -->
A.PROJ_NAME as "projName", <!-- 项目名称 --> UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
A.CONTRACT_NUMBER as "contractNumber", <!-- 合同号 --> UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
A.CONTRACT_NAME as "contractName", <!-- 合同名称 --> UPDATED_TIME = #updatedTime# <!-- 记录修改时间 -->
A.SETTLEMENT_NUMBER as "settlementNumber", <!-- 结算编号 --> WHERE
A.THIS_SETTLEMENT_TAX as "thisSettlementTax", <!-- 税金 --> ID = #id#
A.THIS_SETTLEMENT_AMOUNT as "thisSettlementAmount", <!-- 结算金额 --> </update>
A.THIS_PRICE_TAX as "thisPriceTax", <!-- 税价合计 -->
B.CONTRACT_TYPE as "contractType" <!-- 合同类型 -->
FROM ${hggpSchema}.HGCW008 A LEFT JOIN ${hggpSchema}.HGCW002 B
ON A.PROJ_CODE = B.PROJ_CODE
AND A.CONTRACT_NUMBER = B.CONTRACT_NUMBER
AND A.COMPANY_CODE = B.COMPANY_CODE
WHERE 1=1 AND B.CONTRACT_TYPE = 1 AND A.SETTLEMENT_TYPE = 2
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
A.COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
ORDER BY A.CONTRACT_NUMBER
</select>
</sqlMap> </sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-05-30 14:16:59
Version : 1.0
schema : hggp
tableName : HGCW013
ID BIGINT NOT NULL primarykey,
MAIN_ID BIGINT NOT NULL,
ACCOUNT_CODE VARCHAR,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
SETTLEMENT_NUMBER VARCHAR,
BILL_NUMBER VARCHAR,
PARTY_A VARCHAR,
TAX_POINTS INTEGER,
THIS_SETTLEMENT_TAX VARCHAR,
THIS_SETTLEMENT_AMOUNT VARCHAR,
TOTAL_CONTRACT_PRICE_INCLUDING DECIMAL,
CREATED_BY VARCHAR NOT NULL,
CREATED_NAME VARCHAR NOT NULL,
CREATED_TIME VARCHAR NOT NULL,
UPDATED_BY VARCHAR NOT NULL,
UPDATED_NAME VARCHAR NOT NULL,
UPDATED_TIME VARCHAR NOT NULL,
DEP_CODE VARCHAR
-->
<sqlMap namespace="hgcw013">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="mainId">
MAIN_ID = #mainId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="settlementNumber">
SETTLEMENT_NUMBER = #settlementNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="billNumber">
BILL_NUMBER = #billNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="taxPoints">
TAX_POINTS = #taxPoints#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thisSettlementTax">
THIS_SETTLEMENT_TAX = #thisSettlementTax#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thisSettlementAmount">
THIS_SETTLEMENT_AMOUNT = #thisSettlementAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalContractPriceIncluding">
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#
</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="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cw.service.Hgcw013">
SELECT
ID as "id",
MAIN_ID as "mainId", <!-- 主表ID -->
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
SETTLEMENT_NUMBER as "settlementNumber", <!-- 来源单号 -->
BILL_NUMBER as "billNumber", <!-- 发票号 -->
PARTY_A as "partyA", <!-- 供应商名称 -->
TAX_POINTS as "taxPoints", <!-- 税率 -->
THIS_SETTLEMENT_TAX as "thisSettlementTax", <!-- 税额 -->
THIS_SETTLEMENT_AMOUNT as "thisSettlementAmount", <!-- 不含税金额 -->
TOTAL_CONTRACT_PRICE_INCLUDING as "totalContractPriceIncluding", <!-- 开票总额 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DEP_CODE as "depCode" <!-- 部门编码 -->
FROM ${hggpSchema}.HGCW013 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGCW013 WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="mainId">
MAIN_ID = #mainId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="settlementNumber">
SETTLEMENT_NUMBER = #settlementNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="billNumber">
BILL_NUMBER = #billNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="taxPoints">
TAX_POINTS = #taxPoints#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thisSettlementTax">
THIS_SETTLEMENT_TAX = #thisSettlementTax#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thisSettlementAmount">
THIS_SETTLEMENT_AMOUNT = #thisSettlementAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalContractPriceIncluding">
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#
</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="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGCW013 (ID,
MAIN_ID, <!-- 主表ID -->
ACCOUNT_CODE, <!-- 企业编码 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
SETTLEMENT_NUMBER, <!-- 来源单号 -->
BILL_NUMBER, <!-- 发票号 -->
PARTY_A, <!-- 供应商名称 -->
TAX_POINTS, <!-- 税率 -->
THIS_SETTLEMENT_TAX, <!-- 税额 -->
THIS_SETTLEMENT_AMOUNT, <!-- 不含税金额 -->
TOTAL_CONTRACT_PRICE_INCLUDING, <!-- 开票总额 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
DEP_CODE <!-- 部门编码 -->
)
VALUES (#id#, #mainId#, #accountCode#, #companyCode#, #companyName#, #settlementNumber#, #billNumber#, #partyA#, #taxPoints#, #thisSettlementTax#, #thisSettlementAmount#, #totalContractPriceIncluding#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGCW013 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGCW013
SET
MAIN_ID = #mainId#, <!-- 主表ID -->
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
SETTLEMENT_NUMBER = #settlementNumber#, <!-- 来源单号 -->
BILL_NUMBER = #billNumber#, <!-- 发票号 -->
PARTY_A = #partyA#, <!-- 供应商名称 -->
TAX_POINTS = #taxPoints#, <!-- 税率 -->
THIS_SETTLEMENT_TAX = #thisSettlementTax#, <!-- 税额 -->
THIS_SETTLEMENT_AMOUNT = #thisSettlementAmount#, <!-- 不含税金额 -->
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#, <!-- 开票总额 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 -->
CREATED_NAME = #createdName#, <!-- 记录创建名称 -->
CREATED_TIME = #createdTime#, <!-- 记录创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
DEP_CODE = #depCode# <!-- 部门编码 -->
WHERE
ID = #id#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-05-28 8:45:26
Version : 1.0
schema : hggp
tableName : HGCW015
ID BIGINT NOT NULL primarykey,
MAIN_ID BIGINT NOT NULL,
ACCOUNT_CODE VARCHAR,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
PROJ_NAME VARCHAR,
PROJ_CODE VARCHAR,
CONTRACT_NUMBER VARCHAR,
PARTY_A VARCHAR,
TOTAL_CONTRACT_PRICE_INCLUDING VARCHAR,
CREATED_BY VARCHAR NOT NULL,
CREATED_NAME VARCHAR NOT NULL,
CREATED_TIME VARCHAR NOT NULL,
UPDATED_BY VARCHAR NOT NULL,
UPDATED_NAME VARCHAR NOT NULL,
UPDATED_TIME VARCHAR NOT NULL,
DEP_CODE VARCHAR
-->
<sqlMap namespace="HGCW015">
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="mainId">
MAIN_ID = #mainId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER = #contractNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalContractPriceIncluding">
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#
</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="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cw.domain.HGCW015">
SELECT
ID as "id",
MAIN_ID as "mainId", <!-- 主表ID -->
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PROJ_CODE as "projCode", <!-- 项目编号 -->
CONTRACT_NUMBER as "contractNumber", <!-- 来源单号 -->
PARTY_A as "partyA", <!-- 客户名称 -->
TOTAL_CONTRACT_PRICE_INCLUDING as "totalContractPriceIncluding", <!-- 收款总额 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DEP_CODE as "depCode" <!-- 部门编码 -->
FROM ${hggpSchema}.HGCW015 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGCW015 WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="mainId">
MAIN_ID = #mainId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER = #contractNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalContractPriceIncluding">
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#
</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="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGCW015 (
MAIN_ID, <!-- 主表ID -->
ACCOUNT_CODE, <!-- 企业编码 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
PROJ_NAME, <!-- 项目名称 -->
PROJ_CODE, <!-- 项目编号 -->
CONTRACT_NUMBER, <!-- 来源单号 -->
PARTY_A, <!-- 客户名称 -->
TOTAL_CONTRACT_PRICE_INCLUDING, <!-- 收款总额 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
DEP_CODE <!-- 部门编码 -->
)
VALUES (#mainId#, #accountCode#, #companyCode#, #companyName#, #projName#, #projCode#, #contractNumber#, #partyA#, #totalContractPriceIncluding#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGCW015 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGCW015
SET
MAIN_ID = #mainId#, <!-- 主表ID -->
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
PROJ_CODE = #projCode#, <!-- 项目编号 -->
CONTRACT_NUMBER = #contractNumber#, <!-- 来源单号 -->
PARTY_A = #partyA#, <!-- 客户名称 -->
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#, <!-- 收款总额 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 -->
CREATED_NAME = #createdName#, <!-- 记录创建名称 -->
CREATED_TIME = #createdTime#, <!-- 记录创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
DEP_CODE = #depCode# <!-- 部门编码 -->
WHERE
ID = #id#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-05-30 11:09:35
Version : 1.0
schema : hggp
tableName : HGCW016
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
CONTRACT_NUMBER VARCHAR,
INCOME_NUMBER VARCHAR,
SIGNING_DATE VARCHAR,
PARTY_A VARCHAR,
CANCEL_STATUS TINYINT,
REVIEW_STATUS TINYINT,
TOTAL_CONTRACT_PRICE_INCLUDING VARCHAR,
CREATED_BY VARCHAR NOT NULL,
CREATED_NAME VARCHAR NOT NULL,
CREATED_TIME VARCHAR NOT NULL,
UPDATED_BY VARCHAR NOT NULL,
UPDATED_NAME VARCHAR NOT NULL,
UPDATED_TIME VARCHAR NOT NULL,
DEP_CODE VARCHAR
-->
<sqlMap namespace="HGCW016">
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER = #contractNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="incomeNumber">
INCOME_NUMBER = #incomeNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDate">
SIGNING_DATE = #signingDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="cancelStatus">
CANCEL_STATUS = #cancelStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reviewStatus">
REVIEW_STATUS = #reviewStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalContractPriceIncluding">
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#
</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="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cw.domain.HGCW016">
SELECT
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
CONTRACT_NUMBER as "contractNumber", <!-- 来源单号 -->
INCOME_NUMBER as "incomeNumber", <!-- 单号 -->
SIGNING_DATE as "signingDate", <!-- 付款日期 -->
PARTY_A as "partyA", <!-- 供应商名称 -->
CANCEL_STATUS as "cancelStatus", <!-- 核销状态 -->
REVIEW_STATUS as "reviewStatus", <!-- 审批状态 -->
TOTAL_CONTRACT_PRICE_INCLUDING as "totalContractPriceIncluding", <!-- 付款总额 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DEP_CODE as "depCode" <!-- 部门编码 -->
FROM ${hggpSchema}.HGCW016 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGCW016 WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER = #contractNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="incomeNumber">
INCOME_NUMBER = #incomeNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDate">
SIGNING_DATE = #signingDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="cancelStatus">
CANCEL_STATUS = #cancelStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reviewStatus">
REVIEW_STATUS = #reviewStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalContractPriceIncluding">
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#
</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="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGCW016 (ID,
ACCOUNT_CODE, <!-- 企业编码 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
CONTRACT_NUMBER, <!-- 来源单号 -->
INCOME_NUMBER, <!-- 单号 -->
SIGNING_DATE, <!-- 付款日期 -->
PARTY_A, <!-- 供应商名称 -->
CANCEL_STATUS, <!-- 核销状态 -->
REVIEW_STATUS, <!-- 审批状态 -->
TOTAL_CONTRACT_PRICE_INCLUDING, <!-- 付款总额 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
DEP_CODE <!-- 部门编码 -->
)
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #contractNumber#, #incomeNumber#, #signingDate#, #partyA#, #cancelStatus#, #reviewStatus#, #totalContractPriceIncluding#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGCW016
</selectKey>
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGCW016 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGCW016
SET
CONTRACT_NUMBER = #contractNumber#, <!-- 来源单号 -->
INCOME_NUMBER = #incomeNumber#, <!-- 单号 -->
SIGNING_DATE = #signingDate#, <!-- 付款日期 -->
PARTY_A = #partyA#, <!-- 供应商名称 -->
CANCEL_STATUS = #cancelStatus#, <!-- 核销状态 -->
REVIEW_STATUS = #reviewStatus#, <!-- 审批状态 -->
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#, <!-- 付款总额 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
WHERE
ID = #id#
</update>
<update id="submit">
UPDATE ${hggpSchema}.HGCW016
SET
REVIEW_STATUS = #reviewStatus#, <!-- 审核状态 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime# <!-- 记录修改时间 -->
WHERE
ID = #id#
</update>
<update id="writeoff">
UPDATE ${hggpSchema}.HGCW016
SET
CANCEL_STATUS = #cancelStatus#, <!-- 审核状态 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime# <!-- 记录修改时间 -->
WHERE
ID = #id#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-05-30 11:09:41
Version : 1.0
schema : hggp
tableName : HGCW017
ID BIGINT NOT NULL primarykey,
MAIN_ID BIGINT NOT NULL,
ACCOUNT_CODE VARCHAR,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
CONTRACT_NUMBER VARCHAR,
PARTY_A VARCHAR,
TOTAL_CONTRACT_PRICE_INCLUDING DECIMAL,
CREATED_BY VARCHAR NOT NULL,
CREATED_NAME VARCHAR NOT NULL,
CREATED_TIME VARCHAR NOT NULL,
UPDATED_BY VARCHAR NOT NULL,
UPDATED_NAME VARCHAR NOT NULL,
UPDATED_TIME VARCHAR NOT NULL,
DEP_CODE VARCHAR
-->
<sqlMap namespace="HGCW017">
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="mainId">
MAIN_ID = #mainId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER = #contractNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalContractPriceIncluding">
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#
</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="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cw.domain.HGCW017">
SELECT
ID as "id",
MAIN_ID as "mainId", <!-- 主表ID -->
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
CONTRACT_NUMBER as "contractNumber", <!-- 来源单号 -->
PARTY_A as "partyA", <!-- 供应商名称 -->
TOTAL_CONTRACT_PRICE_INCLUDING as "totalContractPriceIncluding", <!-- 收款总额 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DEP_CODE as "depCode" <!-- 部门编码 -->
FROM ${hggpSchema}.HGCW017 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGCW017 WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="mainId">
MAIN_ID = #mainId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER = #contractNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalContractPriceIncluding">
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#
</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="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGCW017 (
MAIN_ID, <!-- 主表ID -->
ACCOUNT_CODE, <!-- 企业编码 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
CONTRACT_NUMBER, <!-- 来源单号 -->
PARTY_A, <!-- 供应商名称 -->
TOTAL_CONTRACT_PRICE_INCLUDING, <!-- 收款总额 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
DEP_CODE <!-- 部门编码 -->
)
VALUES (#mainId#, #accountCode#, #companyCode#, #companyName#, #contractNumber#, #partyA#, #totalContractPriceIncluding#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGCW017 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGCW017
SET
MAIN_ID = #mainId#, <!-- 主表ID -->
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
CONTRACT_NUMBER = #contractNumber#, <!-- 来源单号 -->
PARTY_A = #partyA#, <!-- 供应商名称 -->
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#, <!-- 收款总额 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 -->
CREATED_NAME = #createdName#, <!-- 记录创建名称 -->
CREATED_TIME = #createdTime#, <!-- 记录创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
DEP_CODE = #depCode# <!-- 部门编码 -->
WHERE
ID = #id#
</update>
</sqlMap>
...@@ -115,6 +115,7 @@ public class HGKC003 extends DaoEPBase { ...@@ -115,6 +115,7 @@ public class HGKC003 extends DaoEPBase {
public static final String UPDATE = "HGKC003.update"; public static final String UPDATE = "HGKC003.update";
public static final String DELETE = "HGKC003.delete"; public static final String DELETE = "HGKC003.delete";
public static final String UPDATE_SUBMIT_STATUS = "HGKC003.updateSubmitStatus"; public static final String UPDATE_SUBMIT_STATUS = "HGKC003.updateSubmitStatus";
public static final String MAX_ID = "HGKC003.maxId";
private Long id = new Long(0); private Long id = new Long(0);
private Long qualityId = new Long(0); /* 质检单id*/ private Long qualityId = new Long(0); /* 质检单id*/
......
...@@ -23,6 +23,7 @@ public class HGKC003A extends DaoEPBase { ...@@ -23,6 +23,7 @@ public class HGKC003A extends DaoEPBase {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id"; public static final String FIELD_ID = "id";
public static final String FIELD_QUALITY_DETAIL_ID = "qualityDetailId"; /* 质检单明细ID*/
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 企业编码*/ public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 企业编码*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/ public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 记录创建者*/ public static final String FIELD_CREATED_BY = "createdBy"; /* 记录创建者*/
...@@ -68,6 +69,7 @@ public class HGKC003A extends DaoEPBase { ...@@ -68,6 +69,7 @@ public class HGKC003A extends DaoEPBase {
public static final String FIELD_STORAGE_TYPE = "storageType"; /* 入库类型:0:入库 1:退回*/ public static final String FIELD_STORAGE_TYPE = "storageType"; /* 入库类型:0:入库 1:退回*/
public static final String COL_ID = "ID"; public static final String COL_ID = "ID";
public static final String COL_QUALITY_DETAIL_ID = "QUALITY_DETAIL_ID"; /* 质检单明细ID*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/ public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/ public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 记录创建者*/ public static final String COL_CREATED_BY = "CREATED_BY"; /* 记录创建者*/
...@@ -120,6 +122,7 @@ public class HGKC003A extends DaoEPBase { ...@@ -120,6 +122,7 @@ public class HGKC003A extends DaoEPBase {
public static final String BATCH_DELETE = "HGKC003A.batchDelete"; public static final String BATCH_DELETE = "HGKC003A.batchDelete";
private Long id = new Long(0); private Long id = new Long(0);
private Long qualityDetailId = new Long(0); /* 质检单明细ID*/
private String accountCode = " "; /* 企业编码*/ private String accountCode = " "; /* 企业编码*/
private String depCode = " "; /* 部门编码*/ private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 记录创建者*/ private String createdBy = " "; /* 记录创建者*/
...@@ -175,6 +178,10 @@ public class HGKC003A extends DaoEPBase { ...@@ -175,6 +178,10 @@ public class HGKC003A extends DaoEPBase {
eiColumn.setDescName(" "); eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_QUALITY_DETAIL_ID);
eiColumn.setDescName("质检单明细ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ACCOUNT_CODE); eiColumn = new EiColumn(FIELD_ACCOUNT_CODE);
eiColumn.setDescName("企业编码"); eiColumn.setDescName("企业编码");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -1094,6 +1101,15 @@ public class HGKC003A extends DaoEPBase { ...@@ -1094,6 +1101,15 @@ public class HGKC003A extends DaoEPBase {
public void setStorageType(Boolean storageType) { public void setStorageType(Boolean storageType) {
this.storageType = storageType; this.storageType = storageType;
} }
public Long getQualityDetailId() {
return qualityDetailId;
}
public void setQualityDetailId(Long qualityDetailId) {
this.qualityDetailId = qualityDetailId;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -1103,6 +1119,7 @@ public class HGKC003A extends DaoEPBase { ...@@ -1103,6 +1119,7 @@ public class HGKC003A extends DaoEPBase {
public void fromMap(Map map) { public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id)); setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setQualityDetailId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_QUALITY_DETAIL_ID)), qualityDetailId));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode)); setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode)); setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy)); setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
...@@ -1156,6 +1173,7 @@ public class HGKC003A extends DaoEPBase { ...@@ -1156,6 +1173,7 @@ public class HGKC003A extends DaoEPBase {
Map map = new HashMap(); Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID))); map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_QUALITY_DETAIL_ID, StringUtils.toString(qualityDetailId, eiMetadata.getMeta(FIELD_QUALITY_DETAIL_ID)));
map.put(FIELD_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE))); map.put(FIELD_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE)));
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_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY))); map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
......
...@@ -56,8 +56,8 @@ public class ServiceHGKC003 extends ServiceBase { ...@@ -56,8 +56,8 @@ public class ServiceHGKC003 extends ServiceBase {
@OperationLogAnnotation(operModul = "生产入库单", operType = "查询", operDesc = "查询") @OperationLogAnnotation(operModul = "生产入库单", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo); // Map queryRow = EiInfoUtils.getFirstRow(inInfo);
HGKCUtils.HgKc003.setCondition(queryRow); // HGKCUtils.HgKc003.setCondition(queryRow);
inInfo = super.query(inInfo, HGKC003.QUERY, new HGKC003()); inInfo = super.query(inInfo, HGKC003.QUERY, new HGKC003());
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
......
...@@ -84,7 +84,6 @@ public class ServiceHGKC006A extends ServiceBase { ...@@ -84,7 +84,6 @@ public class ServiceHGKC006A extends ServiceBase {
for (int i = 0; i < resultRows.size(); i++) { for (int i = 0; i < resultRows.size(); i++) {
HGKC006A hgkc006A = new HGKC006A(); HGKC006A hgkc006A = new HGKC006A();
hgkc006A.fromMap(resultRows.get(i)); hgkc006A.fromMap(resultRows.get(i));
hgkc006A.setInvWeight(hgkc006A.getInvUnitWeight().multiply(hgkc006A.getInvQty()));
if (hgkc006A.getId() == null || hgkc006A.getId() == 0) { if (hgkc006A.getId() == null || hgkc006A.getId() == 0) {
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put("id",inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC006A.FIELD_PRIMARY_ID)); queryMap.put("id",inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC006A.FIELD_PRIMARY_ID));
......
...@@ -86,7 +86,6 @@ public class ServiceHGKC007A extends ServiceBase { ...@@ -86,7 +86,6 @@ public class ServiceHGKC007A extends ServiceBase {
for (int i = 0; i < resultRows.size(); i++) { for (int i = 0; i < resultRows.size(); i++) {
HGKC007A hgkc007A = new HGKC007A(); HGKC007A hgkc007A = new HGKC007A();
hgkc007A.fromMap(resultRows.get(i)); hgkc007A.fromMap(resultRows.get(i));
hgkc007A.setInvWeight(hgkc007A.getInvUnitWeight().multiply(hgkc007A.getInvQty()));
if (hgkc007A.getId() == null || hgkc007A.getId() == 0) { if (hgkc007A.getId() == null || hgkc007A.getId() == 0) {
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put("id",inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC006A.FIELD_PRIMARY_ID)); queryMap.put("id",inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC006A.FIELD_PRIMARY_ID));
......
...@@ -62,19 +62,19 @@ ...@@ -62,19 +62,19 @@
COMPANY_CODE = #companyCode# COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName"> <isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME like '%' || #companyName#|| '%' COMPANY_NAME like ('%$companyName$%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="depositDate"> <isNotEmpty prepend=" AND " property="depositDate">
DEPOSIT_DATE = #depositDate# date_format(DEPOSIT_DATE,'%Y-%m-%d') = #depositDate#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="depositNo"> <isNotEmpty prepend=" AND " property="depositNo">
DEPOSIT_NO like '%' || #depositNo# || '%' DEPOSIT_NO like ('%$depositNo$%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode"> <isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode# WH_CODE = #whCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="whName"> <isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName# WH_NAME like ('%$whName$%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="depositNoOld"> <isNotEmpty prepend=" AND " property="depositNoOld">
DEPOSIT_NO_OLD = #depositNoOld# DEPOSIT_NO_OLD = #depositNoOld#
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
PROJ_CODE = #projCode# PROJ_CODE = #projCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="projName"> <isNotEmpty prepend=" AND " property="projName">
PROJ_NAME like '%' || #projName# || '%' PROJ_NAME like ('%$projName$%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtType"> <isNotEmpty prepend=" AND " property="prdtType">
PRDT_TYPE = #prdtType# PRDT_TYPE = #prdtType#
...@@ -151,9 +151,6 @@ ...@@ -151,9 +151,6 @@
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# ID = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="depositNo">
DEPOSIT_NO = #depositNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositNos"> <isNotEmpty prepend=" AND " property="depositNos">
DEPOSIT_NO IN <iterate open="(" close=")" conjunction="," property="depositNos">#depositNos[]#</iterate> DEPOSIT_NO IN <iterate open="(" close=")" conjunction="," property="depositNos">#depositNos[]#</iterate>
</isNotEmpty> </isNotEmpty>
...@@ -308,4 +305,8 @@ ...@@ -308,4 +305,8 @@
ID = #id# ID = #id#
</update> </update>
<select id="maxId" resultClass="long">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGKC003
</select>
</sqlMap> </sqlMap>
...@@ -37,13 +37,13 @@ ...@@ -37,13 +37,13 @@
COMPANY_CODE = #companyCode# COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName"> <isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName# COMPANY_NAME like ('%$companyName$%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="depositDate"> <isNotEmpty prepend=" AND " property="depositDate">
DEPOSIT_DATE = #depositDate# date_format(DEPOSIT_DATE,'%Y-%m-%d') = #depositDate#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="depositNo"> <isNotEmpty prepend=" AND " property="depositNo">
DEPOSIT_NO = #depositNo# DEPOSIT_NO like ('%$depositNo$%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode"> <isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode# WH_CODE = #whCode#
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
PROJ_CODE = #projCode# PROJ_CODE = #projCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="projName"> <isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName# PROJ_NAME like ('%$projName$%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtType"> <isNotEmpty prepend=" AND " property="prdtType">
PRDT_TYPE = #prdtType# PRDT_TYPE = #prdtType#
...@@ -135,12 +135,16 @@ ...@@ -135,12 +135,16 @@
<isNotEmpty prepend=" AND " property="storageType"> <isNotEmpty prepend=" AND " property="storageType">
STORAGE_TYPE = #storageType# STORAGE_TYPE = #storageType#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="qualityDetailId">
QUALITY_DETAIL_ID = #qualityDetailId#
</isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.kc.domain.HGKC003A"> resultClass="com.baosight.hggp.hg.kc.domain.HGKC003A">
SELECT SELECT
ID as "id", ID as "id",
QUALITY_DETAIL_ID as "qualityDetailId",<!-- 质检单明细ID -->
ACCOUNT_CODE as "accountCode", <!-- 企业编码 --> ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 --> DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 --> CREATED_BY as "createdBy", <!-- 记录创建者 -->
...@@ -204,7 +208,8 @@ ...@@ -204,7 +208,8 @@
<insert id="insert"> <insert id="insert">
INSERT INTO ${hggpSchema}.HGKC003A (ID, INSERT INTO ${hggpSchema}.HGKC003A (
QUALITY_DETAIL_ID,<!-- 企业编码 -->
ACCOUNT_CODE, <!-- 企业编码 --> ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 --> DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 --> CREATED_BY, <!-- 记录创建者 -->
...@@ -249,7 +254,7 @@ ...@@ -249,7 +254,7 @@
AMOUNT, <!-- 金额 --> AMOUNT, <!-- 金额 -->
STORAGE_TYPE <!-- 入库类型:0:入库 1:退回 --> STORAGE_TYPE <!-- 入库类型:0:入库 1:退回 -->
) )
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #depositDate#, #depositNo#, #whCode#, #whName#, #invQty#, #invUnitWeight#, #invWeight#, #depositNoOld#, #remark#, #factoryCode#, #prodOrderNo#, #prodTaskNo#, #projCode#, #projName#, #prdtType#, #prdtCode#, #prdtName#, #prdtLength#, #prdtWidth#, #prdtThick#, #prdtSpec#, #partType#, #partCode#, #partName#, #partLength#, #partWidth#, #partThick#, #partSpec#, #primaryId#, #price#, #amount#, #storageType#) VALUES (#qualityDetailId#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #depositDate#, #depositNo#, #whCode#, #whName#, #invQty#, #invUnitWeight#, #invWeight#, #depositNoOld#, #remark#, #factoryCode#, #prodOrderNo#, #prodTaskNo#, #projCode#, #projName#, #prdtType#, #prdtCode#, #prdtName#, #prdtLength#, #prdtWidth#, #prdtThick#, #prdtSpec#, #partType#, #partCode#, #partName#, #partLength#, #partWidth#, #partThick#, #partSpec#, #primaryId#, #price#, #amount#, #storageType#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -265,6 +270,7 @@ ...@@ -265,6 +270,7 @@
<update id="update"> <update id="update">
UPDATE ${hggpSchema}.HGKC003A UPDATE ${hggpSchema}.HGKC003A
SET SET
QUALITY_DETAIL_ID = #qualityDetailId#,<!-- 企业编码 -->
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 --> ACCOUNT_CODE = #accountCode#, <!-- 企业编码 -->
DEP_CODE = #depCode#, <!-- 部门编码 --> DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 --> CREATED_BY = #createdBy#, <!-- 记录创建者 -->
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
WH_CODE = #whCode# WH_CODE = #whCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="whName"> <isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName# WH_NAME LIKE CONCAT('%', #whName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="otherEnterNoOld"> <isNotEmpty prepend=" AND " property="otherEnterNoOld">
OTHER_ENTER_NO_OLD = #otherEnterNoOld# OTHER_ENTER_NO_OLD = #otherEnterNoOld#
......
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
INVENT_CODE = #inventCode# INVENT_CODE = #inventCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName"> <isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName# INVENT_NAME LIKE CONCAT('%', #inventName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="invQty"> <isNotEmpty prepend=" AND " property="invQty">
INV_QTY = #invQty# INV_QTY = #invQty#
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
WH_CODE = #whCode# WH_CODE = #whCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="whName"> <isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName# WH_NAME LIKE CONCAT('%', #whName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="otherOutNoOld"> <isNotEmpty prepend=" AND " property="otherOutNoOld">
OTHER_OUT_NO_OLD = #otherOutNoOld# OTHER_OUT_NO_OLD = #otherOutNoOld#
......
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
INVENT_CODE = #inventCode# INVENT_CODE = #inventCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName"> <isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName# INVENT_NAME LIKE CONCAT('%', #inventName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="invQty"> <isNotEmpty prepend=" AND " property="invQty">
INV_QTY = #invQty# INV_QTY = #invQty#
......
...@@ -5,6 +5,7 @@ import com.baosight.hggp.core.dao.DaoUtils; ...@@ -5,6 +5,7 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant; import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.domain.*; import com.baosight.hggp.hg.kc.domain.*;
import com.baosight.hggp.hg.sc.domain.HGSC004;
import com.baosight.hggp.hg.sc.domain.HGSC005; import com.baosight.hggp.hg.sc.domain.HGSC005;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.StringUtils; import com.baosight.hggp.util.StringUtils;
...@@ -131,21 +132,39 @@ public class HGKCTools { ...@@ -131,21 +132,39 @@ public class HGKCTools {
public static class HgKc003 { public static class HgKc003 {
public static HGKC003 save(HGKC003 hgkc003){ public static HGKC003 save(HGKC003 hgkc003,List<HGKC003A> hgkc003aList){
checkSaveData(hgkc003); checkSaveData(hgkc003,hgkc003aList);
hgkc003.setDepositNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PROD_DEPOSIT_NO)); hgkc003.setDepositNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PROD_DEPOSIT_NO));
Long maxId = (Long)DaoBase.getInstance().get(HGKC003.MAX_ID,null,null);
Long setId = maxId+1;
hgkc003.setId(setId);
DaoUtils.insert(HGKC003.INSERT,hgkc003); DaoUtils.insert(HGKC003.INSERT,hgkc003);
hgkc003aList.forEach(o->{
o.setPrimaryId(setId);
});
DaoUtils.insertBatch(HGKC003A.INSERT,hgkc003aList);
return hgkc003; return hgkc003;
} }
private static void checkSaveData(HGKC003 hgkc003) { private static void checkSaveData(HGKC003 hgkc003,List<HGKC003A> hgkc003aList) {
AssertUtils.isEmpty(hgkc003.getCompanyCode(), "公司编码不能为空!"); AssertUtils.isEmpty(hgkc003.getCompanyCode(), "公司编码不能为空!");
AssertUtils.isEmpty(hgkc003.getCompanyName(), "公司名称不能为空!"); AssertUtils.isEmpty(hgkc003.getCompanyName(), "公司名称不能为空!");
AssertUtils.isEmpty(hgkc003.getWhCode(), "仓库编码不能为空!"); AssertUtils.isEmpty(hgkc003.getWhCode(), "仓库编码不能为空!");
AssertUtils.isEmpty(hgkc003.getWhName(), "仓库名称不能为空!"); AssertUtils.isEmpty(hgkc003.getWhName(), "仓库名称不能为空!");
AssertUtils.isEmpty(hgkc003.getProjCode(), "项目编号不能为空!"); AssertUtils.isEmpty(hgkc003.getProjCode(), "项目编号不能为空!");
AssertUtils.isEmpty(hgkc003.getProjName(), "项目名称不能为空!"); AssertUtils.isEmpty(hgkc003.getProjName(), "项目名称不能为空!");
AssertUtils.isTrue(Objects.isNull(hgkc003.getQualityId())||hgkc003.getQualityId()<=0, "质检单idID不能为空!"); AssertUtils.isTrue(Objects.isNull(hgkc003.getQualityId())||hgkc003.getQualityId()<=0, "质检单ID不能为空!");
for(HGKC003A hgkc003a : hgkc003aList){
AssertUtils.isEmpty(hgkc003a.getCompanyCode(), "公司编码不能为空!");
AssertUtils.isEmpty(hgkc003a.getCompanyName(), "公司名称不能为空!");
AssertUtils.isEmpty(hgkc003a.getProjCode(), "项目编号不能为空!");
AssertUtils.isEmpty(hgkc003a.getProjName(), "项目名称不能为空!");
AssertUtils.isEmpty(hgkc003a.getWhCode(), "仓库编码不能为空!");
AssertUtils.isEmpty(hgkc003a.getWhName(), "仓库名称不能为空!");
AssertUtils.isEmpty(hgkc003a.getPrdtCode(), "存货编码不能为空!");
AssertUtils.isEmpty(hgkc003a.getPrdtName(), "存货名称不能为空!");
AssertUtils.isTrue(Objects.isNull(hgkc003a.getQualityDetailId())||hgkc003a.getQualityDetailId()<=0, "质检单明细ID不能为空!");
}
} }
/** /**
...@@ -207,8 +226,13 @@ public class HGKCTools { ...@@ -207,8 +226,13 @@ public class HGKCTools {
private static void checkSaveData(HGKC003A hgkc003a) { private static void checkSaveData(HGKC003A hgkc003a) {
AssertUtils.isEmpty(hgkc003a.getCompanyCode(), "公司编码不能为空!"); AssertUtils.isEmpty(hgkc003a.getCompanyCode(), "公司编码不能为空!");
AssertUtils.isEmpty(hgkc003a.getCompanyName(), "公司名称不能为空!"); AssertUtils.isEmpty(hgkc003a.getCompanyName(), "公司名称不能为空!");
AssertUtils.isEmpty(hgkc003a.getProjCode(), "项目编号不能为空!");
// AssertUtils.isTrue(Objects.isNull(hgkc003.getQualityId())||hgkc003.getQualityId()<=0, "质检单idID不能为空!"); AssertUtils.isEmpty(hgkc003a.getProjName(), "项目名称不能为空!");
AssertUtils.isEmpty(hgkc003a.getWhCode(), "仓库编码不能为空!");
AssertUtils.isEmpty(hgkc003a.getWhName(), "仓库名称不能为空!");
AssertUtils.isEmpty(hgkc003a.getPrdtCode(), "存货编码不能为空!");
AssertUtils.isEmpty(hgkc003a.getPrdtName(), "存货名称不能为空!");
AssertUtils.isTrue(Objects.isNull(hgkc003a.getQualityDetailId())||hgkc003a.getQualityDetailId()<=0, "质检单明细ID不能为空!");
} }
} }
......
...@@ -345,10 +345,11 @@ ...@@ -345,10 +345,11 @@
a.INVENT_TYPE as "inventType", a.INVENT_TYPE as "inventType",
a.INVENT_CODE as "inventCode", a.INVENT_CODE as "inventCode",
a.INVENT_NAME as "inventName", a.INVENT_NAME as "inventName",
LENGTH as "length", <!-- 长 --> a.LENGTH as "length", <!-- 长 -->
WIDTH as "width", <!-- 宽 --> a.WIDTH as "width", <!-- 宽 -->
THICK as "thick", <!-- 厚 --> a.THICK as "thick", <!-- 厚 -->
b.PAR_INVENT_TYPE as "parInventType" b.PAR_INVENT_TYPE as "parInventType",
b.INVENT_TYPE_DETAIL as "inventTypeDetail"
FROM ${hggpSchema}.HGPZ005 a FROM ${hggpSchema}.HGPZ005 a
left join ${hggpSchema}.hgpz004 b on a.INVENT_TYPE = b.INVENT_TYPE and b.STATUS=1 and b.DELETE_FLAG = 0 left join ${hggpSchema}.hgpz004 b on a.INVENT_TYPE = b.INVENT_TYPE and b.STATUS=1 and b.DELETE_FLAG = 0
WHERE a.DELETE_FLAG = 0 WHERE a.DELETE_FLAG = 0
......
...@@ -21,7 +21,7 @@ import com.baosight.iplat4j.core.util.StringUtils; ...@@ -21,7 +21,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
*/ */
public class HGSC008 extends DaoEPBase { public class HGSC008 extends DaoEPBase {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public static final String FIELD_id = "id"; public static final String FIELD_id = "id";
public static final String FIELD_mat_id = "matId"; /* 物料清单ID*/ public static final String FIELD_mat_id = "matId"; /* 物料清单ID*/
...@@ -38,7 +38,7 @@ public class HGSC008 extends DaoEPBase { ...@@ -38,7 +38,7 @@ public class HGSC008 extends DaoEPBase {
public static final String FIELD_dep_name = "depName"; /* 部门名称*/ public static final String FIELD_dep_name = "depName"; /* 部门名称*/
public static final String FIELD_proj_code = "projCode"; /* 项目编码*/ public static final String FIELD_proj_code = "projCode"; /* 项目编码*/
public static final String FIELD_proj_name = "projName"; /* 项目名称*/ public static final String FIELD_proj_name = "projName"; /* 项目名称*/
public static final String FIELD_task_code = "taskCode"; /* 任务编码*/ public static final String FIELD_work_code = "workCode"; /* 报工编码*/
public static final String FIELD_product_type = "productType"; /* 产品类型*/ public static final String FIELD_product_type = "productType"; /* 产品类型*/
public static final String FIELD_product_code = "productCode"; /* 产品编号*/ public static final String FIELD_product_code = "productCode"; /* 产品编号*/
public static final String FIELD_product_name = "productName"; /* 产品名称*/ public static final String FIELD_product_name = "productName"; /* 产品名称*/
...@@ -82,7 +82,7 @@ public class HGSC008 extends DaoEPBase { ...@@ -82,7 +82,7 @@ public class HGSC008 extends DaoEPBase {
public static final String COL_dep_name = "dep_name"; /* 部门名称*/ public static final String COL_dep_name = "dep_name"; /* 部门名称*/
public static final String COL_proj_code = "proj_code"; /* 项目编码*/ public static final String COL_proj_code = "proj_code"; /* 项目编码*/
public static final String COL_proj_name = "proj_name"; /* 项目名称*/ public static final String COL_proj_name = "proj_name"; /* 项目名称*/
public static final String COL_task_code = "task_code"; /* 任务编码*/ public static final String COL_work_code = "work_code"; /* 报工编码*/
public static final String COL_product_type = "product_type"; /* 产品类型*/ public static final String COL_product_type = "product_type"; /* 产品类型*/
public static final String COL_product_code = "product_code"; /* 产品编号*/ public static final String COL_product_code = "product_code"; /* 产品编号*/
public static final String COL_product_name = "product_name"; /* 产品名称*/ public static final String COL_product_name = "product_name"; /* 产品名称*/
...@@ -109,6 +109,8 @@ public class HGSC008 extends DaoEPBase { ...@@ -109,6 +109,8 @@ public class HGSC008 extends DaoEPBase {
public static final String INSERT = "HGSC008.insert"; public static final String INSERT = "HGSC008.insert";
public static final String UPDATE = "HGSC008.update"; public static final String UPDATE = "HGSC008.update";
public static final String DELETE = "HGSC008.delete"; public static final String DELETE = "HGSC008.delete";
public static final String BATCH_DELETE = "HGSC008.batch_delete";
private Long id = new Long(0); private Long id = new Long(0);
private Long matId = new Long(0); /* 物料清单ID*/ private Long matId = new Long(0); /* 物料清单ID*/
...@@ -125,7 +127,7 @@ public class HGSC008 extends DaoEPBase { ...@@ -125,7 +127,7 @@ public class HGSC008 extends DaoEPBase {
private String depName = " "; /* 部门名称*/ private String depName = " "; /* 部门名称*/
private String projCode = " "; /* 项目编码*/ private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/ private String projName = " "; /* 项目名称*/
private String taskCode = " "; /* 任务编码*/ private String workCode = " "; /* 报工编码*/
private Integer productType = new Integer(0); /* 产品类型*/ private Integer productType = new Integer(0); /* 产品类型*/
private String productCode = " "; /* 产品编号*/ private String productCode = " "; /* 产品编号*/
private String productName = " "; /* 产品名称*/ private String productName = " "; /* 产品名称*/
...@@ -271,8 +273,8 @@ public class HGSC008 extends DaoEPBase { ...@@ -271,8 +273,8 @@ public class HGSC008 extends DaoEPBase {
eiColumn.setDescName("项目名称"); eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_task_code); eiColumn = new EiColumn(FIELD_work_code);
eiColumn.setDescName("任务编码"); eiColumn.setDescName("报工编码");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_product_type); eiColumn = new EiColumn(FIELD_product_type);
...@@ -649,20 +651,20 @@ public class HGSC008 extends DaoEPBase { ...@@ -649,20 +651,20 @@ public class HGSC008 extends DaoEPBase {
this.projName = projName; this.projName = projName;
} }
/** /**
* get the taskCode - 任务编码. * get the workCode - 报工编码.
* @return the taskCode * @return the workCode
*/ */
public String getTaskCode() { public String getWorkCode() {
return this.taskCode; return this.workCode;
} }
/** /**
* set the taskCode - 任务编码. * set the workCode - 报工编码.
* *
* @param taskCode - 任务编码 * @param workCode - 报工编码
*/ */
public void setTaskCode(String taskCode) { public void setWorkCode(String workCode) {
this.taskCode = taskCode; this.workCode = workCode;
} }
/** /**
* get the productType - 产品类型. * get the productType - 产品类型.
...@@ -1007,7 +1009,7 @@ public class HGSC008 extends DaoEPBase { ...@@ -1007,7 +1009,7 @@ public class HGSC008 extends DaoEPBase {
setDepName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_dep_name)), depName)); setDepName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_dep_name)), depName));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_code)), projCode)); setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_code)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_name)), projName)); setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_name)), projName));
setTaskCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_task_code)), taskCode)); setWorkCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_work_code)), workCode));
setProductType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_product_type)), productType)); setProductType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_product_type)), productType));
setProductCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_product_code)), productCode)); setProductCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_product_code)), productCode));
setProductName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_product_name)), productName)); setProductName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_product_name)), productName));
...@@ -1059,7 +1061,7 @@ public class HGSC008 extends DaoEPBase { ...@@ -1059,7 +1061,7 @@ public class HGSC008 extends DaoEPBase {
map.put(FIELD_dep_name, StringUtils.toString(depName, eiMetadata.getMeta(FIELD_dep_name))); map.put(FIELD_dep_name, StringUtils.toString(depName, eiMetadata.getMeta(FIELD_dep_name)));
map.put(FIELD_proj_code, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_proj_code))); map.put(FIELD_proj_code, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_proj_code)));
map.put(FIELD_proj_name, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_proj_name))); map.put(FIELD_proj_name, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_proj_name)));
map.put(FIELD_task_code, StringUtils.toString(taskCode, eiMetadata.getMeta(FIELD_task_code))); map.put(FIELD_work_code, StringUtils.toString(workCode, eiMetadata.getMeta(FIELD_work_code)));
map.put(FIELD_product_type, StringUtils.toString(productType, eiMetadata.getMeta(FIELD_product_type))); map.put(FIELD_product_type, StringUtils.toString(productType, eiMetadata.getMeta(FIELD_product_type)));
map.put(FIELD_product_code, StringUtils.toString(productCode, eiMetadata.getMeta(FIELD_product_code))); map.put(FIELD_product_code, StringUtils.toString(productCode, eiMetadata.getMeta(FIELD_product_code)));
map.put(FIELD_product_name, StringUtils.toString(productName, eiMetadata.getMeta(FIELD_product_name))); map.put(FIELD_product_name, StringUtils.toString(productName, eiMetadata.getMeta(FIELD_product_name)));
......
...@@ -140,13 +140,13 @@ public class ServiceHGSC004 extends ServiceBase { ...@@ -140,13 +140,13 @@ public class ServiceHGSC004 extends ServiceBase {
AssertUtils.isTrue(hgsc003.getBlueprintStatus().compareTo(HGConstant.EnablingStatus.TY) == 0,"蓝图已停用不可修改!"); AssertUtils.isTrue(hgsc003.getBlueprintStatus().compareTo(HGConstant.EnablingStatus.TY) == 0,"蓝图已停用不可修改!");
} }
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("blueprintId",hgsc004.getBlueprintId()); map.put("projCode",hgsc004.getProjCode());
List<HGSC004> hgsc004List = this.dao.query(HGSC004.QUERY,map); List<HGSC004> hgsc004List = this.dao.query(HGSC004.QUERY,map);
for(HGSC004 o : hgsc004List){ for(HGSC004 o : hgsc004List){
if(Objects.nonNull(hgsc004.getId())&&hgsc004.getId()>0){ if(Objects.nonNull(hgsc004.getId())&&hgsc004.getId()>0){
AssertUtils.isTrue(!(o.getId().intValue() == hgsc004.getId().intValue()),"当前蓝图已存在!"); AssertUtils.isTrue(!(o.getId().intValue() == hgsc004.getId().intValue()),"当前项目已存在!");
}else{ }else{
AssertUtils.isTrue(Objects.nonNull(o),"当前蓝图已存在!"); AssertUtils.isTrue(Objects.nonNull(o),"当前项目已存在!");
} }
} }
...@@ -165,38 +165,31 @@ public class ServiceHGSC004 extends ServiceBase { ...@@ -165,38 +165,31 @@ public class ServiceHGSC004 extends ServiceBase {
* @param hgsc004 * @param hgsc004
*/ */
private void insertTree(HGSC004 hgsc004) { private void insertTree(HGSC004 hgsc004) {
//变更清单里面的公司、项目信息 //录入树结构,公司
Map<String,Object> map = new HashMap<>(); HGSC004A rootHgsc004A = new HGSC004A();
map.put("companyCode",hgsc004.getCompanyCode()); BeanUtil.copyProperties(hgsc004,rootHgsc004A,"id");
map.put("projCode",hgsc004.getProjCode()); //因为获取不到id,所以根据公司编号+项目编号得到树结构
List<HGSC004A> hgsc004AList = dao.query(HGSC004A.QUERY_ALL,map, 0, -999999); rootHgsc004A.setMaterialId(hgsc004.getId());
if(CollectionUtils.isEmpty(hgsc004AList)){ rootHgsc004A.setParentProdCode("root");
//录入树结构,公司 rootHgsc004A.setParentProdName(hgsc004.getCompanyName());
HGSC004A rootHgsc004A = new HGSC004A(); rootHgsc004A.setLeaf(2);//有叶子节点
BeanUtil.copyProperties(hgsc004,rootHgsc004A,"id"); rootHgsc004A.setLv(1);
//因为获取不到id,所以根据公司编号+项目编号得到树结构 rootHgsc004A.setSort(1);
rootHgsc004A.setMaterialId(hgsc004.getId()); rootHgsc004A.setProductCode(hgsc004.getCompanyCode());
rootHgsc004A.setParentProdCode("root"); rootHgsc004A.setProductName(hgsc004.getCompanyName());
rootHgsc004A.setParentProdName(hgsc004.getCompanyName()); DaoUtils.insert(HGSC004A.INSERT, rootHgsc004A);
rootHgsc004A.setLeaf(2);//有叶子节点 //录入2级目录,项目
rootHgsc004A.setLv(1); HGSC004A projectHgsc004A = new HGSC004A();
rootHgsc004A.setSort(1); BeanUtil.copyProperties(hgsc004,projectHgsc004A,"id");
rootHgsc004A.setProductCode(hgsc004.getCompanyCode()); projectHgsc004A.setMaterialId(hgsc004.getId());
rootHgsc004A.setProductName(hgsc004.getCompanyName()); projectHgsc004A.setParentProdCode(rootHgsc004A.getProductCode());
DaoUtils.insert(HGSC004A.INSERT, rootHgsc004A); projectHgsc004A.setParentProdName(rootHgsc004A.getProductName());
//录入2级目录,项目 projectHgsc004A.setLeaf(2);//有叶子节点
HGSC004A projectHgsc004A = new HGSC004A(); projectHgsc004A.setLv(2);
BeanUtil.copyProperties(hgsc004,projectHgsc004A,"id"); projectHgsc004A.setSort(1);
projectHgsc004A.setMaterialId(hgsc004.getId()); projectHgsc004A.setProductCode(hgsc004.getProjCode());
projectHgsc004A.setParentProdCode(rootHgsc004A.getProductCode()); projectHgsc004A.setProductName(hgsc004.getProjName());
projectHgsc004A.setParentProdName(rootHgsc004A.getProductName()); DaoUtils.insert(HGSC004A.INSERT, projectHgsc004A);
projectHgsc004A.setLeaf(2);//有叶子节点
projectHgsc004A.setLv(2);
projectHgsc004A.setSort(1);
projectHgsc004A.setProductCode(hgsc004.getProjCode());
projectHgsc004A.setProductName(hgsc004.getProjName());
DaoUtils.insert(HGSC004A.INSERT, projectHgsc004A);
}
} }
......
...@@ -122,7 +122,7 @@ public class ServiceHGSC004A extends ServiceBase { ...@@ -122,7 +122,7 @@ public class ServiceHGSC004A extends ServiceBase {
hgsc004a.setMaterialId(hgsc004.getId()); hgsc004a.setMaterialId(hgsc004.getId());
hgsc004a.setLv(hgsc004a.getLv() + 1); hgsc004a.setLv(hgsc004a.getLv() + 1);
//不为4级都有叶子节点 //不为4级都有叶子节点
if(hgsc004a.getLv().intValue() <= 4){ if(hgsc004a.getLv().intValue() < 4){
hgsc004a.setLeaf(2); hgsc004a.setLeaf(2);
}else{ }else{
hgsc004a.setLeaf(1); hgsc004a.setLeaf(1);
...@@ -177,9 +177,18 @@ public class ServiceHGSC004A extends ServiceBase { ...@@ -177,9 +177,18 @@ public class ServiceHGSC004A extends ServiceBase {
private void checkSaveData(HGSC004A hgsc004a,HGSC004 hgsc004) { private void checkSaveData(HGSC004A hgsc004a,HGSC004 hgsc004) {
if(Objects.nonNull(hgsc004a.getId())&&hgsc004a.getId()>0){ if(Objects.nonNull(hgsc004a.getId())&&hgsc004a.getId()>0){
//蓝图信息,用于蓝图状态校验 //蓝图信息,用于蓝图状态校验
HGSC003 hgsc003 = (HGSC003) super.dao.get(HGSC003.QUERY,HGSC004A.FIELD_id,hgsc004.getBlueprintId()); HGSC003 hgsc003 = (HGSC003) super.dao.get(HGSC003.QUERY,HGSC003.FIELD_id,hgsc004.getBlueprintId());
AssertUtils.isTrue(hgsc003.getBlueprintStatus().compareTo(HGConstant.EnablingStatus.TY) == 0,"蓝图已停用不可修改!"); AssertUtils.isTrue(hgsc003.getBlueprintStatus().compareTo(HGConstant.EnablingStatus.TY) == 0,"蓝图已停用不可修改!");
} }
//为构件的需要验证是否已经存在了,不能重复添加
if(hgsc004a.getLv().intValue() == 3){
Map<String,Object> mapA = new HashMap<>();
mapA.put("materialId",hgsc004a.getMaterialId());
mapA.put("productId",hgsc004a.getProductId());
mapA.put("notId",hgsc004a.getId());
List<HGSC004A> hgsc004AList = dao.query(HGSC004A.QUERY,mapA, 0, -999999);
AssertUtils.isTrue(!CollectionUtils.isEmpty(hgsc004AList), "已存在构建"+hgsc004a.getProductName());
}
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!"); AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!"); AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(hgsc004a.getCompanyCode(), "请选择公司!"); AssertUtils.isEmpty(hgsc004a.getCompanyCode(), "请选择公司!");
......
...@@ -115,7 +115,6 @@ public class ServiceHGSC006A extends ServiceBase { ...@@ -115,7 +115,6 @@ public class ServiceHGSC006A extends ServiceBase {
hgsc007.setDepCode(null); hgsc007.setDepCode(null);
hgsc007.setDepName(null); hgsc007.setDepName(null);
hgsc007.setId(null); hgsc007.setId(null);
HGSC006A a = new HGSC006A();
} }
} }
...@@ -2,9 +2,13 @@ package com.baosight.hggp.hg.sc.service; ...@@ -2,9 +2,13 @@ package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.domain.HGSC006A;
import com.baosight.hggp.hg.sc.domain.HGSC007; import com.baosight.hggp.hg.sc.domain.HGSC007;
import com.baosight.hggp.hg.sc.domain.HGSC008; import com.baosight.hggp.hg.sc.domain.HGSC008;
import com.baosight.hggp.hg.sc.tools.HGSCTools; import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.zl.tools.HGZLTools;
import com.baosight.hggp.util.*; import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants; import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
...@@ -12,6 +16,8 @@ import com.baosight.iplat4j.core.ei.EiConstant; ...@@ -12,6 +16,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.ServiceEPBase; import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -24,7 +30,7 @@ import java.util.*; ...@@ -24,7 +30,7 @@ import java.util.*;
*/ */
public class ServiceHGSC007A extends ServiceEPBase { public class ServiceHGSC007A extends ServiceEPBase {
@OperationLogAnnotation(operModul = "生产任务", operType = "查询", operDesc = "初始化页面") @OperationLogAnnotation(operModul = "生产报工", operType = "报工", operDesc = "初始化页面")
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo); Map queryMap = EiInfoUtils.getFirstRow(inInfo);
...@@ -35,7 +41,7 @@ public class ServiceHGSC007A extends ServiceEPBase { ...@@ -35,7 +41,7 @@ public class ServiceHGSC007A extends ServiceEPBase {
List<HGSC008> old008List = HGSCTools.THGSC008.getByTaskId(Long.valueOf(taskId)); List<HGSC008> old008List = HGSCTools.THGSC008.getByTaskId(Long.valueOf(taskId));
hgsc008.setTaskId(hgsc007.getId());
hgsc008.setTaskQuantity(hgsc007.getQuantity()); hgsc008.setTaskQuantity(hgsc007.getQuantity());
hgsc008.setTaskWeight(hgsc007.getTotalWeight()); hgsc008.setTaskWeight(hgsc007.getTotalWeight());
hgsc008.setRegisteredQuantity(Optional.ofNullable(old008List).orElse(new ArrayList<>()).stream().mapToInt(HGSC008::getQuantity).sum()); hgsc008.setRegisteredQuantity(Optional.ofNullable(old008List).orElse(new ArrayList<>()).stream().mapToInt(HGSC008::getQuantity).sum());
...@@ -45,6 +51,7 @@ public class ServiceHGSC007A extends ServiceEPBase { ...@@ -45,6 +51,7 @@ public class ServiceHGSC007A extends ServiceEPBase {
hgsc008.setRegisterDate(DateUtil.toDateStr(new Date(),DateUtil.DATE10_PATTERN)); hgsc008.setRegisterDate(DateUtil.toDateStr(new Date(),DateUtil.DATE10_PATTERN));
hgsc008.setQuantity(null); hgsc008.setQuantity(null);
hgsc008.setTotalWeight(null); hgsc008.setTotalWeight(null);
hgsc008.setId(null);
inInfo.addBlock(EiConstant.resultBlock).addRow(hgsc008); inInfo.addBlock(EiConstant.resultBlock).addRow(hgsc008);
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败"); LogUtils.setDetailMsg(inInfo, e, "初始化失败");
...@@ -52,6 +59,17 @@ public class ServiceHGSC007A extends ServiceEPBase { ...@@ -52,6 +59,17 @@ public class ServiceHGSC007A extends ServiceEPBase {
return inInfo; return inInfo;
} }
@OperationLogAnnotation(operModul = "生产报工", operType = "报工", operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try{
HGSCTools.THGSC008.add(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
} }
......
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.sc.domain.HGSC002;
import com.baosight.hggp.hg.sc.domain.HGSC008;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.ObjectUtils;
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 java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author wwl
* @version 1.0 2024/5/24
*/
public class ServiceHGSC008 extends ServiceEPBase {
@OperationLogAnnotation(operModul = "生产报工单", operType = "查询", operDesc = "初始化页面")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC008.QUERY, new HGSC008());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/*
* 查询*/
@OperationLogAnnotation(operModul = "生产报工单", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo,HGSC008.QUERY,new HGSC008() );
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@Override
@OperationLogAnnotation(operModul = "生产报工单", operType = "删除", operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 销售单号
List<Long> ids = ObjectUtils.listKey(resultRows, HGSC002.FIELD_id);
HGSCTools.THGSC008.delete(ids);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
...@@ -171,7 +171,9 @@ ...@@ -171,7 +171,9 @@
<isNotEmpty prepend=" AND " property="updatedTime"> <isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime# updated_time = #updatedTime#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
dep_name VARCHAR, dep_name VARCHAR,
proj_code VARCHAR, proj_code VARCHAR,
proj_name VARCHAR, proj_name VARCHAR,
task_code VARCHAR, work_code VARCHAR,
product_type TINYINT, product_type TINYINT,
product_code VARCHAR, product_code VARCHAR,
product_name VARCHAR, product_name VARCHAR,
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
company_code = #companyCode# company_code = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName"> <isNotEmpty prepend=" AND " property="companyName">
company_name = #companyName# company_name like ('%$companyName$%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode"> <isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode# dep_code = #depCode#
...@@ -89,8 +89,8 @@ ...@@ -89,8 +89,8 @@
<isNotEmpty prepend=" AND " property="projName"> <isNotEmpty prepend=" AND " property="projName">
proj_name = #projName# proj_name = #projName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="taskCode"> <isNotEmpty prepend=" AND " property="workCode">
task_code = #taskCode# work_code like ('%$workCode$%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="productType"> <isNotEmpty prepend=" AND " property="productType">
product_type = #productType# product_type = #productType#
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
group_code = #groupCode# group_code = #groupCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName"> <isNotEmpty prepend=" AND " property="groupName">
group_name = #groupName# group_name like ('%$groupName$%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="registerDate"> <isNotEmpty prepend=" AND " property="registerDate">
register_date = #registerDate# register_date = #registerDate#
...@@ -172,7 +172,7 @@ ...@@ -172,7 +172,7 @@
dep_name as "depName", <!-- 部门名称 --> dep_name as "depName", <!-- 部门名称 -->
proj_code as "projCode", <!-- 项目编码 --> proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 --> proj_name as "projName", <!-- 项目名称 -->
task_code as "taskCode", <!-- 任务编码 --> work_code as "workCode", <!-- 报工编码 -->
product_type as "productType", <!-- 产品类型 --> product_type as "productType", <!-- 产品类型 -->
product_code as "productCode", <!-- 产品编号 --> product_code as "productCode", <!-- 产品编号 -->
product_name as "productName", <!-- 产品名称 --> product_name as "productName", <!-- 产品名称 -->
...@@ -200,7 +200,7 @@ ...@@ -200,7 +200,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
id asc register_date desc ,id desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
...@@ -257,8 +257,8 @@ ...@@ -257,8 +257,8 @@
<isNotEmpty prepend=" AND " property="projName"> <isNotEmpty prepend=" AND " property="projName">
proj_name = #projName# proj_name = #projName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="taskCode"> <isNotEmpty prepend=" AND " property="workCode">
task_code = #taskCode# work_code = #workCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="productType"> <isNotEmpty prepend=" AND " property="productType">
product_type = #productType# product_type = #productType#
...@@ -338,7 +338,7 @@ ...@@ -338,7 +338,7 @@
dep_name, <!-- 部门名称 --> dep_name, <!-- 部门名称 -->
proj_code, <!-- 项目编码 --> proj_code, <!-- 项目编码 -->
proj_name, <!-- 项目名称 --> proj_name, <!-- 项目名称 -->
task_code, <!-- 任务编码 --> work_code, <!-- 报工编码 -->
product_type, <!-- 产品类型 --> product_type, <!-- 产品类型 -->
product_code, <!-- 产品编号 --> product_code, <!-- 产品编号 -->
product_name, <!-- 产品名称 --> product_name, <!-- 产品名称 -->
...@@ -360,7 +360,10 @@ ...@@ -360,7 +360,10 @@
updated_name, <!-- 修改人名称 --> updated_name, <!-- 修改人名称 -->
updated_time <!-- 更新时间 --> updated_time <!-- 更新时间 -->
) )
VALUES (#id#, #matId#, #taskId#, #techFlowId#, #techFlowName#, #inventProcessId#, #processCode#, #processName#, #processOrder#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#, #taskCode#, #productType#, #productCode#, #productName#, #planStartDate#, #planEndDate#, #factoryCode#, #factoryName#, #groupCode#, #groupName#, #registerDate#, #quantity#, #singleWeight#, #totalWeight#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#) VALUES (#id#, #matId#, #taskId#, #techFlowId#, #techFlowName#, #inventProcessId#, #processCode#, #processName#, #processOrder#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#, #workCode#, #productType#, #productCode#, #productName#, #planStartDate#, #planEndDate#, #factoryCode#, #factoryName#, #groupCode#, #groupName#, #registerDate#, #quantity#, #singleWeight#, #totalWeight#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGSC008
</selectKey>
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -385,7 +388,7 @@ ...@@ -385,7 +388,7 @@
dep_name = #depName#, <!-- 部门名称 --> dep_name = #depName#, <!-- 部门名称 -->
proj_code = #projCode#, <!-- 项目编码 --> proj_code = #projCode#, <!-- 项目编码 -->
proj_name = #projName#, <!-- 项目名称 --> proj_name = #projName#, <!-- 项目名称 -->
task_code = #taskCode#, <!-- 任务编码 --> work_code = #workCode#, <!-- 报工编码 -->
product_type = #productType#, <!-- 产品类型 --> product_type = #productType#, <!-- 产品类型 -->
product_code = #productCode#, <!-- 产品编号 --> product_code = #productCode#, <!-- 产品编号 -->
product_name = #productName#, <!-- 产品名称 --> product_name = #productName#, <!-- 产品名称 -->
...@@ -410,4 +413,8 @@ ...@@ -410,4 +413,8 @@
id = #id# id = #id#
</update> </update>
<delete id="batch_delete">
DELETE FROM ${hggpSchema}.HGSC008 WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete>
</sqlMap> </sqlMap>
...@@ -2,6 +2,7 @@ package com.baosight.hggp.hg.sc.tools; ...@@ -2,6 +2,7 @@ package com.baosight.hggp.hg.sc.tools;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import com.baosight.hggp.common.AssignStatusEnum; import com.baosight.hggp.common.AssignStatusEnum;
import com.baosight.hggp.common.CheckStatusEnum;
import com.baosight.hggp.common.ComputeTypeEnum; import com.baosight.hggp.common.ComputeTypeEnum;
import com.baosight.hggp.common.ProductTypeEnum; import com.baosight.hggp.common.ProductTypeEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
...@@ -16,10 +17,17 @@ import com.baosight.hggp.hg.pz.tools.HGPZTools; ...@@ -16,10 +17,17 @@ import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sc.domain.*; import com.baosight.hggp.hg.sc.domain.*;
import com.baosight.hggp.hg.sj.domain.HGSJ001; import com.baosight.hggp.hg.sj.domain.HGSJ001;
import com.baosight.hggp.hg.sj.tools.HGSJTools; import com.baosight.hggp.hg.sj.tools.HGSJTools;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.zl.domain.HGZL002;
import com.baosight.hggp.hg.zl.tools.HGZLTools;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.BeanUtils; import com.baosight.hggp.util.BeanUtils;
import com.baosight.hggp.util.DateUtil; import com.baosight.hggp.util.DateUtil;
import com.baosight.hggp.util.EiInfoUtils;
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.exception.PlatException;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
...@@ -122,6 +130,16 @@ public class HGSCTools { ...@@ -122,6 +130,16 @@ public class HGSCTools {
} }
public static class Hgsc001 {
public static HGSC001 queryByCode(String code) {
AssertUtils.isNull(code, "项目Code不能为空!");
List<HGSC001> results = DaoBase.getInstance().query(HGSC001.QUERY, new HashMap<String,Object>(){
{put("projCode",code);}
});
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
}
public static class THGSC001A{ public static class THGSC001A{
/** /**
...@@ -747,6 +765,59 @@ public class HGSCTools { ...@@ -747,6 +765,59 @@ public class HGSCTools {
List<HGSC008> results = DaoBase.getInstance().query(HGSC008.QUERY, new HashMap<String,Object>(){{put(HGSC008.FIELD_task_id, taskId);}}); List<HGSC008> results = DaoBase.getInstance().query(HGSC008.QUERY, new HashMap<String,Object>(){{put(HGSC008.FIELD_task_id, taskId);}});
return CollectionUtils.isEmpty(results) ? null : results; return CollectionUtils.isEmpty(results) ? null : results;
} }
public static HGSC008 add(EiInfo info){
Map resultMap = EiInfoUtils.getFirstRow(info, EiConstant.resultBlock);
String taskId = MapUtils.getString(resultMap, HGSC008.FIELD_task_id);
HGSC007 hgsc007 = HGSCTools.THGSC007.getById(Long.valueOf(taskId));
HGSC008 hgsc008 = new HGSC008();
BeanUtils.copyProperties(hgsc007,hgsc008);
cleanBaseInfo(hgsc008);
hgsc008.setTaskId(hgsc007.getId());
hgsc008.setQuantity(NumberUtils.toInteger(resultMap.get(HGSC008.FIELD_quantity)));
hgsc008.setRegisterDate(String.valueOf(resultMap.get(HGSC008.FIELD_register_date)));
hgsc008.setTotalWeight(hgsc007.getSingleWeight().multiply(new BigDecimal(hgsc008.getQuantity())));
checkAddDate(hgsc008);
hgsc008.setWorkCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGSC008_WORK_CODE));
DaoUtils.insert(HGSC008.INSERT,hgsc008);
HGZLTools.THGZL002.add(hgsc008);
return hgsc008;
}
private static void checkAddDate(HGSC008 hgsc008){
List<String> orgIdList = UserSessionUtils.getOrgId();
AssertUtils.isEmpty(hgsc008.getGroupCode(),"生产任务班组信息异常,请联系管理员!");
AssertUtils.isTrue(!orgIdList.contains(hgsc008.getGroupCode()),"非当前任务生产组用户,无法报工此任务!");
AssertUtils.isNull(hgsc008.getQuantity(),"报工数量不能为空!");
}
private static void cleanBaseInfo(HGSC008 hgsc008){
hgsc008.setCreatedBy(null);
hgsc008.setCreatedName(null);
hgsc008.setCreatedTime(null);
hgsc008.setUpdatedBy(null);
hgsc008.setUpdatedName(null);
hgsc008.setUpdatedTime(null);
hgsc008.setDepCode(null);
hgsc008.setDepName(null);
hgsc008.setId(null);
}
public static void delete(List<Long> ids) {
checkDeleteDate(ids);
DaoUtils.update(HGSC008.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",ids);}});
HGZLTools.THGZL002.deleteByWorkIds(ids);
}
private static void checkDeleteDate(List<Long> ids){
List<HGZL002> hgzl002s = HGZLTools.THGZL002.list(ids);
List<String> workCodes = hgzl002s.stream().filter(o -> o.getCheckStatus().compareTo(CheckStatusEnum.CHECKED.getCode())==0).map(HGZL002::getWorkCode).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(workCodes)){
AssertUtils.isNotEmpty(workCodes,String.format("生产报工单[%s]已经质检完成,无法删除!",String.join(",",workCodes)));
}
}
} }
......
...@@ -307,7 +307,7 @@ ...@@ -307,7 +307,7 @@
<!--查询用户所在的公司--> <!--查询用户所在的公司-->
<select id="queryCompany" parameterClass="java.util.HashMap" resultClass="java.util.HashMap"> <select id="queryCompany" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select select DISTINCT
a.ORG_ENAME as "orgEname", a.ORG_ENAME as "orgEname",
a.ORG_CNAME as "orgCname" a.ORG_CNAME as "orgCname"
from ${platSchema}.txsog01 a from ${platSchema}.txsog01 a
......
package com.baosight.hggp.hg.zl.tools; package com.baosight.hggp.hg.zl.tools;
import com.baosight.hggp.common.CheckStatusEnum;
import com.baosight.hggp.core.dao.DaoBase; import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant; import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.sc.domain.HGSC008;
import com.baosight.hggp.hg.zl.domain.HGZL001; import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.hg.zl.domain.HGZL002;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import java.math.BigDecimal;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -16,13 +24,13 @@ import java.util.stream.Collectors; ...@@ -16,13 +24,13 @@ import java.util.stream.Collectors;
* @date:2024/5/18,15:12 * @date:2024/5/18,15:12
*/ */
public class HGZLTools { public class HGZLTools {
/** /**
* @author:songx * @author:songx
* @date:2024/5/18,15:12 * @date:2024/5/18,15:12
*/ */
public static class HgZl001 { public static class HgZl001 {
/** /**
* 锁 * 锁
* *
...@@ -37,7 +45,7 @@ public class HGZLTools { ...@@ -37,7 +45,7 @@ public class HGZLTools {
paramMap.put("checkNos", checkNos); paramMap.put("checkNos", checkNos);
DaoBase.getInstance().update(HGSqlConstant.HgZl001.LOCK, paramMap); DaoBase.getInstance().update(HGSqlConstant.HgZl001.LOCK, paramMap);
} }
/** /**
* @param id * @param id
*/ */
...@@ -48,7 +56,7 @@ public class HGZLTools { ...@@ -48,7 +56,7 @@ public class HGZLTools {
List<HGZL001> results = DaoBase.getInstance().query(HGZL001.QUERY, paramMap); List<HGZL001> results = DaoBase.getInstance().query(HGZL001.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0); return CollectionUtils.isEmpty(results) ? null : results.get(0);
} }
/** /**
* 查询 * 查询
* *
...@@ -61,7 +69,7 @@ public class HGZLTools { ...@@ -61,7 +69,7 @@ public class HGZLTools {
paramMap.put("checkNos", checkNos); paramMap.put("checkNos", checkNos);
return DaoBase.getInstance().query(HGZL001.QUERY, paramMap); return DaoBase.getInstance().query(HGZL001.QUERY, paramMap);
} }
/** /**
* 查询 * 查询
* *
...@@ -73,4 +81,45 @@ public class HGZLTools { ...@@ -73,4 +81,45 @@ public class HGZLTools {
return results.stream().collect(Collectors.toMap(HGZL001::getCheckNo, item -> item)); return results.stream().collect(Collectors.toMap(HGZL001::getCheckNo, item -> item));
} }
} }
}
public static class THGZL002 {
public static HGZL002 add(HGSC008 hgsc008){
HGZL002 hgzl002 = new HGZL002();
BeanUtils.copyProperties(hgsc008,hgzl002);
cleanBaseInfo(hgzl002);
hgzl002.setCheckStatus(CheckStatusEnum.CHECKING.getCode());
hgzl002.setWorkId(hgsc008.getId());
hgzl002.setWorkCode(hgsc008.getWorkCode());
hgzl002.setWorkBy(hgsc008.getCreatedBy());
hgzl002.setWorkName(hgsc008.getCreatedName());
hgzl002.setCheckCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGZL002_CHECK_CODE));
DaoUtils.insert(HGZL002.INSERT,hgzl002);
return hgzl002;
}
private static void cleanBaseInfo(HGZL002 hgzl002){
hgzl002.setCreatedBy(null);
hgzl002.setCreatedName(null);
hgzl002.setCreatedTime(null);
hgzl002.setUpdatedBy(null);
hgzl002.setUpdatedName(null);
hgzl002.setUpdatedTime(null);
hgzl002.setDepCode(null);
hgzl002.setDepName(null);
hgzl002.setId(null);
}
public static List<HGZL002> list(List<Long> workIds) {
if (CollectionUtils.isEmpty(workIds)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("workIds", workIds);
return DaoBase.getInstance().query(HGZL002.QUERY, queryMap);
}
public static void deleteByWorkIds(List<Long> workIds) {
DaoUtils.update(HGZL002.DELETE_BY_WORKS, new HashMap<String,Object>(){{put("workIds",workIds);}});
}
}
}
\ No newline at end of file
...@@ -51,8 +51,8 @@ ...@@ -51,8 +51,8 @@
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW008.xml"/> <sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW008.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW009.xml"/> <sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW009.xml"/>
<!-- <sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW014.xml"/>--> <sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW014.xml"/>
<!-- <sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW015.xml"/>--> <sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW015.xml"/>
<!--配置--> <!--配置-->
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<div class="row"> <div class="row">
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3" filter="contains"> <EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFDatePicker cname="会计期" blockId="inqu_status" ename="accountPeriod" row="0" colWidth="3" <EF:EFDatePicker cname="会计期" blockId="inqu_status" ename="accountPeriod" row="0" colWidth="3"
format="yyyy-MM" parseFormats="['yyyyMM']" start="year" depth="year"/> format="yyyy-MM" parseFormats="['yyyyMM']" start="year" depth="year"/>
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称" width="110" align="center" <EF:EFComboColumn ename="companyCode" cname="公司名称" width="110" align="center"
filter="contains" readonly="true"> filter="contains" readonly="true">
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/> <EF:EFOptions blockId="companyBox_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="accountYear" cname="会计年度" width="100" align="center" start="decade" depth="decade" <EF:EFColumn ename="accountYear" cname="会计年度" width="100" align="center" start="decade" depth="decade"
editType="date" dateFormat="yyyy" parseFormats="['yyyy']" required="true"/> editType="date" dateFormat="yyyy" parseFormats="['yyyy']" required="true"/>
......
...@@ -16,7 +16,7 @@ $(function() { ...@@ -16,7 +16,7 @@ $(function() {
field: "operator", field: "operator",
template: function (item) { template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="contractDetailFunc(' + item.id + ')">合同详情</a>'; + 'onclick="contractDetailFunc(' + item.id + ')">明细详情</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="fileDetailFunc(' + item.id + ')">附件详情</a>'; + 'onclick="fileDetailFunc(' + item.id + ')">附件详情</a>';
return template; return template;
...@@ -100,8 +100,8 @@ function windowCallback() { ...@@ -100,8 +100,8 @@ function windowCallback() {
function contractDetailFunc(id) { function contractDetailFunc(id) {
JSColorbox.open({ JSColorbox.open({
href: "HGCW010C?methodName=initLoad&id=" + id + "&efParentFormEname=HGCW010", href: "HGCW011?methodName=initLoad&id=" + id + "&efParentFormEname=HGCW011",
title: "<div style='text-align: center;'>合同详情</div>", title: "<div style='text-align: center;'>明细详情</div>",
width: "90%", width: "90%",
height: "90%", height: "90%",
callbackName: windowCallback callbackName: windowCallback
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,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="140" align="center"/>
<EF:EFColumn ename="partyA" cname="客户名称" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="partyA" cname="客户名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="projName" cname="项目名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="settlementNumber" cname="来源单号" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="settlementNumber" cname="来源单号" width="120" enable="false" readonly="true" align="center"/>
......
$(function() { $(function() {
// 查询 // 查询
$("#QUERY").on("click", function () { $("#QUERY").on("click", function () {
query(); query();
}); });
$("#cancel").on("click", function () {
cancelFunc();
});
$("#btn_save").on("click", function () {
btnSaveFunc();
});
IPLATUI.EFGrid.result = { IPLATUI.EFGrid.result = {
pageable: { pageable: {
pageSize: 20, pageSize: 20,
pageSizes: [10,20,30,50,100,200], pageSizes: [10,20,30,50,100,200],
},
columns: [{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="contractDetailFunc(' + item.id + ')">合同详情</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="fileDetailFunc(' + item.id + ')">附件详情</a>';
return template;
}
} }
],
loadComplete: function (e) {
$("#BTN_UPDATE").on("click",updateFunc);
$("#BTN_SUBMIT").on("click",submitFunc);
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
} }
...@@ -55,79 +37,43 @@ $(window).load(function () { ...@@ -55,79 +37,43 @@ $(window).load(function () {
* 查询 * 查询
*/ */
let query = function () { let query = function () {
resultGrid.dataSource.page(2);
}
/**
* 结算单选择
*/
function windowCallback() {
// 刷新列表
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
} }
function cancelFunc() {
function fileDetailFunc(id) { // 关闭弹窗
JSColorbox.open({ parent.JSColorbox.setValueCallback();
href: "HGCW999?methodName=initLoad&inqu_status-0-bizType=KP&inqu_status-0-matId=" + id + "&efParentFormEname=HGCW010",
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
} }
function submitFunc() { function btnSaveFunc() {
let rows = resultGrid.getCheckedRows(); let rows = resultGrid.getCheckedRows();
if (rows.length != 1) { if (rows.length < 1) {
message("请选择一条数据"); message("请选择数据")
return; return;
} }
var flag = true; for (let i = 0; i < rows.length; i++) {
rows.forEach(function (row) { let thisAmount = rows[i]['thisAmount'];
if (row.reviewStatus == "3") { let remainingAmount = rows[i]['remainingAmount'];
message("勾选的数据中有已经提交的合同!"); if (!isNumber(thisAmount) && !isPositiveNumber(thisAmount)) {
flag = false; message("勾选的第" + (i + 1) + "行本次开票金额必须是大于0的数字");
return;
}
if (parseFloat(thisAmount) > parseFloat(remainingAmount)) {
message("第" + (i + 1) + "行本次开票金额不能大于剩余开票金额");
return;
} }
})
if (flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW010", "submit", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
query();
} catch (e) {
// TODO: handle exception
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
});
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成销售票据吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCW010", "select",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
// parent.JSColorbox.setValueCallback();
}
}
);
}
});
} }
...@@ -6,31 +6,38 @@ ...@@ -6,31 +6,38 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/> <c:set var="ctx" value="${pageContext.request.contextPath}"/>
<head> <head>
</head> </head>
<EF:EFPage title="结算单"> <EF:EFPage title="结算单选择">
<EF:EFRegion id="detail1" title="结算单明细">
<EF:EFGrid blockId="detail1" autoDraw="override" checkMode="row" isFloat="true" copyToAdd="false"> <EF:EFRegion id="inqu" title="查询条件">
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/> <div class="row">
<EF:EFInput cname="隐藏条件" ename="mainId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFDateSpan startCname="结算日期(从)" endCname="至" blockId="inqu_status"
startName="signingDateFrom" endName="signingDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="项目编号" ename="projCode" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="结算编号" ename="settlementNumber" blockId="inqu_status" row="0" colWidth="3" />
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="companyName" cname="所属公司" width="120" serviceName="HGCW010" methodName="queryconteractComboBox" resultId="conteract_combo_box" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="projCode" cname="项目编号" width="120" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编号" width="120" serviceName="HGCW010" methodName="queryconteractComboBox" resultId="conteract_combo_box" enable="false" readonly="true" align="center" /> <EF:EFColumn ename="projName" cname="项目名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" serviceName="HGCW010" methodName="queryconteractComboBox" resultId="conteract_combo_box" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="settlementNumber" cname="结算编号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="contractNumber" cname="合同号" width="120" serviceName="HGCW010" methodName="queryconteractComboBox" resultId="conteract_combo_box" enable="false" readonly="true" align="center" /> <EF:EFColumn ename="contractDate" cname="结算日期" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="contractName" cname="合同名称" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="billNumber" cname="发票号" width="120" enable="true" align="center" required="true"/>
<EF:EFColumn ename="settlementNumber" cname="结算编号" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="taxPoints" cname="税率(%)" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisPriceTax" cname="结算价税合计金额" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="thisPriceTax" cname="结算价税合计金额" hidden="true"/>
<EF:EFColumn ename="thisSettlementTax" cname="结算税金" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="thisSettlementTax" cname="结算税金" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisSettlementAmount" cname="结算金额" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="thisSettlementAmount" cname="结算金额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="billNumber" cname="发票号" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="remainingAmount" cname="剩余开票金额" width="120" enable="false" readonly="true" 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:EFGrid>
</EF:EFRegion> </EF:EFRegion>
<div class="row" style="display:flex;justify-content:center;"> <div class="row" style="display:flex;justify-content:center;">
......
$(function() {
// 查询
$("#QUERY").on("click", function () {
query();
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
columns: [{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="contractDetailFunc(' + item.id + ')">明细详情</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="fileDetailFunc(' + item.id + ')">附件详情</a>';
return template;
}
}
],
loadComplete: function (e) {
$("#SELECT_BILL").on("click",addFunc);
$("#BTN_UPDATE").on("click",updateFunc);
$("#BTN_SUBMIT").on("click",submitFunc);
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
}
window.document.addEventListener("keyup",function (event) {
if(event.keyCode === 13){
var grid = $("#ef_grid_result").data("kendoGrid");
// 回填
//grid.addRows(returnRows);
grid.closeCell();
}
})
});
$(window).load(function () {
// 查
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 结算单选择
*/
function addFunc() {
JSColorbox.open({
href: "HGCW012A?methodName=initLoad&efParentFormEname=HGCW010",
title: "<div style='text-align: center;'>结算单</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
/**
* 修改
*/
function updateFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
return;
}
JSColorbox.open({
href: "HGCW010B?methodName=initLoad&id=" + rows[0].id + "&efParentFormEname=HGCW010",
title: "<div style='text-align: center;'>修改合同</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
function windowCallback() {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
function contractDetailFunc(id) {
JSColorbox.open({
href: "HGCW012?methodName=initLoad&id=" + id + "&efParentFormEname=HGCW012",
title: "<div style='text-align: center;'>明细详情</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
function fileDetailFunc(id) {
JSColorbox.open({
href: "HGCW999?methodName=initLoad&inqu_status-0-bizType=HT&inqu_status-0-matId=" + id + "&efParentFormEname=HGCW010",
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
function submitFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
return;
}
var flag = true;
rows.forEach(function (row) {
if (row.reviewStatus == "3") {
message("勾选的数据中有已经提交的合同!");
flag = false;
}
})
if (flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW012", "submit", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
query();
} catch (e) {
// TODO: handle exception
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
});
}
}
<!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="inqu" title="查询条件">
<div class="row">
<EF:EFDateSpan startCname="开票日期(从)" endCname="至" blockId="inqu_status"
startName="signingDateFrom" endName="signingDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
<EF:EFInput cname="客户名称" ename="partyA" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="票据类型" ename="billTybe" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="发票号" ename="billNumber" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFSelect cname="开票状态" ename="inqu_status-0-billState" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.reviewStatus"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="140" align="center"/>
<EF:EFColumn ename="partyA" cname="客户名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="settlementNumber" cname="来源单号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="billTybe" cname="票据类型" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="signingDate" cname="开票日期" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="billNumber" cname="发票号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="taxPoints" cname="税率" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisSettlementAmount" cname="不含税金额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisSettlementTax" cname="税额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="开票总额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFComboColumn ename="billState" cname="开票状态" width="100" align="center" required="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
<EF:EFCodeOption codeName="hggp.cw.billState"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="reviewStatus" cname="审批状态" width="100" align="center" required="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
<EF:EFCodeOption codeName="hggp.cw.reviewStatus"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
$(function() {
// 查询
$("#QUERY").on("click", function () {
query();
});
$("#cancel").on("click", function () {
cancelFunc();
});
$("#btn_save").on("click", function () {
btnSaveFunc();
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
}
}
window.document.addEventListener("keyup",function (event) {
if(event.keyCode === 13){
var grid = $("#ef_grid_result").data("kendoGrid");
// 回填
//grid.addRows(returnRows);
grid.closeCell();
}
})
});
$(window).load(function () {
// 查
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
function cancelFunc() {
// 关闭弹窗
parent.JSColorbox.setValueCallback();
}
function btnSaveFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
for (let i = 0; i < rows.length; i++) {
let thisAmount = rows[i]['thisAmount'];
let remainingAmount = rows[i]['remainingAmount'];
if (!isNumber(thisAmount) && !isPositiveNumber(thisAmount)) {
message("勾选的第" + (i + 1) + "行本次开票金额必须是大于0的数字");
return;
}
if (parseFloat(thisAmount) > parseFloat(remainingAmount)) {
message("第" + (i + 1) + "行本次开票金额不能大于剩余开票金额");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成销售票据吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCW010", "select",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
// parent.JSColorbox.setValueCallback();
}
}
);
}
});
}
<!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="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="隐藏条件" ename="mainId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFDateSpan startCname="结算日期(从)" endCname="至" blockId="inqu_status"
startName="signingDateFrom" endName="signingDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="项目编号" ename="projCode" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="结算编号" ename="settlementNumber" blockId="inqu_status" row="0" colWidth="3" />
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="projCode" cname="项目编号" width="120" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="settlementNumber" cname="结算编号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="contractDate" cname="结算日期" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="billNumber" cname="发票号" width="120" enable="true" align="center" required="true"/>
<EF:EFColumn ename="taxPoints" cname="税率(%)" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisPriceTax" cname="结算价税合计金额" hidden="true"/>
<EF:EFColumn ename="thisSettlementTax" cname="结算税金" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisSettlementAmount" cname="结算金额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="remainingAmount" cname="剩余开票金额" width="120" enable="false" readonly="true" align="center"/>
</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>
$(function() {
// 查询
$("#QUERY").on("click", function () {
query();
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
columns: [{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="contractDetailFunc(' + item.id + ')">收款清单</a>';
return template;
}
}
],
loadComplete: function (grid) {
$("#BTN_CHOICE").on("click",choiceFunc);
$("#BTN_UPDATE").on("click",updateFunc);
$("#BTN_SUBMIT").on("click",submitFunc);
$("#BTN_WRITEOFF").on("click",writeoffFunc);
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
saveResult1Func();
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
}
$("#result-0-projCode").change(function () {
let textField = IPLAT.EFSelect.text($("#result-0-projCode"));
$("#result-0-projName").val(textField);
})
window.document.addEventListener("keyup",function (event) {
if(event.keyCode === 13){
var grid = $("#ef_grid_result").data("kendoGrid");
// 回填
//grid.addRows(returnRows);
grid.closeCell();
}
})
});
$(window).load(function () {
// 查
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 结算单选择
*/
function choiceFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length == 1 || rows.length == 0) {
var mainId = "";
if (rows.length == 1) {
mainId = rows[0].id;
}
JSColorbox.open({
href: "HGCW014A?methodName=initLoad&inqu_status-0-hiddenConditions=1" +
"&inqu_status-0-billState=2" +
"&inqu_status-0-reviewStatus=3" +
"&inqu_status-0-mainId=" + mainId +
"&efParentFormEname=HGCW014",
title: "<div style='text-align: center;'>销售开票</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
} else {
message("请选择一条数据或不选择数据");
return;
}
}
/**
* 修改
*/
function updateFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
return;
}
if (rows[0].cancelStatus == "2") {
message("已经核销的单据不能修改");
return;
}
JSColorbox.open({
href: "HGCW014B?methodName=initLoad&inqu_status-0-mainId=" + rows[0].id + "&efParentFormEname=HGCW014",
title: "<div style='text-align: center;'>收款清单</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
function saveResult1Func() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请至少选择一条数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW014", "save", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
query();
} catch (e) {
// TODO: handle exception
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
//JSUtils.submitGridsData("result", "HPSC001", "save", true);
}
});
}
function windowCallback() {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
function submitFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
return;
}
var flag = true;
rows.forEach(function (row) {
if (row.cancelStatus == "1") {
message("勾选的数据中有未核销的单据!");
flag = false;
return;
}
if (row.reviewStatus == "3") {
message("勾选的数据中有已经提交的单据!");
flag = false;
return;
}
})
if (flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW014", "submit", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
query();
} catch (e) {
// TODO: handle exception
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
});
}
}
function writeoffFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
return;
}
var flag = true;
rows.forEach(function (row) {
if (row.cancelStatus == "2") {
message("勾选的数据中有已经核销的单据!");
flag = false;
return;
}
})
if (flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"核销\"操作? ", {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW014", "writeoff", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
query();
} catch (e) {
// TODO: handle exception
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
});
}
}
function deleteFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let cancelStatus= item.get("cancelStatus");
if(cancelStatus === "2"){
message("选中的第"+(index+1)+"行记录为核销状态,不能删除!");
flag = false;
return;
}
});
if(flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCW014", "delete", true);
}
});
}
}
function contractDetailFunc(id) {
JSColorbox.open({
href: "HGCW014C?methodName=initLoad&inqu_status-0-mainId=" + id + "&efParentFormEname=HGCW002",
title: "<div style='text-align: center;'>合同详情</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
<!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="inqu" title="查询条件">
<div class="row">
<EF:EFDateSpan startCname="收款日期(从)" endCname="至" blockId="inqu_status"
startName="signingDateFrom" endName="signingDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
<EF:EFInput cname="客户名称" ename="partyA" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFSelect cname="核销状态" ename="inqu_status-0-cancelStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.cancelStatus"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFComboColumn ename="partyA" cname="客户名称" width="120" align="left" defaultValue=""
filter="contains" readonly="true">
<EF:EFOptions blockId="customer_record_block_id"
valueField="textField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="projCode" cname="项目名称" width="120" align="left" defaultValue=""
filter="contains" readonly="true">
<EF:EFOptions blockId="proj_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="projName" cname="项目编码" hidden="true"/>
<EF:EFColumn ename="signingDate" cname="收款日期" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="contractNumber" cname="来源单号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="incomeNumber" cname="收款单号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="收款总额" width="120" format="{0:N3}" readonly="true" align="center"/>
<EF:EFComboColumn ename="cancelStatus" cname="核销状态" width="100" align="center" readonly="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
<EF:EFCodeOption codeName="hggp.cw.cancelStatus"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="reviewStatus" cname="审批状态" width="100" align="center" readonly="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
<EF:EFCodeOption codeName="hggp.cw.reviewStatus"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
$(function() {
// 查询
$("#QUERY").on("click", function () {
query();
});
$("#cancel").on("click", function () {
cancelFunc();
});
$("#btn_save").on("click", function () {
btnSaveFunc();
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
}
}
window.document.addEventListener("keyup",function (event) {
if(event.keyCode === 13){
var grid = $("#ef_grid_result").data("kendoGrid");
// 回填
//grid.addRows(returnRows);
grid.closeCell();
}
})
});
$(window).load(function () {
// 查
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
function cancelFunc() {
// 关闭弹窗
parent.JSColorbox.setValueCallback();
}
function btnSaveFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
for (let i = 0; i < rows.length; i++) {
let thisAmount = rows[i]['thisAmount'];
let remainingAmount = rows[i]['remainingAmount'];
if (!isNumber(thisAmount) && !isPositiveNumber(thisAmount)) {
message("勾选的第" + (i + 1) + "行本次收款金额必须是大于0的数字");
return;
}
if (parseFloat(thisAmount) > parseFloat(remainingAmount)) {
message("第" + (i + 1) + "行本次收款金额不能大于剩余开票金额");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成收款单吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCW014", "select",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
parent.JSColorbox.setValueCallback();
}
}
);
}
});
}
<!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="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="隐藏条件" ename="partyA" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="隐藏条件" ename="mainId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFDateSpan startCname="开票日期(从)" endCname="至" blockId="inqu_status"
startName="signingDateFrom" endName="signingDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
<EF:EFInput cname="客户名称" ename="partyA" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFSelect cname="票据类型" ename="inqu_status-0-billTybe" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.billTybe"/>
</EF:EFSelect>
<EF:EFInput cname="发票号" ename="billNumber" blockId="inqu_status" row="0" colWidth="3" />
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="thisAmount" cname="本次收款金额" width="120" align="center"/>
<EF:EFColumn ename="remainingAmount" cname="剩余开票金额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="partyA" cname="客户名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编码" hidden="true"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="settlementNumber" cname="来源单号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFComboColumn ename="billTybe" cname="票据类型" width="100" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
<EF:EFCodeOption codeName="hggp.cw.billTybe"/>
</EF:EFComboColumn>
<EF:EFColumn ename="signingDate" cname="开票日期" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="billNumber" cname="发票号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="taxPoints" cname="税率(%)" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisSettlementAmount" cname="不含税金额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisSettlementTax" cname="税额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="开票总额" width="120" enable="false" readonly="true" align="center"/>
</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>
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