Commit 419f4ad0 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/cw/sql/HGCW001.xml
	src/main/java/com/baosight/hggp/hg/cw/tools/HGCWTools.java
parents 97fc9efd 591b0662
......@@ -19,9 +19,9 @@ import com.baosight.iplat4j.core.util.StringUtils;
* @history 2024-05-11 17:25:48 create
*/
public class HGCG001 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id";
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 企业编码*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
......@@ -57,7 +57,10 @@ public class HGCG001 extends DaoEPBase {
public static final String FIELD_AUDIT_USER_ID = "auditUserId"; /* 审核人ID*/
public static final String FIELD_AUDIT_USER_NAME = "auditUserName"; /* 审核人名称*/
public static final String FIELD_AUDIT_REASON = "auditReason"; /* 审核原因*/
public static final String FIELD_INVENT_TYPE_DETAIL = "inventTypeDetail"; /*存货类型明细*/
public static final String FIELD_MATERIAL_PLAN_ID = "materialPlanId"; /*材料计划id*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
......@@ -93,13 +96,13 @@ public class HGCG001 extends DaoEPBase {
public static final String COL_AUDIT_USER_ID = "AUDIT_USER_ID"; /* 审核人ID*/
public static final String COL_AUDIT_USER_NAME = "AUDIT_USER_NAME"; /* 审核人名称*/
public static final String COL_AUDIT_REASON = "AUDIT_REASON"; /* 审核原因*/
public static final String QUERY = "HGCG001.query";
public static final String COUNT = "HGCG001.count";
public static final String INSERT = "HGCG001.insert";
public static final String UPDATE = "HGCG001.update";
public static final String DELETE = "HGCG001.delete";
private Long id = new Long(0);
private String accountCode = " "; /* 企业编码*/
private String depCode = " "; /* 部门编码*/
......@@ -135,191 +138,199 @@ public class HGCG001 extends DaoEPBase {
private String auditUserId = " "; /* 审核人ID*/
private String auditUserName = " "; /* 审核人名称*/
private String auditReason = " "; /* 审核原因*/
private Integer inventTypeDetail; /*存货类型明细 1:构建 2:零件*/
private Long materialPlanId = new Long(0); /*材料计划id*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ACCOUNT_CODE);
eiColumn.setDescName("企业编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("记录创建者");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("记录创建名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("记录创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("记录修改者");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("记录修改名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("记录修改时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("0-未删除,1-已删除");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("公司编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_NAME);
eiColumn.setDescName("公司名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PLAN_DATE);
eiColumn.setDescName("计划日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PLAN_NO);
eiColumn.setDescName("计划单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_TYPE);
eiColumn.setDescName("存货类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_CODE);
eiColumn.setDescName("存货编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_NAME);
eiColumn.setDescName("存货名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SPEC_ID);
eiColumn.setDescName("规格ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SPEC);
eiColumn.setDescName("规格");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MATERIAL);
eiColumn.setDescName("材质");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UNIT);
eiColumn.setDescName("单位");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_LENGTH);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("长度");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WIDTH);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("宽度");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_THICK);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("厚度");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PLAN_QTY);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("计划数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PLAN_UNIT_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("计划单重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PLAN_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("计划重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PUR_QTY);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("采购数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PUR_UNIT_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("采购单重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PUR_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("采购重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("状态:0-未审批,1-审核通过,2-审核未通过");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_AUDIT_TIME);
eiColumn.setDescName("审核时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_AUDIT_USER_ID);
eiColumn.setDescName("审核人ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_AUDIT_USER_NAME);
eiColumn.setDescName("审核人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_AUDIT_REASON);
eiColumn.setDescName("审核原因");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_TYPE_DETAIL);
eiColumn.setDescName("存货类型明细");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MATERIAL_PLAN_ID);
eiColumn.setDescName("存货类型明细");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGCG001() {
initMetaData();
}
/**
* get the id .
* @return the id
......@@ -327,7 +338,7 @@ public class HGCG001 extends DaoEPBase {
public Long getId() {
return this.id;
}
/**
* set the id .
*
......@@ -343,7 +354,7 @@ public class HGCG001 extends DaoEPBase {
public String getAccountCode() {
return this.accountCode;
}
/**
* set the accountCode - 企业编码.
*
......@@ -359,7 +370,7 @@ public class HGCG001 extends DaoEPBase {
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码.
*
......@@ -375,7 +386,7 @@ public class HGCG001 extends DaoEPBase {
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 记录创建者.
*
......@@ -391,7 +402,7 @@ public class HGCG001 extends DaoEPBase {
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 记录创建名称.
*
......@@ -407,7 +418,7 @@ public class HGCG001 extends DaoEPBase {
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 记录创建时间.
*
......@@ -423,7 +434,7 @@ public class HGCG001 extends DaoEPBase {
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 记录修改者.
*
......@@ -439,7 +450,7 @@ public class HGCG001 extends DaoEPBase {
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 记录修改名称.
*
......@@ -455,7 +466,7 @@ public class HGCG001 extends DaoEPBase {
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 记录修改时间.
*
......@@ -471,7 +482,7 @@ public class HGCG001 extends DaoEPBase {
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 0-未删除,1-已删除.
*
......@@ -487,7 +498,7 @@ public class HGCG001 extends DaoEPBase {
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 公司编码.
*
......@@ -503,7 +514,7 @@ public class HGCG001 extends DaoEPBase {
public String getCompanyName() {
return this.companyName;
}
/**
* set the companyName - 公司名称.
*
......@@ -519,7 +530,7 @@ public class HGCG001 extends DaoEPBase {
public String getPlanDate() {
return this.planDate;
}
/**
* set the planDate - 计划日期.
*
......@@ -535,7 +546,7 @@ public class HGCG001 extends DaoEPBase {
public String getPlanNo() {
return this.planNo;
}
/**
* set the planNo - 计划单号.
*
......@@ -551,7 +562,7 @@ public class HGCG001 extends DaoEPBase {
public String getInventType() {
return this.inventType;
}
/**
* set the inventType - 存货类型.
*
......@@ -567,7 +578,7 @@ public class HGCG001 extends DaoEPBase {
public String getInventCode() {
return this.inventCode;
}
/**
* set the inventCode - 存货编码.
*
......@@ -583,7 +594,7 @@ public class HGCG001 extends DaoEPBase {
public String getInventName() {
return this.inventName;
}
/**
* set the inventName - 存货名称.
*
......@@ -599,7 +610,7 @@ public class HGCG001 extends DaoEPBase {
public Long getSpecId() {
return this.specId;
}
/**
* set the specId - 规格ID.
*
......@@ -615,7 +626,7 @@ public class HGCG001 extends DaoEPBase {
public String getSpec() {
return this.spec;
}
/**
* set the spec - 规格.
*
......@@ -631,7 +642,7 @@ public class HGCG001 extends DaoEPBase {
public String getMaterial() {
return this.material;
}
/**
* set the material - 材质.
*
......@@ -647,7 +658,7 @@ public class HGCG001 extends DaoEPBase {
public String getUnit() {
return this.unit;
}
/**
* set the unit - 单位.
*
......@@ -663,7 +674,7 @@ public class HGCG001 extends DaoEPBase {
public BigDecimal getLength() {
return this.length;
}
/**
* set the length - 长度.
*
......@@ -679,7 +690,7 @@ public class HGCG001 extends DaoEPBase {
public BigDecimal getWidth() {
return this.width;
}
/**
* set the width - 宽度.
*
......@@ -695,7 +706,7 @@ public class HGCG001 extends DaoEPBase {
public BigDecimal getThick() {
return this.thick;
}
/**
* set the thick - 厚度.
*
......@@ -711,7 +722,7 @@ public class HGCG001 extends DaoEPBase {
public BigDecimal getPlanQty() {
return this.planQty;
}
/**
* set the planQty - 计划数量.
*
......@@ -727,7 +738,7 @@ public class HGCG001 extends DaoEPBase {
public BigDecimal getPlanUnitWeight() {
return this.planUnitWeight;
}
/**
* set the planUnitWeight - 计划单重.
*
......@@ -743,7 +754,7 @@ public class HGCG001 extends DaoEPBase {
public BigDecimal getPlanWeight() {
return this.planWeight;
}
/**
* set the planWeight - 计划重量.
*
......@@ -759,7 +770,7 @@ public class HGCG001 extends DaoEPBase {
public BigDecimal getPurQty() {
return this.purQty;
}
/**
* set the purQty - 采购数量.
*
......@@ -775,7 +786,7 @@ public class HGCG001 extends DaoEPBase {
public BigDecimal getPurUnitWeight() {
return this.purUnitWeight;
}
/**
* set the purUnitWeight - 采购单重.
*
......@@ -791,7 +802,7 @@ public class HGCG001 extends DaoEPBase {
public BigDecimal getPurWeight() {
return this.purWeight;
}
/**
* set the purWeight - 采购重量.
*
......@@ -807,7 +818,7 @@ public class HGCG001 extends DaoEPBase {
public Integer getStatus() {
return this.status;
}
/**
* set the status - 状态:0-未审批,1-审核通过,2-审核未通过.
*
......@@ -823,7 +834,7 @@ public class HGCG001 extends DaoEPBase {
public String getAuditTime() {
return this.auditTime;
}
/**
* set the auditTime - 审核时间.
*
......@@ -839,7 +850,7 @@ public class HGCG001 extends DaoEPBase {
public String getAuditUserId() {
return this.auditUserId;
}
/**
* set the auditUserId - 审核人ID.
*
......@@ -855,7 +866,7 @@ public class HGCG001 extends DaoEPBase {
public String getAuditUserName() {
return this.auditUserName;
}
/**
* set the auditUserName - 审核人名称.
*
......@@ -871,7 +882,7 @@ public class HGCG001 extends DaoEPBase {
public String getAuditReason() {
return this.auditReason;
}
/**
* set the auditReason - 审核原因.
*
......@@ -880,6 +891,23 @@ public class HGCG001 extends DaoEPBase {
public void setAuditReason(String auditReason) {
this.auditReason = auditReason;
}
public Integer getInventTypeDetail() {
return inventTypeDetail;
}
public void setInventTypeDetail(Integer inventTypeDetail) {
this.inventTypeDetail = inventTypeDetail;
}
public Long getMaterialPlanId() {
return materialPlanId;
}
public void setMaterialPlanId(Long materialPlanId) {
this.materialPlanId = materialPlanId;
}
/**
* get the value from Map.
*
......@@ -887,7 +915,7 @@ public class HGCG001 extends DaoEPBase {
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
......@@ -923,14 +951,16 @@ public class HGCG001 extends DaoEPBase {
setAuditUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUDIT_USER_ID)), auditUserId));
setAuditUserName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUDIT_USER_NAME)), auditUserName));
setAuditReason(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUDIT_REASON)), auditReason));
setMaterialPlanId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_MATERIAL_PLAN_ID)), materialPlanId));
setInventTypeDetail(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_INVENT_TYPE_DETAIL)), inventTypeDetail));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE)));
......@@ -967,7 +997,8 @@ public class HGCG001 extends DaoEPBase {
map.put(FIELD_AUDIT_USER_ID, StringUtils.toString(auditUserId, eiMetadata.getMeta(FIELD_AUDIT_USER_ID)));
map.put(FIELD_AUDIT_USER_NAME, StringUtils.toString(auditUserName, eiMetadata.getMeta(FIELD_AUDIT_USER_NAME)));
map.put(FIELD_AUDIT_REASON, StringUtils.toString(auditReason, eiMetadata.getMeta(FIELD_AUDIT_REASON)));
map.put(FIELD_MATERIAL_PLAN_ID,StringUtils.toString(materialPlanId, eiMetadata.getMeta(FIELD_MATERIAL_PLAN_ID)));
map.put(FIELD_INVENT_TYPE_DETAIL,StringUtils.toString(inventTypeDetail, eiMetadata.getMeta(FIELD_INVENT_TYPE_DETAIL)));
return map;
}
}
......@@ -37,7 +37,9 @@
AUDIT_TIME as "auditTime", <!-- 审核时间 -->
AUDIT_USER_ID as "auditUserId", <!-- 审核人ID -->
AUDIT_USER_NAME as "auditUserName", <!-- 审核人名称 -->
AUDIT_REASON as "auditReason" <!-- 审核原因 -->
AUDIT_REASON as "auditReason", <!-- 审核原因 -->
INVENT_TYPE_DETAIL as "inventTypeDetail", <!-- 存货类型明细 -->
MATERIAL_PLAN_ID as "materialPlanId" <!-- 材料计划id -->
</sql>
<sql id="condition">
......@@ -78,6 +80,12 @@
<isNotEmpty prepend=" AND " property="auditUserName">
AUDIT_USER_NAME = #auditUserName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventTypeDetail">
INVENT_TYPE_DETAIL = #inventTypeDetail#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="materialPlanId">
MATERIAL_PLAN_ID = #materialPlanId#
</isNotEmpty>
</sql>
<sql id="idCondition">
......@@ -90,6 +98,9 @@
<isNotEmpty prepend=" AND " property="planNos">
PLAN_NO IN <iterate open="(" close=")" conjunction="," property="planNos">#planNos[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="materialPlanIds">
MATERIAL_PLAN_ID IN <iterate open="(" close=")" conjunction="," property="materialPlanIds">#materialPlanIds[]#</iterate>
</isNotEmpty>
</sql>
<sql id="customCondition">
......@@ -152,12 +163,14 @@
PLAN_QTY, <!-- 计划数量 -->
PLAN_UNIT_WEIGHT, <!-- 计划单重 -->
PLAN_WEIGHT, <!-- 计划重量 -->
STATUS <!-- 状态:0-未审批,1-审核通过,2-审核未通过 -->
STATUS, <!-- 状态:0-未审批,1-审核通过,2-审核未通过 -->
INVENT_TYPE_DETAIL, <!-- 存货类型明细 -->
MATERIAL_PLAN_ID <!-- 材料计划id -->
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#companyCode#, #companyName#, #planDate#, #planNo#, #inventCode#, #inventName#,
#specId#, #spec#, #material#, #unit#, #length#, #width#, #thick#,
#planQty#, #planUnitWeight#, #planWeight#, #status#
#planQty#, #planUnitWeight#, #planWeight#, #status#, #inventTypeDetail#, #materialPlanId#
)
</insert>
......
......@@ -23,7 +23,7 @@ import java.util.stream.Collectors;
* @date:2024/5/9,14:33
*/
public class HGCGTools {
/**
* HGCG001 工具类
*
......@@ -31,7 +31,7 @@ public class HGCGTools {
* @date:2024/5/9,14:33
*/
public static class HgCg001 {
/**
* 锁
*
......@@ -46,7 +46,7 @@ public class HGCGTools {
paramMap.put("planNos", planNos);
DaoBase.getInstance().update(HGSqlConstant.HgCg001.LOCK, paramMap);
}
/**
* 查询
*
......@@ -69,7 +69,20 @@ public class HGCGTools {
Map<String, Object> paramMap = new HashMap();
return DaoBase.getInstance().query(HGCG001.QUERY, paramMap);
}
/**
* 查询
*
* @param materialPlanIds
* @return
*/
public static List<HGCG001> listByMaterialPlanIds(List<Long> materialPlanIds) {
AssertUtils.isEmpty(materialPlanIds, "材料计划id不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("materialPlanIds", materialPlanIds);
return DaoBase.getInstance().query(HGCG001.QUERY, paramMap);
}
/**
* 查询
*
......@@ -80,7 +93,7 @@ public class HGCGTools {
List<HGCG001> results = list(planNos);
return results.stream().collect(Collectors.toMap(HGCG001::getPlanNo, item -> item));
}
/**
* 修改状态
*
......@@ -95,9 +108,9 @@ public class HGCGTools {
paramMap.put("status", status);
DaoUtils.update(HGSqlConstant.HgCg001.UPDATE_STATUS, paramMap);
}
}
/**
* HGCG002 工具类
*
......@@ -105,7 +118,7 @@ public class HGCGTools {
* @date:2024/5/9,14:33
*/
public static class HgCg002 {
/**
* 锁
*
......@@ -120,7 +133,7 @@ public class HGCGTools {
paramMap.put("contractNos", contractNos);
DaoBase.getInstance().update(HGSqlConstant.HgCg002.LOCK, paramMap);
}
/**
* 修改状态
*
......@@ -135,7 +148,7 @@ public class HGCGTools {
paramMap.put("status", status);
DaoUtils.update(HGSqlConstant.HgCg002.UPDATE_STATUS, paramMap);
}
/**
* 修改状态
*
......@@ -156,7 +169,7 @@ public class HGCGTools {
paramMap.put(HGCG002.FIELD_RECEIVE_WEIGHT, newReceiveQty.multiply(dbCg002.getPurUnitWeight()));
DaoUtils.update(HGSqlConstant.HgCg002.UPDATE_RECEIVE, paramMap);
}
/**
* 查询
*
......@@ -169,7 +182,7 @@ public class HGCGTools {
paramMap.put("contractNos", contractNos);
return DaoBase.getInstance().query(HGCG002.QUERY, paramMap);
}
/**
* 查询
*
......@@ -180,9 +193,9 @@ public class HGCGTools {
List<HGCG002A> results = list(contractNos);
return results.stream().collect(Collectors.toMap(HGCG002A::getContractNo, item -> item));
}
}
/**
* HGCG003 工具类
*
......@@ -190,7 +203,7 @@ public class HGCGTools {
* @date:2024/5/9,14:33
*/
public static class HgCg003 {
/**
* 锁
*
......@@ -205,7 +218,7 @@ public class HGCGTools {
paramMap.put("receiveNos", receiveNos);
DaoBase.getInstance().update(HGSqlConstant.HgCg003.LOCK, paramMap);
}
/**
* 查询
*
......@@ -218,7 +231,7 @@ public class HGCGTools {
paramMap.put("receiveNos", receiveNos);
return DaoBase.getInstance().query(HGCG003.QUERY, paramMap);
}
/**
* 查询
*
......@@ -229,7 +242,7 @@ public class HGCGTools {
List<HGCG003> results = list(receiveNos);
return results.stream().collect(Collectors.toMap(HGCG003::getReceiveNo, item -> item));
}
/**
* 修改状态
*
......@@ -244,7 +257,7 @@ public class HGCGTools {
paramMap.put("status", status);
DaoUtils.update(HGSqlConstant.HgCg003.UPDATE_STATUS, paramMap);
}
/**
* 修改状态
*
......@@ -258,8 +271,8 @@ public class HGCGTools {
paramMap.put(HGCG003.FIELD_DEPOSIT_QTY, zl001.getQualifyQty());
DaoUtils.update(HGSqlConstant.HgCg003.UPDATE_CONFIRM, paramMap);
}
}
}
package com.baosight.hggp.hg.cw.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* Project: <br>
* Title:Hgcw055.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-06-26 15:48:30 create
*/
public class HGCW055 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id";
public static final String FIELD_CREATED_BY = "createdBy"; /* 记录创建者*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 记录创建名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 记录创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 记录修改者*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 记录修改名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 记录修改时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 0-未删除,1-已删除*/
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 公司编码*/
public static final String FIELD_COMPANY_NAME = "companyName"; /* 公司名称*/
public static final String FIELD_YEAR = "year"; /* 年份*/
public static final String FIELD_MONTH = "month"; /* 月份*/
public static final String FIELD_CHECK_STATUS = "checkStatus"; /* 核算状态*/
public static final String FIELD_CHECK_BY = "checkBy"; /* 核算人*/
public static final String FIELD_CHECK_NAME = "checkName"; /* 核算人名称*/
public static final String FIELD_CHECK_TIME = "checkTime"; /* 核算时间*/
public static final String COL_ID = "ID";
public static final String COL_CREATED_BY = "CREATED_BY"; /* 记录创建者*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 记录创建名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 记录创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 记录修改者*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 记录修改名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 记录修改时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 0-未删除,1-已删除*/
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 公司编码*/
public static final String COL_COMPANY_NAME = "COMPANY_NAME"; /* 公司名称*/
public static final String COL_YEAR = "YEAR"; /* 年份*/
public static final String COL_MONTH = "MONTH"; /* 月份*/
public static final String COL_CHECK_STATUS = "CHECK_STATUS"; /* 核算状态*/
public static final String COL_CHECK_BY = "CHECK_BY"; /* 核算人*/
public static final String COL_CHECK_NAME = "CHECK_NAME"; /* 核算人名称*/
public static final String COL_CHECK_TIME = "CHECK_TIME"; /* 核算时间*/
public static final String QUERY = "HGCW055.query";
public static final String COUNT = "HGCW055.count";
public static final String INSERT = "HGCW055.insert";
public static final String UPDATE = "HGCW055.update";
public static final String DELETE = "HGCW055.delete";
private Long id = new Long(0);
private String createdBy = " "; /* 记录创建者*/
private String createdName = " "; /* 记录创建名称*/
private String createdTime = " "; /* 记录创建时间*/
private String updatedBy = " "; /* 记录修改者*/
private String updatedName = " "; /* 记录修改名称*/
private String updatedTime = " "; /* 记录修改时间*/
private Boolean deleteFlag; /* 0-未删除,1-已删除*/
private String companyCode = " "; /* 公司编码*/
private String companyName = " "; /* 公司名称*/
private String year = " "; /* 年份*/
private String month = " "; /* 月份*/
private String checkStatus = " "; /* 核算状态*/
private String checkBy = " "; /* 核算人*/
private String checkName = " "; /* 核算人名称*/
private String checkTime = " "; /* 核算时间*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("记录创建者");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("记录创建名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("记录创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("记录修改者");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("记录修改名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("记录修改时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("0-未删除,1-已删除");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("公司编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_NAME);
eiColumn.setDescName("公司名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_YEAR);
eiColumn.setDescName("年份");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MONTH);
eiColumn.setDescName("月份");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHECK_STATUS);
eiColumn.setDescName("核算状态");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHECK_BY);
eiColumn.setDescName("核算人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHECK_NAME);
eiColumn.setDescName("核算人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHECK_TIME);
eiColumn.setDescName("核算时间");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGCW055() {
initMetaData();
}
/**
* get the id .
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id .
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the createdBy - 记录创建者.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 记录创建者.
*
* @param createdBy - 记录创建者
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 记录创建名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 记录创建名称.
*
* @param createdName - 记录创建名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 记录创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 记录创建时间.
*
* @param createdTime - 记录创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 记录修改者.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 记录修改者.
*
* @param updatedBy - 记录修改者
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 记录修改名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 记录修改名称.
*
* @param updatedName - 记录修改名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 记录修改时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 记录修改时间.
*
* @param updatedTime - 记录修改时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 0-未删除,1-已删除.
* @return the deleteFlag
*/
public Boolean getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 0-未删除,1-已删除.
*
* @param deleteFlag - 0-未删除,1-已删除
*/
public void setDeleteFlag(Boolean deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the companyCode - 公司编码.
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 公司编码.
*
* @param companyCode - 公司编码
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the companyName - 公司名称.
* @return the companyName
*/
public String getCompanyName() {
return this.companyName;
}
/**
* set the companyName - 公司名称.
*
* @param companyName - 公司名称
*/
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
/**
* get the year - 年份.
* @return the year
*/
public String getYear() {
return this.year;
}
/**
* set the year - 年份.
*
* @param year - 年份
*/
public void setYear(String year) {
this.year = year;
}
/**
* get the month - 月份.
* @return the month
*/
public String getMonth() {
return this.month;
}
/**
* set the month - 月份.
*
* @param month - 月份
*/
public void setMonth(String month) {
this.month = month;
}
/**
* get the checkStatus - 核算状态.
* @return the checkStatus
*/
public String getCheckStatus() {
return this.checkStatus;
}
/**
* set the checkStatus - 核算状态.
*
* @param checkStatus - 核算状态
*/
public void setCheckStatus(String checkStatus) {
this.checkStatus = checkStatus;
}
/**
* get the checkBy - 核算人.
* @return the checkBy
*/
public String getCheckBy() {
return this.checkBy;
}
/**
* set the checkBy - 核算人.
*
* @param checkBy - 核算人
*/
public void setCheckBy(String checkBy) {
this.checkBy = checkBy;
}
/**
* get the checkName - 核算人名称.
* @return the checkName
*/
public String getCheckName() {
return this.checkName;
}
/**
* set the checkName - 核算人名称.
*
* @param checkName - 核算人名称
*/
public void setCheckName(String checkName) {
this.checkName = checkName;
}
/**
* get the checkTime - 核算时间.
* @return the checkTime
*/
public String getCheckTime() {
return this.checkTime;
}
/**
* set the checkTime - 核算时间.
*
* @param checkTime - 核算时间
*/
public void setCheckTime(String checkTime) {
this.checkTime = checkTime;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_NAME)), companyName));
setYear(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_YEAR)), year));
setMonth(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MONTH)), month));
setCheckStatus(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHECK_STATUS)), checkStatus));
setCheckBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHECK_BY)), checkBy));
setCheckName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHECK_NAME)), checkName));
setCheckTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHECK_TIME)), checkTime));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
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_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_COMPANY_NAME, StringUtils.toString(companyName, eiMetadata.getMeta(FIELD_COMPANY_NAME)));
map.put(FIELD_YEAR, StringUtils.toString(year, eiMetadata.getMeta(FIELD_YEAR)));
map.put(FIELD_MONTH, StringUtils.toString(month, eiMetadata.getMeta(FIELD_MONTH)));
map.put(FIELD_CHECK_STATUS, StringUtils.toString(checkStatus, eiMetadata.getMeta(FIELD_CHECK_STATUS)));
map.put(FIELD_CHECK_BY, StringUtils.toString(checkBy, eiMetadata.getMeta(FIELD_CHECK_BY)));
map.put(FIELD_CHECK_NAME, StringUtils.toString(checkName, eiMetadata.getMeta(FIELD_CHECK_NAME)));
map.put(FIELD_CHECK_TIME, StringUtils.toString(checkTime, eiMetadata.getMeta(FIELD_CHECK_TIME)));
return map;
}
}
package com.baosight.hggp.hg.cw.service;
import cn.hutool.core.util.StrUtil;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cw.domain.HGCW001;
import com.baosight.hggp.hg.cw.domain.HGCW012;
import com.baosight.hggp.hg.cw.domain.HGCW055;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.kc.domain.*;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @className: com.baosight.hggp.hg.cw.service.ServiceHGCW055
* @description: 成本核算
* @author: lwj
* @create: 2024-06-26 15:52
*/
public class ServiceHGCW055 extends ServiceBase {
/**
* 画面初始化.
*/
@OperationLogAnnotation(operModul = "成本核算",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
} catch (Exception 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, HGCW055.QUERY, new HGCW055());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 数据检查操作
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "成本核算",operType = "查询",operDesc = "数据检查")
public EiInfo checkData(EiInfo inInfo){
try {
this.checkAllData(inInfo);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 成本核算操作
* @param inInfo
* @return
*/
public EiInfo calculate(EiInfo inInfo){
try {
this.checkAllData(inInfo);
if ("100".equals(inInfo.getString("resultCode"))) {
// 检查返回码
String resultCode = "200";
String resultDesc = "成本核算完成";
String id = inInfo.getString("id");
AssertUtils.isNull(id, "成本核算ID不能为空!");
List<HGCW055> results = dao.query(HGCW055.QUERY, new HashMap<String, Object>() {
{
put("id", id);
}
});
if (results.size() > 0) {
HGCW055 hgcw055 = results.get(0);
// 成本核算步骤:
// 1,入库成本核算;
// 2,出库成本核算;
// 3,收发存汇总数据同步接口;
// 4,产副品制造成本核算接口;
// 5.费用归集完成
// 6.费用分摊完成
}
inInfo.set("resultCode",resultCode);
inInfo.set("resultDesc",resultDesc);
}
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
private void checkAllData(EiInfo inInfo) {
// 检查返回码
String resultCode = "100";
String resultDesc = "数据检查完成";
String id = inInfo.getString("id");
AssertUtils.isNull(id, "成本核算ID不能为空!");
List<HGCW055> results = dao.query(HGCW055.QUERY,new HashMap<String,Object>(){
{put("id",id);}
});
if (results.size() > 0) {
HGCW055 hgcw055 = results.get(0);
Map paramMap = new HashMap();
paramMap.put("billDate", StrUtil.concat(true,hgcw055.getYear(),hgcw055.getMonth()));
paramMap.put("submitStatus", 0);
paramMap.put("accountPeriodStatus", 1);
paramMap.put("companyCode", hgcw055.getCompanyCode());
// 点击数据检查按钮弹出窗口,点击执行进行数据检查,检查顺序和显示内容如下:
// 1.业务单据日期为当月会计期的日期范围采购入库单提交或未提交;HGKC001 采购入库
List<HGKC001> hgkc001List = HGKCTools.HgKc001.checkList(paramMap);
if (hgkc001List.size() > 0) {
resultCode = "101";
resultDesc = "采购入库单未提交";
}
// 2.业务单据日期为当月会计期的日期范围采购发票提交或未提交;HGCW012 采购发票
List<HGCW012> hgcw012List = HGCWTools.HgCw012.checkList(paramMap);
if (hgcw012List.size() > 0) {
resultCode = "102";
resultDesc = "采购发票未审核";
}
// 3.业务单据日期为当月会计期的日期范围生产领用单提交或未提交;HGKC008 生产领料单
List<HGKC008> hgkc008List = HGKCTools.HgKc008.checkList(paramMap);
if (hgkc008List.size() > 0) {
resultCode = "103";
resultDesc = "生产领料单未提交";
}
// 4.业务单据日期为当月会计期的日期范围生产入库单提交或未提交;HGKC003 生产入库单
List<HGKC003> hgkc003List = HGKCTools.HgKc003.checkList(paramMap);
if (hgkc003List.size() > 0) {
resultCode = "104";
resultDesc = "生产入库单未提交";
}
// 5.业务单据日期为当月会计期的日期范围销售出库单提交或未提交;HGKC004 销售出库单
List<HGKC004> hgkc004List = HGKCTools.HgKc004.checkList(paramMap);
if (hgkc004List.size() > 0) {
resultCode = "105";
resultDesc = "销售出库单未提交";
}
// 6.业务单据日期为当月会计期的日期范围其他入库单提交或未提交;HGKC006 其他入库单
List<HGKC006> hgkc006List = HGKCTools.HgKc006.checkList(paramMap);
if (hgkc006List.size() > 0) {
resultCode = "106";
resultDesc = "其他入库单未提交";
}
// 7.业务单据日期为当月会计期的日期范围其他出库单提交或未提交;HGKC007 其他出库单
List<HGKC007> hgkc007List = HGKCTools.HgKc007.checkList(paramMap);
if (hgkc007List.size() > 0) {
resultCode = "107";
resultDesc = "其他出库单未提交";
}
// 8.当前公司的当月会计期是否为关账状态
List<HGCW001> hgcw001List = HGCWTools.HgCw001.checkList(paramMap);
if (hgcw001List.size() > 0) {
resultCode = "108";
resultDesc = "账期为开帐状态";
}
}
inInfo.set("resultCode",resultCode);
inInfo.set("resultDesc",resultDesc);
}
}
......@@ -229,6 +229,46 @@
ID = #id#
</update>
<select id="queryCheckList" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cw.domain.HGCW001">
SELECT
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
ACCOUNT_YEAR as "accountYear", <!-- 会计年度 -->
ACCOUNT_PERIOD as "accountPeriod", <!-- 会计期 -->
ACCOUNT_PERIOD_STATUS as "accountPeriodStatus", <!-- 会计期状态0:关账1:开账 -->
ACCOUNT_PERIOD_DATE_START as "accountPeriodDateStart", <!-- 账期开始日期 -->
ACCOUNT_PERIOD_DATE_END as "accountPeriodDateEnd", <!-- 账期结束日期 -->
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}.HGCW001 WHERE 1=1
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="billDate">
ACCOUNT_PERIOD = #billDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountPeriodStatus">
ACCOUNT_PERIOD_STATUS = #accountPeriodStatus#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="getMaxAccountPeriod" resultClass="java.util.HashMap">
select
ACCOUNT_CODE as "accountCode",
......
......@@ -325,4 +325,25 @@
ID = #id#
</update>
<select id="queryCheckList" resultClass="com.baosight.hggp.hg.cw.domain.HGCW012">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGCW012
WHERE 1 = 1
<isNotEmpty prepend=" AND " property="billDate">
LEFT(RECEIVE_DATE,6) = #billDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="submitStatus">
REVIEW_STATUS = #submitStatus#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID desc
</isEmpty>
</dynamic>
</select>
</sqlMap>
......@@ -69,18 +69,18 @@
A.YEAR AS "year",
A.MONTH as "month",
A.ID AS "id",
SUM(B.AMOUNT) AS "amount"
B.AMOUNT AS "amount"
from ${hggpSchema}.HGCW051 a,
${hggpSchema}.HGCW052 b
WHERE A.ID = B.HGCW051_ID
from ${hggpSchema}.HGCW051 a
left JOIN (SELECT HGCW051_ID, SUM(AMOUNT) as AMOUNT FROM ${hggpSchema}.HGCW052 GROUP BY HGCW051_ID) b on A.ID = B.HGCW051_ID
WHERE 1 = 1
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
a.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="month">
MONTH = #month#
a.MONTH = #month#
</isNotEmpty>
GROUP BY A.COMPANY_CODE,A.COMPANY_NAME,A.YEAR, A.MONTH,A.ID
</select>
......
<?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-06-26 15:48:30
Version : 1.0
schema : hggp
tableName : HGCW055
ID BIGINT NOT NULL primarykey,
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,
DELETE_FLAG TINYINT,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
YEAR VARCHAR NOT NULL,
MONTH VARCHAR NOT NULL,
CHECK_STATUS VARCHAR,
CHECK_BY VARCHAR,
CHECK_NAME VARCHAR,
CHECK_TIME VARCHAR
-->
<sqlMap namespace="HGCW055">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</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="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="year">
YEAR = #year#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="month">
MONTH = #month#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkStatus">
CHECK_STATUS = #checkStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkBy">
CHECK_BY = #checkBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkName">
CHECK_NAME = #checkName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkTime">
CHECK_TIME = #checkTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="yearMonth">
CONCAT(YEAR, MONTH) = #yearMonth#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cw.domain.HGCW055">
SELECT
ID as "id",
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
YEAR as "year", <!-- 年份 -->
MONTH as "month", <!-- 月份 -->
CHECK_STATUS as "checkStatus", <!-- 核算状态 -->
CHECK_BY as "checkBy", <!-- 核算人 -->
CHECK_NAME as "checkName", <!-- 核算人名称 -->
CHECK_TIME as "checkTime" <!-- 核算时间 -->
FROM ${hggpSchema}.HGCW055 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}.HGCW055 WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</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="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="year">
YEAR = #year#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="month">
MONTH = #month#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkStatus">
CHECK_STATUS = #checkStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkBy">
CHECK_BY = #checkBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkName">
CHECK_NAME = #checkName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkTime">
CHECK_TIME = #checkTime#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGCW055 (
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
DELETE_FLAG, <!-- 0-未删除,1-已删除 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
YEAR, <!-- 年份 -->
MONTH, <!-- 月份 -->
CHECK_STATUS, <!-- 核算状态 -->
CHECK_BY, <!-- 核算人 -->
CHECK_NAME, <!-- 核算人名称 -->
CHECK_TIME <!-- 核算时间 -->
)
VALUES (#createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #year#, #month#, #checkStatus#, #checkBy#, #checkName#, #checkTime#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGCW055 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGCW055
SET
CREATED_BY = #createdBy#, <!-- 记录创建者 -->
CREATED_NAME = #createdName#, <!-- 记录创建名称 -->
CREATED_TIME = #createdTime#, <!-- 记录创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 0-未删除,1-已删除 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
YEAR = #year#, <!-- 年份 -->
MONTH = #month#, <!-- 月份 -->
CHECK_STATUS = #checkStatus#, <!-- 核算状态 -->
CHECK_BY = #checkBy#, <!-- 核算人 -->
CHECK_NAME = #checkName#, <!-- 核算人名称 -->
CHECK_TIME = #checkTime# <!-- 核算时间 -->
WHERE
ID = #id#
</update>
</sqlMap>
......@@ -26,6 +26,10 @@ import java.util.stream.Collectors;
public class HGCWTools {
public static class HgCw001 {
public static List<HGCW001> checkList(Map paramMap) {
AssertUtils.isEmpty(paramMap, "数据检查参数不能为空");
return DaoBase.getInstance().query("HGCW001.queryCheckList", paramMap);
}
public static Map getMaxAccountPeriod(String companyCode) {
Map<String, Object> params = new HashMap<>();
......@@ -450,6 +454,11 @@ public class HGCWTools {
DaoUtils.update("HGCW012.updateDeductionAmount", HGCW012);
}
public static List<HGCW012> checkList(Map paramMap) {
AssertUtils.isEmpty(paramMap, "数据检查参数不能为空");
return DaoBase.getInstance().query("HGCW012.queryCheckList", paramMap);
}
}
/**
......@@ -679,4 +688,20 @@ public class HGCWTools {
}
}
public static class HgCw055{
public static void save(List<Map> rows, UserVO userVO) {
// AssertUtils.isNull(contractNumber, "合同号不能为空!");
rows.forEach(row -> {
HGCW055 hgcw055 = new HGCW055();
hgcw055.fromMap(row);
hgcw055.setCompanyCode(userVO.getUsercode());
hgcw055.setCompanyName(userVO.getUsername());
DaoUtils.insert(HGCW055.INSERT, hgcw055);
});
}
}
}
......@@ -294,4 +294,27 @@
<include refid="orderBy"/>
</select>
<select id="queryCheckList" resultClass="com.baosight.hggp.hg.kc.domain.HGKC001">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGKC001
WHERE DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="billDate">
LEFT(DEPOSIT_DATE,6) = #billDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="submitStatus">
SUBMIT_STATUS = #submitStatus#
</isNotEmpty>
<include refid="orderBy"/>
</select>
</sqlMap>
......@@ -382,4 +382,74 @@
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, PROJ_CODE, PART_CODE
</select>
<select id="queryCheckList" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.kc.domain.HGKC003">
SELECT
ID as "id",
QUALITY_ID as "qualityId",<!-- 质检单明细ID -->
RECTIFICATION_ID as "rectificationId",<!-- 整改通知单ID -->
PART_SPEC_ID as "partSpecId",<!-- 零件规格ID -->
PART_COEFFICIENT as "partCoefficient",<!-- 零件系数 -->
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
DEPOSIT_DATE as "depositDate", <!-- 入库日期 -->
DEPOSIT_NO as "depositNo", <!-- 入库单号 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
INV_QTY as "invQty", <!-- 数量 -->
INV_UNIT_WEIGHT as "invUnitWeight", <!-- 单重 -->
INV_WEIGHT as "invWeight", <!-- 重量 -->
DEPOSIT_NO_OLD as "depositNoOld", <!-- 入库单号(旧) -->
REMARK as "remark", <!-- 备注 -->
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
PROD_ORDER_NO as "prodOrderNo", <!-- 生产订单号 -->
PROD_TASK_NO as "prodTaskNo", <!-- 生产任务号 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PRDT_TYPE as "prdtType", <!-- 产品类型 -->
PRDT_CODE as "prdtCode", <!-- 产品编码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
PRDT_LENGTH as "prdtLength", <!-- 产品-长 -->
PRDT_WIDTH as "prdtWidth", <!-- 产品-宽 -->
PRDT_THICK as "prdtThick", <!-- 产品-厚 -->
PRDT_SPEC as "prdtSpec", <!-- 产品规格 -->
PART_TYPE as "partType", <!-- 零件类型 -->
PART_CODE as "partCode", <!-- 零件编码 -->
PART_NAME as "partName", <!-- 零件名称 -->
PART_LENGTH as "partLength", <!-- 零件-长 -->
PART_WIDTH as "partWidth", <!-- 零件-宽 -->
PART_THICK as "partThick", <!-- 零件-厚 -->
PART_SPEC as "partSpec", <!-- 零件规格 -->
PRICE as "price", <!-- 单价 -->
AMOUNT as "amount", <!-- 金额 -->
STORAGE_TYPE as "storageType", <!-- 入库类型:1:入库 2:退回 -->
IS_RETURN as "isReturn", <!-- 是否退回:0:否 1:是 -->
SUBMIT_STATUS as "submitStatus" <!-- 提交状态 -->
FROM ${hggpSchema}.HGKC003 WHERE 1=1 AND DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="billDate">
LEFT(DEPOSIT_DATE,6) = #billDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="submitStatus">
SUBMIT_STATUS = #submitStatus#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID desc
</isEmpty>
</dynamic>
</select>
</sqlMap>
......@@ -290,4 +290,24 @@
</dynamic>
</select>
<select id="queryCheckList" parameterClass="HashMap" resultClass="HGKC004">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGKC004 WHERE 1=1
<isNotEmpty prepend=" AND " property="billDate">
LEFT(RECEIPT_DATE,6) = #billDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="submitStatus">
STATUS = #submitStatus#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
RECEIPT_DATE DESC,CREATED_TIME DESC
</isEmpty>
</dynamic>
</select>
</sqlMap>
......@@ -534,4 +534,64 @@
</select>
<select id="queryCheckList" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.kc.domain.HGKC006">
SELECT
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
OTHER_ENTER_DATE as "otherEnterDate", <!-- 其他入库日期 -->
OTHER_ENTER_NO as "otherEnterNo", <!-- 其他入库单号 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
OTHER_ENTER_NO_OLD as "otherEnterNoOld", <!-- 其他入库单号(旧) -->
REMARK as "remark", <!-- 备注 -->
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
PROD_ORDER_NO as "prodOrderNo", <!-- 生产订单号 -->
PROD_TASK_NO as "prodTaskNo", <!-- 生产任务号 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PRDT_TYPE as "prdtType", <!-- 产品类型 -->
PRDT_CODE as "prdtCode", <!-- 产品编码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
PRDT_LENGTH as "prdtLength", <!-- 产品-长 -->
PRDT_WIDTH as "prdtWidth", <!-- 产品-宽 -->
PRDT_THICK as "prdtThick", <!-- 产品-厚 -->
PRDT_SPEC as "prdtSpec", <!-- 产品规格 -->
PART_TYPE as "partType", <!-- 零件类型 -->
PART_CODE as "partCode", <!-- 零件编码 -->
PART_NAME as "partName", <!-- 零件名称 -->
PART_LENGTH as "partLength", <!-- 零件-长 -->
PART_WIDTH as "partWidth", <!-- 零件-宽 -->
PART_THICK as "partThick", <!-- 零件-厚 -->
PART_SPEC as "partSpec", <!-- 零件规格 -->
SUBMIT_STATUS as "submitStatus", <!-- 提交状态 -->
SOURCE as "source" <!-- 数据来源 -->
FROM ${hggpSchema}.HGKC006 WHERE 1=1 and DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="billDate">
LEFT(OTHER_ENTER_DATE,6) = #billDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="submitStatus">
SUBMIT_STATUS = #submitStatus#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
</sqlMap>
......@@ -532,4 +532,65 @@
</select>
<select id="queryCheckList" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.kc.domain.HGKC007">
SELECT
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
OTHER_OUT_DATE as "otherOutDate", <!-- 其他出库日期 -->
OTHER_OUT_NO as "otherOutNo", <!-- 其他出库单号 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
OTHER_OUT_NO_OLD as "otherOutNoOld", <!-- 其他出库单号(旧) -->
REMARK as "remark", <!-- 备注 -->
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
PROD_ORDER_NO as "prodOrderNo", <!-- 生产订单号 -->
PROD_TASK_NO as "prodTaskNo", <!-- 生产任务号 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PRDT_TYPE as "prdtType", <!-- 产品类型 -->
PRDT_CODE as "prdtCode", <!-- 产品编码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
PRDT_LENGTH as "prdtLength", <!-- 产品-长 -->
PRDT_WIDTH as "prdtWidth", <!-- 产品-宽 -->
PRDT_THICK as "prdtThick", <!-- 产品-厚 -->
PRDT_SPEC as "prdtSpec", <!-- 产品规格 -->
PART_TYPE as "partType", <!-- 零件类型 -->
PART_CODE as "partCode", <!-- 零件编码 -->
PART_NAME as "partName", <!-- 零件名称 -->
PART_LENGTH as "partLength", <!-- 零件-长 -->
PART_WIDTH as "partWidth", <!-- 零件-宽 -->
PART_THICK as "partThick", <!-- 零件-厚 -->
PART_SPEC as "partSpec", <!-- 零件规格 -->
SUBMIT_STATUS as "submitStatus", <!-- 提交状态 -->
SOURCE as "source" <!-- 数据来源 -->
FROM ${hggpSchema}.HGKC007 WHERE 1=1 and DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="billDate">
LEFT(OTHER_OUT_DATE,6) = #billDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="submitStatus">
SUBMIT_STATUS = #submitStatus#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
</sqlMap>
......@@ -188,4 +188,44 @@
WHERE
ID = #id#
</update>
<select id="queryCheckList" resultClass="com.baosight.hggp.hg.kc.domain.HGKC008">
SELECT
ID as "id", <!-- 主键id -->
ACCOUNT_CODE as "accountCode", <!-- 账套 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
RECEIPT_DATE as "receiptDate", <!-- 单据日期 -->
APPLY_CODE as "applyCode", <!-- 申请单号 -->
WH_CODE as "whCode", <!-- 仓库编号 -->
WH_NAME as "whName", <!-- 仓库名称 -->
STATUS as "status", <!-- 状态 0未提交,1已提交 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
RECEIVE_TYPE as "receiveType" <!-- 领料单类型 0:正常,1:退库 -->
FROM ${hggpSchema}.HGKC008 WHERE 1=1
<isNotEmpty prepend=" AND " property="billDate">
LEFT(RECEIPT_DATE,6) = #billDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="submitStatus">
STATUS = #submitStatus#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID desc
</isEmpty>
</dynamic>
</select>
</sqlMap>
......@@ -13,6 +13,8 @@ import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.domain.*;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sc.domain.HGSC008;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.zl.domain.HGZL002;
import com.baosight.hggp.hg.zl.domain.HGZL004;
import com.baosight.hggp.util.AssertUtils;
......@@ -127,6 +129,16 @@ public class HGKCTools {
// HGCGTools.HgCg003.updateStatus(receiveNo, HGConstant.CgReceiveStatus.S_5);
}
/**
* 查询
* 成本核算数据检查
* @param paramMap
* @return
*/
public static List<HGKC001> checkList(Map paramMap) {
AssertUtils.isEmpty(paramMap, "入库时间不能为空");
return DaoBase.getInstance().query("HGKC001.queryCheckList", paramMap);
}
}
/**
......@@ -278,8 +290,10 @@ public class HGKCTools {
private static void setHgkc003Data(List<HGZL002> hgzl002List, List<HGKC003> hgkc003List, Integer code, List<HGZL004> hgzl004List) {
List<String> inventCodes = hgzl002List.stream().map(HGZL002::getProductCode).collect(Collectors.toList());
List<HGPZ005> hgpz005List = HGPZTools.HgPz005.listByInventCodes(inventCodes);
hgzl002List.forEach(o->{
HGPZ005 hgpz005 = hgpz005List.stream().filter(h->h.getInventCode().equals(o.getProductCode())).findAny().orElse(null);
HGSC008 hgsc008 = HGSCTools.THGSC008.getById(o.getWorkId());
if(Objects.nonNull(hgpz005)){
HGKC003 hgkc003 = new HGKC003();
hgkc003.setDepositNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PROD_DEPOSIT_NO));
......@@ -302,11 +316,11 @@ public class HGKCTools {
return;
}
//单重
BigDecimal invUnitWeight = HGPZTools.HgPz005.calcUnitWeight(hgpz005);
hgkc003.setInvUnitWeight(invUnitWeight);
// BigDecimal invUnitWeight = HGPZTools.HgPz005.calcUnitWeight(hgpz005);
hgkc003.setInvUnitWeight(hgsc008.getSingleWeight());
//总重
BigDecimal invWeight = invUnitWeight.multiply(hgkc003.getInvQty());
hgkc003.setInvWeight(invWeight);
// BigDecimal invWeight = invUnitWeight.multiply(hgkc003.getInvQty());
hgkc003.setInvWeight(hgsc008.getTotalWeight());
hgkc003.setProjCode(o.getProjCode());
hgkc003.setProjName(o.getProjName());
hgkc003.setPartCode(o.getProductCode());
......@@ -387,6 +401,17 @@ public class HGKCTools {
List<HGKC003> results = list(depositNos);
return results.stream().collect(Collectors.toMap(HGKC003::getDepositNo, item -> item));
}
/**
* 查询
* 成本核算数据检查
* @param paramMap
* @return
*/
public static List<HGKC003> checkList(Map paramMap) {
AssertUtils.isEmpty(paramMap, "时间不能为空");
return DaoBase.getInstance().query("HGKC003.queryCheckList", paramMap);
}
}
/**
......@@ -527,6 +552,17 @@ public class HGKCTools {
queryMap.put("ids", ids);
DaoUtils.update(HGSqlConstant.HGKC004.UPDATE_PRINT, queryMap);
}
/**
* 查询
* 成本核算数据检查
* @param paramMap
* @return
*/
public static List<HGKC004> checkList(Map paramMap) {
AssertUtils.isEmpty(paramMap, "时间不能为空");
return DaoBase.getInstance().query("HGKC004.queryCheckList", paramMap);
}
}
/**
......@@ -653,6 +689,17 @@ public class HGKCTools {
HGKC006 result = (HGKC006) DaoBase.getInstance().get(HGKC006.QUERY, HGKC006.FIELD_ID, id);
return result;
}
/**
* 查询
* 成本核算数据检查
* @param paramMap
* @return
*/
public static List<HGKC006> checkList(Map paramMap) {
AssertUtils.isEmpty(paramMap, "时间不能为空");
return DaoBase.getInstance().query("HGKC006.queryCheckList", paramMap);
}
}
public static class HgKc006A {
......@@ -671,6 +718,17 @@ public class HGKCTools {
HGKC007 result = (HGKC007) DaoBase.getInstance().get(HGKC007.QUERY, HGKC007.FIELD_ID, id);
return result;
}
/**
* 查询
* 成本核算数据检查
* @param paramMap
* @return
*/
public static List<HGKC007> checkList(Map paramMap) {
AssertUtils.isEmpty(paramMap, "时间不能为空");
return DaoBase.getInstance().query("HGKC007.queryCheckList", paramMap);
}
}
public static class HgKc007A {
......@@ -680,7 +738,6 @@ public class HGKCTools {
List<HGKC007A> results = DaoBase.getInstance().query(HGKC007A.QUERY, paramMap);
return results;
}
}
......@@ -691,6 +748,17 @@ public class HGKCTools {
return result;
}
/**
* 查询
* 成本核算数据检查
* @param paramMap
* @return
*/
public static List<HGKC008> checkList(Map paramMap) {
AssertUtils.isEmpty(paramMap, "时间不能为空");
return DaoBase.getInstance().query("HGKC008.queryCheckList", paramMap);
}
}
public static class HgKc008A {
......
......@@ -5,6 +5,7 @@ import com.baosight.hggp.common.AssignStatusEnum;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cg.domain.HGCG001;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
......@@ -31,7 +32,7 @@ import java.util.stream.Collectors;
* @date:2024/1/15,11:20
*/
public class ServiceHGSC009A extends ServiceBase {
/**
* 画面初始化
*
......@@ -50,7 +51,7 @@ public class ServiceHGSC009A extends ServiceBase {
}
return inInfo;
}
/**
* 查询数据列表
*
......@@ -67,7 +68,7 @@ public class ServiceHGSC009A extends ServiceBase {
}
return inInfo;
}
/**
* 保存操作.
*
......@@ -107,7 +108,7 @@ public class ServiceHGSC009A extends ServiceBase {
}
return inInfo;
}
/**
* 校验保存的数据
*
......@@ -121,7 +122,7 @@ public class ServiceHGSC009A extends ServiceBase {
//AssertUtils.isNull(hgsc009A.s(), "是否启用不能为空");
}
}
/**
* 新增
*
......@@ -133,7 +134,7 @@ public class ServiceHGSC009A extends ServiceBase {
DaoUtils.insert(HGSC009A.INSERT, hgsc009A);
}
/**
* 修改数据
*
......@@ -142,9 +143,9 @@ public class ServiceHGSC009A extends ServiceBase {
private void modify(HGSC009A hgsc009A) {
DaoUtils.update(HGSC009A.UPDATE, hgsc009A);
}
/**
* 修改操作
*
......@@ -170,7 +171,7 @@ public class ServiceHGSC009A extends ServiceBase {
}
return inInfo;
}
/**
* 删除操作
*
......@@ -219,11 +220,14 @@ public class ServiceHGSC009A extends ServiceBase {
inventUnitMap = hgpz005List.stream().collect(Collectors.toMap(HGPZ005::getInventCode,HGPZ005::getUnit,(v1,v2)->v1));
}
}
// 数据校验
this.checkInsertcgData(hgsc009AList);
for (HGSC009A hgsc009 : hgsc009AList) {
// 写入子表数据
HGCG001 hgcg001 = new HGCG001();
BeanUtils.copyProperties(hgsc009,hgcg001);
hgcg001.setMaterialPlanId(hgsc009.getId());
hgcg001.setCompanyCode(hgsc009.getCompanyCode());
hgcg001.setCompanyName(hgsc009.getCompanyName());
hgcg001.setInventCode(hgsc009.getInventCode());
......@@ -250,5 +254,14 @@ public class ServiceHGSC009A extends ServiceBase {
}
return inInfo;
}
private void checkInsertcgData(List<HGSC009A> hgsc009AList) {
List<Long> materialPlanIds = hgsc009AList.stream().map(HGSC009A::getId).collect(Collectors.toList());
List<HGCG001> hgcg001List = HGCGTools.HgCg001.listByMaterialPlanIds(materialPlanIds);
hgsc009AList.forEach(o->{
HGCG001 hgcg001 = hgcg001List.stream().filter(c -> c.getMaterialPlanId().intValue() == o.getId()).findAny().orElse(null);
AssertUtils.isTrue(Objects.nonNull(hgcg001), String.format("材料计划[%s]已生成采购计划", o.getPlanMaterialCode()));
});
}
}
$(function() {
// 查询
$("#QUERY").on("click", function () {
query();
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
columns: [
{
field: "button",
title: "操作",
template: '<input value="数据检查" class="i-btn-sm" type="button" align="center" onclick="openButtonCheck(\'#:id#\')" >' +
'<input value="成本核算" class="i-btn-sm" type="button" align="center" onclick="openButtonCalculate(\'#:id#\')" >'
,
width: 100
}
],
}
});
$(window).load(function () {
// 查
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 数据检查
* @param id
*/
let openButtonCheck = function (id) {
let inEiInfo = new EiInfo();
inEiInfo.set("id", id);
JSUtils.confirm("确定进行检查数据吗? ", {
ok: function () {
EiCommunicator.send('HGCW055', 'checkData', inEiInfo, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
let resultCode = ei.extAttr.resultCode;
let resultDesc = ei.extAttr.resultDesc;
message(resultDesc);
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
}
);
}
});
}
/**
* 成本核算
* @param id
*/
let openButtonCalculate = function (id) {
let inEiInfo = new EiInfo();
inEiInfo.set("id", id);
JSUtils.confirm("确定进行成本核算操作吗? ", {
ok: function () {
EiCommunicator.send('HGCW055', 'calculate', inEiInfo, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
let resultCode = ei.extAttr.resultCode;
let resultDesc = ei.extAttr.resultDesc;
message(resultDesc);
} 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:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFDatePicker cname="核算年月" blockId="inqu_status" ename="yearMonth" row="0" colWidth="3"
format="yyyy-MM" parseFormats="['yyyyMM']" start="year" depth="year"/>
<EF:EFSelect cname="核算状态" ename="inqu_status-0-checkStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.checkStatus"/>
</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="button" cname="操作" width="120" enable="false" align="center"/>
<EF:EFColumn ename="companyName" cname="公司名称" width="150" align="center" required="true"/>
<EF:EFColumn ename="year" cname="核算年度" width="100" align="center" required="true"/>
<EF:EFColumn ename="month" cname="核算月份" width="100" align="center" required="true"/>
<EF:EFComboColumn ename="checkStatus" cname="核算状态" width="100" align="center" required="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" defaultValue="0">
<EF:EFCodeOption codeName="hggp.cw.checkStatus"/>
</EF:EFComboColumn>
<EF:EFColumn ename="checkName" cname="核算人" width="100" align="center"
required="true"/>
<EF:EFColumn ename="checkBy" cname="核算人" width="100" align="center"
required="true" hidden="true"/>
<EF:EFColumn ename="checkTime" cname="核算时间" enable="false" width="120" editType="datetime"
parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"
dateFormat="yyyy-MM-dd HH:mm:ss" displayType="datetime" />
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HG/CW/HGCW055.js"></script>
\ No newline at end of file
......@@ -49,7 +49,7 @@
<EF:EFColumn ename="companyName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="otherOutDate" cname="单据日期" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="otherOutNo" cname="其他库单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="otherOutNo" cname="其他库单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true" />
<EF:EFColumn ename="whName" cname="仓库名称" hidden="true"/>
<EF:EFComboColumn cname="状态" ename="submitStatus" width="90" align="center" enable="false" >
......
......@@ -107,7 +107,6 @@ $(function () {
resultGrid.setCellValue(e.items[0],"companyName",companyCodeBox[i]['companyName']);
}
}
loadChange(grid, e, "projCode");
}
// 判断父级节点是否发生变化
if (e.field == "projCode") {
......@@ -136,9 +135,6 @@ $(function () {
}
let query = function () {
resultGrid.dataSource.page(1);
}
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
......@@ -174,6 +170,9 @@ $(function () {
});
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 显示附件详情
*
......@@ -237,8 +236,12 @@ function INSERTCG() {
ok: function () {
EiCommunicator.send('HGSC009A', 'insertcg', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
query();
if (response.status == 1){
NotificationUtil(response.msg);
query();
}else {
NotificationUtil(response.msg, "error");
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
......
......@@ -29,13 +29,13 @@
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="150" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="200" required="true"
columnTemplate="#=companyName#" itemTemplate="#=companyName#"
textField="companyName" valueField="companyCode"
maxLength="16" readonly="false" width="100" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" width="120" enable="false" readonly="true" align="center" hidden="true" />
<EF:EFColumn ename="companyName" cname="公司名称" width="120" enable="false" readonly="true" align="center"/>
<%-- <EF:EFComboColumn ename="projCode" cname="项目编码"--%>
<%-- columnTemplate="#=textField#" itemTemplate="#=textField#"--%>
<%-- textField="textField" valueField="valueField"--%>
......
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