Commit 66df8c73 by wuwenlong

Merge remote-tracking branch 'origin/dev' into dev

parents 336d0c9a aedb2b81
...@@ -16,7 +16,7 @@ import com.baosight.iplat4j.core.util.StringUtils; ...@@ -16,7 +16,7 @@ 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-11 16:45:56 create * @history 2024-05-11 17:25:48 create
*/ */
public class HGCG001 extends DaoEPBase { public class HGCG001 extends DaoEPBase {
...@@ -47,8 +47,10 @@ public class HGCG001 extends DaoEPBase { ...@@ -47,8 +47,10 @@ public class HGCG001 extends DaoEPBase {
public static final String FIELD_WIDTH = "width"; /* 宽度*/ public static final String FIELD_WIDTH = "width"; /* 宽度*/
public static final String FIELD_THICK = "thick"; /* 厚度*/ public static final String FIELD_THICK = "thick"; /* 厚度*/
public static final String FIELD_PLAN_QTY = "planQty"; /* 计划数量*/ public static final String FIELD_PLAN_QTY = "planQty"; /* 计划数量*/
public static final String FIELD_PLAN_UNIT_WEIGHT = "planUnitWeight"; /* 计划单重*/
public static final String FIELD_PLAN_WEIGHT = "planWeight"; /* 计划重量*/ public static final String FIELD_PLAN_WEIGHT = "planWeight"; /* 计划重量*/
public static final String FIELD_PUR_QTY = "purQty"; /* 采购数量*/ public static final String FIELD_PUR_QTY = "purQty"; /* 采购数量*/
public static final String FIELD_PUR_UNIT_WEIGHT = "purUnitWeight"; /* 采购单重*/
public static final String FIELD_PUR_WEIGHT = "purWeight"; /* 采购重量*/ public static final String FIELD_PUR_WEIGHT = "purWeight"; /* 采购重量*/
public static final String FIELD_STATUS = "status"; /* 状态:0-未审批,1-审核通过,2-审核未通过*/ public static final String FIELD_STATUS = "status"; /* 状态:0-未审批,1-审核通过,2-审核未通过*/
public static final String FIELD_AUDIT_TIME = "auditTime"; /* 审核时间*/ public static final String FIELD_AUDIT_TIME = "auditTime"; /* 审核时间*/
...@@ -81,8 +83,10 @@ public class HGCG001 extends DaoEPBase { ...@@ -81,8 +83,10 @@ public class HGCG001 extends DaoEPBase {
public static final String COL_WIDTH = "WIDTH"; /* 宽度*/ public static final String COL_WIDTH = "WIDTH"; /* 宽度*/
public static final String COL_THICK = "THICK"; /* 厚度*/ public static final String COL_THICK = "THICK"; /* 厚度*/
public static final String COL_PLAN_QTY = "PLAN_QTY"; /* 计划数量*/ public static final String COL_PLAN_QTY = "PLAN_QTY"; /* 计划数量*/
public static final String COL_PLAN_UNIT_WEIGHT = "PLAN_UNIT_WEIGHT"; /* 计划单重*/
public static final String COL_PLAN_WEIGHT = "PLAN_WEIGHT"; /* 计划重量*/ public static final String COL_PLAN_WEIGHT = "PLAN_WEIGHT"; /* 计划重量*/
public static final String COL_PUR_QTY = "PUR_QTY"; /* 采购数量*/ public static final String COL_PUR_QTY = "PUR_QTY"; /* 采购数量*/
public static final String COL_PUR_UNIT_WEIGHT = "PUR_UNIT_WEIGHT"; /* 采购单重*/
public static final String COL_PUR_WEIGHT = "PUR_WEIGHT"; /* 采购重量*/ public static final String COL_PUR_WEIGHT = "PUR_WEIGHT"; /* 采购重量*/
public static final String COL_STATUS = "STATUS"; /* 状态:0-未审批,1-审核通过,2-审核未通过*/ public static final String COL_STATUS = "STATUS"; /* 状态:0-未审批,1-审核通过,2-审核未通过*/
public static final String COL_AUDIT_TIME = "AUDIT_TIME"; /* 审核时间*/ public static final String COL_AUDIT_TIME = "AUDIT_TIME"; /* 审核时间*/
...@@ -121,8 +125,10 @@ public class HGCG001 extends DaoEPBase { ...@@ -121,8 +125,10 @@ public class HGCG001 extends DaoEPBase {
private BigDecimal width = new BigDecimal(0.000); /* 宽度*/ private BigDecimal width = new BigDecimal(0.000); /* 宽度*/
private BigDecimal thick = new BigDecimal(0.000); /* 厚度*/ private BigDecimal thick = new BigDecimal(0.000); /* 厚度*/
private BigDecimal planQty = new BigDecimal(0.000); /* 计划数量*/ private BigDecimal planQty = new BigDecimal(0.000); /* 计划数量*/
private BigDecimal planUnitWeight = new BigDecimal(0.000); /* 计划单重*/
private BigDecimal planWeight = new BigDecimal(0.000); /* 计划重量*/ private BigDecimal planWeight = new BigDecimal(0.000); /* 计划重量*/
private BigDecimal purQty = new BigDecimal(0.000); /* 采购数量*/ private BigDecimal purQty = new BigDecimal(0.000); /* 采购数量*/
private BigDecimal purUnitWeight = new BigDecimal(0.000); /* 采购单重*/
private BigDecimal purWeight = new BigDecimal(0.000); /* 采购重量*/ private BigDecimal purWeight = new BigDecimal(0.000); /* 采购重量*/
private Integer status; /* 状态:0-未审批,1-审核通过,2-审核未通过*/ private Integer status; /* 状态:0-未审批,1-审核通过,2-审核未通过*/
private String auditTime = " "; /* 审核时间*/ private String auditTime = " "; /* 审核时间*/
...@@ -249,6 +255,13 @@ public class HGCG001 extends DaoEPBase { ...@@ -249,6 +255,13 @@ public class HGCG001 extends DaoEPBase {
eiColumn.setDescName("计划数量"); eiColumn.setDescName("计划数量");
eiMetadata.addMeta(eiColumn); 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 = new EiColumn(FIELD_PLAN_WEIGHT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(3);
...@@ -263,6 +276,13 @@ public class HGCG001 extends DaoEPBase { ...@@ -263,6 +276,13 @@ public class HGCG001 extends DaoEPBase {
eiColumn.setDescName("采购数量"); eiColumn.setDescName("采购数量");
eiMetadata.addMeta(eiColumn); 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 = new EiColumn(FIELD_PUR_WEIGHT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(3);
...@@ -701,6 +721,22 @@ public class HGCG001 extends DaoEPBase { ...@@ -701,6 +721,22 @@ public class HGCG001 extends DaoEPBase {
this.planQty = planQty; this.planQty = planQty;
} }
/** /**
* get the planUnitWeight - 计划单重.
* @return the planUnitWeight
*/
public BigDecimal getPlanUnitWeight() {
return this.planUnitWeight;
}
/**
* set the planUnitWeight - 计划单重.
*
* @param planUnitWeight - 计划单重
*/
public void setPlanUnitWeight(BigDecimal planUnitWeight) {
this.planUnitWeight = planUnitWeight;
}
/**
* get the planWeight - 计划重量. * get the planWeight - 计划重量.
* @return the planWeight * @return the planWeight
*/ */
...@@ -733,6 +769,22 @@ public class HGCG001 extends DaoEPBase { ...@@ -733,6 +769,22 @@ public class HGCG001 extends DaoEPBase {
this.purQty = purQty; this.purQty = purQty;
} }
/** /**
* get the purUnitWeight - 采购单重.
* @return the purUnitWeight
*/
public BigDecimal getPurUnitWeight() {
return this.purUnitWeight;
}
/**
* set the purUnitWeight - 采购单重.
*
* @param purUnitWeight - 采购单重
*/
public void setPurUnitWeight(BigDecimal purUnitWeight) {
this.purUnitWeight = purUnitWeight;
}
/**
* get the purWeight - 采购重量. * get the purWeight - 采购重量.
* @return the purWeight * @return the purWeight
*/ */
...@@ -861,8 +913,10 @@ public class HGCG001 extends DaoEPBase { ...@@ -861,8 +913,10 @@ public class HGCG001 extends DaoEPBase {
setWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WIDTH)), width)); setWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WIDTH)), width));
setThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_THICK)), thick)); setThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_THICK)), thick));
setPlanQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PLAN_QTY)), planQty)); setPlanQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PLAN_QTY)), planQty));
setPlanUnitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PLAN_UNIT_WEIGHT)), planUnitWeight));
setPlanWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PLAN_WEIGHT)), planWeight)); setPlanWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PLAN_WEIGHT)), planWeight));
setPurQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PUR_QTY)), purQty)); setPurQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PUR_QTY)), purQty));
setPurUnitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PUR_UNIT_WEIGHT)), purUnitWeight));
setPurWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PUR_WEIGHT)), purWeight)); setPurWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PUR_WEIGHT)), purWeight));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status)); setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setAuditTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUDIT_TIME)), auditTime)); setAuditTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUDIT_TIME)), auditTime));
...@@ -903,8 +957,10 @@ public class HGCG001 extends DaoEPBase { ...@@ -903,8 +957,10 @@ public class HGCG001 extends DaoEPBase {
map.put(FIELD_WIDTH, StringUtils.toString(width, eiMetadata.getMeta(FIELD_WIDTH))); map.put(FIELD_WIDTH, StringUtils.toString(width, eiMetadata.getMeta(FIELD_WIDTH)));
map.put(FIELD_THICK, StringUtils.toString(thick, eiMetadata.getMeta(FIELD_THICK))); map.put(FIELD_THICK, StringUtils.toString(thick, eiMetadata.getMeta(FIELD_THICK)));
map.put(FIELD_PLAN_QTY, StringUtils.toString(planQty, eiMetadata.getMeta(FIELD_PLAN_QTY))); map.put(FIELD_PLAN_QTY, StringUtils.toString(planQty, eiMetadata.getMeta(FIELD_PLAN_QTY)));
map.put(FIELD_PLAN_UNIT_WEIGHT, StringUtils.toString(planUnitWeight, eiMetadata.getMeta(FIELD_PLAN_UNIT_WEIGHT)));
map.put(FIELD_PLAN_WEIGHT, StringUtils.toString(planWeight, eiMetadata.getMeta(FIELD_PLAN_WEIGHT))); map.put(FIELD_PLAN_WEIGHT, StringUtils.toString(planWeight, eiMetadata.getMeta(FIELD_PLAN_WEIGHT)));
map.put(FIELD_PUR_QTY, StringUtils.toString(purQty, eiMetadata.getMeta(FIELD_PUR_QTY))); map.put(FIELD_PUR_QTY, StringUtils.toString(purQty, eiMetadata.getMeta(FIELD_PUR_QTY)));
map.put(FIELD_PUR_UNIT_WEIGHT, StringUtils.toString(purUnitWeight, eiMetadata.getMeta(FIELD_PUR_UNIT_WEIGHT)));
map.put(FIELD_PUR_WEIGHT, StringUtils.toString(purWeight, eiMetadata.getMeta(FIELD_PUR_WEIGHT))); map.put(FIELD_PUR_WEIGHT, StringUtils.toString(purWeight, eiMetadata.getMeta(FIELD_PUR_WEIGHT)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS))); map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
map.put(FIELD_AUDIT_TIME, StringUtils.toString(auditTime, eiMetadata.getMeta(FIELD_AUDIT_TIME))); map.put(FIELD_AUDIT_TIME, StringUtils.toString(auditTime, eiMetadata.getMeta(FIELD_AUDIT_TIME)));
......
...@@ -16,7 +16,7 @@ import com.baosight.iplat4j.core.util.StringUtils; ...@@ -16,7 +16,7 @@ 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-11 16:32:20 create * @history 2024-05-11 17:26:09 create
*/ */
public class HGCG002 extends DaoEPBase { public class HGCG002 extends DaoEPBase {
...@@ -52,8 +52,10 @@ public class HGCG002 extends DaoEPBase { ...@@ -52,8 +52,10 @@ public class HGCG002 extends DaoEPBase {
public static final String FIELD_WIDTH = "width"; /* 宽度*/ public static final String FIELD_WIDTH = "width"; /* 宽度*/
public static final String FIELD_THICK = "thick"; /* 厚度*/ public static final String FIELD_THICK = "thick"; /* 厚度*/
public static final String FIELD_PUR_QTY = "purQty"; /* 采购数量*/ public static final String FIELD_PUR_QTY = "purQty"; /* 采购数量*/
public static final String FIELD_PUR_UNIT_WEIGHT = "purUnitWeight"; /* 采购单重*/
public static final String FIELD_PUR_WEIGHT = "purWeight"; /* 采购重量*/ public static final String FIELD_PUR_WEIGHT = "purWeight"; /* 采购重量*/
public static final String FIELD_RECEIVE_QTY = "receiveQty"; /* 收货数量*/ public static final String FIELD_RECEIVE_QTY = "receiveQty"; /* 收货数量*/
public static final String FIELD_RECEIVE_WEIGHT = "receiveWeight"; /* 收货重量*/
public static final String FIELD_STATUS = "status"; /* 状态:0-未审批,1-审核通过,2-审核未通过*/ public static final String FIELD_STATUS = "status"; /* 状态:0-未审批,1-审核通过,2-审核未通过*/
public static final String FIELD_AUDIT_TIME = "auditTime"; /* 审核时间*/ public static final String FIELD_AUDIT_TIME = "auditTime"; /* 审核时间*/
public static final String FIELD_AUDIT_USER_ID = "auditUserId"; /* 审核人ID*/ public static final String FIELD_AUDIT_USER_ID = "auditUserId"; /* 审核人ID*/
...@@ -90,8 +92,10 @@ public class HGCG002 extends DaoEPBase { ...@@ -90,8 +92,10 @@ public class HGCG002 extends DaoEPBase {
public static final String COL_WIDTH = "WIDTH"; /* 宽度*/ public static final String COL_WIDTH = "WIDTH"; /* 宽度*/
public static final String COL_THICK = "THICK"; /* 厚度*/ public static final String COL_THICK = "THICK"; /* 厚度*/
public static final String COL_PUR_QTY = "PUR_QTY"; /* 采购数量*/ public static final String COL_PUR_QTY = "PUR_QTY"; /* 采购数量*/
public static final String COL_PUR_UNIT_WEIGHT = "PUR_UNIT_WEIGHT"; /* 采购单重*/
public static final String COL_PUR_WEIGHT = "PUR_WEIGHT"; /* 采购重量*/ public static final String COL_PUR_WEIGHT = "PUR_WEIGHT"; /* 采购重量*/
public static final String COL_RECEIVE_QTY = "RECEIVE_QTY"; /* 收货数量*/ public static final String COL_RECEIVE_QTY = "RECEIVE_QTY"; /* 收货数量*/
public static final String COL_RECEIVE_WEIGHT = "RECEIVE_WEIGHT"; /* 收货重量*/
public static final String COL_STATUS = "STATUS"; /* 状态:0-未审批,1-审核通过,2-审核未通过*/ public static final String COL_STATUS = "STATUS"; /* 状态:0-未审批,1-审核通过,2-审核未通过*/
public static final String COL_AUDIT_TIME = "AUDIT_TIME"; /* 审核时间*/ public static final String COL_AUDIT_TIME = "AUDIT_TIME"; /* 审核时间*/
public static final String COL_AUDIT_USER_ID = "AUDIT_USER_ID"; /* 审核人ID*/ public static final String COL_AUDIT_USER_ID = "AUDIT_USER_ID"; /* 审核人ID*/
...@@ -134,8 +138,10 @@ public class HGCG002 extends DaoEPBase { ...@@ -134,8 +138,10 @@ public class HGCG002 extends DaoEPBase {
private BigDecimal width = new BigDecimal(0.000); /* 宽度*/ private BigDecimal width = new BigDecimal(0.000); /* 宽度*/
private BigDecimal thick = new BigDecimal(0.000); /* 厚度*/ private BigDecimal thick = new BigDecimal(0.000); /* 厚度*/
private BigDecimal purQty = new BigDecimal(0.000); /* 采购数量*/ private BigDecimal purQty = new BigDecimal(0.000); /* 采购数量*/
private BigDecimal purUnitWeight = new BigDecimal(0.000); /* 采购单重*/
private BigDecimal purWeight = new BigDecimal(0.000); /* 采购重量*/ private BigDecimal purWeight = new BigDecimal(0.000); /* 采购重量*/
private BigDecimal receiveQty = new BigDecimal(0.000); /* 收货数量*/ private BigDecimal receiveQty = new BigDecimal(0.000); /* 收货数量*/
private BigDecimal receiveWeight = new BigDecimal(0.000); /* 收货重量*/
private Integer status; /* 状态:0-未审批,1-审核通过,2-审核未通过*/ private Integer status; /* 状态:0-未审批,1-审核通过,2-审核未通过*/
private String auditTime = " "; /* 审核时间*/ private String auditTime = " "; /* 审核时间*/
private String auditUserId = " "; /* 审核人ID*/ private String auditUserId = " "; /* 审核人ID*/
...@@ -281,6 +287,13 @@ public class HGCG002 extends DaoEPBase { ...@@ -281,6 +287,13 @@ public class HGCG002 extends DaoEPBase {
eiColumn.setDescName("采购数量"); eiColumn.setDescName("采购数量");
eiMetadata.addMeta(eiColumn); 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 = new EiColumn(FIELD_PUR_WEIGHT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(3);
...@@ -295,6 +308,13 @@ public class HGCG002 extends DaoEPBase { ...@@ -295,6 +308,13 @@ public class HGCG002 extends DaoEPBase {
eiColumn.setDescName("收货数量"); eiColumn.setDescName("收货数量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_RECEIVE_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("收货重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS); eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("状态:0-未审批,1-审核通过,2-审核未通过"); eiColumn.setDescName("状态:0-未审批,1-审核通过,2-审核未通过");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -806,6 +826,22 @@ public class HGCG002 extends DaoEPBase { ...@@ -806,6 +826,22 @@ public class HGCG002 extends DaoEPBase {
this.purQty = purQty; this.purQty = purQty;
} }
/** /**
* get the purUnitWeight - 采购单重.
* @return the purUnitWeight
*/
public BigDecimal getPurUnitWeight() {
return this.purUnitWeight;
}
/**
* set the purUnitWeight - 采购单重.
*
* @param purUnitWeight - 采购单重
*/
public void setPurUnitWeight(BigDecimal purUnitWeight) {
this.purUnitWeight = purUnitWeight;
}
/**
* get the purWeight - 采购重量. * get the purWeight - 采购重量.
* @return the purWeight * @return the purWeight
*/ */
...@@ -838,6 +874,22 @@ public class HGCG002 extends DaoEPBase { ...@@ -838,6 +874,22 @@ public class HGCG002 extends DaoEPBase {
this.receiveQty = receiveQty; this.receiveQty = receiveQty;
} }
/** /**
* get the receiveWeight - 收货重量.
* @return the receiveWeight
*/
public BigDecimal getReceiveWeight() {
return this.receiveWeight;
}
/**
* set the receiveWeight - 收货重量.
*
* @param receiveWeight - 收货重量
*/
public void setReceiveWeight(BigDecimal receiveWeight) {
this.receiveWeight = receiveWeight;
}
/**
* get the status - 状态:0-未审批,1-审核通过,2-审核未通过. * get the status - 状态:0-未审批,1-审核通过,2-审核未通过.
* @return the status * @return the status
*/ */
...@@ -955,8 +1007,10 @@ public class HGCG002 extends DaoEPBase { ...@@ -955,8 +1007,10 @@ public class HGCG002 extends DaoEPBase {
setWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WIDTH)), width)); setWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WIDTH)), width));
setThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_THICK)), thick)); setThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_THICK)), thick));
setPurQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PUR_QTY)), purQty)); setPurQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PUR_QTY)), purQty));
setPurUnitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PUR_UNIT_WEIGHT)), purUnitWeight));
setPurWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PUR_WEIGHT)), purWeight)); setPurWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PUR_WEIGHT)), purWeight));
setReceiveQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_RECEIVE_QTY)), receiveQty)); setReceiveQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_RECEIVE_QTY)), receiveQty));
setReceiveWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_RECEIVE_WEIGHT)), receiveWeight));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status)); setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setAuditTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUDIT_TIME)), auditTime)); setAuditTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUDIT_TIME)), auditTime));
setAuditUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUDIT_USER_ID)), auditUserId)); setAuditUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUDIT_USER_ID)), auditUserId));
...@@ -1001,8 +1055,10 @@ public class HGCG002 extends DaoEPBase { ...@@ -1001,8 +1055,10 @@ public class HGCG002 extends DaoEPBase {
map.put(FIELD_WIDTH, StringUtils.toString(width, eiMetadata.getMeta(FIELD_WIDTH))); map.put(FIELD_WIDTH, StringUtils.toString(width, eiMetadata.getMeta(FIELD_WIDTH)));
map.put(FIELD_THICK, StringUtils.toString(thick, eiMetadata.getMeta(FIELD_THICK))); map.put(FIELD_THICK, StringUtils.toString(thick, eiMetadata.getMeta(FIELD_THICK)));
map.put(FIELD_PUR_QTY, StringUtils.toString(purQty, eiMetadata.getMeta(FIELD_PUR_QTY))); map.put(FIELD_PUR_QTY, StringUtils.toString(purQty, eiMetadata.getMeta(FIELD_PUR_QTY)));
map.put(FIELD_PUR_UNIT_WEIGHT, StringUtils.toString(purUnitWeight, eiMetadata.getMeta(FIELD_PUR_UNIT_WEIGHT)));
map.put(FIELD_PUR_WEIGHT, StringUtils.toString(purWeight, eiMetadata.getMeta(FIELD_PUR_WEIGHT))); map.put(FIELD_PUR_WEIGHT, StringUtils.toString(purWeight, eiMetadata.getMeta(FIELD_PUR_WEIGHT)));
map.put(FIELD_RECEIVE_QTY, StringUtils.toString(receiveQty, eiMetadata.getMeta(FIELD_RECEIVE_QTY))); map.put(FIELD_RECEIVE_QTY, StringUtils.toString(receiveQty, eiMetadata.getMeta(FIELD_RECEIVE_QTY)));
map.put(FIELD_RECEIVE_WEIGHT, StringUtils.toString(receiveWeight, eiMetadata.getMeta(FIELD_RECEIVE_WEIGHT)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS))); map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
map.put(FIELD_AUDIT_TIME, StringUtils.toString(auditTime, eiMetadata.getMeta(FIELD_AUDIT_TIME))); map.put(FIELD_AUDIT_TIME, StringUtils.toString(auditTime, eiMetadata.getMeta(FIELD_AUDIT_TIME)));
map.put(FIELD_AUDIT_USER_ID, StringUtils.toString(auditUserId, eiMetadata.getMeta(FIELD_AUDIT_USER_ID))); map.put(FIELD_AUDIT_USER_ID, StringUtils.toString(auditUserId, eiMetadata.getMeta(FIELD_AUDIT_USER_ID)));
......
...@@ -16,7 +16,7 @@ import com.baosight.iplat4j.core.util.StringUtils; ...@@ -16,7 +16,7 @@ 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-11 16:32:26 create * @history 2024-05-11 17:26:18 create
*/ */
public class HGCG003 extends DaoEPBase { public class HGCG003 extends DaoEPBase {
...@@ -55,6 +55,7 @@ public class HGCG003 extends DaoEPBase { ...@@ -55,6 +55,7 @@ public class HGCG003 extends DaoEPBase {
public static final String FIELD_RECEIVE_QTY = "receiveQty"; /* 收货数量*/ public static final String FIELD_RECEIVE_QTY = "receiveQty"; /* 收货数量*/
public static final String FIELD_DELIVER_QTY = "deliverQty"; /* 退货数量*/ public static final String FIELD_DELIVER_QTY = "deliverQty"; /* 退货数量*/
public static final String FIELD_DEPOSIT_QTY = "depositQty"; /* 入库数量*/ public static final String FIELD_DEPOSIT_QTY = "depositQty"; /* 入库数量*/
public static final String FIELD_RECEIVE_UNIT_WEIGHT = "receiveUnitWeight"; /* 收货单重*/
public static final String FIELD_RECEIVE_WEIGHT = "receiveWeight"; /* 收货重量*/ public static final String FIELD_RECEIVE_WEIGHT = "receiveWeight"; /* 收货重量*/
public static final String FIELD_STATUS = "status"; /* 状态:0-已收货,1-已入库,2-部分入库,3-退货*/ public static final String FIELD_STATUS = "status"; /* 状态:0-已收货,1-已入库,2-部分入库,3-退货*/
...@@ -91,6 +92,7 @@ public class HGCG003 extends DaoEPBase { ...@@ -91,6 +92,7 @@ public class HGCG003 extends DaoEPBase {
public static final String COL_RECEIVE_QTY = "RECEIVE_QTY"; /* 收货数量*/ public static final String COL_RECEIVE_QTY = "RECEIVE_QTY"; /* 收货数量*/
public static final String COL_DELIVER_QTY = "DELIVER_QTY"; /* 退货数量*/ public static final String COL_DELIVER_QTY = "DELIVER_QTY"; /* 退货数量*/
public static final String COL_DEPOSIT_QTY = "DEPOSIT_QTY"; /* 入库数量*/ public static final String COL_DEPOSIT_QTY = "DEPOSIT_QTY"; /* 入库数量*/
public static final String COL_RECEIVE_UNIT_WEIGHT = "RECEIVE_UNIT_WEIGHT"; /* 收货单重*/
public static final String COL_RECEIVE_WEIGHT = "RECEIVE_WEIGHT"; /* 收货重量*/ public static final String COL_RECEIVE_WEIGHT = "RECEIVE_WEIGHT"; /* 收货重量*/
public static final String COL_STATUS = "STATUS"; /* 状态:0-已收货,1-已入库,2-部分入库,3-退货*/ public static final String COL_STATUS = "STATUS"; /* 状态:0-已收货,1-已入库,2-部分入库,3-退货*/
...@@ -133,6 +135,7 @@ public class HGCG003 extends DaoEPBase { ...@@ -133,6 +135,7 @@ public class HGCG003 extends DaoEPBase {
private BigDecimal receiveQty = new BigDecimal(0.000); /* 收货数量*/ private BigDecimal receiveQty = new BigDecimal(0.000); /* 收货数量*/
private BigDecimal deliverQty = new BigDecimal(0.000); /* 退货数量*/ private BigDecimal deliverQty = new BigDecimal(0.000); /* 退货数量*/
private BigDecimal depositQty = new BigDecimal(0.000); /* 入库数量*/ private BigDecimal depositQty = new BigDecimal(0.000); /* 入库数量*/
private BigDecimal receiveUnitWeight = new BigDecimal(0.000); /* 收货单重*/
private BigDecimal receiveWeight = new BigDecimal(0.000); /* 收货重量*/ private BigDecimal receiveWeight = new BigDecimal(0.000); /* 收货重量*/
private Integer status; /* 状态:0-已收货,1-已入库,2-部分入库,3-退货*/ private Integer status; /* 状态:0-已收货,1-已入库,2-部分入库,3-退货*/
...@@ -293,6 +296,13 @@ public class HGCG003 extends DaoEPBase { ...@@ -293,6 +296,13 @@ public class HGCG003 extends DaoEPBase {
eiColumn.setDescName("入库数量"); eiColumn.setDescName("入库数量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_RECEIVE_UNIT_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("收货单重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_RECEIVE_WEIGHT); eiColumn = new EiColumn(FIELD_RECEIVE_WEIGHT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(3);
...@@ -843,6 +853,22 @@ public class HGCG003 extends DaoEPBase { ...@@ -843,6 +853,22 @@ public class HGCG003 extends DaoEPBase {
this.depositQty = depositQty; this.depositQty = depositQty;
} }
/** /**
* get the receiveUnitWeight - 收货单重.
* @return the receiveUnitWeight
*/
public BigDecimal getReceiveUnitWeight() {
return this.receiveUnitWeight;
}
/**
* set the receiveUnitWeight - 收货单重.
*
* @param receiveUnitWeight - 收货单重
*/
public void setReceiveUnitWeight(BigDecimal receiveUnitWeight) {
this.receiveUnitWeight = receiveUnitWeight;
}
/**
* get the receiveWeight - 收货重量. * get the receiveWeight - 收货重量.
* @return the receiveWeight * @return the receiveWeight
*/ */
...@@ -915,6 +941,7 @@ public class HGCG003 extends DaoEPBase { ...@@ -915,6 +941,7 @@ public class HGCG003 extends DaoEPBase {
setReceiveQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_RECEIVE_QTY)), receiveQty)); setReceiveQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_RECEIVE_QTY)), receiveQty));
setDeliverQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_DELIVER_QTY)), deliverQty)); setDeliverQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_DELIVER_QTY)), deliverQty));
setDepositQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_DEPOSIT_QTY)), depositQty)); setDepositQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_DEPOSIT_QTY)), depositQty));
setReceiveUnitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_RECEIVE_UNIT_WEIGHT)), receiveUnitWeight));
setReceiveWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_RECEIVE_WEIGHT)), receiveWeight)); setReceiveWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_RECEIVE_WEIGHT)), receiveWeight));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status)); setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
} }
...@@ -959,6 +986,7 @@ public class HGCG003 extends DaoEPBase { ...@@ -959,6 +986,7 @@ public class HGCG003 extends DaoEPBase {
map.put(FIELD_RECEIVE_QTY, StringUtils.toString(receiveQty, eiMetadata.getMeta(FIELD_RECEIVE_QTY))); map.put(FIELD_RECEIVE_QTY, StringUtils.toString(receiveQty, eiMetadata.getMeta(FIELD_RECEIVE_QTY)));
map.put(FIELD_DELIVER_QTY, StringUtils.toString(deliverQty, eiMetadata.getMeta(FIELD_DELIVER_QTY))); map.put(FIELD_DELIVER_QTY, StringUtils.toString(deliverQty, eiMetadata.getMeta(FIELD_DELIVER_QTY)));
map.put(FIELD_DEPOSIT_QTY, StringUtils.toString(depositQty, eiMetadata.getMeta(FIELD_DEPOSIT_QTY))); map.put(FIELD_DEPOSIT_QTY, StringUtils.toString(depositQty, eiMetadata.getMeta(FIELD_DEPOSIT_QTY)));
map.put(FIELD_RECEIVE_UNIT_WEIGHT, StringUtils.toString(receiveUnitWeight, eiMetadata.getMeta(FIELD_RECEIVE_UNIT_WEIGHT)));
map.put(FIELD_RECEIVE_WEIGHT, StringUtils.toString(receiveWeight, eiMetadata.getMeta(FIELD_RECEIVE_WEIGHT))); map.put(FIELD_RECEIVE_WEIGHT, StringUtils.toString(receiveWeight, eiMetadata.getMeta(FIELD_RECEIVE_WEIGHT)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS))); map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
......
package com.baosight.hggp.hg.cg.domain;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.StringUtils;
import java.util.Map;
/**
* Project: <br>
* Title:Hgcg003.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-05-11 17:26:18 create
*/
public class HGCG003A extends HGCG003 {
private static final long serialVersionUID = 1L;
public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/
public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/
public static final String COL_WH_CODE = "WH_CODE"; /* 仓库编码*/
public static final String COL_WH_NAME = "WH_NAME"; /* 仓库名称*/
private String whCode = " "; /* 仓库编码*/
private String whName = " "; /* 仓库名称*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_WH_CODE);
eiColumn.setDescName("仓库编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WH_NAME);
eiColumn.setDescName("仓库名称");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGCG003A() {
super.initMetaData();
initMetaData();
}
/**
* get the whCode - 仓库编码.
* @return the whCode
*/
public String getWhCode() {
return this.whCode;
}
/**
* set the whCode - 仓库编码.
*
* @param whCode - 仓库编码
*/
public void setWhCode(String whCode) {
this.whCode = whCode;
}
/**
* get the whName - 仓库名称.
* @return the whName
*/
public String getWhName() {
return this.whName;
}
/**
* set the whName - 仓库名称.
*
* @param whName - 仓库名称
*/
public void setWhName(String whName) {
this.whName = whName;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
super.fromMap(map);
setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode));
setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = super.toMap();
map.put(FIELD_WH_CODE, StringUtils.toString(whCode, eiMetadata.getMeta(FIELD_WH_CODE)));
map.put(FIELD_WH_NAME, StringUtils.toString(whName, eiMetadata.getMeta(FIELD_WH_NAME)));
return map;
}
}
...@@ -7,7 +7,7 @@ import com.baosight.hggp.core.enums.DeleteFlagEnum; ...@@ -7,7 +7,7 @@ import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cg.domain.HGCG001; import com.baosight.hggp.hg.cg.domain.HGCG001;
import com.baosight.hggp.hg.cg.tools.HGCGTools; import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HgCgUtils; import com.baosight.hggp.hg.cg.utils.HGCGUtils;
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.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
...@@ -23,6 +23,7 @@ import com.baosight.iplat4j.core.exception.PlatException; ...@@ -23,6 +23,7 @@ import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -64,7 +65,7 @@ public class ServiceHGCG001 extends ServiceBase { ...@@ -64,7 +65,7 @@ public class ServiceHGCG001 extends ServiceBase {
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo); Map queryRow = EiInfoUtils.getFirstRow(inInfo);
HgCgUtils.HgCg001.setCondition(queryRow); HGCGUtils.HgCg001.setCondition(queryRow);
inInfo = super.query(inInfo, HGCG001.QUERY, new HGCG001()); inInfo = super.query(inInfo, HGCG001.QUERY, new HGCG001());
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
...@@ -122,6 +123,7 @@ public class ServiceHGCG001 extends ServiceBase { ...@@ -122,6 +123,7 @@ public class ServiceHGCG001 extends ServiceBase {
*/ */
private void saveData(List<HGCG001> fCg001s) { private void saveData(List<HGCG001> fCg001s) {
for (HGCG001 fCg001 : fCg001s) { for (HGCG001 fCg001 : fCg001s) {
fCg001.setPurUnitWeight(fCg001.getPurWeight().divide(fCg001.getPurQty(), 3, RoundingMode.HALF_UP));
DaoUtils.update(HGSqlConstant.HgCg001.UPDATE_PUR, fCg001); DaoUtils.update(HGSqlConstant.HgCg001.UPDATE_PUR, fCg001);
} }
} }
......
...@@ -8,7 +8,7 @@ import com.baosight.hggp.core.security.UserSessionUtils; ...@@ -8,7 +8,7 @@ import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cg.domain.HGCG002; import com.baosight.hggp.hg.cg.domain.HGCG002;
import com.baosight.hggp.hg.cg.domain.HGCG002A; import com.baosight.hggp.hg.cg.domain.HGCG002A;
import com.baosight.hggp.hg.cg.tools.HGCGTools; import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HgCgUtils; import com.baosight.hggp.hg.cg.utils.HGCGUtils;
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.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
...@@ -64,7 +64,7 @@ public class ServiceHGCG002 extends ServiceBase { ...@@ -64,7 +64,7 @@ public class ServiceHGCG002 extends ServiceBase {
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo); Map queryRow = EiInfoUtils.getFirstRow(inInfo);
HgCgUtils.HgCg002.setCondition(queryRow); HGCGUtils.HgCg002.setCondition(queryRow);
inInfo = super.query(inInfo, HGCG002.QUERY, new HGCG002()); inInfo = super.query(inInfo, HGCG002.QUERY, new HGCG002());
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
...@@ -83,7 +83,7 @@ public class ServiceHGCG002 extends ServiceBase { ...@@ -83,7 +83,7 @@ public class ServiceHGCG002 extends ServiceBase {
try { try {
List<HGCG002> fCg002s = MapUtils.toDaoEPBase(inInfo, HGCG002.class); List<HGCG002> fCg002s = MapUtils.toDaoEPBase(inInfo, HGCG002.class);
// db数据 // db数据
Map<String, HGCG002A> dbCg002AMap = HgCgUtils.HgCg002.lockGetDataEp(fCg002s); Map<String, HGCG002A> dbCg002AMap = HGCGUtils.HgCg002.lockGetDataEp(fCg002s);
// 数据校验 // 数据校验
this.checkSaveData(fCg002s, dbCg002AMap); this.checkSaveData(fCg002s, dbCg002AMap);
// 保存数据 // 保存数据
...@@ -135,7 +135,7 @@ public class ServiceHGCG002 extends ServiceBase { ...@@ -135,7 +135,7 @@ public class ServiceHGCG002 extends ServiceBase {
try { try {
List<HGCG002> fCg002s = MapUtils.toDaoEPBase(inInfo, HGCG002.class); List<HGCG002> fCg002s = MapUtils.toDaoEPBase(inInfo, HGCG002.class);
// db数据 // db数据
Map<String, HGCG002A> dbCg002AMap = HgCgUtils.HgCg002.lockGetDataEp(fCg002s); Map<String, HGCG002A> dbCg002AMap = HGCGUtils.HgCg002.lockGetDataEp(fCg002s);
// 数据校验 // 数据校验
this.checkRemoveData(fCg002s, dbCg002AMap); this.checkRemoveData(fCg002s, dbCg002AMap);
// 保存数据 // 保存数据
...@@ -193,7 +193,7 @@ public class ServiceHGCG002 extends ServiceBase { ...@@ -193,7 +193,7 @@ public class ServiceHGCG002 extends ServiceBase {
try { try {
List<HGCG002> fCg002s = MapUtils.toDaoEPBase(inInfo, HGCG002.class); List<HGCG002> fCg002s = MapUtils.toDaoEPBase(inInfo, HGCG002.class);
// db数据 // db数据
Map<String, HGCG002A> dbCg002AMap = HgCgUtils.HgCg002.lockGetDataEp(fCg002s); Map<String, HGCG002A> dbCg002AMap = HGCGUtils.HgCg002.lockGetDataEp(fCg002s);
// 数据校验 // 数据校验
this.checkSubmitData(fCg002s, dbCg002AMap); this.checkSubmitData(fCg002s, dbCg002AMap);
// 提交数据 // 提交数据
......
...@@ -7,7 +7,7 @@ import com.baosight.hggp.core.enums.DeleteFlagEnum; ...@@ -7,7 +7,7 @@ import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.cg.domain.HGCG001; import com.baosight.hggp.hg.cg.domain.HGCG001;
import com.baosight.hggp.hg.cg.domain.HGCG002; import com.baosight.hggp.hg.cg.domain.HGCG002;
import com.baosight.hggp.hg.cg.tools.HGCGTools; import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HgCgUtils; import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.BeanUtils; import com.baosight.hggp.util.BeanUtils;
...@@ -65,7 +65,7 @@ public class ServiceHGCG002A extends ServiceBase { ...@@ -65,7 +65,7 @@ public class ServiceHGCG002A extends ServiceBase {
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo); Map queryRow = EiInfoUtils.getFirstRow(inInfo);
HgCgUtils.HgCg001.setCondition(queryRow); HGCGUtils.HgCg001.setCondition(queryRow);
// 仅审核通过 // 仅审核通过
queryRow.put(HGCG001.FIELD_STATUS, HGConstant.CgPlanStatus.S_2); queryRow.put(HGCG001.FIELD_STATUS, HGConstant.CgPlanStatus.S_2);
inInfo = super.query(inInfo, HGCG001.QUERY, new HGCG001()); inInfo = super.query(inInfo, HGCG001.QUERY, new HGCG001());
......
...@@ -7,7 +7,7 @@ import com.baosight.hggp.core.enums.DeleteFlagEnum; ...@@ -7,7 +7,7 @@ import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.cg.domain.HGCG002A; import com.baosight.hggp.hg.cg.domain.HGCG002A;
import com.baosight.hggp.hg.cg.domain.HGCG003; import com.baosight.hggp.hg.cg.domain.HGCG003;
import com.baosight.hggp.hg.cg.tools.HGCGTools; import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HgCgUtils; import com.baosight.hggp.hg.cg.utils.HGCGUtils;
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.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
...@@ -64,7 +64,7 @@ public class ServiceHGCG003 extends ServiceBase { ...@@ -64,7 +64,7 @@ public class ServiceHGCG003 extends ServiceBase {
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo); Map queryRow = EiInfoUtils.getFirstRow(inInfo);
HgCgUtils.HgCg003.setCondition(queryRow); HGCGUtils.HgCg003.setCondition(queryRow);
inInfo = super.query(inInfo, HGCG003.QUERY, new HGCG003()); inInfo = super.query(inInfo, HGCG003.QUERY, new HGCG003());
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
...@@ -83,9 +83,9 @@ public class ServiceHGCG003 extends ServiceBase { ...@@ -83,9 +83,9 @@ public class ServiceHGCG003 extends ServiceBase {
try { try {
List<HGCG003> fCg003s = MapUtils.toDaoEPBase(inInfo, HGCG003.class); List<HGCG003> fCg003s = MapUtils.toDaoEPBase(inInfo, HGCG003.class);
// 采购收货DB数据 // 采购收货DB数据
Map<String, HGCG003> dbCg003Map = HgCgUtils.HgCg003.lockGetDataEp(fCg003s); Map<String, HGCG003> dbCg003Map = HGCGUtils.HgCg003.lockGetDataEp(fCg003s);
// 采购合同DB数据 // 采购合同DB数据
Map<String, HGCG002A> dbCg002AMap = HgCgUtils.HgCg002.lockGetData( Map<String, HGCG002A> dbCg002AMap = HGCGUtils.HgCg002.lockGetData(
ObjectUtils.listEpKey(fCg003s, HGCG003.FIELD_CONTRACT_NO)); ObjectUtils.listEpKey(fCg003s, HGCG003.FIELD_CONTRACT_NO));
// 数据校验 // 数据校验
this.checkSaveData(fCg003s, dbCg003Map); this.checkSaveData(fCg003s, dbCg003Map);
...@@ -140,6 +140,8 @@ public class ServiceHGCG003 extends ServiceBase { ...@@ -140,6 +140,8 @@ public class ServiceHGCG003 extends ServiceBase {
for (HGCG003 fCg003 : fCg003s) { for (HGCG003 fCg003 : fCg003s) {
String receiveNo = fCg003.getReceiveNo(); String receiveNo = fCg003.getReceiveNo();
String contractNo = fCg003.getContractNo(); String contractNo = fCg003.getContractNo();
// 计算重量
fCg003.setReceiveWeight(fCg003.getReceiveQty().multiply(fCg003.getReceiveUnitWeight()));
DaoUtils.update(HGSqlConstant.HgCg003.UPDATE_QTY, fCg003); DaoUtils.update(HGSqlConstant.HgCg003.UPDATE_QTY, fCg003);
// 计算差异数量,更新合同状态 // 计算差异数量,更新合同状态
HGCG003 dbCg003 = dbCg003Map.get(receiveNo); HGCG003 dbCg003 = dbCg003Map.get(receiveNo);
...@@ -159,9 +161,9 @@ public class ServiceHGCG003 extends ServiceBase { ...@@ -159,9 +161,9 @@ public class ServiceHGCG003 extends ServiceBase {
try { try {
List<HGCG003> fCg003s = MapUtils.toDaoEPBase(inInfo, HGCG003.class); List<HGCG003> fCg003s = MapUtils.toDaoEPBase(inInfo, HGCG003.class);
// 采购收货DB数据 // 采购收货DB数据
Map<String, HGCG003> dbCg003Map = HgCgUtils.HgCg003.lockGetDataEp(fCg003s); Map<String, HGCG003> dbCg003Map = HGCGUtils.HgCg003.lockGetDataEp(fCg003s);
// 采购合同DB数据 // 采购合同DB数据
Map<String, HGCG002A> dbCg002AMap = HgCgUtils.HgCg002.lockGetData( Map<String, HGCG002A> dbCg002AMap = HGCGUtils.HgCg002.lockGetData(
ObjectUtils.listEpKey(fCg003s, HGCG003.FIELD_CONTRACT_NO)); ObjectUtils.listEpKey(fCg003s, HGCG003.FIELD_CONTRACT_NO));
// 数据校验 // 数据校验
this.checkRemoveData(fCg003s, dbCg003Map); this.checkRemoveData(fCg003s, dbCg003Map);
...@@ -222,16 +224,16 @@ public class ServiceHGCG003 extends ServiceBase { ...@@ -222,16 +224,16 @@ public class ServiceHGCG003 extends ServiceBase {
try { try {
List<HGCG003> fCg003s = MapUtils.toDaoEPBase(inInfo, HGCG003.class); List<HGCG003> fCg003s = MapUtils.toDaoEPBase(inInfo, HGCG003.class);
// db数据 // db数据
Map<String, HGCG003> dbCg003Map = HgCgUtils.HgCg003.lockGetDataEp(fCg003s); Map<String, HGCG003> dbCg003Map = HGCGUtils.HgCg003.lockGetDataEp(fCg003s);
// 数据校验 // 数据校验
this.checkConfirmData(fCg003s, dbCg003Map); this.checkConfirmData(fCg003s, dbCg003Map);
// 提交数据 // 提交数据
this.confirmData(fCg003s); this.confirmData(fCg003s);
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fCg003s.size() + "]条数据审核成功!"); inInfo.setMsg("操作成功!本次对[" + fCg003s.size() + "]条数据收货成功!");
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "审核失败"); LogUtils.setDetailMsg(inInfo, e, "收货失败");
} }
return inInfo; return inInfo;
} }
...@@ -247,8 +249,13 @@ public class ServiceHGCG003 extends ServiceBase { ...@@ -247,8 +249,13 @@ public class ServiceHGCG003 extends ServiceBase {
String receiveNo = fCg003.getReceiveNo(); String receiveNo = fCg003.getReceiveNo();
HGCG003 dbCg003 = dbCg003Map.get(receiveNo); HGCG003 dbCg003 = dbCg003Map.get(receiveNo);
AssertUtils.isNull(dbCg003, String.format("收货单[%s]不存在", receiveNo)); AssertUtils.isNull(dbCg003, String.format("收货单[%s]不存在", receiveNo));
AssertUtils.isNotEquals(HGConstant.CgReceiveStatus.S_0, dbCg003.getStatus(), AssertUtils.isNotEquals(HGConstant.CgReceiveStatus.S_4, dbCg003.getStatus(),
String.format("收货单[%s]状态不是\"待确认\",不允许操作", receiveNo)); String.format("收货单【%s】状态不是\"质检完成\",不允许操作", receiveNo));
// 计算退货数量和入库数量
BigDecimal totalQty = fCg003.getDeliverQty().add(fCg003.getDepositQty());
AssertUtils.isNotEquals(totalQty, dbCg003.getReceiveQty(),
String.format("收货单【%s】的\"退货数量(%s)\"加\"入库数量(%s)\"不等于\"收货数量(%s)\",请检查", receiveNo,
fCg003.getDeliverQty(), fCg003.getDepositQty(), dbCg003.getReceiveQty()));
} }
} }
...@@ -260,7 +267,7 @@ public class ServiceHGCG003 extends ServiceBase { ...@@ -260,7 +267,7 @@ public class ServiceHGCG003 extends ServiceBase {
private void confirmData(List<HGCG003> fCg003s) { private void confirmData(List<HGCG003> fCg003s) {
for (HGCG003 fCg003 : fCg003s) { for (HGCG003 fCg003 : fCg003s) {
fCg003.setStatus(HGConstant.CgReceiveStatus.S_2); fCg003.setStatus(HGConstant.CgReceiveStatus.S_2);
DaoUtils.update(HGSqlConstant.HgCg003.UPDATE_STATUS, fCg003); DaoUtils.update(HGSqlConstant.HgCg003.UPDATE_CONFIRM, fCg003);
} }
} }
......
...@@ -8,7 +8,7 @@ import com.baosight.hggp.hg.cg.domain.HGCG002; ...@@ -8,7 +8,7 @@ import com.baosight.hggp.hg.cg.domain.HGCG002;
import com.baosight.hggp.hg.cg.domain.HGCG002A; import com.baosight.hggp.hg.cg.domain.HGCG002A;
import com.baosight.hggp.hg.cg.domain.HGCG003; import com.baosight.hggp.hg.cg.domain.HGCG003;
import com.baosight.hggp.hg.cg.tools.HGCGTools; import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HgCgUtils; import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.BeanUtils; import com.baosight.hggp.util.BeanUtils;
...@@ -17,7 +17,6 @@ import com.baosight.hggp.util.DateUtils; ...@@ -17,7 +17,6 @@ import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils; import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils;
import com.baosight.iplat4j.core.ei.EiConstant; 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;
...@@ -66,7 +65,7 @@ public class ServiceHGCG003A extends ServiceBase { ...@@ -66,7 +65,7 @@ public class ServiceHGCG003A extends ServiceBase {
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo); Map queryRow = EiInfoUtils.getFirstRow(inInfo);
HgCgUtils.HgCg001.setCondition(queryRow); HGCGUtils.HgCg001.setCondition(queryRow);
// 仅审核通过和收货中 // 仅审核通过和收货中
queryRow.put("statuses", new Integer[]{HGConstant.CgContractStatus.S_2, HGConstant.CgContractStatus.S_4}); queryRow.put("statuses", new Integer[]{HGConstant.CgContractStatus.S_2, HGConstant.CgContractStatus.S_4});
inInfo = super.query(inInfo, HGCG002.QUERY, new HGCG002A()); inInfo = super.query(inInfo, HGCG002.QUERY, new HGCG002A());
...@@ -85,10 +84,9 @@ public class ServiceHGCG003A extends ServiceBase { ...@@ -85,10 +84,9 @@ public class ServiceHGCG003A extends ServiceBase {
@OperationLogAnnotation(operModul = "采购合同", operType = "修改", operDesc = "确认") @OperationLogAnnotation(operModul = "采购合同", operType = "修改", operDesc = "确认")
public EiInfo confirm(EiInfo inInfo) { public EiInfo confirm(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<HGCG002A> fCg002As = MapUtils.toDaoEPBase(inInfo, HGCG002A.class); List<HGCG002A> fCg002As = MapUtils.toDaoEPBase(inInfo, HGCG002A.class);
// db数据 // db数据
Map<String, HGCG002A> dbCg002AMap = this.lockGetData(fCg002As); Map<String, HGCG002A> dbCg002AMap = HGCGUtils.HgCg002.lockGetDataEp(fCg002As);
// 数据校验 // 数据校验
this.checkConfirmData(fCg002As, dbCg002AMap); this.checkConfirmData(fCg002As, dbCg002AMap);
// 保存数据 // 保存数据
...@@ -136,7 +134,8 @@ public class ServiceHGCG003A extends ServiceBase { ...@@ -136,7 +134,8 @@ public class ServiceHGCG003A extends ServiceBase {
newCg003.setReceiveDate(DateUtils.shortDate()); newCg003.setReceiveDate(DateUtils.shortDate());
newCg003.setReceiveNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CG_RECEIVE_NO)); newCg003.setReceiveNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CG_RECEIVE_NO));
newCg003.setReceiveQty(fCg002A.getBcReceiveQty()); newCg003.setReceiveQty(fCg002A.getBcReceiveQty());
newCg003.setReceiveWeight(fCg002A.getPurWeight()); newCg003.setReceiveUnitWeight(fCg002A.getPurUnitWeight());
newCg003.setReceiveWeight(fCg002A.getBcReceiveQty().multiply(fCg002A.getPurUnitWeight()));
newCg003.setStatus(HGConstant.CgReceiveStatus.S_0); newCg003.setStatus(HGConstant.CgReceiveStatus.S_0);
newCg003.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode()); newCg003.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
DaoUtils.insert(HGCG003.INSERT, newCg003); DaoUtils.insert(HGCG003.INSERT, newCg003);
...@@ -145,19 +144,4 @@ public class ServiceHGCG003A extends ServiceBase { ...@@ -145,19 +144,4 @@ public class ServiceHGCG003A extends ServiceBase {
} }
} }
/**
* 锁并且获取数据
*
* @param fCg002As
* @return
*/
private Map<String, HGCG002A> lockGetData(List<HGCG002A> fCg002As) {
// 合同号
List<String> contractNos = ObjectUtils.listEpKey(fCg002As, HGCG002.FIELD_CONTRACT_NO);
// 锁
HGCGTools.HgCg002.lock(contractNos);
// db数据
return HGCGTools.HgCg002.map(contractNos);
}
} }
...@@ -28,8 +28,10 @@ ...@@ -28,8 +28,10 @@
WIDTH as "width", <!-- 宽度 --> WIDTH as "width", <!-- 宽度 -->
THICK as "thick", <!-- 厚度 --> THICK as "thick", <!-- 厚度 -->
PLAN_QTY as "planQty", <!-- 计划数量 --> PLAN_QTY as "planQty", <!-- 计划数量 -->
PLAN_UNIT_WEIGHT as "planUnitWeight", <!-- 计划单重 -->
PLAN_WEIGHT as "planWeight", <!-- 计划重量 --> PLAN_WEIGHT as "planWeight", <!-- 计划重量 -->
PUR_QTY as "purQty", <!-- 采购数量 --> PUR_QTY as "purQty", <!-- 采购数量 -->
PUR_UNIT_WEIGHT as "purUnitWeight", <!-- 采购单重 -->
PUR_WEIGHT as "purWeight", <!-- 采购重量 --> PUR_WEIGHT as "purWeight", <!-- 采购重量 -->
STATUS as "status", <!-- 状态:0-未审批,1-审核通过,2-审核未通过 --> STATUS as "status", <!-- 状态:0-未审批,1-审核通过,2-审核未通过 -->
AUDIT_TIME as "auditTime", <!-- 审核时间 --> AUDIT_TIME as "auditTime", <!-- 审核时间 -->
...@@ -145,13 +147,14 @@ ...@@ -145,13 +147,14 @@
WIDTH, <!-- 宽度 --> WIDTH, <!-- 宽度 -->
THICK, <!-- 厚度 --> THICK, <!-- 厚度 -->
PLAN_QTY, <!-- 计划数量 --> PLAN_QTY, <!-- 计划数量 -->
PLAN_UNIT_WEIGHT, <!-- 计划单重 -->
PLAN_WEIGHT, <!-- 计划重量 --> PLAN_WEIGHT, <!-- 计划重量 -->
STATUS <!-- 状态:0-未审批,1-审核通过,2-审核未通过 --> STATUS <!-- 状态:0-未审批,1-审核通过,2-审核未通过 -->
) VALUES ( ) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#companyCode#, #companyName#, #planDate#, #planNo#, #inventCode#, #inventName#, #companyCode#, #companyName#, #planDate#, #planNo#, #inventCode#, #inventName#,
#specId#, #spec#, #material#, #unit#, #length#, #width#, #thick#, #specId#, #spec#, #material#, #unit#, #length#, #width#, #thick#,
#planQty#, #planWeight#, #status# #planQty#, #planUnitWeight#, #planWeight#, #status#
) )
</insert> </insert>
...@@ -176,6 +179,7 @@ ...@@ -176,6 +179,7 @@
UPDATE ${hggpSchema}.HGCG001 UPDATE ${hggpSchema}.HGCG001
SET SET
PUR_QTY = #purQty#, <!-- 采购数量 --> PUR_QTY = #purQty#, <!-- 采购数量 -->
PUR_UNIT_WEIGHT = #purUnitWeight#, <!-- 采购单重 -->
PUR_WEIGHT = #purWeight#, <!-- 采购重量 --> PUR_WEIGHT = #purWeight#, <!-- 采购重量 -->
<include refid="updateRevise"/> <include refid="updateRevise"/>
WHERE PLAN_NO = #planNo# WHERE PLAN_NO = #planNo#
......
...@@ -33,8 +33,10 @@ ...@@ -33,8 +33,10 @@
WIDTH as "width", <!-- 宽度 --> WIDTH as "width", <!-- 宽度 -->
THICK as "thick", <!-- 厚度 --> THICK as "thick", <!-- 厚度 -->
PUR_QTY as "purQty", <!-- 采购数量 --> PUR_QTY as "purQty", <!-- 采购数量 -->
PUR_UNIT_WEIGHT as "purUnitWeight", <!-- 采购单重 -->
PUR_WEIGHT as "purWeight", <!-- 采购重量 --> PUR_WEIGHT as "purWeight", <!-- 采购重量 -->
RECEIVE_QTY as "receiveQty", <!-- 收货数量 --> RECEIVE_QTY as "receiveQty", <!-- 收货数量 -->
RECEIVE_WEIGHT as "receiveWeight", <!-- 收货重量 -->
STATUS as "status", <!-- 状态:0-未审批,1-审核通过,2-审核未通过 --> STATUS as "status", <!-- 状态:0-未审批,1-审核通过,2-审核未通过 -->
AUDIT_TIME as "auditTime", <!-- 审核时间 --> AUDIT_TIME as "auditTime", <!-- 审核时间 -->
AUDIT_USER_ID as "auditUserId", <!-- 审核人ID --> AUDIT_USER_ID as "auditUserId", <!-- 审核人ID -->
...@@ -169,23 +171,29 @@ ...@@ -169,23 +171,29 @@
CONTRACT_DATE, <!-- 合同日期 --> CONTRACT_DATE, <!-- 合同日期 -->
CONTRACT_NO, <!-- 合同号 --> CONTRACT_NO, <!-- 合同号 -->
PLAN_NO, <!-- 计划单号 --> PLAN_NO, <!-- 计划单号 -->
SUP_CODE, <!-- 供应商编码 -->
SUP_NAME, <!-- 供应商名称 -->
PUR_USER_ID, <!-- 采购员 -->
PUR_USER_NAME, <!-- 采购员名称 -->
INVENT_CODE, <!-- 存货编码 --> INVENT_CODE, <!-- 存货编码 -->
INVENT_NAME, <!-- 存货名称 --> INVENT_NAME, <!-- 存货名称 -->
SPEC_ID as "specId", <!-- 规格ID --> SPEC_ID, <!-- 规格ID -->
SPEC as "spec", <!-- 规格 --> SPEC, <!-- 规格 -->
MATERIAL as "material", <!-- 材质 --> MATERIAL, <!-- 材质 -->
UNIT as "unit", <!-- 单位 --> UNIT, <!-- 单位 -->
LENGTH as "length", <!-- 长度 --> LENGTH, <!-- 长度 -->
WIDTH as "width", <!-- 宽度 --> WIDTH, <!-- 宽度 -->
THICK as "thick", <!-- 厚度 --> THICK, <!-- 厚度 -->
PUR_QTY, <!-- 采购数量 --> PUR_QTY, <!-- 采购数量 -->
PUR_UNIT_WEIGHT, <!-- 采购单重 -->
PUR_WEIGHT, <!-- 采购重量 --> PUR_WEIGHT, <!-- 采购重量 -->
STATUS <!-- 状态:0-未审批,1-审核通过,2-审核未通过 --> STATUS <!-- 状态:0-未审批,1-审核通过,2-审核未通过 -->
) VALUES ( ) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #companyCode#, #companyName#, #contractDate#, #contractNo#, #planNo#, #deleteFlag#, #companyCode#, #companyName#, #contractDate#, #contractNo#, #planNo#,
#inventCode#, #inventName#, #specId#, #spec#, #material#, #unit#, #length#, #width#, #thick#, #supCode#, #supName#, #purUserId#, #purUserName#, #inventCode#, #inventName#,
#purQty#, #purWeight#, #status# #specId#, #spec#, #material#, #unit#, #length#, #width#, #thick#,
#purQty#, #purUnitWeight#, #purWeight#, #status#
) )
</insert> </insert>
...@@ -245,6 +253,7 @@ ...@@ -245,6 +253,7 @@
SET SET
STATUS = #status#, STATUS = #status#,
RECEIVE_QTY = #receiveQty#, RECEIVE_QTY = #receiveQty#,
RECEIVE_WEIGHT = #receiveWeight#,
<include refid="updateRevise"/> <include refid="updateRevise"/>
WHERE CONTRACT_NO = #contractNo# WHERE CONTRACT_NO = #contractNo#
</update> </update>
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
RECEIVE_QTY as "receiveQty", <!-- 收货数量 --> RECEIVE_QTY as "receiveQty", <!-- 收货数量 -->
DELIVER_QTY as "deliverQty", <!-- 退货数量 --> DELIVER_QTY as "deliverQty", <!-- 退货数量 -->
DEPOSIT_QTY as "depositQty", <!-- 入库数量 --> DEPOSIT_QTY as "depositQty", <!-- 入库数量 -->
RECEIVE_UNIT_WEIGHT as "receiveUnitWeight", <!-- 收货单重 -->
RECEIVE_WEIGHT as "receiveWeight", <!-- 收货重量 --> RECEIVE_WEIGHT as "receiveWeight", <!-- 收货重量 -->
STATUS as "status" <!-- 状态:0-已收货,1-已入库,2-部分入库,3-退货 --> STATUS as "status" <!-- 状态:0-已收货,1-已入库,2-部分入库,3-退货 -->
</sql> </sql>
...@@ -172,14 +173,16 @@ ...@@ -172,14 +173,16 @@
WIDTH, <!-- 宽度 --> WIDTH, <!-- 宽度 -->
THICK, <!-- 厚度 --> THICK, <!-- 厚度 -->
RECEIVE_QTY, <!-- 收货数量 --> RECEIVE_QTY, <!-- 收货数量 -->
RECEIVE_UNIT_WEIGHT, <!-- 收货单重 -->
RECEIVE_WEIGHT, <!-- 收货重量 --> RECEIVE_WEIGHT, <!-- 收货重量 -->
STATUS <!-- 状态:0-已收货,1-已入库,2-部分入库,3-退货 --> STATUS <!-- 状态:0-已收货,1-已入库,2-部分入库,3-退货 -->
) VALUES ( ) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #companyCode#, #companyName#, #receiveDate#, #receiveNo#, #deleteFlag#, #companyCode#, #companyName#, #receiveDate#, #receiveNo#,
#planNo#, #contractNo#, #supCode#, #supName#, #purUserId#, #purUserName#, #planNo#, #contractNo#, #supCode#, #supName#, #purUserId#, #purUserName#,
#inventType#, #inventCode#, #inventName#, #specId#, #spec#, #material#, #inventType#, #inventCode#, #inventName#, #specId#, #spec#, #material#,
#unit#, #length#, #width#, #thick#, #receiveQty#, #receiveWeight#, #status# #unit#, #length#, #width#, #thick#, #receiveQty#, #receiveUnitWeight#,
#receiveWeight#, #status#
) )
</insert> </insert>
...@@ -213,6 +216,18 @@ ...@@ -213,6 +216,18 @@
UPDATE ${hggpSchema}.HGCG003 UPDATE ${hggpSchema}.HGCG003
SET SET
RECEIVE_QTY = #receiveQty#, <!-- 收货数量 --> RECEIVE_QTY = #receiveQty#, <!-- 收货数量 -->
RECEIVE_WEIGHT = #receiveWeight#, <!-- 收货重量 -->
<include refid="updateRevise"/>
WHERE RECEIVE_NO = #receiveNo#
</update>
<!-- 修改确认 -->
<update id="updateConfirm">
UPDATE ${hggpSchema}.HGCG003
SET
STATUS = #status#,
DELIVER_QTY = #deliverQty#, <!-- 退货数量 -->
DEPOSIT_QTY = #depositQty#, <!-- 退货数量 -->
<include refid="updateRevise"/> <include refid="updateRevise"/>
WHERE RECEIVE_NO = #receiveNo# WHERE RECEIVE_NO = #receiveNo#
</update> </update>
......
...@@ -6,6 +6,7 @@ import com.baosight.hggp.hg.cg.domain.HGCG001; ...@@ -6,6 +6,7 @@ import com.baosight.hggp.hg.cg.domain.HGCG001;
import com.baosight.hggp.hg.cg.domain.HGCG002; import com.baosight.hggp.hg.cg.domain.HGCG002;
import com.baosight.hggp.hg.cg.domain.HGCG002A; import com.baosight.hggp.hg.cg.domain.HGCG002A;
import com.baosight.hggp.hg.cg.domain.HGCG003; import com.baosight.hggp.hg.cg.domain.HGCG003;
import com.baosight.hggp.hg.kc.domain.HGKC001;
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.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
...@@ -134,13 +135,15 @@ public class HGCGTools { ...@@ -134,13 +135,15 @@ public class HGCGTools {
public static void updateReceive(HGCG002 dbCg002, BigDecimal receiveQty) { public static void updateReceive(HGCG002 dbCg002, BigDecimal receiveQty) {
AssertUtils.isNull(dbCg002, "合同号不能为空!"); AssertUtils.isNull(dbCg002, "合同号不能为空!");
AssertUtils.isNull(receiveQty, "收货数量不能为空!"); AssertUtils.isNull(receiveQty, "收货数量不能为空!");
BigDecimal diffQty = dbCg002.getPurQty().subtract(receiveQty.add(dbCg002.getReceiveQty())); BigDecimal newReceiveQty = receiveQty.add(dbCg002.getReceiveQty());
BigDecimal diffQty = dbCg002.getPurQty().subtract(newReceiveQty);
Integer status = diffQty.compareTo(BigDecimal.ZERO) == 0 ? HGConstant.CgContractStatus.S_5 Integer status = diffQty.compareTo(BigDecimal.ZERO) == 0 ? HGConstant.CgContractStatus.S_5
: HGConstant.CgContractStatus.S_4; : HGConstant.CgContractStatus.S_4;
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put(HGCG002.FIELD_CONTRACT_NO, dbCg002.getContractNo()); paramMap.put(HGCG002.FIELD_CONTRACT_NO, dbCg002.getContractNo());
paramMap.put(HGCG002.FIELD_STATUS, status); paramMap.put(HGCG002.FIELD_STATUS, status);
paramMap.put(HGCG002.FIELD_RECEIVE_QTY, receiveQty.add(dbCg002.getReceiveQty())); paramMap.put(HGCG002.FIELD_RECEIVE_QTY, newReceiveQty);
paramMap.put(HGCG002.FIELD_RECEIVE_WEIGHT, newReceiveQty.multiply(dbCg002.getPurUnitWeight()));
DaoUtils.update(HGSqlConstant.HgCg002.UPDATE_RECEIVE, paramMap); DaoUtils.update(HGSqlConstant.HgCg002.UPDATE_RECEIVE, paramMap);
} }
...@@ -217,6 +220,20 @@ public class HGCGTools { ...@@ -217,6 +220,20 @@ public class HGCGTools {
return results.stream().collect(Collectors.toMap(HGCG003::getReceiveNo, item -> item)); return results.stream().collect(Collectors.toMap(HGCG003::getReceiveNo, item -> item));
} }
/**
* 修改状态
*
* @param receiveNo
* @param status
*/
public static void updateStatus(String receiveNo, Integer status) {
AssertUtils.isEmpty(receiveNo, "收货单号不能为空!");
AssertUtils.isNull(status, "状态不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("receiveNo", receiveNo);
paramMap.put("status", status);
DaoUtils.update(HGSqlConstant.HgCg003.UPDATE_STATUS, paramMap);
}
} }
} }
...@@ -17,7 +17,7 @@ import java.util.Map; ...@@ -17,7 +17,7 @@ import java.util.Map;
* @author:songx * @author:songx
* @date:2024/5/9,13:50 * @date:2024/5/9,13:50
*/ */
public class HgCgUtils { public class HGCGUtils {
/** /**
* 设置查询条件 * 设置查询条件
...@@ -51,7 +51,7 @@ public class HgCgUtils { ...@@ -51,7 +51,7 @@ public class HgCgUtils {
* @return * @return
*/ */
public static void setCondition(Map queryRow) { public static void setCondition(Map queryRow) {
HgCgUtils.setCondition(queryRow); HGCGUtils.setCondition(queryRow);
// 计划日期 // 计划日期
String planDate = MapUtils.getString(queryRow, HGCG001.FIELD_PLAN_DATE); String planDate = MapUtils.getString(queryRow, HGCG001.FIELD_PLAN_DATE);
if (StringUtils.isNotBlank(planDate)) { if (StringUtils.isNotBlank(planDate)) {
...@@ -76,7 +76,7 @@ public class HgCgUtils { ...@@ -76,7 +76,7 @@ public class HgCgUtils {
* @return * @return
*/ */
public static void setCondition(Map queryRow) { public static void setCondition(Map queryRow) {
HgCgUtils.setCondition(queryRow); HGCGUtils.setCondition(queryRow);
// 合同日期 // 合同日期
String contractDate = MapUtils.getString(queryRow, HGCG002.FIELD_CONTRACT_DATE); String contractDate = MapUtils.getString(queryRow, HGCG002.FIELD_CONTRACT_DATE);
if (StringUtils.isNotBlank(contractDate)) { if (StringUtils.isNotBlank(contractDate)) {
...@@ -90,7 +90,7 @@ public class HgCgUtils { ...@@ -90,7 +90,7 @@ public class HgCgUtils {
* @param fCg002s * @param fCg002s
* @return * @return
*/ */
public static Map<String, HGCG002A> lockGetDataEp(List<HGCG002> fCg002s) { public static Map<String, HGCG002A> lockGetDataEp(List<? extends HGCG002> fCg002s) {
return lockGetData(ObjectUtils.listEpKey(fCg002s, HGCG002.FIELD_CONTRACT_NO)); return lockGetData(ObjectUtils.listEpKey(fCg002s, HGCG002.FIELD_CONTRACT_NO));
} }
...@@ -124,7 +124,7 @@ public class HgCgUtils { ...@@ -124,7 +124,7 @@ public class HgCgUtils {
* @return * @return
*/ */
public static void setCondition(Map queryRow) { public static void setCondition(Map queryRow) {
HgCgUtils.setCondition(queryRow); HGCGUtils.setCondition(queryRow);
// 收货日期 // 收货日期
String receiveDate = MapUtils.getString(queryRow, HGCG003.FIELD_RECEIVE_DATE); String receiveDate = MapUtils.getString(queryRow, HGCG003.FIELD_RECEIVE_DATE);
if (StringUtils.isNotBlank(receiveDate)) { if (StringUtils.isNotBlank(receiveDate)) {
...@@ -138,7 +138,7 @@ public class HgCgUtils { ...@@ -138,7 +138,7 @@ public class HgCgUtils {
* @param fCg003s * @param fCg003s
* @return * @return
*/ */
public static Map<String, HGCG003> lockGetDataEp(List<HGCG003> fCg003s) { public static Map<String, HGCG003> lockGetDataEp(List<? extends HGCG003> fCg003s) {
return lockGetData(ObjectUtils.listEpKey(fCg003s, HGCG003.FIELD_RECEIVE_NO)); return lockGetData(ObjectUtils.listEpKey(fCg003s, HGCG003.FIELD_RECEIVE_NO));
} }
......
...@@ -95,6 +95,12 @@ public class HGConstant { ...@@ -95,6 +95,12 @@ public class HGConstant {
public static final String CG_CONTRACT_NO = "CG_CONTRACT_NO"; public static final String CG_CONTRACT_NO = "CG_CONTRACT_NO";
// 采购收货号 // 采购收货号
public static final String CG_RECEIVE_NO = "CG_RECEIVE_NO"; public static final String CG_RECEIVE_NO = "CG_RECEIVE_NO";
// 采购入库号
public static final String CG_DEPOSIT_NO = "CG_DEPOSIT_NO";
// 点检单号
public static final String INSPEC_CODE = "INSPEC_CODE";
// 保养单号
public static final String UPKEEP_CODE = "UPKEEP_CODE";
} }
/** /**
......
...@@ -64,6 +64,38 @@ public class HGSqlConstant { ...@@ -64,6 +64,38 @@ public class HGSqlConstant {
public static final String UPDATE_STATUS = MODULE_NAME + "updateStatus"; public static final String UPDATE_STATUS = MODULE_NAME + "updateStatus";
// 修改数量 // 修改数量
public static final String UPDATE_QTY = MODULE_NAME + "updateQty"; public static final String UPDATE_QTY = MODULE_NAME + "updateQty";
// 修改数量
public static final String UPDATE_CONFIRM = MODULE_NAME + "updateConfirm";
}
/**
* HGKC001 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HgKc001 {
// 模块名称
private static final String MODULE_NAME = "HGKC001.";
// 锁
public static final String LOCK = MODULE_NAME + "lock";
}
/**
* HGKC001 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HgKc010 {
// 模块名称
private static final String MODULE_NAME = "HGKC010.";
// 锁
public static final String LOCK = MODULE_NAME + "lock";
// 锁
public static final String UPDATE_INV = MODULE_NAME + "updateInv";
} }
/** /**
......
package com.baosight.hggp.hg.kc.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.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.kc.domain.HGKC001;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
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:songx
* @date:2024/5/9,11:04
*/
public class ServiceHGKC001 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "采购入库", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUP_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC001().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "采购入库", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
HGKCUtils.HgKc001.setCondition(queryRow);
inInfo = super.query(inInfo, HGKC001.QUERY, new HGKC001());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "采购入库", operType = "修改", operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<HGKC001> fCg004s = MapUtils.toDaoEPBase(inInfo, HGKC001.class);
// 采购收货DB数据
Map<String, HGKC001> dbCg004Map = HGKCUtils.HgKc001.lockGetDataEp(fCg004s);
// 数据校验
this.checkSaveData(fCg004s, dbCg004Map);
// 保存数据
this.saveData(fCg004s, dbCg004Map);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fCg004s.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fCg004s
* @param dbCg004Map
*/
private void checkSaveData(List<HGKC001> fCg004s, Map<String, HGKC001> dbCg004Map) {
for (HGKC001 fCg004 : fCg004s) {
String depositNo = fCg004.getDepositNo();
HGKC001 dbCg004 = dbCg004Map.get(depositNo);
AssertUtils.isNull(dbCg004, String.format("入库单[%s]不存在", depositNo));
}
}
/**
* 数据保存
*
* @param fCg004s
* @param dbCg004Map
*/
private void saveData(List<HGKC001> fCg004s, Map<String, HGKC001> dbCg004Map) {
for (HGKC001 fCg004 : fCg004s) {
String depositNo = fCg004.getDepositNo();
}
}
/**
* 删除操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "采购入库", operType = "修改", operDesc = "删除")
public EiInfo remove(EiInfo inInfo) {
try {
List<HGKC001> fKc001s = MapUtils.toDaoEPBase(inInfo, HGKC001.class);
// 采购收货DB数据
Map<String, HGKC001> dbCg004Map = HGKCUtils.HgKc001.lockGetDataEp(fKc001s);
// 数据校验
this.checkRemoveData(fKc001s, dbCg004Map);
// 保存数据
this.removeData(fKc001s, dbCg004Map);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fKc001s.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fKc001s
* @param dbKc001Map
*/
private void checkRemoveData(List<HGKC001> fKc001s, Map<String, HGKC001> dbKc001Map) {
for (HGKC001 fKc001 : fKc001s) {
String depositNo = fKc001.getDepositNo();
HGKC001 dbCg004 = dbKc001Map.get(depositNo);
AssertUtils.isNull(dbCg004, String.format("入库单[%s]不存在", depositNo));
}
}
/**
* 数据保存
*
* @param fKc001s
* @param dbKc001Map
*/
private void removeData(List<HGKC001> fKc001s, Map<String, HGKC001> dbKc001Map) {
for (HGKC001 fKc001 : fKc001s) {
String depositNo = fKc001.getDepositNo();
HGKC001 dbKc001 = dbKc001Map.get(depositNo);
dbKc001.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode());
DaoUtils.update(HGKC001.DELETE, dbKc001);
// 扣减库存
HGKCUtils.HgKc010.updateInv(dbKc001.getCompanyCode(), dbKc001.getWhCode(), dbKc001.getSpecId(),
dbKc001.getDepositQty().negate(), dbKc001.getDepositWeight().negate());
// 更新收货单状态
HGCGTools.HgCg003.updateStatus(dbKc001.getReceiveNo(), HGConstant.CgReceiveStatus.S_2);
}
}
}
package com.baosight.hggp.hg.kc.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.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.cg.domain.HGCG003;
import com.baosight.hggp.hg.cg.domain.HGCG003A;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.kc.domain.HGKC001;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.BeanUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
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.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/5/9,11:04
*/
public class ServiceHGKC001A extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "采购收货", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUP_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCG003A().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "采购合同", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
HGCGUtils.HgCg003.setCondition(queryRow);
// 仅已收货
queryRow.put(HGCG003.FIELD_STATUS, HGConstant.CgReceiveStatus.S_2);
inInfo = super.query(inInfo, HGCG003.QUERY, new HGCG003());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 确认操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "采购收货", operType = "修改", operDesc = "确认")
public EiInfo confirm(EiInfo inInfo) {
try {
List<HGCG003A> fCg003As = MapUtils.toDaoEPBase(inInfo, HGCG003A.class);
// db数据
Map<String, HGCG003> dbCg003Map = HGCGUtils.HgCg003.lockGetDataEp(fCg003As);
// 数据校验
this.checkConfirmData(fCg003As, dbCg003Map);
// 保存数据
this.confirmData(fCg003As, dbCg003Map);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fCg003As.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fCg003As
* @param dbCg003Map
*/
private void checkConfirmData(List<HGCG003A> fCg003As, Map<String, HGCG003> dbCg003Map) {
for (HGCG003A fCg003A : fCg003As) {
String receiveNo = fCg003A.getReceiveNo();
HGCG003 dbCg003 = dbCg003Map.get(receiveNo);
AssertUtils.isNull(dbCg003, String.format("收货单号[%s]不存在", receiveNo));
AssertUtils.isNotEquals(HGConstant.CgReceiveStatus.S_2, dbCg003.getStatus(),
String.format("收货单号[%s]状态不是\"已收货\",不允许操作", receiveNo));
AssertUtils.isEmpty(fCg003A.getWhCode(), String.format("收货单号[%s]的仓库名称不能为空", dbCg003.getReceiveNo()));
}
}
/**
* 数据保存
*
* @param fCg003As
* @param dbCg003Map
*/
private void confirmData(List<HGCG003A> fCg003As, Map<String, HGCG003> dbCg003Map) {
for (HGCG003A fCg003A : fCg003As) {
String receiveNo = fCg003A.getReceiveNo();
HGCG003 dbCg003 = dbCg003Map.get(receiveNo);
HGKC001 newKc001 = BeanUtils.copy(dbCg003, HGKC001.class);
newKc001.setWhCode(fCg003A.getWhCode());
newKc001.setWhName(fCg003A.getWhName());
newKc001.setDepositDate(DateUtils.shortDate());
newKc001.setDepositNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CG_DEPOSIT_NO));
newKc001.setDepositQty(dbCg003.getDepositQty());
newKc001.setDepositUnitWeight(dbCg003.getReceiveUnitWeight());
newKc001.setDepositWeight(dbCg003.getDepositQty().multiply(dbCg003.getReceiveUnitWeight()));
newKc001.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
DaoUtils.insert(HGKC001.INSERT, newKc001);
// 更新库存数量
HGKCUtils.HgKc010.updateInv(newKc001.getCompanyCode(), newKc001.getWhCode(), newKc001.getSpecId(),
newKc001.getDepositQty(), newKc001.getDepositUnitWeight(), newKc001.getDepositWeight());
// 更新收货单状态
HGCGTools.HgCg003.updateStatus(receiveNo, HGConstant.CgReceiveStatus.S_5);
}
}
}
package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.hg.cg.domain.HGCG001;
import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
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.Map;
/**
* @author:songx
* @date:2024/5/9,11:04
*/
public class ServiceHGKC010 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "综合库存", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC010().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "综合库存", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
inInfo = super.query(inInfo, HGKC010.QUERY, new HGKC010());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd"> <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGCG004"> <sqlMap namespace="HGKC001">
<sql id="column"> <sql id="column">
ID as "id", ID as "id",
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
WIDTH as "width", <!-- 宽度 --> WIDTH as "width", <!-- 宽度 -->
THICK as "thick", <!-- 厚度 --> THICK as "thick", <!-- 厚度 -->
DEPOSIT_QTY as "depositQty", <!-- 入库数量 --> DEPOSIT_QTY as "depositQty", <!-- 入库数量 -->
DEPOSIT_UNIT_WEIGHT as "depositUnitWeight", <!-- 入库单重 -->
DEPOSIT_WEIGHT as "depositWeight" <!-- 入库重量 --> DEPOSIT_WEIGHT as "depositWeight" <!-- 入库重量 -->
</sql> </sql>
...@@ -124,27 +125,27 @@ ...@@ -124,27 +125,27 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
ID asc ID DESC
</isEmpty> </isEmpty>
</dynamic> </dynamic>
</sql> </sql>
<select id="query" resultClass="com.baosight.hggp.hg.cg.domain.HGCG004"> <select id="query" resultClass="com.baosight.hggp.hg.kc.domain.HGKC001">
SELECT SELECT
<include refid="column"/> <include refid="column"/>
FROM ${hggpSchema}.HGCG004 FROM ${hggpSchema}.HGKC001
WHERE 1=1 WHERE 1=1
<include refid="condition"/> <include refid="condition"/>
<include refid="orderBy"/> <include refid="orderBy"/>
</select> </select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGCG004 WHERE 1=1 SELECT COUNT(*) FROM ${hggpSchema}.HGKC001 WHERE 1=1
<include refid="condition"/> <include refid="condition"/>
</select> </select>
<insert id="insert"> <insert id="insert">
INSERT INTO ${hggpSchema}.HGCG004 ( INSERT INTO ${hggpSchema}.HGKC001 (
ACCOUNT_CODE, <!-- 企业编码 --> ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 --> DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 --> CREATED_BY, <!-- 记录创建者 -->
...@@ -171,22 +172,31 @@ ...@@ -171,22 +172,31 @@
WIDTH, <!-- 宽度 --> WIDTH, <!-- 宽度 -->
THICK, <!-- 厚度 --> THICK, <!-- 厚度 -->
DEPOSIT_QTY, <!-- 入库数量 --> DEPOSIT_QTY, <!-- 入库数量 -->
DEPOSIT_UNIT_WEIGHT, <!-- 入库单重 -->
DEPOSIT_WEIGHT <!-- 入库重量 --> DEPOSIT_WEIGHT <!-- 入库重量 -->
) VALUES ( ) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #companyCode#, #companyName#, #depositDate#, #depositNo#, #deleteFlag#, #companyCode#, #companyName#, #depositDate#, #depositNo#,
#receiveNo#, #planNo#, #contractNo#, #whCode#, #whName#, #inventType#, #receiveNo#, #planNo#, #contractNo#, #whCode#, #whName#, #inventType#,
#inventCode#, #inventName#, #specId#, #spec#, #material#, #inventCode#, #inventName#, #specId#, #spec#, #material#,
#unit#, #length#, #width#, #thick#, #depositQty#, #depositWeight# #unit#, #length#, #width#, #thick#, #depositQty#, #depositUnitWeight#, #depositWeight#
) )
</insert> </insert>
<delete id="delete"> <delete id="delete">
UPDATE ${hggpSchema}.HGCG004 UPDATE ${hggpSchema}.HGKC001
SET SET
DELETE_FLAG = #deleteFlag#, DELETE_FLAG = #deleteFlag#,
<include refid="updateRevise"/> <include refid="updateRevise"/>
WHERE DEPOSIT_NO = #depositNo# WHERE DEPOSIT_NO = #depositNo#
</delete> </delete>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGKC001
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
</sqlMap> </sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGKC010">
<sql id="column">
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", <!-- 公司名称 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
SPEC_ID as "specId", <!-- 规格ID -->
SPEC as "spec", <!-- 规格 -->
MATERIAL as "material", <!-- 材质 -->
UNIT as "unit", <!-- 单位 -->
LENGTH as "length", <!-- 长度 -->
WIDTH as "width", <!-- 宽度 -->
THICK as "thick", <!-- 厚度 -->
INV_QTY as "invQty", <!-- 库存数量 -->
INV_UNIT_WEIGHT as "invUnitWeight", <!-- 库存单重 -->
INV_WEIGHT as "invWeight", <!-- 库存重量 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName" <!-- 厂区名称 -->
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</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="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="specId">
SPEC_ID = #specId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
SPEC = #spec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="material">
MATERIAL = #material#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unit">
UNIT = #unit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="length">
LENGTH = #length#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="width">
WIDTH = #width#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thick">
THICK = #thick#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invQty">
INV_QTY = #invQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invUnitWeight">
INV_UNIT_WEIGHT = #invUnitWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invWeight">
INV_WEIGHT = #invWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.kc.domain.HGKC010">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGKC010
WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGKC010 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGKC010 (
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
DELETE_FLAG, <!-- 0-未删除,1-已删除 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
WH_CODE, <!-- 仓库编码 -->
WH_NAME, <!-- 仓库名称 -->
INVENT_TYPE, <!-- 存货类型 -->
INVENT_CODE, <!-- 存货编码 -->
INVENT_NAME, <!-- 存货名称 -->
SPEC_ID, <!-- 规格ID -->
SPEC, <!-- 规格 -->
MATERIAL, <!-- 材质 -->
UNIT, <!-- 单位 -->
LENGTH, <!-- 长度 -->
WIDTH, <!-- 宽度 -->
THICK, <!-- 厚度 -->
INV_QTY, <!-- 库存数量 -->
INV_UNIT_WEIGHT, <!-- 库存单重 -->
INV_WEIGHT, <!-- 库存重量 -->
FACTORY_CODE, <!-- 厂区编码 -->
FACTORY_NAME <!-- 厂区名称 -->
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#,
#companyName#, #whCode#, #whName#, #inventType#, #inventCode#,
#inventName#, #specId#, #spec#, #material#, #unit#, #length#, #width#,
#thick#, #invQty#, #invUnitWeight#, #invWeight#, #factoryCode#, #factoryName#
)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGKC010 WHERE ID = #id#
</delete>
<!-- 锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGKC010
SET CREATED_TIME = #createdTime#
WHERE 1=1
AND ACCOUNT_CODE = #accountCode#
AND COMPANY_CODE = #companyCode#
AND WH_CODE = #whCode#
AND INVENT_CODE = #inventCode#
AND SPEC_ID = #specId#
</update>
<!-- 更新库存 -->
<update id="updateInv">
UPDATE ${hggpSchema}.HGKC010
SET
INV_QTY = #invQty#, <!-- 库存数量 -->
INV_UNIT_WEIGHT = #invUnitWeight#, <!-- 库存单重 -->
INV_WEIGHT = #invWeight# <!-- 库存重量 -->
WHERE ID = #id#
</update>
</sqlMap>
package com.baosight.hggp.hg.kc.tools;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.domain.HGKC001;
import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.StringUtils;
import org.apache.commons.collections.CollectionUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author:songx
* @date:2024/5/13,14:56
*/
public class HGKCTools {
/**
* HGKC001 工具类
*
* @author:songx
* @date:2024/5/9,14:33
*/
public static class HgKc001 {
/**
* 锁
*
* @param depositNos
* @return
*/
public static void lock(List<String> depositNos) {
if (CollectionUtils.isEmpty(depositNos)) {
return;
}
Map paramMap = new HashMap();
paramMap.put("depositNos", depositNos);
DaoBase.getInstance().update(HGSqlConstant.HgKc001.LOCK, paramMap);
}
/**
* 查询
*
* @param depositNos
* @return
*/
public static List<HGKC001> list(List<String> depositNos) {
AssertUtils.isEmpty(depositNos, "入库号不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("depositNos", depositNos);
return DaoBase.getInstance().query(HGKC001.QUERY, paramMap);
}
/**
* 查询
*
* @param depositNos
* @return
*/
public static Map<String, HGKC001> map(List<String> depositNos) {
List<HGKC001> results = list(depositNos);
return results.stream().collect(Collectors.toMap(HGKC001::getDepositNo, item -> item));
}
}
/**
* HGKC010 工具类
*
* @author:songx
* @date:2024/5/9,14:33
*/
public static class HgKc010 {
/**
* 锁
*
* @param companyCode
* @param whCode
* @param specId
* @return
*/
public static void lock(String companyCode, String whCode, Long specId) {
if (StringUtils.isBlank(companyCode) || StringUtils.isBlank(whCode) || specId == null) {
return;
}
Map paramMap = new HashMap();
paramMap.put("companyCode", companyCode);
paramMap.put("whCode", whCode);
paramMap.put("specId", specId);
DaoBase.getInstance().update(HGSqlConstant.HgKc010.LOCK, paramMap);
}
/**
* @param companyCode
* @param whCode
* @param specId
*/
public static HGKC010 get(String companyCode, String whCode, Long specId) {
AssertUtils.isEmpty(companyCode, "公司编码不能为空");
AssertUtils.isEmpty(whCode, "仓库编码不能为空");
AssertUtils.isTrue(specId == null || specId == 0, "规格ID不能为空");
Map paramMap = new HashMap();
paramMap.put("companyCode", companyCode);
paramMap.put("whCode", whCode);
paramMap.put("specId", specId);
List<HGKC010> results = DaoBase.getInstance().query(HGKC010.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
}
}
package com.baosight.hggp.hg.kc.utils;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.domain.HGKC001;
import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils;
import com.baosight.hggp.util.StringUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/5/13,14:57
*/
public class HGKCUtils {
/**
* HGKC001 工具类
*
* @author:songx
* @date:2024/5/9,16:58
*/
public static class HgKc001 {
/**
* 设置查询条件
*
* @param queryRow 集合
* @return
*/
public static void setCondition(Map queryRow) {
HGCGUtils.setCondition(queryRow);
// 入库日期
String depositDate = MapUtils.getString(queryRow, HGKC001.FIELD_DEPOSIT_DATE);
if (StringUtils.isNotBlank(depositDate)) {
queryRow.put(HGKC001.FIELD_DEPOSIT_DATE, DateUtils.formatShort(depositDate));
}
}
/**
* 锁并且获取数据
*
* @param kc001s
* @return
*/
public static Map<String, HGKC001> lockGetDataEp(List<? extends HGKC001> kc001s) {
return lockGetData(ObjectUtils.listEpKey(kc001s, HGKC001.FIELD_DEPOSIT_NO));
}
/**
* 锁并且获取数据
*
* @param depositNos
* @return
*/
public static Map<String, HGKC001> lockGetData(List<String> depositNos) {
// 锁
HGKCTools.HgKc001.lock(depositNos);
// db数据
return HGKCTools.HgKc001.map(depositNos);
}
}
/**
* HGKC010 工具类
*
* @author:songx
* @date:2024/5/9,16:58
*/
public static class HgKc010 {
/**
* 更新库存
*
* @param companyCode
* @param whCode
* @param specId
* @param qty
* @param weight
*/
public static void updateInv(String companyCode, String whCode, Long specId, BigDecimal qty,
BigDecimal weight) {
updateInv(companyCode, whCode, specId, qty, null, weight);
}
/**
* 更新库存
*
* @param companyCode
* @param whCode
* @param specId
* @param qty
* @param unitWeight
* @param weight
*/
public static void updateInv(String companyCode, String whCode, Long specId, BigDecimal qty,
BigDecimal unitWeight, BigDecimal weight) {
HGKC010 newKc010 = buildBean(companyCode, whCode, specId, qty, unitWeight, weight);
// 参数校验
checkUpdateInv(companyCode, whCode, specId, qty, weight);
// 锁库存
HGKCTools.HgKc010.lock(companyCode, whCode, specId);
// 获取DB数据
HGKC010 dbKc010 = HGKCTools.HgKc010.get(companyCode, whCode, specId);
if (dbKc010 == null) {
addInvData(newKc010);
} else {
updateInvData(newKc010, dbKc010);
}
}
/**
* 构建对象
*
* @param companyCode
* @param whCode
* @param specId
* @param qty
* @param unitWeight
* @param weight
* @return
*/
private static HGKC010 buildBean(String companyCode, String whCode, Long specId, BigDecimal qty,
BigDecimal unitWeight, BigDecimal weight) {
HGKC010 newKc010 = new HGKC010();
newKc010.setCompanyCode(companyCode);
newKc010.setWhCode(whCode);
newKc010.setSpecId(specId);
newKc010.setInvQty(qty);
newKc010.setInvUnitWeight(unitWeight);
newKc010.setInvWeight(weight);
return newKc010;
}
/**
* 参数校验
*
* @param companyCode
* @param whCode
* @param specId
* @param qty
* @param weight
*/
private static void checkUpdateInv(String companyCode, String whCode, Long specId, BigDecimal qty,
BigDecimal weight) {
AssertUtils.isEmpty(companyCode, "公司编码不能为空");
AssertUtils.isEmpty(whCode, "仓库编码不能为空");
AssertUtils.isTrue(specId == null || specId == 0, "规格ID不能为空");
AssertUtils.isNull(qty, "库存变更数量不能为空");
AssertUtils.isNull(weight, "库存变更重量不能为空");
AssertUtils.isTrue(qty.compareTo(BigDecimal.ZERO) == 0
&& weight.compareTo(BigDecimal.ZERO) == 0, "库存变更数量和重量不能为空");
}
/**
* 新增库存
*
* @param newKc010
*/
private static void addInvData(HGKC010 newKc010) {
// 公司
newKc010.setCompanyName(HGXSTools.XsOrg.get(newKc010.getCompanyCode()).getOrgCname());
// 仓库
newKc010.setWhName(HGPZTools.HgPz007.get(newKc010.getWhCode()).getWhName());
// 规格
HGPZ005 dbPz005 = HGPZTools.HgPz005.get(newKc010.getSpecId());
newKc010.setInventType(dbPz005.getInventType());
newKc010.setInventCode(dbPz005.getInventCode());
newKc010.setInventName(dbPz005.getInventName());
newKc010.setSpec(dbPz005.getSpec());
newKc010.setLength(dbPz005.getLength());
newKc010.setWidth(dbPz005.getWidth());
newKc010.setThick(dbPz005.getThick());
newKc010.setMaterial(dbPz005.getMaterial());
newKc010.setUnit(dbPz005.getUnit());
newKc010.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
DaoUtils.insert(HGKC010.INSERT, newKc010);
}
/**
* 修改库存
*
* @param newKc010
* @param dbKc010
*/
private static void updateInvData(HGKC010 newKc010, HGKC010 dbKc010) {
BigDecimal newQty = newKc010.getInvQty().add(dbKc010.getInvQty());
AssertUtils.isGt(BigDecimal.ZERO, newQty, String.format("更新后的库存数量小于0(%s),请检查", newQty));
BigDecimal newWeight = newKc010.getInvWeight().add(dbKc010.getInvWeight());
BigDecimal newUnitWeight = newQty.compareTo(BigDecimal.ZERO) == 0 ? BigDecimal.ZERO
: newWeight.divide(newQty, 3, RoundingMode.HALF_UP);
dbKc010.setInvQty(newQty);
dbKc010.setInvWeight(newWeight);
dbKc010.setInvUnitWeight(newUnitWeight);
DaoUtils.update(HGSqlConstant.HgKc010.UPDATE_INV, dbKc010);
}
}
}
...@@ -5,6 +5,7 @@ import com.baosight.hggp.core.dao.DaoBase; ...@@ -5,6 +5,7 @@ import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.ValidFlagEnum; import com.baosight.hggp.core.enums.ValidFlagEnum;
import com.baosight.hggp.hg.pz.domain.HGPZ005; import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.domain.HGPZ007;
import com.baosight.hggp.hg.pz.domain.HGPZ009; import com.baosight.hggp.hg.pz.domain.HGPZ009;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.MapUtils; import com.baosight.hggp.util.MapUtils;
...@@ -33,6 +34,30 @@ import lombok.extern.slf4j.Slf4j; ...@@ -33,6 +34,30 @@ import lombok.extern.slf4j.Slf4j;
public class HGPZTools { public class HGPZTools {
/** /**
* 仓库管理
* HPPZ007 公共DAO定义
*
* @author:songx
* @date:2024/2/6,13:37
*/
public static class HgPz007 {
/**
* 查询
*
* @param whCode
* @return
*/
public static HGPZ007 get(String whCode) {
AssertUtils.isEmpty(whCode, "仓库编码不能为空");
Map queryMap = new HashMap();
queryMap.put("whCode", whCode);
List<HGPZ007> results = DaoBase.getInstance().query(HGPZ007.QUERY, queryMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
}
/**
* HPPZ009 公共DAO定义 * HPPZ009 公共DAO定义
* *
* @author:songx * @author:songx
...@@ -71,6 +96,7 @@ public class HGPZTools { ...@@ -71,6 +96,7 @@ public class HGPZTools {
} }
/** /**
* 存货管理
* HGPZ005 公共DAO定义 * HGPZ005 公共DAO定义
* *
* @author:songx * @author:songx
......
...@@ -45,6 +45,7 @@ public class HGSB002 extends DaoEPBase { ...@@ -45,6 +45,7 @@ public class HGSB002 extends DaoEPBase {
public static final String FIELD_PLAN_USER_ID = "planUserId"; /* 计划人编码*/ public static final String FIELD_PLAN_USER_ID = "planUserId"; /* 计划人编码*/
public static final String FIELD_PLAN_USER_NAME = "planUserName"; /* 计划人名称*/ public static final String FIELD_PLAN_USER_NAME = "planUserName"; /* 计划人名称*/
public static final String FIELD_PLAN_STATUS = "planStatus"; /* 审批状态 0-停止 1-启用*/ public static final String FIELD_PLAN_STATUS = "planStatus"; /* 审批状态 0-停止 1-启用*/
public static final String FIELD_TASK_STATUS = "taskStatus"; /* 任务状态 0-未生成任务 1-已生成任务*/
public static final String COL_ID = "ID"; /* ID*/ public static final String COL_ID = "ID"; /* ID*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 账套*/ public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 账套*/
...@@ -103,6 +104,7 @@ public class HGSB002 extends DaoEPBase { ...@@ -103,6 +104,7 @@ public class HGSB002 extends DaoEPBase {
private String planUserId = " "; /* 计划人编码*/ private String planUserId = " "; /* 计划人编码*/
private String planUserName = " "; /* 计划人名称*/ private String planUserName = " "; /* 计划人名称*/
private Integer planStatus = 1; /* 审批状态 0-停止 1-启用*/ private Integer planStatus = 1; /* 审批状态 0-停止 1-启用*/
private Integer taskStatus = 0; /* 任务状态 0-未生成任务 1-已生成任务*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -207,7 +209,9 @@ public class HGSB002 extends DaoEPBase { ...@@ -207,7 +209,9 @@ public class HGSB002 extends DaoEPBase {
eiColumn.setDescName("审批状态 0-停止 1-启用"); eiColumn.setDescName("审批状态 0-停止 1-启用");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_TASK_STATUS);
eiColumn.setDescName("任务状态 0-未生成任务 1-已生成任务");
eiMetadata.addMeta(eiColumn);
} }
/** /**
...@@ -601,6 +605,15 @@ public class HGSB002 extends DaoEPBase { ...@@ -601,6 +605,15 @@ public class HGSB002 extends DaoEPBase {
public void setPlanStatus(Integer planStatus) { public void setPlanStatus(Integer planStatus) {
this.planStatus = planStatus; this.planStatus = planStatus;
} }
public Integer getTaskStatus() {
return taskStatus;
}
public void setTaskStatus(Integer taskStatus) {
this.taskStatus = taskStatus;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -633,6 +646,7 @@ public class HGSB002 extends DaoEPBase { ...@@ -633,6 +646,7 @@ public class HGSB002 extends DaoEPBase {
setPlanUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_USER_ID)), planUserId)); setPlanUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_USER_ID)), planUserId));
setPlanUserName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_USER_NAME)), planUserName)); setPlanUserName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_USER_NAME)), planUserName));
setPlanStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_PLAN_STATUS)), planStatus)); setPlanStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_PLAN_STATUS)), planStatus));
setTaskStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_TASK_STATUS)), taskStatus));
} }
/** /**
...@@ -666,6 +680,7 @@ public class HGSB002 extends DaoEPBase { ...@@ -666,6 +680,7 @@ public class HGSB002 extends DaoEPBase {
map.put(FIELD_PLAN_USER_ID, StringUtils.toString(planUserId, eiMetadata.getMeta(FIELD_PLAN_USER_ID))); map.put(FIELD_PLAN_USER_ID, StringUtils.toString(planUserId, eiMetadata.getMeta(FIELD_PLAN_USER_ID)));
map.put(FIELD_PLAN_USER_NAME, StringUtils.toString(planUserName, eiMetadata.getMeta(FIELD_PLAN_USER_NAME))); map.put(FIELD_PLAN_USER_NAME, StringUtils.toString(planUserName, eiMetadata.getMeta(FIELD_PLAN_USER_NAME)));
map.put(FIELD_PLAN_STATUS, StringUtils.toString(planStatus, eiMetadata.getMeta(FIELD_PLAN_STATUS))); map.put(FIELD_PLAN_STATUS, StringUtils.toString(planStatus, eiMetadata.getMeta(FIELD_PLAN_STATUS)));
map.put(FIELD_TASK_STATUS, StringUtils.toString(taskStatus, eiMetadata.getMeta(FIELD_TASK_STATUS)));
return map; return map;
} }
......
...@@ -40,6 +40,7 @@ public class HGSB003 extends DaoEPBase { ...@@ -40,6 +40,7 @@ public class HGSB003 extends DaoEPBase {
public static final String FIELD_CHECK_ITEM = "checkItem"; /* 检查项*/ public static final String FIELD_CHECK_ITEM = "checkItem"; /* 检查项*/
public static final String FIELD_CHECK_DESCRIP = "checkDescrip"; /* 检查结果*/ public static final String FIELD_CHECK_DESCRIP = "checkDescrip"; /* 检查结果*/
public static final String FIELD_DOC_ID = "docId"; /* 附件ID*/ public static final String FIELD_DOC_ID = "docId"; /* 附件ID*/
public static final String FIELD_DOC_NAME = "docName"; /* 附件ID*/
public static final String FIELD_APPLY_USER_ID = "applyUserId"; /* 申请人*/ public static final String FIELD_APPLY_USER_ID = "applyUserId"; /* 申请人*/
public static final String FIELD_APPLY_USER_NAME = "applyUserName"; /* 申请人名称*/ public static final String FIELD_APPLY_USER_NAME = "applyUserName"; /* 申请人名称*/
public static final String FIELD_STATUS = "status"; /* 审批状态 0-审批未完成 1-审批完成*/ public static final String FIELD_STATUS = "status"; /* 审批状态 0-审批未完成 1-审批完成*/
...@@ -95,6 +96,7 @@ public class HGSB003 extends DaoEPBase { ...@@ -95,6 +96,7 @@ public class HGSB003 extends DaoEPBase {
private String checkItem = " "; /* 检查项*/ private String checkItem = " "; /* 检查项*/
private String checkDescrip = " "; /* 检查结果*/ private String checkDescrip = " "; /* 检查结果*/
private String docId = " "; /* 附件ID*/ private String docId = " "; /* 附件ID*/
private String docName = " ";
private String applyUserId = " "; /* 申请人*/ private String applyUserId = " "; /* 申请人*/
private String applyUserName = " "; /* 申请人名称*/ private String applyUserName = " "; /* 申请人名称*/
private Integer status = 0; /* 审批状态 0-审批未完成 1-审批完成*/ private Integer status = 0; /* 审批状态 0-审批未完成 1-审批完成*/
...@@ -182,6 +184,10 @@ public class HGSB003 extends DaoEPBase { ...@@ -182,6 +184,10 @@ public class HGSB003 extends DaoEPBase {
eiColumn.setDescName("附件ID"); eiColumn.setDescName("附件ID");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_NAME);
eiColumn.setDescName("附件名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_APPLY_USER_ID); eiColumn = new EiColumn(FIELD_APPLY_USER_ID);
eiColumn.setDescName("申请人"); eiColumn.setDescName("申请人");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -508,6 +514,15 @@ public class HGSB003 extends DaoEPBase { ...@@ -508,6 +514,15 @@ public class HGSB003 extends DaoEPBase {
public void setDocId(String docId) { public void setDocId(String docId) {
this.docId = docId; this.docId = docId;
} }
public String getDocName() {
return docName;
}
public void setDocName(String docName) {
this.docName = docName;
}
/** /**
* get the applyUserId - 申请人. * get the applyUserId - 申请人.
* @return the applyUserId * @return the applyUserId
...@@ -583,6 +598,7 @@ public class HGSB003 extends DaoEPBase { ...@@ -583,6 +598,7 @@ public class HGSB003 extends DaoEPBase {
setCheckItem(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHECK_ITEM)), checkItem)); setCheckItem(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHECK_ITEM)), checkItem));
setCheckDescrip(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHECK_DESCRIP)), checkDescrip)); setCheckDescrip(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHECK_DESCRIP)), checkDescrip));
setDocId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_ID)), docId)); setDocId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_ID)), docId));
setDocName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_NAME)), docName));
setApplyUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_APPLY_USER_ID)), applyUserId)); setApplyUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_APPLY_USER_ID)), applyUserId));
setApplyUserName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_APPLY_USER_NAME)), applyUserName)); setApplyUserName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_APPLY_USER_NAME)), applyUserName));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status)); setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
...@@ -614,6 +630,7 @@ public class HGSB003 extends DaoEPBase { ...@@ -614,6 +630,7 @@ public class HGSB003 extends DaoEPBase {
map.put(FIELD_CHECK_ITEM, StringUtils.toString(checkItem, eiMetadata.getMeta(FIELD_CHECK_ITEM))); map.put(FIELD_CHECK_ITEM, StringUtils.toString(checkItem, eiMetadata.getMeta(FIELD_CHECK_ITEM)));
map.put(FIELD_CHECK_DESCRIP, StringUtils.toString(checkDescrip, eiMetadata.getMeta(FIELD_CHECK_DESCRIP))); map.put(FIELD_CHECK_DESCRIP, StringUtils.toString(checkDescrip, eiMetadata.getMeta(FIELD_CHECK_DESCRIP)));
map.put(FIELD_DOC_ID, StringUtils.toString(docId, eiMetadata.getMeta(FIELD_DOC_ID))); map.put(FIELD_DOC_ID, StringUtils.toString(docId, eiMetadata.getMeta(FIELD_DOC_ID)));
map.put(FIELD_DOC_NAME, StringUtils.toString(docName, eiMetadata.getMeta(FIELD_DOC_NAME)));
map.put(FIELD_APPLY_USER_ID, StringUtils.toString(applyUserId, eiMetadata.getMeta(FIELD_APPLY_USER_ID))); map.put(FIELD_APPLY_USER_ID, StringUtils.toString(applyUserId, eiMetadata.getMeta(FIELD_APPLY_USER_ID)));
map.put(FIELD_APPLY_USER_NAME, StringUtils.toString(applyUserName, eiMetadata.getMeta(FIELD_APPLY_USER_NAME))); map.put(FIELD_APPLY_USER_NAME, StringUtils.toString(applyUserName, eiMetadata.getMeta(FIELD_APPLY_USER_NAME)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS))); map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
......
package com.baosight.hggp.hg.sb.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
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.sb.domain.HGSB004;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtil;
import com.baosight.hggp.util.contants.ACConstants;
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.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/5/11
*/
public class ServiceHGSB004 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB004.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGSB004.QUERY, new HGSB004());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.USER_BLOCK_ID,DdynamicEnum.GROUP_CODE_BOX_BLOCK_ID),null
);
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
EiBlock block = inInfo.getBlock(EiConstant.queryBlock);
block.setCell(ACConstants.ROW_CODE_0, HGSB004.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
String planDate = block.getCellStr(ACConstants.ROW_CODE_0,HGSB004.FIELD_INSPEC_DATE);
if (!planDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB004.FIELD_INSPEC_DATE, StringUtil.removeHorizontalLine(planDate));
}
return super.query(inInfo,HGSB004.QUERY,new HGSB004());
}
@OperationLogAnnotation(operModul = "设备点检",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HGSB004 hgsb004 = new HGSB004();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgsb004.fromMap(map);
hgsb004.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGSB004.DELETE_FLAG, hgsb004.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("删除失败", e.getMessage());
return inInfo;
}
return inInfo;
}
/**
* 保存操作
*/
@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++) {
HGSB004 hgsb004 = new HGSB004();
hgsb004.fromMap(resultRows.get(i));
if (hgsb004.getId() == null || hgsb004.getId() == 0) {
this.add(hgsb004);
} else {
this.modify(hgsb004);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HGSB004 hgsb004) {
//生成点检单号
hgsb004.setInspecCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.INSPEC_CODE));
DaoUtils.insert(HGSB004.INSERT, hgsb004);
}
/**
* 修改操作
*/
public void modify(HGSB004 hgsb004) {
hgsb004.setInspecDate(StringUtil.removeHorizontalLine(hgsb004.getInspecDate()));
DaoUtils.update(HGSB004.UPDATE, hgsb004);
}
@OperationLogAnnotation(operModul = "设备点检",operType = "修改",operDesc = "修改状态操作")
public EiInfo updateStatus(EiInfo inInfo){
int i = 0;
try {
HGSB004 hgsb004 = new HGSB004();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgsb004.fromMap(map);
DaoUtils.update(HGSB004.UPDATE_STATUS, hgsb004);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleUpdateException(inInfo,i,e);
logError("修改失败", e.getMessage());
return inInfo;
}
return inInfo;
}
}
package com.baosight.hggp.hg.sb.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.sb.domain.HGSB004;
import com.baosight.hggp.hg.sb.domain.HGSB004A;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
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.ServiceEPBase;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/5/11
*/
public class ServiceHGSB004A extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB004A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
//String companyCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB004.FIELD_COMPANY_CODE);
//String groupCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB004A.FIELD_GROUP_CODE);
inInfo = super.query(inInfo, HGSB004A.QUERY, new HGSB004A());
//CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_CODE_BOX_BLOCK_ID),null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),
new HashMap<String,Object>(){{
//put(HGSB004.FIELD_COMPANY_CODE,companyCode);
//put(HGSB004A.FIELD_GROUP_CODE,groupCode);
put(HGSB004A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);}}
);
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB004A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo, HGSB004A.QUERY,new HGSB004A());
}
@OperationLogAnnotation(operModul = "设备点检详情",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HGSB004A hgsb004a = new HGSB004A();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgsb004a.fromMap(map);
hgsb004a.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGSB004A.DELETE_FLAG, hgsb004a.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("删除失败", e.getMessage());
return inInfo;
}
return inInfo;
}
@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++) {
HGSB004A hgsb004a = new HGSB004A();
hgsb004a.fromMap(resultRows.get(i));
if (hgsb004a.getId() == null || hgsb004a.getId() == 0) {
hgsb004a.setParentId(Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB004A.FIELD_PARENT_ID)));
this.add(hgsb004a);
} else {
this.modify(hgsb004a);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HGSB004A hgsb004a) {
DaoUtils.insert(HGSB004A.INSERT, hgsb004a);
}
/**
* 修改操作
*/
public void modify(HGSB004A hgsb004a) {
DaoUtils.update(HGSB004A.UPDATE, hgsb004a);
}
@OperationLogAnnotation(operModul = "设备点检详情",operType = "上传附件",operDesc = "上传附件操作")
public EiInfo updateDocId(EiInfo inInfo){
int i = 0;
try {
HGSB004A hgsb004a = new HGSB004A();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgsb004a.fromMap(map);
DaoUtils.update(HGSB004A.UPDATE_DOC_ID, hgsb004a);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleUpdateException(inInfo,i,e);
logError("修改失败", e.getMessage());
return inInfo;
}
return inInfo;
}
}
package com.baosight.hggp.hg.sb.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
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.sb.domain.*;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
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.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/5/13
*/
public class ServiceHGSB004B extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB002.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB002.FIELD_TASK_STATUS, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGSB002.QUERY, new HGSB002());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID, DdynamicEnum.USER_BLOCK_ID,DdynamicEnum.GROUP_CODE_BOX_BLOCK_ID),null
);
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
EiBlock block = inInfo.getBlock(EiConstant.queryBlock);
block.setCell(ACConstants.ROW_CODE_0, HGSB002.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
String planDate = block.getCellStr(ACConstants.ROW_CODE_0,HGSB002.FIELD_PLAN_DATE);
if (!planDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB002.FIELD_PLAN_DATE, StringUtil.removeHorizontalLine(planDate));
}
return super.query(inInfo,HGSB002.QUERY,new HGSB002());
}
/**
* 保存操作
*/
@OperationLogAnnotation(operModul = "设备计划",operType = "保存",operDesc = "保存操作")
public EiInfo save(EiInfo inInfo) {
try {
EiBlock block =inInfo.getBlock(EiConstant.queryBlock);
String pageNumber = block.getCellStr(ACConstants.ROW_CODE_0,"pageNumber");
Map<String,String> map = new HashMap<String,String>();
map.put(HGSB004.FIELD_INSPEC_USER_ID,block.getCellStr(ACConstants.ROW_CODE_0,HGSB004.FIELD_INSPEC_USER_ID));
map.put(HGSB004.FIELD_INSPEC_USER_NAME,block.getCellStr(ACConstants.ROW_CODE_0,HGSB004.FIELD_INSPEC_USER_NAME));
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<HGSB002A> hgsb002A;
// 写入数据
for (Map resultRow : resultRows) {
HGSB002 hgsb002 = new HGSB002();
hgsb002.fromMap(resultRow);
if ("HGSB004".equals(pageNumber)) {
//添加设备点检
HGSB004 hgsb004 = addHgsb004(hgsb002,map);
hgsb002A = HGSBTools.Hgsb002.getDetails(hgsb002.getId());
addHgsb004a(hgsb002A,hgsb004.getId());
}else if ("HGSB005".equals(pageNumber)){
//添加设备点检
HGSB005 hgsb005 = addHgsb005(hgsb002,map);
hgsb002A = HGSBTools.Hgsb002.getDetails(hgsb002.getId());
addHgsb005a(hgsb002A,hgsb005.getId());
}
hgsb002.setTaskStatus(1);
DaoUtils.update(HGSB002.UPDATE,hgsb002);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 添加设备点检
*/
private HGSB004 addHgsb004(HGSB002 hgsb002,Map<String,String> map){
HGSB004 hgsb004 = new HGSB004();
hgsb004.setCompanyCode(hgsb002.getCompanyCode());
hgsb004.setCompanyName(hgsb002.getCompanyName());
hgsb004.setPlanCode(hgsb002.getPlanCode());
hgsb004.setPlanStartDate(hgsb002.getPlanStartDate());
hgsb004.setPlanEndDate(hgsb002.getPlanEndDate());
hgsb004.setInspecDate(DateUtils.formatShort(DateUtils.date()));
hgsb004.setInspecCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.INSPEC_CODE));
hgsb004.setInspecUserId(map.get(HGSB004.FIELD_INSPEC_USER_ID));
hgsb004.setInspecUserName(map.get(HGSB004.FIELD_INSPEC_USER_NAME));
DaoUtils.insert(HGSB004.INSERT, hgsb004);
Map map1 = hgsb004.toMap();
map1.remove(HGSB004.FIELD_ID);
List<HGSB004> hgsb004List = this.dao.query(HGSB004.QUERY,map1);
AssertUtils.isEmpty(hgsb004List, "设备点检添加失败");
return hgsb004List.get(0);
}
/**
* 添加设备点检
*/
private void addHgsb004a(List<HGSB002A> hgsb002AList, Long id){
AssertUtils.isEmpty(hgsb002AList, "设备计划详情不能为空");
for (HGSB002A hgsb002a: hgsb002AList) {
HGSB004A hgsb004A = new HGSB004A();
hgsb004A.setCheckItem(hgsb002a.getCheckItem());
hgsb004A.setCheckDescrip(hgsb002a.getCheckDescrip());
hgsb004A.setDeviceCode(hgsb002a.getDeviceCode());
hgsb004A.setDeviceName(hgsb002a.getDeviceName());
hgsb004A.setDeleteFlag(CommonConstant.YesNo.NO_0);
hgsb004A.setGroupCode(hgsb002a.getGroupCode());
hgsb004A.setGroupName(hgsb002a.getGroupName());
hgsb004A.setDeviceType(hgsb002a.getDeviceType());
hgsb004A.setParentId(id);
DaoUtils.insert(HGSB004A.INSERT, hgsb004A);
}
}
/**
* 添加设备保养
*/
private HGSB005 addHgsb005(HGSB002 hgsb002,Map<String,String> map){
HGSB005 hgsb005 = new HGSB005();
hgsb005.setCompanyCode(hgsb002.getCompanyCode());
hgsb005.setCompanyName(hgsb002.getCompanyName());
hgsb005.setPlanCode(hgsb002.getPlanCode());
hgsb005.setPlanStartDate(hgsb002.getPlanStartDate());
hgsb005.setPlanEndDate(hgsb002.getPlanEndDate());
hgsb005.setUpkeepDate(DateUtils.formatShort(DateUtils.date()));
hgsb005.setUpkeepCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.INSPEC_CODE));
hgsb005.setUpkeepUserId(map.get(HGSB004.FIELD_INSPEC_USER_ID));
hgsb005.setUpkeepUserName(map.get(HGSB004.FIELD_INSPEC_USER_NAME));
DaoUtils.insert(HGSB005.INSERT, hgsb005);
Map map1 = hgsb005.toMap();
map1.remove(HGSB004.FIELD_ID);
List<HGSB005> hgsb005List = this.dao.query(HGSB005.QUERY,map1);
AssertUtils.isEmpty(hgsb005List, "设备保养添加失败");
return hgsb005List.get(0);
}
/**
* 添加设备保养详情
*/
private void addHgsb005a(List<HGSB002A> hgsb002AList,Long id){
AssertUtils.isEmpty(hgsb002AList, "设备计划详情不能为空");
for (HGSB002A hgsb002a: hgsb002AList) {
HGSB005A hgsb005A = new HGSB005A();
hgsb005A.setCheckItem(hgsb002a.getCheckItem());
hgsb005A.setCheckDescrip(hgsb002a.getCheckDescrip());
hgsb005A.setDeviceCode(hgsb002a.getDeviceCode());
hgsb005A.setDeviceName(hgsb002a.getDeviceName());
hgsb005A.setDeleteFlag(CommonConstant.YesNo.NO_0);
hgsb005A.setGroupCode(hgsb002a.getGroupCode());
hgsb005A.setGroupName(hgsb002a.getGroupName());
hgsb005A.setDeviceType(hgsb002a.getDeviceType());
hgsb005A.setParentId(id);
DaoUtils.insert(HGSB005A.INSERT, hgsb005A);
}
}
}
package com.baosight.hggp.hg.sb.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
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.sb.domain.HGSB005;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
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.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/5/11
*/
public class ServiceHGSB005 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB005.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGSB005.QUERY, new HGSB005());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.USER_BLOCK_ID,DdynamicEnum.GROUP_CODE_BOX_BLOCK_ID),null
);
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
EiBlock block = inInfo.getBlock(EiConstant.queryBlock);
block.setCell(ACConstants.ROW_CODE_0, HGSB005.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
String upkeepDate = block.getCellStr(ACConstants.ROW_CODE_0,HGSB005.FIELD_UPKEEP_DATE);
if (!upkeepDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB005.FIELD_UPKEEP_DATE, StringUtil.removeHorizontalLine(upkeepDate));
}
return super.query(inInfo,HGSB005.QUERY,new HGSB005());
}
@OperationLogAnnotation(operModul = "设备保养",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HGSB005 hgsb005 = new HGSB005();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgsb005.fromMap(map);
hgsb005.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGSB005.DELETE_FLAG, hgsb005.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("删除失败", e.getMessage());
return inInfo;
}
return inInfo;
}
/**
* 保存操作
*/
@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++) {
HGSB005 hgsb005 = new HGSB005();
hgsb005.fromMap(resultRows.get(i));
if (hgsb005.getId() == null || hgsb005.getId() == 0) {
this.add(hgsb005);
} else {
this.modify(hgsb005);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HGSB005 hgsb005) {
//生成保养单号
hgsb005.setUpkeepDate(SequenceGenerator.getNextSequence(HGConstant.SequenceId.UPKEEP_CODE));
DaoUtils.insert(HGSB005.INSERT, hgsb005);
}
/**
* 修改操作
*/
public void modify(HGSB005 hgsb005) {
hgsb005.setUpkeepDate(DateUtils.formatShort(hgsb005.getUpkeepDate()));
DaoUtils.update(HGSB005.UPDATE, hgsb005);
}
@OperationLogAnnotation(operModul = "设备保养",operType = "修改",operDesc = "修改状态操作")
public EiInfo updateStatus(EiInfo inInfo){
int i = 0;
try {
HGSB005 hgsb005 = new HGSB005();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgsb005.fromMap(map);
DaoUtils.update(HGSB005.UPDATE_STATUS, hgsb005);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleUpdateException(inInfo,i,e);
logError("修改失败", e.getMessage());
return inInfo;
}
return inInfo;
}
}
package com.baosight.hggp.hg.sb.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.sb.domain.HGSB005A;
import com.baosight.hggp.hg.sb.domain.HGSB005;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
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.ServiceEPBase;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/5/11
*/
public class ServiceHGSB005A extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB005A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
//String companyCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB005.FIELD_COMPANY_CODE);
//String groupCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB005A.FIELD_GROUP_CODE);
inInfo = super.query(inInfo, HGSB005A.QUERY, new HGSB005A());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_CODE_BOX_BLOCK_ID),null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),
new HashMap<String,Object>(){{
//put(HGSB005.FIELD_COMPANY_CODE,companyCode);
//put(HGSB005A.FIELD_GROUP_CODE,groupCode);
put(HGSB005A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);}}
);
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB005A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo, HGSB005A.QUERY,new HGSB005A());
}
@OperationLogAnnotation(operModul = "设备保养详情",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HGSB005A hgsb005a = new HGSB005A();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgsb005a.fromMap(map);
hgsb005a.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGSB005A.DELETE_FLAG, hgsb005a.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("删除失败", e.getMessage());
return inInfo;
}
return inInfo;
}
@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++) {
HGSB005A hgsb005a = new HGSB005A();
hgsb005a.fromMap(resultRows.get(i));
if (hgsb005a.getId() == null || hgsb005a.getId() == 0) {
hgsb005a.setParentId(Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB005A.FIELD_PARENT_ID)));
this.add(hgsb005a);
} else {
this.modify(hgsb005a);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HGSB005A hgsb005a) {
DaoUtils.insert(HGSB005A.INSERT, hgsb005a);
}
/**
* 修改操作
*/
public void modify(HGSB005A hgsb005a) {
DaoUtils.update(HGSB005A.UPDATE, hgsb005a);
}
@OperationLogAnnotation(operModul = "设备保养详情",operType = "上传附件",operDesc = "上传附件操作")
public EiInfo updateDocId(EiInfo inInfo){
int i = 0;
try {
HGSB005A hgsb005a = new HGSB005A();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgsb005a.fromMap(map);
DaoUtils.update(HGSB005A.UPDATE_DOC_ID, hgsb005a);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleUpdateException(inInfo,i,e);
logError("修改失败", e.getMessage());
return inInfo;
}
return inInfo;
}
}
<?xml version="1.0" encoding="UTF-8"?> <?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 <!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-09 14:12:07 Generate time : 2024-05-09 14:12:07
Version : 1.0 Version : 1.0
schema : hggp schema : hggp
...@@ -55,7 +56,8 @@ ...@@ -55,7 +56,8 @@
PLAN_END_DATE as "planEndDate", <!-- 计划结束日期 --> PLAN_END_DATE as "planEndDate", <!-- 计划结束日期 -->
PLAN_USER_ID as "planUserId", <!-- 计划人编码 --> PLAN_USER_ID as "planUserId", <!-- 计划人编码 -->
PLAN_USER_NAME as "planUserName", <!-- 计划人名称 --> PLAN_USER_NAME as "planUserName", <!-- 计划人名称 -->
PLAN_STATUS as "planStatus" <!-- 审批状态 0-停止 1-启用 --> PLAN_STATUS as "planStatus", <!-- 审批状态 0-停止 1-启用 -->
TASK_STATUS as "taskStatus"
</sql> </sql>
<sql id="authCondition"> <sql id="authCondition">
...@@ -151,6 +153,9 @@ ...@@ -151,6 +153,9 @@
<isNotEmpty prepend=" AND " property="planStatus"> <isNotEmpty prepend=" AND " property="planStatus">
PLAN_STATUS = #planStatus# PLAN_STATUS = #planStatus#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="taskStatus">
TASK_STATUS = #taskStatus#
</isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
...@@ -274,9 +279,10 @@ ...@@ -274,9 +279,10 @@
PLAN_END_DATE, <!-- 计划结束日期 --> PLAN_END_DATE, <!-- 计划结束日期 -->
PLAN_USER_ID, <!-- 计划人编码 --> PLAN_USER_ID, <!-- 计划人编码 -->
PLAN_USER_NAME, <!-- 计划人名称 --> PLAN_USER_NAME, <!-- 计划人名称 -->
PLAN_STATUS <!-- 审批状态 0-停止 1-启用 --> PLAN_STATUS, <!-- 审批状态 0-停止 1-启用 -->
TASK_STATUS
) )
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #factoryCode#, #factoryName#, #groupCode#, #groupName#, #planDate#, #planCode#, #planType#, #planStartDate#, #planEndDate#, #planUserId#, #planUserName#, #planStatus#) VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #factoryCode#, #factoryName#, #groupCode#, #groupName#, #planDate#, #planCode#, #planType#, #planStartDate#, #planEndDate#, #planUserId#, #planUserName#, #planStatus#, #taskStatus#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -320,7 +326,8 @@ ...@@ -320,7 +326,8 @@
PLAN_END_DATE = #planEndDate#, <!-- 计划结束日期 --> PLAN_END_DATE = #planEndDate#, <!-- 计划结束日期 -->
PLAN_USER_ID = #planUserId#, <!-- 计划人编码 --> PLAN_USER_ID = #planUserId#, <!-- 计划人编码 -->
PLAN_USER_NAME = #planUserName#, <!-- 计划人名称 --> PLAN_USER_NAME = #planUserName#, <!-- 计划人名称 -->
PLAN_STATUS = #planStatus# <!-- 审批状态 0-停止 1-启用 --> PLAN_STATUS = #planStatus#, <!-- 审批状态 0-停止 1-启用 -->
TASK_STATUS = #taskStatus#
WHERE WHERE
ID = #id# ID = #id#
</update> </update>
...@@ -336,4 +343,15 @@ ...@@ -336,4 +343,15 @@
ID = #id# ID = #id#
</update> </update>
<update id="updateTaskStatus">
UPDATE ${hggpSchema}.HGSB002
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
TASK_STATUS = #taskStatus# <!-- 任务状态0.启用1.停止 -->
WHERE
ID = #id#
</update>
</sqlMap> </sqlMap>
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
CHECK_ITEM as "checkItem", <!-- 检查项 --> CHECK_ITEM as "checkItem", <!-- 检查项 -->
CHECK_DESCRIP as "checkDescrip", <!-- 检查结果 --> CHECK_DESCRIP as "checkDescrip", <!-- 检查结果 -->
DOC_ID as "docId", <!-- 附件ID --> DOC_ID as "docId", <!-- 附件ID -->
DOC_NAME as "docName",
APPLY_USER_ID as "applyUserId", <!-- 申请人 --> APPLY_USER_ID as "applyUserId", <!-- 申请人 -->
APPLY_USER_NAME as "applyUserName", <!-- 申请人名称 --> APPLY_USER_NAME as "applyUserName", <!-- 申请人名称 -->
STATUS as "status" <!-- 审批状态 0-审批未完成 1-审批完成 --> STATUS as "status" <!-- 审批状态 0-审批未完成 1-审批完成 -->
...@@ -256,11 +257,12 @@ ...@@ -256,11 +257,12 @@
CHECK_ITEM, <!-- 检查项 --> CHECK_ITEM, <!-- 检查项 -->
CHECK_DESCRIP, <!-- 检查结果 --> CHECK_DESCRIP, <!-- 检查结果 -->
DOC_ID, <!-- 附件ID --> DOC_ID, <!-- 附件ID -->
DOC_NAME,
APPLY_USER_ID, <!-- 申请人 --> APPLY_USER_ID, <!-- 申请人 -->
APPLY_USER_NAME, <!-- 申请人名称 --> APPLY_USER_NAME, <!-- 申请人名称 -->
STATUS <!-- 审批状态 0-审批未完成 1-审批完成 --> STATUS <!-- 审批状态 0-审批未完成 1-审批完成 -->
) )
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #applyDate#, #applyCode#, #deviceCode#, #deviceName#, #checkItem#, #checkDescrip#, #docId#, #applyUserId#, #applyUserName#, #status#) VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #applyDate#, #applyCode#, #deviceCode#, #deviceName#, #checkItem#, #checkDescrip#, #docId#, #docName#, #applyUserId#, #applyUserName#, #status#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -300,6 +302,7 @@ ...@@ -300,6 +302,7 @@
CHECK_ITEM = #checkItem#, <!-- 检查项 --> CHECK_ITEM = #checkItem#, <!-- 检查项 -->
CHECK_DESCRIP = #checkDescrip#, <!-- 检查结果 --> CHECK_DESCRIP = #checkDescrip#, <!-- 检查结果 -->
DOC_ID = #docId#, <!-- 附件ID --> DOC_ID = #docId#, <!-- 附件ID -->
DOC_NAME = #docName#,
APPLY_USER_ID = #applyUserId#, <!-- 申请人 --> APPLY_USER_ID = #applyUserId#, <!-- 申请人 -->
APPLY_USER_NAME = #applyUserName#, <!-- 申请人名称 --> APPLY_USER_NAME = #applyUserName#, <!-- 申请人名称 -->
STATUS = #status# <!-- 审批状态 0-审批未完成 1-审批完成 --> STATUS = #status# <!-- 审批状态 0-审批未完成 1-审批完成 -->
...@@ -324,7 +327,8 @@ ...@@ -324,7 +327,8 @@
UPDATED_BY = #updatedBy#, <!-- 更新人 --> UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 --> UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 --> UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DOC_ID = #docId# <!-- 附件ID --> DOC_ID = #docId#, <!-- 附件ID -->
DOC_NAME = #docName#
WHERE WHERE
ID = #id# ID = #id#
</update> </update>
......
package com.baosight.hggp.hg.sb.tools;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.hg.sb.domain.HGSB002;
import com.baosight.hggp.hg.sb.domain.HGSB002A;
import com.baosight.hggp.hg.sb.domain.HGSB004;
import com.baosight.hggp.hg.sb.domain.HGSB004A;
import com.baosight.hggp.util.AssertUtils;
import org.apache.commons.collections.CollectionUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/5/11
*/
public class HGSBTools {
/**
* Hgsb002公共DAO方法定义
*
*/
public static class Hgsb002 {
/**
* 查询设备计划详情
*
* @param id
*/
public static List<HGSB002A> getDetails(Long id) {
AssertUtils.isNull(id, "设备计划不能为空");
Map queryMap = new HashMap();
queryMap.put(HGSB002A.FIELD_PARENT_ID, id);
queryMap.put(HGSB002A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
List<HGSB002A> results = DaoBase.getInstance().query(HGSB002A.QUERY, queryMap);
return results;
}
}
/**
* Hgsb004公共DAO方法定义
*
*/
public static class Hgsb004 {
/**
* 查询
*
* @param hgsb004
*/
public static List<HGSB004> get(HGSB004 hgsb004) {
AssertUtils.isNull(hgsb004, "设备点检不能为空");
List<HGSB004> results = DaoBase.getInstance().query(HGSB004.QUERY, hgsb004);
return results;
}
}
}
...@@ -169,7 +169,7 @@ public class AssertUtils { ...@@ -169,7 +169,7 @@ public class AssertUtils {
* @param b * @param b
* @param message * @param message
*/ */
public static void isNotEqual(BigDecimal a, BigDecimal b, String message) { public static void isNotEquals(BigDecimal a, BigDecimal b, String message) {
if (a.compareTo(b) != 0) { if (a.compareTo(b) != 0) {
throw new PlatException(message); throw new PlatException(message);
} }
......
...@@ -23,4 +23,8 @@ ...@@ -23,4 +23,8 @@
<!-- 库存 -->
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC001.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC010.xml"/>
</sqlMapConfig> </sqlMapConfig>
...@@ -102,7 +102,7 @@ let submit = function () { ...@@ -102,7 +102,7 @@ let submit = function () {
message("请选择数据"); message("请选择数据");
return; return;
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"审核\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HGCG001", "submit", true); JSUtils.submitGridsData("result", "HGCG001", "submit", true);
} }
......
...@@ -47,11 +47,11 @@ ...@@ -47,11 +47,11 @@
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center"> <EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="hggp.hgcg.planStatus"/> <EF:EFCodeOption codeName="hggp.hgcg.planStatus"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center"/> <EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/> <EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="specId" cname="规格ID" enable="false" width="120" align="center" hidden="true"/> <EF:EFColumn ename="specId" cname="规格ID" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/> <EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="purQty" cname="采购数量" width="120" align="right" format="{0:N3}" required="true"/> <EF:EFColumn ename="purQty" cname="采购数量" width="120" align="right" format="{0:N0}" required="true"/>
<EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}" required="true"/> <EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="planWeight" cname="计划重量" enable="false" width="120" align="right" format="{0:N3}"/> <EF:EFColumn ename="planWeight" cname="计划重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/> <EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
......
...@@ -10,7 +10,11 @@ $(function () { ...@@ -10,7 +10,11 @@ $(function () {
columns: [], columns: [],
loadComplete: function (grid) { loadComplete: function (grid) {
// 提交 // 提交
$(document.body).on("click", "#SUBMIT", submit); $("#SUBMIT").on("click", submit);
// change事件
grid.dataSource.bind("change", function (e) {
supCodeChange(e);
});
}, },
onSave: function (e) { onSave: function (e) {
// 阻止后台请求,使用自定义 // 阻止后台请求,使用自定义
...@@ -50,6 +54,26 @@ let query = function () { ...@@ -50,6 +54,26 @@ let query = function () {
} }
/** /**
* 供应商变更
*/
let supCodeChange = function (e) {
if (e.field != "supCode") {
return;
}
let item = e.items[0];
let supRecordRows = __eiInfo.blocks.sup_record_block_id.rows;
for (let k = 0; k < resultGrid.getCheckedRowsIndex() + 1; k++) {
for (let i = 0; i < supRecordRows.length; i++) {
if (supRecordRows[i][1] === item.supCode) {
let supName = supRecordRows[i][0];
resultGrid.setCellValue(item, 'supName', supName == null ? "" : supName);
return;
}
}
}
}
/**
* 保存 * 保存
*/ */
let save = function () { let save = function () {
...@@ -100,7 +124,7 @@ let submit = function () { ...@@ -100,7 +124,7 @@ let submit = function () {
message("请选择数据"); message("请选择数据");
return; return;
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"审核\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HGCG002", "submit", true); JSUtils.submitGridsData("result", "HGCG002", "submit", true);
} }
......
...@@ -59,14 +59,15 @@ ...@@ -59,14 +59,15 @@
filter="contains" required="true"> filter="contains" required="true">
<EF:EFOptions blockId="sup_record_block_id" valueField="valueField" textField="textField"/> <EF:EFOptions blockId="sup_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="supName" cname="供应商名称" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="purUserName" cname="采购员" width="100" align="center" required="true"/> <EF:EFColumn ename="purUserName" cname="采购员" width="100" align="center" required="true"/>
<EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center"/> <EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/> <EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="specId" cname="规格ID" enable="false" width="120" align="center" hidden="true"/> <EF:EFColumn ename="specId" cname="规格ID" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/> <EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="purQty" cname="采购数量" width="120" align="right" format="{0:N3}"/> <EF:EFColumn ename="purQty" cname="采购数量" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}"/> <EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="receiveQty" cname="已收货数量" width="120" align="right" format="{0:N3}"/> <EF:EFColumn ename="receiveQty" cname="已收货数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/> <EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="unit" cname="单位" enable="false" width="80" align="center"/> <EF:EFColumn ename="unit" cname="单位" enable="false" width="80" align="center"/>
<EF:EFColumn ename="length" cname="长(M)" enable="false" width="80" align="right" format="{0:N3}"/> <EF:EFColumn ename="length" cname="长(M)" enable="false" width="80" align="right" format="{0:N3}"/>
......
...@@ -46,11 +46,11 @@ ...@@ -46,11 +46,11 @@
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="supName" cname="供应商名称" enable="false" width="100" align="center" hidden="true"/> <EF:EFColumn ename="supName" cname="供应商名称" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="purUserName" cname="采购员" width="100" align="center" maxLength="100" required="true"/> <EF:EFColumn ename="purUserName" cname="采购员" width="100" align="center" maxLength="100" required="true"/>
<EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center"/> <EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/> <EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="sepcId" cname="规格ID" enable="false" width="120" align="center" hidden="true"/> <EF:EFColumn ename="sepcId" cname="规格ID" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/> <EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="purQty" cname="采购数量" enable="false" width="120" align="right" format="{0:N3}"/> <EF:EFColumn ename="purQty" cname="采购数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="purWeight" cname="采购重量" enable="false" width="120" align="right" format="{0:N3}"/> <EF:EFColumn ename="purWeight" cname="采购重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/> <EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="length" cname="长(M)" enable="false" width="80" align="right" format="{0:N3}"/> <EF:EFColumn ename="length" cname="长(M)" enable="false" width="80" align="right" format="{0:N3}"/>
......
...@@ -96,7 +96,7 @@ let confirm = function () { ...@@ -96,7 +96,7 @@ let confirm = function () {
message("请选择数据"); message("请选择数据");
return; return;
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"确认\"操作? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"收货\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HGCG003", "confirm", true); JSUtils.submitGridsData("result", "HGCG003", "confirm", true);
} }
......
...@@ -58,13 +58,13 @@ ...@@ -58,13 +58,13 @@
<EF:EFColumn ename="supCode" cname="供应商编码" enable="false" width="100" align="center" hidden="true"/> <EF:EFColumn ename="supCode" cname="供应商编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="supName" cname="供应商名称" enable="false" width="100" align="center"/> <EF:EFColumn ename="supName" cname="供应商名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="purUserName" cname="采购员" enable="false" width="100" align="center"/> <EF:EFColumn ename="purUserName" cname="采购员" enable="false" width="100" align="center"/>
<EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center"/> <EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/> <EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="specId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/> <EF:EFColumn ename="specId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/> <EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="receiveQty" cname="收货数量" width="120" align="right" format="{0:N3}" required="true"/> <EF:EFColumn ename="receiveQty" cname="收货数量" width="120" align="right" format="{0:N0}" required="true"/>
<EF:EFColumn ename="deliverQty" cname="退货数量" enable="false" width="120" align="right" format="{0:N3}"/> <EF:EFColumn ename="deliverQty" cname="退货数量" width="120" align="right" format="{0:N0}" required="true"/>
<EF:EFColumn ename="depositQty" cname="入库数量" enable="false" width="120" align="right" format="{0:N3}"/> <EF:EFColumn ename="depositQty" cname="入库数量" width="120" align="right" format="{0:N0}" required="true"/>
<EF:EFColumn ename="receiveWeight" cname="收货重量" enable="false" width="120" align="right" format="{0:N3}"/> <EF:EFColumn ename="receiveWeight" cname="收货重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/> <EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="unit" cname="单位" enable="false" width="80" align="center"/> <EF:EFColumn ename="unit" cname="单位" enable="false" width="80" align="center"/>
...@@ -76,5 +76,9 @@ ...@@ -76,5 +76,9 @@
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/> editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion title="提示">
<span style="color: red">1."待确认"状态时,仅能修改收货数量。</span><br/>
<span style="color: red">2."质检完成"状态时,可修改"退货数量"和"入库数量",同时可进行收货确认。</span>
</EF:EFRegion>
</EF:EFPage> </EF:EFPage>
...@@ -54,16 +54,16 @@ ...@@ -54,16 +54,16 @@
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center"> <EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="hggp.hgcg.contractStatus"/> <EF:EFCodeOption codeName="hggp.hgcg.contractStatus"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center"/> <EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/> <EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="inventRecordId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/> <EF:EFColumn ename="inventRecordId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/> <EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="bcReceiveQty" cname="本次</br>收货数量" width="100" align="right" format="{0:N3}" <EF:EFColumn ename="bcReceiveQty" cname="本次</br>收货数量" width="100" align="right" format="{0:N0}"
required="true"/> required="true"/>
<EF:EFColumn ename="bcMaxReceiveQty" cname="本次最大</br>收货数量" enable="false" width="100" align="right" <EF:EFColumn ename="bcMaxReceiveQty" cname="本次最大</br>收货数量" enable="false" width="100" align="right"
format="{0:N3}"/> format="{0:N0}"/>
<EF:EFColumn ename="receiveQty" cname="已收货数量" enable="false" width="100" align="right" format="{0:N3}"/> <EF:EFColumn ename="receiveQty" cname="已收货数量" enable="false" width="100" align="right" format="{0:N0}"/>
<EF:EFColumn ename="purQty" cname="采购数量" enable="false" width="100" align="right" format="{0:N3}"/> <EF:EFColumn ename="purQty" cname="采购数量" enable="false" width="100" align="right" format="{0:N0}"/>
<EF:EFColumn ename="purWeight" cname="采购重量" enable="false" width="100" align="right" format="{0:N3}"/> <EF:EFColumn ename="purWeight" cname="采购重量" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFComboColumn ename="supCode" cname="供应商名称" enable="false" width="120" align="left" defaultValue="" <EF:EFComboColumn ename="supCode" cname="供应商名称" enable="false" width="120" align="left" defaultValue=""
filter="contains"> filter="contains">
......
$(function () {
IPLATUI.EFGrid = {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
pageable: {
pageSize: 20,
pageSizes: [20, 50, 70, 100],
},
columns: [],
loadComplete: function (grid) {
// 确认
$("#CONFIRM").on("click", confirm);
// change事件
grid.dataSource.bind("change", function (e) {
supCodeChange(e);
});
},
onSave: function (e) {
// 阻止后台请求,使用自定义
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止后台请求,使用自定义
e.preventDefault();
remove();
}
}
}
// 查询
$("#QUERY").on("click", query);
// 选择收货
$("#SELECT_RECEIVE").on("click", selectReceive);
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 仓库变更
*/
let supCodeChange = function (e) {
if (e.field != "whCode") {
return;
}
let item = e.items[0];
let whRecordRows = __eiInfo.blocks.wh_record_block_id.rows;
for (let k = 0; k < resultGrid.getCheckedRowsIndex() + 1; k++) {
for (let i = 0; i < whRecordRows.length; i++) {
if (whRecordRows[i][1] === item.whCode) {
let whName = whRecordRows[i][0];
resultGrid.setCellValue(item, 'whName', whName == null ? "" : whName);
return;
}
}
}
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
for (let i = 0; i < rows.length; i++) {
if (isBlank(rows[i]['whCode'])) {
message("勾选的第" + (i + 1) + "行仓库不能为空");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC001", "save", true);
}
});
}
/**
* 删除
*/
let remove = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC001", "remove", true);
}
});
}
/**
* 选择
*/
let selectReceive = function () {
JSColorbox.open({
href: "HGKC001A?methodName=initLoad",
title: "<div style='text-align: center;'>收货查询</div>",
width: "80%",
height: "80%",
callbackName: selectReceiveCallback
});
}
/**
* 选择回调
*/
let selectReceiveCallback = function () {
// 刷新页面
query();
// 关闭弹窗
JSColorbox.close();
}
<!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}"/>
<EF:EFPage title="采购入库">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDatePicker cname="入库日期" blockId="inqu_status" ename="receiveDate" row="0" colWidth="3"
role="date" format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="入库单号" blockId="inqu_status" ename="depositNo" row="0" colWidth="3"/>
<EF:EFInput cname="收货单号" blockId="inqu_status" ename="receiveNo" row="0" colWidth="3"/>
<EF:EFSelect cname="状态" blockId="inqu_status" ename="status" row="0" colWidth="3" optionLabel="全部"
defultValue="">
<EF:EFCodeOption codeName="hggp.hgcg.receiveStatus"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="供应商名称" blockId="inqu_status" ename="supCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="sup_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="存货名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="invent_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="规格" ename="inqu_status-0-spec" colWidth="3" filter="contains" optionLabel="全部"
defultValue="">
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFDateSpan startCname="创建时间(从)" endCname="至" blockId="inqu_status"
startName="createdTimeFrom" endName="createdTimeTo" row="0" role="datetime"
format="yyyy-MM-dd HH:mm:ss" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="130" align="center"/>
<EF:EFColumn ename="depositDate" cname="入库日期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="depositNo" cname="入库单号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="receiveNo" cname="收货单号" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="120" align="left" defaultValue=""
filter="contains" required="true">
<EF:EFOptions blockId="wh_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="whName" cname="仓库名称" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="specId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="depositQty" cname="入库数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="depositWeight" cname="入库重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="unit" cname="单位" enable="false" width="80" align="center"/>
<EF:EFColumn ename="length" cname="长(M)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽(M)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚(M)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</EF:EFGrid>
</EF:EFRegion>
<EF:EFRegion title="提示">
<span style="color: red">说明:入库数据仅支持删除,不能修改。</span>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFGrid = {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
pageable: {
pageSize: 20,
pageSizes: [20, 50, 70, 100],
},
columns: [],
loadComplete: function (grid) {
// change事件
grid.dataSource.bind("change", function (e) {
supCodeChange(e);
});
}
}
}
// 查询
$("#QUERY").on("click", query);
// 确认
$("#CONFIRM").on("click", confirm);
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 仓库变更
*/
let supCodeChange = function (e) {
if (e.field != "whCode") {
return;
}
let item = e.items[0];
let whRecordRows = __eiInfo.blocks.wh_record_block_id.rows;
for (let k = 0; k < resultGrid.getCheckedRowsIndex() + 1; k++) {
for (let i = 0; i < whRecordRows.length; i++) {
if (whRecordRows[i][1] === item.whCode) {
let whName = whRecordRows[i][0];
resultGrid.setCellValue(item, 'whName', whName == null ? "" : whName);
return;
}
}
}
}
/**
* 选择
*/
let confirm = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
for (let i = 0; i < rows.length; i++) {
let whCode = rows[i]['whCode'];
if (isBlank(whCode)) {
message("勾选的第" + (i + 1) + "行仓库名称不能为空");
return;
}
}
JSUtils.confirm("确定对勾选的[" + rows.length + "]条数据生成\"采购入库\"吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC001A", "confirm",
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}"/>
<EF:EFPage title="收货查询">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDatePicker cname="收货日期" blockId="inqu_status" ename="receiveDate" row="0" colWidth="3"
role="date" format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="收货单号" blockId="inqu_status" ename="receiveNo" row="0" colWidth="3"/>
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="供应商名称" blockId="inqu_status" ename="supCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="sup_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect cname="存货名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="invent_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="规格" ename="inqu_status-0-spec" colWidth="3" filter="contains" optionLabel="全部"
defultValue="">
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDateSpan startCname="创建时间(从)" endCname="至" blockId="inqu_status"
startName="createdTimeFrom" endName="createdTimeTo" row="0" role="datetime"
format="yyyy-MM-dd HH:mm:ss" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="130" align="center"/>
<EF:EFColumn ename="receiveDate" cname="收货日期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="receiveNo" cname="收货单号" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="hggp.hgcg.receiveStatus"/>
</EF:EFComboColumn>
<EF:EFColumn ename="supCode" cname="供应商编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="supName" cname="供应商名称" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="purUserName" cname="采购员" enable="false" width="100" align="center"/>
<EF:EFComboColumn ename="whCode" cname="仓库名称" width="120" align="left" defaultValue=""
filter="contains" required="true">
<EF:EFOptions blockId="wh_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="whName" cname="仓库名称" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="specId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="receiveQty" cname="收货数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="deliverQty" cname="退货数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="depositQty" cname="入库数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="receiveWeight" cname="收货重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="unit" cname="单位" enable="false" width="80" align="center"/>
<EF:EFColumn ename="length" cname="长(M)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽(M)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚(M)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="contractNo" cname="合同号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFGrid = {
exportGrid: false, // 隐藏右侧自定义导出按钮
"result": {
columns: []
},
};
// 查询
$("#QUERY").on("click", query);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1); // 点击查询按钮,从第1页开始查询
}
<!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}"/>
<EF:EFPage title="综合库存管理">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect cname="仓库名称" blockId="inqu_status" ename="whCode" row="0" colWidth="3"
optionLabel="全部" filter="contains" defultValue="">
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="存货类型" blockId="inqu_status" ename="incentType" row="0" colWidth="3" optionLabel="全部"
filter="contains" defultValue="">
<%-- 1.原料,2.耗材,5废料 --%>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('1', '2', '5')"/>
</EF:EFSelect>
<EF:EFSelect cname="存货名称" blockId="inqu_status" ename="incentCode" row="0" colWidth="3" optionLabel="全部"
filter="contains" defultValue="">
<EF:EFOptions blockId="invent_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="规格" blockId="inqu_status" ename="spec" row="0" colWidth="3" optionLabel="全部"
filter="contains" defultValue="">
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" autoFit="true" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="130" align="center"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="100" align="center">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="120" align="center"
blockName="wh_record_block_id" textField="textField" valueField="valueField">
</EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="specId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="invQty" cname="库存数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="invUnitWeight" cname="单重(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invWeight" cname="库存总重(T)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="unit" cname="单位" enable="false" width="80" align="center"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时刻" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
<EF:EFColumn ename="updatedName" cname="更新人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="updatedTime" cname="更新时刻" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="groupName" cname="设备区域" colWidth="3"/> <EF:EFInput blockId="inqu_status" row="0" ename="groupName" cname="设备区域" placeholder="模糊查询" colWidth="3"/>
<%--<EF:EFSelect blockId="inqu_status" row="0" ename="groupCode" cname="设备区域" colWidth="3" filter="contains"> <%--<EF:EFSelect blockId="inqu_status" row="0" ename="groupCode" cname="设备区域" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="groupCodeBox_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="groupCodeBox_block_id" textField="textField" valueField="valueField"/>
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
<EF:EFCodeOption codeName="hpjx.hpsb.deviceType"/> <EF:EFCodeOption codeName="hpjx.hpsb.deviceType"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="purchaseDate" cname="购置日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/> <EF:EFDatePicker blockId="inqu_status" row="0" ename="purchaseDate" cname="购置日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="deviceCode" cname="设备编码" colWidth="3"/> <EF:EFInput blockId="inqu_status" row="0" ename="deviceCode" cname="设备编码" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="deviceName" cname="设备名称" colWidth="3"/> <EF:EFInput blockId="inqu_status" row="0" ename="deviceName" cname="设备名称" placeholder="模糊查询" colWidth="3"/>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="groupName" cname="设备区域" colWidth="3"/> <EF:EFInput blockId="inqu_status" row="0" ename="groupName" cname="设备区域" placeholder="模糊查询" colWidth="3"/>
<%--<EF:EFSelect blockId="inqu_status" row="0" ename="groupCode" cname="设备区域" colWidth="3" filter="contains"> <%--<EF:EFSelect blockId="inqu_status" row="0" ename="groupCode" cname="设备区域" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="groupCodeBox_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="groupCodeBox_block_id" textField="textField" valueField="valueField"/>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<EF:EFCodeOption codeName="hggp.hgsb.planType"/> <EF:EFCodeOption codeName="hggp.hgsb.planType"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="planDate" cname="计划日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/> <EF:EFDatePicker blockId="inqu_status" row="0" ename="planDate" cname="计划日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="planUserName" cname="计划人" colWidth="3"/> <EF:EFInput blockId="inqu_status" row="0" ename="planUserName" cname="计划人" placeholder="模糊查询" colWidth="3"/>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpsb.deviceType"/> <EF:EFCodeOption codeName="hpjx.hpsb.deviceType"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="deviceName" cname="设备名称" colWidth="3"/> <EF:EFInput blockId="inqu_status" row="0" ename="deviceName" cname="设备名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="groupCode" cname="设备区间编码" colWidth="3" type="hidden"/> <EF:EFInput blockId="inqu_status" row="0" ename="groupCode" cname="设备区间编码" colWidth="3" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="groupName" cname="设备区间名称" colWidth="3" type="hidden"/> <EF:EFInput blockId="inqu_status" row="0" ename="groupName" cname="设备区间名称" colWidth="3" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="上级ID" colWidth="3" type="hidden"/> <EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="上级ID" colWidth="3" type="hidden"/>
......
...@@ -86,8 +86,9 @@ $(function () { ...@@ -86,8 +86,9 @@ $(function () {
template: function (item) { template: function (item) {
let template = ''; let template = '';
if (item.id>0 && item.docId.trim().length>0){ if (item.id>0 && item.docId.trim().length>0){
let docName = item.docName;
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" '
+ 'href="' + downloadHref(item.docId) + '" target="_blank">附件图片</a>'; + 'href="' + downloadHref(item.docId) + '" target="_blank">'+item.docName+'</a>';
} }
return template; return template;
} }
...@@ -275,6 +276,7 @@ function uploadFileCallback(result) { ...@@ -275,6 +276,7 @@ function uploadFileCallback(result) {
let inEiInfo = new EiInfo(); let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", result.id); inEiInfo.set("result-0-id", result.id);
inEiInfo.set("result-0-docId", result.docId); inEiInfo.set("result-0-docId", result.docId);
inEiInfo.set("result-0-docName", result.docName);
EiCommunicator.send('HGSB003', 'updateDocId', inEiInfo, { EiCommunicator.send('HGSB003', 'updateDocId', inEiInfo, {
onSuccess(ei) { onSuccess(ei) {
if (ei.status == "-1") { if (ei.status == "-1") {
......
...@@ -5,6 +5,7 @@ $(function () { ...@@ -5,6 +5,7 @@ $(function () {
uploadFile: { uploadFile: {
success: function(e) { success: function(e) {
let docId = e.response.docId; let docId = e.response.docId;
let docName = e.response.docName;
let id = $("#inqu_status-0-id").val() let id = $("#inqu_status-0-id").val()
if (isBlank(docId)) { if (isBlank(docId)) {
return; return;
...@@ -13,7 +14,7 @@ $(function () { ...@@ -13,7 +14,7 @@ $(function () {
NotificationUtil("附件上传成功"); NotificationUtil("附件上传成功");
//saveTemp(e); //saveTemp(e);
try { try {
parent.JSColorbox.setValueCallback({"id":id,"docId":docId}); parent.JSColorbox.setValueCallback({"id":id,"docId":docId,"docName":docName});
parent.JSColorbox.close(); parent.JSColorbox.close();
} catch (e){ } catch (e){
} }
......
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/5/11
Time: 15:58
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<EF:EFPage title="设备点检">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="inspecDate" cname="点检日期" role="date"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="planCode" cname="计划单号" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="inspecUserName" cname="点检人" placeholder="模糊查询" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="账套" hidden="true"/>
<%--blockName="factoryCodeBox_block_id"--%>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="220" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="inspecDate" cname="点检日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="inspecCode" cname="点检单号" width="100" enable="false" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="planCode" cname="计划单号" width="100" enable="false" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="planStartDate" cname="计划开始日期" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="true" required="true"/>
<EF:EFColumn ename="planEndDate" cname="计划结束日期" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="true" required="true"/>
<EF:EFComboColumn ename="inspecUserId" cname="点检人" defaultValue="${loginName}"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="100" readonly="false" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="checkStatus" cname="审核状态" width="80" align="center" readonly="false" required="true" defaultValue="1">
<EF:EFCodeOption codeName="hggp.hgsb.approveStatus"/>
</EF:EFComboColumn>
<%--<EF:EFColumn cname="创建人" ename="createdName" align="center" width="100" readonly="true" required="false"
enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="120" readonly="true" required="false"
enable="false"/>--%>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
var deviceCodeBox = __eiInfo.getBlock("deviceCodeBox_block_id").getMappedRows();
//var groupCodeBox = __eiInfo.getBlock("groupCodeBox_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
IPLATUI.EFGrid= {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
{
field: "operator",
title: "操作",
template: function (item) {
let auditStatus = item.status;
let template = '';
if (item.id) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="uploadFile(' + item.id + ')" >附件上传</a>';
}
return template;
}
}, {
field: "deviceCode",
filter: function (options) {
var deviceType = options.model['deviceType'];
if(deviceType) {
// 返回我们过滤后的数据集
return _.filter(deviceCodeBox, function (item) {
return item["param1Field"]==deviceType;
})
}
return deviceCodeBox;
},
template: function (dataItem) {
for (let i = 0; i < deviceCodeBox.length; i++) {
if (deviceCodeBox[i]['valueField'] === dataItem['deviceCode']) {
dataItem['deviceName'] = deviceCodeBox[i]['textField']
return deviceCodeBox[i]['textField'];
}
}
return dataItem["deviceCode"]
}
}, {
field: "docId",
template: function (item) {
let template = '';
if (item.id>0 && item.docId.trim().length>0){
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + downloadHref(item.docId) + '" target="_blank">'+item.docName+'</a>';
}
return template;
}
}
],
exportGrid: {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "设备点检详情_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls", // 默认值是xls,可选值为pdf[规划中]
exportBlockId: "result", // 默认值和blockId相同,导出的EiInfo中的指定数据块被导出
},
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "deviceType") {
loadChange(grid,e,"deviceCode");
}else if (e.field === "deviceCode") {
if (e.items[0].deviceType.length===0){
loadChange(grid,e,"deviceType");
}
//loadChange(grid,e,"userId");
}
});
},
afterEdit:function (e) {
/*if (e.field === "groupCode" && e.model["companyCode"].length === 0){
for (let i = 0; i < groupCodeBox.length; i++) {
if (e.model[e.field] === groupCodeBox[i]["valueField"]){
e.model["companyCode"]=groupCodeBox[i]["param3Field"]
break;
}
}
}else if (e.field === "userId" && e.model["groupCode"].length === 0){
for (let i = 0; i < userName.length; i++) {
if (e.model[e.field] === userName[i]["valueField"]){
//e.model["factoryCode"]=userName[i]["param1Field"]
e.model["groupCode"]=userName[i]["param2Field"]
break;
}
}
}*/
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {
}
}
}
downKeyUp();
});
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let groupCode= item.get("groupCode");
let deviceType= item.get("deviceType");
let deviceCode= item.get("deviceCode");
let checkItem= item.get("checkItem");
if(isBlank(groupCode)){
message("选中的第"+(index+1)+"行\"设备区域\",不能为空!");
flag = false;
return false;
}
if(isBlank(deviceType)){
message("选中的第"+(index+1)+"行\"设备类型\",不能为空!");
flag = false;
return false;
}
if(isBlank(deviceCode)){
message("选中的第"+(index+1)+"行\"设备名称\",不能为空!");
flag = false;
return false;
}
if(isBlank(checkItem)){
message("选中的第"+(index+1)+"行\"检查项\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSB004A", "save", true);
btnNode.attr("disabled", false);
}
});
}
}
/**
* 文件上传
*
* @param id
*/
function uploadFile(id) {
JSColorbox.open({
href: "HGSB003A?methodName=initLoad&inqu_status-0-id="+id,
title: "<div style='text-align: center;'>附件上传</div>",
width: "60%",
height: "50%",
callbackName: uploadFileCallback
});
}
/**
* 附件上传回调
*
* @param docId
*/
function uploadFileCallback(result) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", result.id);
inEiInfo.set("result-0-docId", result.docId);
inEiInfo.set("result-0-docName", result.docName);
EiCommunicator.send('HGSB004A', 'updateDocId', inEiInfo, {
onSuccess(ei) {
if (ei.status == "-1") {
NotificationUtil({msg: ei.msg, detailMsg: ei.detailMsg}, "error");
} else {
NotificationUtil(ei.msg);
query();
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
function loadChange(grid,e,field) {
var cell_label = field,that = grid;
// locked 表示是否为固定列
var locked = that.isCellLocked(cell_label);
// tr 表示 locked 和非 locked 的行,index 表示此行的第几列
var tr,index;
// 获取此 model 元素信息
var item = e.items[0];
var _uid = item.uid;
if (locked) {
tr = $(".k-grid-content-locked tr[data-uid="+ _uid +"]");
index = $("th[data-field='"+cell_label+"']").data("index");
} else {
tr = $(".k-grid-content tr[data-uid="+ _uid +"]");
index = parseInt($("th[data-field='"+cell_label+"']").data("index")) - that.lockedHeader.find("th").length;
}
// 获取子 cell(td)
var td = tr.children("td:eq("+index+")");
// 触发 td.click 事件,
td.trigger("click");
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/5/11
Time: 15:58
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ 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}"/>
<EF:EFPage title="设备点检详情">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput blockId="inqu_status" row="0" ename="companyName" cname="公司名称" colWidth="3" readonly="true"/>
<EF:EFInput blockId="inqu_status" row="0" ename="companyCode" cname="公司编码" colWidth="3" type="hidden"/>
<%--<EF:EFInput blockId="inqu_status" row="0" ename="groupName" cname="设备区域" colWidth="3"/>--%>
<%--<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>--%>
<EF:EFSelect blockId="inqu_status" row="0" ename="deviceType" cname="设备类型" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpsb.deviceType"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="checkItem" cname="检查项" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="上级ID" colWidth="3" type="hidden"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="账套" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFComboColumn ename="deviceType" cname="设备类型"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="80" readonly="true" required="true"
align="center" filter="contains" sort="true">
<EF:EFCodeOption codeName="hpjx.hpsb.deviceType" />
</EF:EFComboColumn>
<EF:EFComboColumn ename="deviceCode" cname="设备名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="deviceCodeBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="checkItem" cname="检查项" width="100" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="checkDescrip" cname="检查描述" editType="textarea" width="160" align="center"/>
<EF:EFColumn ename="checkResult" cname="检查结果" editType="textarea" width="160" align="center"/>
<EF:EFColumn ename="docId" cname="点检图片" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn cname="创建人" ename="createdName" align="center" width="100" readonly="true" required="false"
enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="120" readonly="true" required="false"
enable="false"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
var groupCodeBox = __eiInfo.getBlock("groupCodeBox_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
IPLATUI.EFGrid= {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [{
field: "groupCode",
title: "设备区域",
template: function (dataItem) {
for (let i = 0; i < groupCodeBox.length; i++) {
if (groupCodeBox[i]['valueField'] === dataItem['groupCode']) {
dataItem['groupName'] = groupCodeBox[i]['textField'].split("]")[1]
return groupCodeBox[i]['textField'].split("]")[1];
}
}
return dataItem["groupCode"]
}
}],
exportGrid: {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "设备计划任务_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls", // 默认值是xls,可选值为pdf[规划中]
exportBlockId: "result", // 默认值和blockId相同,导出的EiInfo中的指定数据块被导出
},
loadComplete: function(grid) {
$("#CONFIRM").on("click",confirm);
},
afterEdit:function (e) {
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {
}
}
}
/**
* 取消
*/
$('#cancel').on('click', function () {
// 关闭弹窗
parent.JSColorbox.close();
})
downKeyUp();
});
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 确认
*/
let confirm = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对数据做\"确认\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSB004B", "save", true,
function (e) {
var status = e.getStatus();
if (status !== -1) {
parent.JSColorbox.setValueCallback(e);
//parent.JSColorbox.close();
}else {
NotificationUtil({msg: e.msg, detailMsg: e.detailMsg}, "error");
}
});
}
});
}
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let companyCode= item.get("companyCode");
let groupCode= item.get("groupCode");
let planDate= item.get("planDate");
let planType= item.get("planType");
let planStartDate= item.get("planStartDate");
let planEndDate= item.get("planEndDate");
let planUserId= item.get("planUserId");
if(isBlank(companyCode)){
message("选中的第"+(index+1)+"行\"公司\",不能为空!");
flag = false;
return false;
}
if(isBlank(groupCode)){
message("选中的第"+(index+1)+"行\"设备区域\",不能为空!");
flag = false;
return false;
}
if(isBlank(planDate)){
message("选中的第"+(index+1)+"行\"计划日期\",不能为空!");
flag = false;
return false;
}
if(isBlank(planType)){
message("选中的第"+(index+1)+"行\"计划类型\",不能为空!");
flag = false;
return false;
}
if(isBlank(planStartDate)){
message("选中的第"+(index+1)+"行\"计划开始日期\",不能为空!");
flag = false;
return false;
}
if(isBlank(planEndDate)){
message("选中的第"+(index+1)+"行\"计划结束日期\",不能为空!");
flag = false;
return false;
}
if(isBlank(planUserId)){
message("选中的第"+(index+1)+"行\"计划人\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSB004", "save", true);
btnNode.attr("disabled", false);
}
});
}
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/5/11
Time: 17:38
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%
UserSession.web2Service(request);
String userName = UserSession.getLoginCName();
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<c:set var="userName" value="<%=userName%>" />
<EF:EFPage title="设备计划">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="groupName" cname="设备区域" placeholder="模糊查询" colWidth="3"/>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="planDate" cname="计划日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="inspecUserId" cname="点检人" value="${loginName}" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="inspecUserName" cname="点检人名称" value="${userName}" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="planType" cname="计划类型" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="taskStatus" cname="任务类型" value="0" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="pageNumber" cname="页面号" type="hidden"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="账套" hidden="true"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupCode" cname="设备区域"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="groupCodeBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="planDate" cname="计划日期" width="120" enable="true" readonly="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="planCode" cname="计划单号" width="100" enable="false" readonly="true" align="center" required="true"/>
<EF:EFComboColumn ename="planType" cname="计划类型"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="100" readonly="true" required="true"
align="center" filter="contains" sort="true">
<EF:EFCodeOption codeName="hggp.hgsb.planType" />
</EF:EFComboColumn>
<EF:EFColumn ename="planStartDate" cname="计划开始日期" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="false" required="true"/>
<EF:EFColumn ename="planEndDate" cname="计划结束日期" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="false" required="true"/>
<%--defaultValue="${loginName}"--%>
<EF:EFComboColumn ename="planUserId" cname="计划人"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="100" readonly="false" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="planStatus" cname="审批状态" width="80" align="center" readonly="false" required="true" defaultValue="1">
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFComboColumn>
<%--<EF:EFColumn cname="创建人" ename="createdName" align="center" width="100" readonly="true" required="false"
enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="120" readonly="true" required="false"
enable="false"/>--%>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/5/13
Time: 16:20
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<EF:EFPage title="设备保养">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="upkeepDate" cname="保养日期" role="date"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="planCode" cname="计划单号" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="upkeepUserName" cname="保养人" placeholder="模糊查询" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="账套" hidden="true"/>
<%--blockName="factoryCodeBox_block_id"--%>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="220" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="upkeepDate" cname="保养日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="upkeepCode" cname="保养单号" width="100" enable="false" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="planCode" cname="计划单号" width="100" enable="false" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="planStartDate" cname="计划开始日期" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="true" required="true"/>
<EF:EFColumn ename="planEndDate" cname="计划结束日期" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="true" required="true"/>
<EF:EFComboColumn ename="upkeepUserId" cname="保养人" defaultValue="${loginName}"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="100" readonly="false" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="checkStatus" cname="审核状态" width="80" align="center" readonly="false" required="true" defaultValue="1">
<EF:EFCodeOption codeName="hggp.hgsb.approveStatus"/>
</EF:EFComboColumn>
<%--<EF:EFColumn cname="创建人" ename="createdName" align="center" width="100" readonly="true" required="false"
enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="120" readonly="true" required="false"
enable="false"/>--%>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
\ No newline at end of file
$(function () {
var deviceCodeBox = __eiInfo.getBlock("deviceCodeBox_block_id").getMappedRows();
//var groupCodeBox = __eiInfo.getBlock("groupCodeBox_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
IPLATUI.EFGrid= {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
{
field: "operator",
title: "操作",
template: function (item) {
let auditStatus = item.status;
let template = '';
if (item.id) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="uploadFile(' + item.id + ')" >附件上传</a>';
}
return template;
}
}, {
field: "deviceCode",
filter: function (options) {
var deviceType = options.model['deviceType'];
if(deviceType) {
// 返回我们过滤后的数据集
return _.filter(deviceCodeBox, function (item) {
return item["param1Field"]==deviceType;
})
}
return deviceCodeBox;
},
template: function (dataItem) {
for (let i = 0; i < deviceCodeBox.length; i++) {
if (deviceCodeBox[i]['valueField'] === dataItem['deviceCode']) {
dataItem['deviceName'] = deviceCodeBox[i]['textField']
return deviceCodeBox[i]['textField'];
}
}
return dataItem["deviceCode"]
}
}, {
field: "docId",
template: function (item) {
let template = '';
if (item.id>0 && item.docId.trim().length>0){
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + downloadHref(item.docId) + '" target="_blank">'+item.docName+'</a>';
}
return template;
}
}
],
exportGrid: {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "设备保养详情_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls", // 默认值是xls,可选值为pdf[规划中]
exportBlockId: "result", // 默认值和blockId相同,导出的EiInfo中的指定数据块被导出
},
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "deviceType") {
loadChange(grid,e,"deviceCode");
}else if (e.field === "deviceCode") {
if (e.items[0].deviceType.length===0){
loadChange(grid,e,"deviceType");
}
//loadChange(grid,e,"userId");
}
});
},
afterEdit:function (e) {
/*if (e.field === "groupCode" && e.model["companyCode"].length === 0){
for (let i = 0; i < groupCodeBox.length; i++) {
if (e.model[e.field] === groupCodeBox[i]["valueField"]){
e.model["companyCode"]=groupCodeBox[i]["param3Field"]
break;
}
}
}else if (e.field === "userId" && e.model["groupCode"].length === 0){
for (let i = 0; i < userName.length; i++) {
if (e.model[e.field] === userName[i]["valueField"]){
//e.model["factoryCode"]=userName[i]["param1Field"]
e.model["groupCode"]=userName[i]["param2Field"]
break;
}
}
}*/
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {
}
}
}
downKeyUp();
});
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let groupCode= item.get("groupCode");
let deviceType= item.get("deviceType");
let deviceCode= item.get("deviceCode");
let checkItem= item.get("checkItem");
if(isBlank(groupCode)){
message("选中的第"+(index+1)+"行\"设备区域\",不能为空!");
flag = false;
return false;
}
if(isBlank(deviceType)){
message("选中的第"+(index+1)+"行\"设备类型\",不能为空!");
flag = false;
return false;
}
if(isBlank(deviceCode)){
message("选中的第"+(index+1)+"行\"设备名称\",不能为空!");
flag = false;
return false;
}
if(isBlank(checkItem)){
message("选中的第"+(index+1)+"行\"检查项\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSB005A", "save", true);
btnNode.attr("disabled", false);
}
});
}
}
/**
* 文件上传
*
* @param id
*/
function uploadFile(id) {
JSColorbox.open({
href: "HGSB003A?methodName=initLoad&inqu_status-0-id="+id,
title: "<div style='text-align: center;'>附件上传</div>",
width: "60%",
height: "50%",
callbackName: uploadFileCallback
});
}
/**
* 附件上传回调
*
* @param result
*/
function uploadFileCallback(result) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", result.id);
inEiInfo.set("result-0-docId", result.docId);
inEiInfo.set("result-0-docName", result.docName);
EiCommunicator.send('HGSB005A', 'updateDocId', inEiInfo, {
onSuccess(ei) {
if (ei.status == "-1") {
NotificationUtil({msg: ei.msg, detailMsg: ei.detailMsg}, "error");
} else {
NotificationUtil(ei.msg);
query();
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/5/13
Time: 16:21
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ 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}"/>
<EF:EFPage title="设备保养详情">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput blockId="inqu_status" row="0" ename="companyName" cname="公司名称" colWidth="3" readonly="true"/>
<EF:EFInput blockId="inqu_status" row="0" ename="companyCode" cname="公司编码" colWidth="3" type="hidden"/>
<%--<EF:EFInput blockId="inqu_status" row="0" ename="groupName" cname="设备区域" colWidth="3"/>--%>
<%--<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>--%>
<EF:EFSelect blockId="inqu_status" row="0" ename="deviceType" cname="设备类型" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpsb.deviceType"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="checkItem" cname="检查项" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="上级ID" colWidth="3" type="hidden"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="账套" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFComboColumn ename="deviceType" cname="设备类型"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="80" readonly="true" required="true"
align="center" filter="contains" sort="true">
<EF:EFCodeOption codeName="hpjx.hpsb.deviceType" />
</EF:EFComboColumn>
<EF:EFComboColumn ename="deviceCode" cname="设备名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="deviceCodeBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="checkItem" cname="检查项" width="100" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="checkDescrip" cname="检查描述" editType="textarea" width="160" align="center"/>
<EF:EFColumn ename="checkResult" cname="检查结果" editType="textarea" width="160" align="center"/>
<EF:EFColumn ename="docId" cname="点检图片" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn cname="创建人" ename="createdName" align="center" width="100" readonly="true" required="false"
enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="120" readonly="true" required="false"
enable="false"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
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