Commit 87ad59d9 by wuwenlong

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

parents 0df5f4a7 76369964
...@@ -152,7 +152,7 @@ public enum DdynamicEnum { ...@@ -152,7 +152,7 @@ public enum DdynamicEnum {
* 用途:调拨单下拉框 * 用途:调拨单下拉框
* 编写:ly * 编写:ly
*/ */
INVENT_CODE_BOX_BLOCK_ID("invent_code_box_block_id", "inventCode", "inventName","inventType", "specId", "HGKC010.queryInventCodeBox"), INVENT_CODE_BOX_BLOCK_ID("invent_code_box_block_id", "inventCode", "inventName","inventType", "specId","spec","length","width","thick","invQty","invUnitWeight","invWeight", "HGKC010.queryInventCodeBox"),
/** /**
* 模块:从实时库存取规格信息 * 模块:从实时库存取规格信息
......
...@@ -65,6 +65,12 @@ public class HGKC003 extends DaoEPBase { ...@@ -65,6 +65,12 @@ public class HGKC003 extends DaoEPBase {
public static final String FIELD_PART_THICK = "partThick"; /* 零件-厚*/ public static final String FIELD_PART_THICK = "partThick"; /* 零件-厚*/
public static final String FIELD_PART_SPEC = "partSpec"; /* 零件规格*/ public static final String FIELD_PART_SPEC = "partSpec"; /* 零件规格*/
public static final String FIELD_SUBMIT_STATUS = "submitStatus"; /* 提交状态 0未提交,1已提交*/ public static final String FIELD_SUBMIT_STATUS = "submitStatus"; /* 提交状态 0未提交,1已提交*/
public static final String FIELD_PART_SPEC_ID = "partSpecId"; /* 零件规格ID*/
public static final String FIELD_RECTIFICATION_ID = "rectificationId"; /* 整改通知单ID*/
public static final String FIELD_PART_COEFFICIENT = "partCoefficient"; /* 零件系数*/
public static final String FIELD_PRICE = "price"; /* 单价*/
public static final String FIELD_AMOUNT = "amount"; /* 金额*/
public static final String FIELD_STORAGE_TYPE = "storageType"; /* 入库类型:0:入库 1:退回*/
public static final String COL_ID = "ID"; public static final String COL_ID = "ID";
public static final String COL_QUALITY_ID = "QUALITY_ID"; /* 质检单ID*/ public static final String COL_QUALITY_ID = "QUALITY_ID"; /* 质检单ID*/
...@@ -108,6 +114,12 @@ public class HGKC003 extends DaoEPBase { ...@@ -108,6 +114,12 @@ public class HGKC003 extends DaoEPBase {
public static final String COL_PART_THICK = "PART_THICK"; /* 零件-厚*/ public static final String COL_PART_THICK = "PART_THICK"; /* 零件-厚*/
public static final String COL_PART_SPEC = "PART_SPEC"; /* 零件规格*/ public static final String COL_PART_SPEC = "PART_SPEC"; /* 零件规格*/
public static final String COL_SUBMIT_STATUS = "SUBMIT_STATUS"; /* 提交状态 0未提交,1已提交*/ public static final String COL_SUBMIT_STATUS = "SUBMIT_STATUS"; /* 提交状态 0未提交,1已提交*/
public static final String COL_PART_SPEC_ID = "PART_SPEC_ID"; /* 零件规格ID*/
public static final String COL_RECTIFICATION_ID = "RECTIFICATION_ID"; /* 整改通知单ID*/
public static final String COL_PART_COEFFICIENT = "PART_COEFFICIENT"; /* 零件系数*/
public static final String COL_PRICE = "PRICE"; /* 单价*/
public static final String COL_AMOUNT = "AMOUNT"; /* 金额*/
public static final String COL_STORAGE_TYPE = "STORAGE_TYPE"; /* 入库类型:0:入库 1:退回*/
public static final String QUERY = "HGKC003.query"; public static final String QUERY = "HGKC003.query";
public static final String COUNT = "HGKC003.count"; public static final String COUNT = "HGKC003.count";
...@@ -159,6 +171,12 @@ public class HGKC003 extends DaoEPBase { ...@@ -159,6 +171,12 @@ public class HGKC003 extends DaoEPBase {
private BigDecimal partThick = new BigDecimal(0.000); /* 零件-厚*/ private BigDecimal partThick = new BigDecimal(0.000); /* 零件-厚*/
private String partSpec = " "; /* 零件规格*/ private String partSpec = " "; /* 零件规格*/
private Integer submitStatus; /* 提交状态 0未提交,1已提交*/ private Integer submitStatus; /* 提交状态 0未提交,1已提交*/
private Long partSpecId = new Long(0); /* 规格id*/
private Long rectificationId = new Long(0); /* 整改通知单id*/
private BigDecimal partCoefficient = new BigDecimal(0.000); /* 零件-系数*/
private BigDecimal price = new BigDecimal("0"); /* 单价*/
private BigDecimal amount = new BigDecimal("0"); /* 金额*/
private Boolean storageType; /* 入库类型:0:入库 1:退回*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -362,6 +380,39 @@ public class HGKC003 extends DaoEPBase { ...@@ -362,6 +380,39 @@ public class HGKC003 extends DaoEPBase {
eiColumn.setDescName("提交状态"); eiColumn.setDescName("提交状态");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PART_SPEC_ID);
eiColumn.setDescName("零件规格ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_RECTIFICATION_ID);
eiColumn.setDescName("整改通知单ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PART_COEFFICIENT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(12);
eiColumn.setDescName("零件-系数");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PRICE);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(12);
eiColumn.setDescName("单价");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(12);
eiColumn.setDescName("金额");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STORAGE_TYPE);
eiColumn.setDescName("入库类型:0:入库 1:退回");
eiMetadata.addMeta(eiColumn);
} }
...@@ -1029,6 +1080,54 @@ public class HGKC003 extends DaoEPBase { ...@@ -1029,6 +1080,54 @@ public class HGKC003 extends DaoEPBase {
this.qualityId = qualityId; this.qualityId = qualityId;
} }
public Long getPartSpecId() {
return partSpecId;
}
public void setPartSpecId(Long partSpecId) {
this.partSpecId = partSpecId;
}
public Long getRectificationId() {
return rectificationId;
}
public void setRectificationId(Long rectificationId) {
this.rectificationId = rectificationId;
}
public BigDecimal getPartCoefficient() {
return partCoefficient;
}
public void setPartCoefficient(BigDecimal partCoefficient) {
this.partCoefficient = partCoefficient;
}
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public Boolean getStorageType() {
return storageType;
}
public void setStorageType(Boolean storageType) {
this.storageType = storageType;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -1079,6 +1178,12 @@ public class HGKC003 extends DaoEPBase { ...@@ -1079,6 +1178,12 @@ public class HGKC003 extends DaoEPBase {
setPartThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PART_THICK)), partThick)); setPartThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PART_THICK)), partThick));
setPartSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PART_SPEC)), partSpec)); setPartSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PART_SPEC)), partSpec));
setSubmitStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_SUBMIT_STATUS)), submitStatus)); setSubmitStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_SUBMIT_STATUS)), submitStatus));
setPartSpecId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PART_SPEC_ID)), partSpecId));
setRectificationId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_RECTIFICATION_ID)), rectificationId));
setPartCoefficient(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PART_COEFFICIENT)), partCoefficient));
setPrice(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PRICE)), price));
setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount));
setStorageType(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_STORAGE_TYPE)), storageType));
} }
/** /**
...@@ -1130,6 +1235,12 @@ public class HGKC003 extends DaoEPBase { ...@@ -1130,6 +1235,12 @@ public class HGKC003 extends DaoEPBase {
map.put(FIELD_PART_THICK, StringUtils.toString(partThick, eiMetadata.getMeta(FIELD_PART_THICK))); map.put(FIELD_PART_THICK, StringUtils.toString(partThick, eiMetadata.getMeta(FIELD_PART_THICK)));
map.put(FIELD_PART_SPEC, StringUtils.toString(partSpec, eiMetadata.getMeta(FIELD_PART_SPEC))); map.put(FIELD_PART_SPEC, StringUtils.toString(partSpec, eiMetadata.getMeta(FIELD_PART_SPEC)));
map.put(FIELD_SUBMIT_STATUS, StringUtils.toString(submitStatus, eiMetadata.getMeta(FIELD_SUBMIT_STATUS))); map.put(FIELD_SUBMIT_STATUS, StringUtils.toString(submitStatus, eiMetadata.getMeta(FIELD_SUBMIT_STATUS)));
map.put(FIELD_PART_SPEC_ID, StringUtils.toString(partSpecId, eiMetadata.getMeta(FIELD_PART_SPEC_ID)));
map.put(FIELD_RECTIFICATION_ID, StringUtils.toString(rectificationId, eiMetadata.getMeta(FIELD_RECTIFICATION_ID)));
map.put(FIELD_PART_COEFFICIENT, StringUtils.toString(partCoefficient, eiMetadata.getMeta(FIELD_PART_COEFFICIENT)));
map.put(FIELD_PRICE, StringUtils.toString(price, eiMetadata.getMeta(FIELD_PRICE)));
map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT)));
map.put(FIELD_STORAGE_TYPE, StringUtils.toString(storageType, eiMetadata.getMeta(FIELD_STORAGE_TYPE)));
return map; return map;
} }
......
...@@ -23,7 +23,6 @@ public class HGKC003A extends DaoEPBase { ...@@ -23,7 +23,6 @@ public class HGKC003A extends DaoEPBase {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id"; public static final String FIELD_ID = "id";
public static final String FIELD_QUALITY_DETAIL_ID = "qualityDetailId"; /* 质检单明细ID*/
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 企业编码*/ public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 企业编码*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/ public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 记录创建者*/ public static final String FIELD_CREATED_BY = "createdBy"; /* 记录创建者*/
...@@ -67,9 +66,13 @@ public class HGKC003A extends DaoEPBase { ...@@ -67,9 +66,13 @@ public class HGKC003A extends DaoEPBase {
public static final String FIELD_PRICE = "price"; /* 单价*/ public static final String FIELD_PRICE = "price"; /* 单价*/
public static final String FIELD_AMOUNT = "amount"; /* 金额*/ public static final String FIELD_AMOUNT = "amount"; /* 金额*/
public static final String FIELD_STORAGE_TYPE = "storageType"; /* 入库类型:0:入库 1:退回*/ public static final String FIELD_STORAGE_TYPE = "storageType"; /* 入库类型:0:入库 1:退回*/
public static final String FIELD_QUALITY_ID = "qualityId"; /* 质检单ID*/
public static final String FIELD_PART_SPEC_ID = "partSpecId"; /* 零件规格ID*/
public static final String FIELD_RECTIFICATION_ID = "rectificationId"; /* 整改通知单ID*/
public static final String FIELD_PART_COEFFICIENT = "partCoefficient"; /* 零件系数*/
public static final String COL_ID = "ID"; public static final String COL_ID = "ID";
public static final String COL_QUALITY_DETAIL_ID = "QUALITY_DETAIL_ID"; /* 质检单明细ID*/ public static final String COL_QUALITY_ID = "QUALITY_ID"; /* 质检单ID*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/ public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/ public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 记录创建者*/ public static final String COL_CREATED_BY = "CREATED_BY"; /* 记录创建者*/
...@@ -114,6 +117,10 @@ public class HGKC003A extends DaoEPBase { ...@@ -114,6 +117,10 @@ public class HGKC003A extends DaoEPBase {
public static final String COL_AMOUNT = "AMOUNT"; /* 金额*/ public static final String COL_AMOUNT = "AMOUNT"; /* 金额*/
public static final String COL_STORAGE_TYPE = "STORAGE_TYPE"; /* 入库类型:0:入库 1:退回*/ public static final String COL_STORAGE_TYPE = "STORAGE_TYPE"; /* 入库类型:0:入库 1:退回*/
public static final String COL_PART_SPEC_ID = "PART_SPEC_ID"; /* 零件规格ID*/
public static final String COL_RECTIFICATION_ID = "RECTIFICATION_ID"; /* 整改通知单ID*/
public static final String COL_PART_COEFFICIENT = "PART_COEFFICIENT"; /* 零件系数*/
public static final String QUERY = "HGKC003A.query"; public static final String QUERY = "HGKC003A.query";
public static final String COUNT = "HGKC003A.count"; public static final String COUNT = "HGKC003A.count";
public static final String INSERT = "HGKC003A.insert"; public static final String INSERT = "HGKC003A.insert";
...@@ -122,7 +129,7 @@ public class HGKC003A extends DaoEPBase { ...@@ -122,7 +129,7 @@ public class HGKC003A extends DaoEPBase {
public static final String BATCH_DELETE = "HGKC003A.batchDelete"; public static final String BATCH_DELETE = "HGKC003A.batchDelete";
private Long id = new Long(0); private Long id = new Long(0);
private Long qualityDetailId = new Long(0); /* 质检单明细ID*/ private Long qualityId = new Long(0); /* 质检单ID*/
private String accountCode = " "; /* 企业编码*/ private String accountCode = " "; /* 企业编码*/
private String depCode = " "; /* 部门编码*/ private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 记录创建者*/ private String createdBy = " "; /* 记录创建者*/
...@@ -167,6 +174,11 @@ public class HGKC003A extends DaoEPBase { ...@@ -167,6 +174,11 @@ public class HGKC003A extends DaoEPBase {
private BigDecimal amount = new BigDecimal("0"); /* 金额*/ private BigDecimal amount = new BigDecimal("0"); /* 金额*/
private Boolean storageType; /* 入库类型:0:入库 1:退回*/ private Boolean storageType; /* 入库类型:0:入库 1:退回*/
private Long partSpecId = new Long(0); /* 规格id*/
private Long rectificationId = new Long(0); /* 整改通知单id*/
private BigDecimal partCoefficient = new BigDecimal(0.000); /* 零件-系数*/
/** /**
* initialize the metadata. * initialize the metadata.
*/ */
...@@ -178,8 +190,8 @@ public class HGKC003A extends DaoEPBase { ...@@ -178,8 +190,8 @@ public class HGKC003A extends DaoEPBase {
eiColumn.setDescName(" "); eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_QUALITY_DETAIL_ID); eiColumn = new EiColumn(FIELD_QUALITY_ID);
eiColumn.setDescName("质检单明细ID"); eiColumn.setDescName("质检单ID");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ACCOUNT_CODE); eiColumn = new EiColumn(FIELD_ACCOUNT_CODE);
...@@ -387,6 +399,21 @@ public class HGKC003A extends DaoEPBase { ...@@ -387,6 +399,21 @@ public class HGKC003A extends DaoEPBase {
eiColumn.setDescName("入库类型:0:入库 1:退回"); eiColumn.setDescName("入库类型:0:入库 1:退回");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PART_SPEC_ID);
eiColumn.setDescName("零件规格ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_RECTIFICATION_ID);
eiColumn.setDescName("整改通知单ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PART_COEFFICIENT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(12);
eiColumn.setDescName("零件-系数");
eiMetadata.addMeta(eiColumn);
} }
...@@ -1102,12 +1129,36 @@ public class HGKC003A extends DaoEPBase { ...@@ -1102,12 +1129,36 @@ public class HGKC003A extends DaoEPBase {
this.storageType = storageType; this.storageType = storageType;
} }
public Long getQualityDetailId() { public Long getQualityId() {
return qualityDetailId; return qualityId;
}
public void setQualityId(Long qualityId) {
this.qualityId = qualityId;
}
public Long getPartSpecId() {
return partSpecId;
}
public void setPartSpecId(Long partSpecId) {
this.partSpecId = partSpecId;
}
public Long getRectificationId() {
return rectificationId;
}
public void setRectificationId(Long rectificationId) {
this.rectificationId = rectificationId;
}
public BigDecimal getPartCoefficient() {
return partCoefficient;
} }
public void setQualityDetailId(Long qualityDetailId) { public void setPartCoefficient(BigDecimal partCoefficient) {
this.qualityDetailId = qualityDetailId; this.partCoefficient = partCoefficient;
} }
/** /**
...@@ -1119,7 +1170,7 @@ public class HGKC003A extends DaoEPBase { ...@@ -1119,7 +1170,7 @@ public class HGKC003A extends DaoEPBase {
public void fromMap(Map map) { public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id)); setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setQualityDetailId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_QUALITY_DETAIL_ID)), qualityDetailId)); setQualityId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_QUALITY_ID)), qualityId));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode)); setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode)); setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy)); setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
...@@ -1163,6 +1214,9 @@ public class HGKC003A extends DaoEPBase { ...@@ -1163,6 +1214,9 @@ public class HGKC003A extends DaoEPBase {
setPrice(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PRICE)), price)); setPrice(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PRICE)), price));
setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount)); setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount));
setStorageType(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_STORAGE_TYPE)), storageType)); setStorageType(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_STORAGE_TYPE)), storageType));
setPartSpecId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PART_SPEC_ID)), partSpecId));
setRectificationId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_RECTIFICATION_ID)), rectificationId));
setPartCoefficient(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PART_COEFFICIENT)), partCoefficient));
} }
/** /**
...@@ -1173,7 +1227,7 @@ public class HGKC003A extends DaoEPBase { ...@@ -1173,7 +1227,7 @@ public class HGKC003A extends DaoEPBase {
Map map = new HashMap(); Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID))); map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_QUALITY_DETAIL_ID, StringUtils.toString(qualityDetailId, eiMetadata.getMeta(FIELD_QUALITY_DETAIL_ID))); map.put(FIELD_QUALITY_ID, StringUtils.toString(qualityId, eiMetadata.getMeta(FIELD_QUALITY_ID)));
map.put(FIELD_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE))); map.put(FIELD_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE))); map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY))); map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
...@@ -1217,6 +1271,9 @@ public class HGKC003A extends DaoEPBase { ...@@ -1217,6 +1271,9 @@ public class HGKC003A extends DaoEPBase {
map.put(FIELD_PRICE, StringUtils.toString(price, eiMetadata.getMeta(FIELD_PRICE))); map.put(FIELD_PRICE, StringUtils.toString(price, eiMetadata.getMeta(FIELD_PRICE)));
map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT))); map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT)));
map.put(FIELD_STORAGE_TYPE, StringUtils.toString(storageType, eiMetadata.getMeta(FIELD_STORAGE_TYPE))); map.put(FIELD_STORAGE_TYPE, StringUtils.toString(storageType, eiMetadata.getMeta(FIELD_STORAGE_TYPE)));
map.put(FIELD_PART_SPEC_ID, StringUtils.toString(partSpecId, eiMetadata.getMeta(FIELD_PART_SPEC_ID)));
map.put(FIELD_RECTIFICATION_ID, StringUtils.toString(rectificationId, eiMetadata.getMeta(FIELD_RECTIFICATION_ID)));
map.put(FIELD_PART_COEFFICIENT, StringUtils.toString(partCoefficient, eiMetadata.getMeta(FIELD_PART_COEFFICIENT)));
return map; return map;
} }
......
...@@ -87,6 +87,7 @@ public class HGKC010 extends DaoEPBase { ...@@ -87,6 +87,7 @@ public class HGKC010 extends DaoEPBase {
public static final String COUNT = "HGKC010.count"; public static final String COUNT = "HGKC010.count";
public static final String INSERT = "HGKC010.insert"; public static final String INSERT = "HGKC010.insert";
public static final String UPDATE = "HGKC010.update"; public static final String UPDATE = "HGKC010.update";
public static final String UPDATE_INV = "HGKC010.updateInv";
public static final String DELETE = "HGKC010.delete"; public static final String DELETE = "HGKC010.delete";
private Long id = new Long(0); private Long id = new Long(0);
......
...@@ -27,8 +27,6 @@ public class HGKC012 extends HGKC010{ ...@@ -27,8 +27,6 @@ public class HGKC012 extends HGKC010{
private BigDecimal warnNum = new BigDecimal("0"); /* 预警数量*/ private BigDecimal warnNum = new BigDecimal("0"); /* 预警数量*/
private String princ = " "; /* 负责人*/
/** /**
* initialize the metadata. * initialize the metadata.
*/ */
...@@ -76,28 +74,10 @@ public class HGKC012 extends HGKC010{ ...@@ -76,28 +74,10 @@ public class HGKC012 extends HGKC010{
* @param map - source data map * @param map - source data map
*/ */
/**
* get the princ - 负责人.
* @return the princ
*/
public String getPrinc() {
return this.princ;
}
/**
* set the princ - 负责人.
*
* @param princ - 负责人
*/
public void setPrinc(String princ) {
this.princ = princ;
}
@Override @Override
public void fromMap(Map map) { public void fromMap(Map map) {
super.fromMap(map); super.fromMap(map);
setWarnNum(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WARN_NUM)), warnNum)); setWarnNum(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WARN_NUM)), warnNum));
setPrinc(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRINC)), princ));
} }
/** /**
...@@ -108,7 +88,6 @@ public class HGKC012 extends HGKC010{ ...@@ -108,7 +88,6 @@ public class HGKC012 extends HGKC010{
Map map = super.toMap(); Map map = super.toMap();
map.put(FIELD_WARN_NUM, StringUtils.toString(warnNum, eiMetadata.getMeta(FIELD_WARN_NUM))); map.put(FIELD_WARN_NUM, StringUtils.toString(warnNum, eiMetadata.getMeta(FIELD_WARN_NUM)));
map.put(FIELD_PRINC, StringUtils.toString(princ, eiMetadata.getMeta(FIELD_PRINC)));
return map; return map;
} }
} }
...@@ -8,6 +8,8 @@ import com.baosight.hggp.hg.constant.HGConstant; ...@@ -8,6 +8,8 @@ import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant; import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.domain.HGKC004; import com.baosight.hggp.hg.kc.domain.HGKC004;
import com.baosight.hggp.hg.kc.domain.HGKC004A; import com.baosight.hggp.hg.kc.domain.HGKC004A;
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.domain.HGPZ005;
import com.baosight.hggp.hg.pz.tools.HGPZTools; import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sb.domain.HGSB002; import com.baosight.hggp.hg.sb.domain.HGSB002;
...@@ -156,6 +158,29 @@ public class ServiceHGKC004 extends ServiceEPBase { ...@@ -156,6 +158,29 @@ public class ServiceHGKC004 extends ServiceEPBase {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
HGKC004 hgkc004 = new HGKC004(); HGKC004 hgkc004 = new HGKC004();
hgkc004.fromMap(map); hgkc004.fromMap(map);
HGKC004 kc004 = HGKCTools.HgKc004.getId(hgkc004.getId());
List<HGKC004A> hgkc004s = HGKCTools.HgKc004.getDetailById(hgkc004.getId());
AssertUtils.isEmpty(hgkc004s, "销售出库单明细不存在!");
for (HGKC004A hgkc004A : hgkc004s) {
if (hgkc004A.getPrice().compareTo(BigDecimal.ZERO)<=0 || hgkc004A.getAmount().compareTo(BigDecimal.ZERO)<=0){
throw new PlatException("单价和金额不能小于0!");
}
HGKC010 hgkc010 = HGKCTools.HgKc010.get(kc004.getCompanyCode(), kc004.getWhCode(), hgkc004A.getInventRecordId());
if (hgkc010 == null) {
throw new PlatException("库存不足!");
}
if (hgkc010.getInvQty().compareTo(hgkc004A.getQuantity()) < 0) {
throw new PlatException("库存不足,无法提交!");
}else if (hgkc010.getInvQty().compareTo(hgkc004A.getQuantity()) == 0) {
hgkc010.setInvQty(BigDecimal.ZERO);
hgkc010.setInvWeight(BigDecimal.ZERO);
}else {
hgkc010.setInvQty(hgkc010.getInvQty().subtract(hgkc004A.getQuantity()));
hgkc010.setInvWeight(hgkc010.getInvQty().multiply(hgkc004A.getUnitWeight()));
}
DaoUtils.update(HGKC010.UPDATE_INV, hgkc010);
}
DaoUtils.update(HGKC004.UPDATE_STATUS, hgkc004); DaoUtils.update(HGKC004.UPDATE_STATUS, hgkc004);
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
......
<?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.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="HGKC003"> <sqlMap namespace="HGKC003">
<sql id="column">
ID as "id",
QUALITY_ID as "qualityId", <!-- 质检单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", <!-- 公司名称 -->
DEPOSIT_DATE as "depositDate", <!-- 入库日期 -->
DEPOSIT_NO as "depositNo", <!-- 入库单号 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
INV_QTY as "invQty", <!-- 数量 -->
INV_UNIT_WEIGHT as "invUnitWeight", <!-- 单重 -->
INV_WEIGHT as "invWeight", <!-- 重量 -->
DEPOSIT_NO_OLD as "depositNoOld", <!-- 入库单号(旧) -->
REMARK as "remark", <!-- 备注 -->
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
PROD_ORDER_NO as "prodOrderNo", <!-- 生产订单号 -->
PROD_TASK_NO as "prodTaskNo", <!-- 生产任务号 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PRDT_TYPE as "prdtType", <!-- 产品类型 -->
PRDT_CODE as "prdtCode", <!-- 产品编码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
PRDT_LENGTH as "prdtLength", <!-- 产品-长 -->
PRDT_WIDTH as "prdtWidth", <!-- 产品-宽 -->
PRDT_THICK as "prdtThick", <!-- 产品-厚 -->
PRDT_SPEC as "prdtSpec", <!-- 产品规格 -->
PART_TYPE as "partType", <!-- 零件类型 -->
PART_CODE as "partCode", <!-- 零件编码 -->
PART_NAME as "partName", <!-- 零件名称 -->
PART_LENGTH as "partLength", <!-- 零件-长 -->
PART_WIDTH as "partWidth", <!-- 零件-宽 -->
PART_THICK as "partThick", <!-- 零件-厚 -->
PART_SPEC as "partSpec", <!-- 零件规格 -->
SUBMIT_STATUS as "submitStatus" <!-- 提交状态 -->
</sql>
<sql id="condition"> <sql id="condition">
AND DELETE_FLAG = 0 <isNotEmpty prepend=" AND " property="id">
<include refid="HGXSDataAuth.authCondition"/> ID = #id#
<include refid="idCondition"/> </isNotEmpty>
<include refid="customCondition"/>
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode# ACCOUNT_CODE = #accountCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode"> <isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode# DEP_CODE = #depCode#
</isNotEmpty> </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"> <isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode# COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
...@@ -74,7 +49,16 @@ ...@@ -74,7 +49,16 @@
WH_CODE = #whCode# WH_CODE = #whCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="whName"> <isNotEmpty prepend=" AND " property="whName">
WH_NAME like ('%$whName$%') WH_NAME = #whName#
</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>
<isNotEmpty prepend=" AND " property="depositNoOld"> <isNotEmpty prepend=" AND " property="depositNoOld">
DEPOSIT_NO_OLD = #depositNoOld# DEPOSIT_NO_OLD = #depositNoOld#
...@@ -139,67 +123,116 @@ ...@@ -139,67 +123,116 @@
<isNotEmpty prepend=" AND " property="partSpec"> <isNotEmpty prepend=" AND " property="partSpec">
PART_SPEC = #partSpec# PART_SPEC = #partSpec#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="submitStatus"> <isNotEmpty prepend=" AND " property="price">
SUBMIT_STATUS = #submitStatus# PRICE = #price#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="amount">
AMOUNT = #amount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="storageType">
STORAGE_TYPE = #storageType#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="qualityId"> <isNotEmpty prepend=" AND " property="qualityId">
QUALITY_ID = #qualityId# QUALITY_ID = #qualityId#
</isNotEmpty> </isNotEmpty>
</sql> <isNotEmpty prepend=" AND " property="partSpecId">
PART_SPEC_ID = #partSpecId#
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="depositNos"> <isNotEmpty prepend=" AND " property="rectificationId">
DEPOSIT_NO IN <iterate open="(" close=")" conjunction="," property="depositNos">#depositNos[]#</iterate> RECTIFICATION_ID = #rectificationId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partCoefficient">
PART_COEFFICIENT = #partCoefficient#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="submitStatus">
SUBMIT_STATUS = #submitStatus#
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<sql id="customCondition"> <select id="query" parameterClass="java.util.HashMap"
<include refid="BaseCondition.specCondition"/> resultClass="com.baosight.hggp.hg.kc.domain.HGKC003">
<include refid="BaseCondition.createdTimeCondition"/> SELECT
</sql> ID as "id",
QUALITY_ID as "qualityId",<!-- 质检单明细ID -->
<!-- 公共修改字段 --> RECTIFICATION_ID as "rectificationId",<!-- 整改通知单ID -->
<sql id="updateRevise"> PART_SPEC_ID as "partSpecId",<!-- 零件规格ID -->
UPDATED_BY = #updatedBy#, PART_COEFFICIENT as "partCoefficient",<!-- 零件系数 -->
UPDATED_NAME = #updatedName#, ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
UPDATED_TIME = #updatedTime# DEP_CODE as "depCode", <!-- 部门编码 -->
</sql> CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
<sql id="orderBy"> CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
DEPOSIT_DATE as "depositDate", <!-- 入库日期 -->
DEPOSIT_NO as "depositNo", <!-- 入库单号 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
INV_QTY as "invQty", <!-- 数量 -->
INV_UNIT_WEIGHT as "invUnitWeight", <!-- 单重 -->
INV_WEIGHT as "invWeight", <!-- 重量 -->
DEPOSIT_NO_OLD as "depositNoOld", <!-- 入库单号(旧) -->
REMARK as "remark", <!-- 备注 -->
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
PROD_ORDER_NO as "prodOrderNo", <!-- 生产订单号 -->
PROD_TASK_NO as "prodTaskNo", <!-- 生产任务号 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PRDT_TYPE as "prdtType", <!-- 产品类型 -->
PRDT_CODE as "prdtCode", <!-- 产品编码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
PRDT_LENGTH as "prdtLength", <!-- 产品-长 -->
PRDT_WIDTH as "prdtWidth", <!-- 产品-宽 -->
PRDT_THICK as "prdtThick", <!-- 产品-厚 -->
PRDT_SPEC as "prdtSpec", <!-- 产品规格 -->
PART_TYPE as "partType", <!-- 零件类型 -->
PART_CODE as "partCode", <!-- 零件编码 -->
PART_NAME as "partName", <!-- 零件名称 -->
PART_LENGTH as "partLength", <!-- 零件-长 -->
PART_WIDTH as "partWidth", <!-- 零件-宽 -->
PART_THICK as "partThick", <!-- 零件-厚 -->
PART_SPEC as "partSpec", <!-- 零件规格 -->
PRICE as "price", <!-- 单价 -->
AMOUNT as "amount", <!-- 金额 -->
STORAGE_TYPE as "storageType", <!-- 入库类型:0:入库 1:退回 -->
SUBMIT_STATUS as "submitStatus" <!-- 提交状态 -->
FROM ${hggpSchema}.HGKC003 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy"> <isNotEmpty property="orderBy">
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
ID DESC ID asc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.kc.domain.HGKC003">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGKC003 WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select> </select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGKC003 WHERE 1=1 SELECT COUNT(*) FROM ${hggpSchema}.HGKC003 WHERE 1=1
<include refid="condition"/> <include refid="condition" />
</select> </select>
<insert id="insert"> <insert id="insert">
INSERT INTO ${hggpSchema}.HGKC003 ( INSERT INTO ${hggpSchema}.HGKC003 (
QUALITY_ID, <!-- 企业编码 --> QUALITY_ID,<!-- 质检单ID -->
PART_SPEC_ID,<!-- 零件规格ID -->
RECTIFICATION_ID,<!-- 整改通知单ID -->
PART_COEFFICIENT,<!-- 零件系数 -->
ACCOUNT_CODE, <!-- 企业编码 --> ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 --> DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 --> CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 --> CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 --> CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
DELETE_FLAG, <!-- 0-未删除,1-已删除 --> DELETE_FLAG, <!-- 0-未删除,1-已删除 -->
COMPANY_CODE, <!-- 公司编码 --> COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 --> COMPANY_NAME, <!-- 公司名称 -->
...@@ -231,14 +264,20 @@ ...@@ -231,14 +264,20 @@
PART_WIDTH, <!-- 零件-宽 --> PART_WIDTH, <!-- 零件-宽 -->
PART_THICK, <!-- 零件-厚 --> PART_THICK, <!-- 零件-厚 -->
PART_SPEC, <!-- 零件规格 --> PART_SPEC, <!-- 零件规格 -->
SUBMIT_STATUS <!-- 提交状态 --> PRICE, <!-- 单价 -->
) VALUES ( AMOUNT, <!-- 金额 -->
#qualityId#,#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, STORAGE_TYPE, <!-- 入库类型:0:入库 1:退回 -->
#deleteFlag#, #companyCode#, #companyName#, #depositDate#, #depositNo#, #whCode#, #whName#, SUBMIT_STATUS
#invQty#, #invUnitWeight#, #invWeight#, #depositNoOld#, #remark#, #factoryCode#, #prodOrderNo#, #prodTaskNo#,
#projCode#, #projName#, #prdtType#, #prdtCode#, #prdtName#, #prdtLength#, #prdtWidth#, #prdtThick#, #prdtSpec#,
#partType#, #partCode#, #partName#, #partLength#, #partWidth#, #partThick#, #partSpec#, #submitStatus#
) )
VALUES (#qualityId#,#partSpecId#,#rectificationId#,#partCoefficient#,#accountCode#,
#depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#,
#updatedName#, #updatedTime#, #deleteFlag#, #companyCode#,
#companyName#, #depositDate#, #depositNo#, #whCode#, #whName#,
#invQty#, #invUnitWeight#, #invWeight#, #depositNoOld#, #remark#,
#factoryCode#, #prodOrderNo#, #prodTaskNo#, #projCode#, #projName#,
#prdtType#, #prdtCode#, #prdtName#, #prdtLength#, #prdtWidth#, #prdtThick#,
#prdtSpec#, #partType#, #partCode#, #partName#, #partLength#, #partWidth#,
#partThick#, #partSpec#, #price#, #amount#, #storageType#,#submitStatus#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -246,10 +285,18 @@ ...@@ -246,10 +285,18 @@
ID = #id# ID = #id#
</delete> </delete>
<delete id="batchDelete">
DELETE FROM ${hggpSchema}.HGKC003 WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete>
<update id="update"> <update id="update">
UPDATE ${hggpSchema}.HGKC003 UPDATE ${hggpSchema}.HGKC003
SET SET
QUALITY_ID = #qualityId#, <!-- 质检单id --> QUALITY_ID = #qualityId#,<!-- 质检单ID -->
RECTIFICATION_ID = #rectificationId#,<!-- 整改通知单ID -->
PART_SPEC_ID = #partSpecId#,<!-- 零件规格ID -->
PART_COEFFICIENT = #partCoefficient#,<!-- 零件系数 -->
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 --> ACCOUNT_CODE = #accountCode#, <!-- 企业编码 -->
DEP_CODE = #depCode#, <!-- 部门编码 --> DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 --> CREATED_BY = #createdBy#, <!-- 记录创建者 -->
...@@ -289,6 +336,9 @@ ...@@ -289,6 +336,9 @@
PART_WIDTH = #partWidth#, <!-- 零件-宽 --> PART_WIDTH = #partWidth#, <!-- 零件-宽 -->
PART_THICK = #partThick#, <!-- 零件-厚 --> PART_THICK = #partThick#, <!-- 零件-厚 -->
PART_SPEC = #partSpec#, <!-- 零件规格 --> PART_SPEC = #partSpec#, <!-- 零件规格 -->
PRICE = #price#, <!-- 单价 -->
AMOUNT = #amount#, <!-- 金额 -->
STORAGE_TYPE = #storageType#, <!-- 入库类型:0:入库 1:退回 -->
SUBMIT_STATUS = #submitStatus# <!-- 提交状态 --> SUBMIT_STATUS = #submitStatus# <!-- 提交状态 -->
WHERE WHERE
ID = #id# ID = #id#
......
...@@ -135,8 +135,17 @@ ...@@ -135,8 +135,17 @@
<isNotEmpty prepend=" AND " property="storageType"> <isNotEmpty prepend=" AND " property="storageType">
STORAGE_TYPE = #storageType# STORAGE_TYPE = #storageType#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="qualityDetailId"> <isNotEmpty prepend=" AND " property="qualityId">
QUALITY_DETAIL_ID = #qualityDetailId# QUALITY_ID = #qualityId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partSpecId">
PART_SPEC_ID = #partSpecId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="rectificationId">
RECTIFICATION_ID = #rectificationId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partCoefficient">
PART_COEFFICIENT = #partCoefficient#
</isNotEmpty> </isNotEmpty>
</sql> </sql>
...@@ -144,7 +153,10 @@ ...@@ -144,7 +153,10 @@
resultClass="com.baosight.hggp.hg.kc.domain.HGKC003A"> resultClass="com.baosight.hggp.hg.kc.domain.HGKC003A">
SELECT SELECT
ID as "id", ID as "id",
QUALITY_DETAIL_ID as "qualityDetailId",<!-- 质检单明细ID --> QUALITY_ID as "qualityId",<!-- 质检单明细ID -->
RECTIFICATION_ID as "rectificationId",<!-- 整改通知单ID -->
PART_SPEC_ID as "partSpecId",<!-- 零件规格ID -->
PART_COEFFICIENT as "partCoefficient",<!-- 零件系数 -->
ACCOUNT_CODE as "accountCode", <!-- 企业编码 --> ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 --> DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 --> CREATED_BY as "createdBy", <!-- 记录创建者 -->
...@@ -209,7 +221,10 @@ ...@@ -209,7 +221,10 @@
<insert id="insert"> <insert id="insert">
INSERT INTO ${hggpSchema}.HGKC003A ( INSERT INTO ${hggpSchema}.HGKC003A (
QUALITY_DETAIL_ID,<!-- 企业编码 --> QUALITY_ID,<!-- 质检单ID -->
RECTIFICATION_ID,<!-- 整改通知单ID -->
PART_SPEC_ID,<!-- 零件规格ID -->
PART_COEFFICIENT,<!-- 零件系数 -->
ACCOUNT_CODE, <!-- 企业编码 --> ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 --> DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 --> CREATED_BY, <!-- 记录创建者 -->
...@@ -254,7 +269,7 @@ ...@@ -254,7 +269,7 @@
AMOUNT, <!-- 金额 --> AMOUNT, <!-- 金额 -->
STORAGE_TYPE <!-- 入库类型:0:入库 1:退回 --> STORAGE_TYPE <!-- 入库类型:0:入库 1:退回 -->
) )
VALUES (#qualityDetailId#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #depositDate#, #depositNo#, #whCode#, #whName#, #invQty#, #invUnitWeight#, #invWeight#, #depositNoOld#, #remark#, #factoryCode#, #prodOrderNo#, #prodTaskNo#, #projCode#, #projName#, #prdtType#, #prdtCode#, #prdtName#, #prdtLength#, #prdtWidth#, #prdtThick#, #prdtSpec#, #partType#, #partCode#, #partName#, #partLength#, #partWidth#, #partThick#, #partSpec#, #primaryId#, #price#, #amount#, #storageType#) VALUES (#qualityId#,#partSpecId#,#rectificationId#,#partCoefficient#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #depositDate#, #depositNo#, #whCode#, #whName#, #invQty#, #invUnitWeight#, #invWeight#, #depositNoOld#, #remark#, #factoryCode#, #prodOrderNo#, #prodTaskNo#, #projCode#, #projName#, #prdtType#, #prdtCode#, #prdtName#, #prdtLength#, #prdtWidth#, #prdtThick#, #prdtSpec#, #partType#, #partCode#, #partName#, #partLength#, #partWidth#, #partThick#, #partSpec#, #primaryId#, #price#, #amount#, #storageType#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -270,7 +285,10 @@ ...@@ -270,7 +285,10 @@
<update id="update"> <update id="update">
UPDATE ${hggpSchema}.HGKC003A UPDATE ${hggpSchema}.HGKC003A
SET SET
QUALITY_DETAIL_ID = #qualityDetailId#,<!-- 企业编码 --> QUALITY_ID = #qualityId#,<!-- 质检单ID -->
RECTIFICATION_ID = #rectificationId#,<!-- 整改通知单ID -->
PART_SPEC_ID = #partSpecId#,<!-- 零件规格ID -->
PART_COEFFICIENT = #partCoefficient#,<!-- 零件系数 -->
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 --> ACCOUNT_CODE = #accountCode#, <!-- 企业编码 -->
DEP_CODE = #depCode#, <!-- 部门编码 --> DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 --> CREATED_BY = #createdBy#, <!-- 记录创建者 -->
......
...@@ -218,7 +218,14 @@ ...@@ -218,7 +218,14 @@
INVENT_TYPE as "inventType", <!-- 存货类型 --> INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 --> INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 --> INVENT_NAME as "inventName", <!-- 存货名称 -->
SPEC_ID as "specId" <!-- 规格ID --> SPEC_ID as "specId", <!-- 规格ID -->
SPEC as "spec", <!-- 规格 -->
LENGTH as "length", <!-- 长度 -->
WIDTH as "width", <!-- 宽度 -->
THICK as "thick", <!-- 厚度 -->
INV_QTY as "invQty", <!-- 库存数量 -->
INV_UNIT_WEIGHT as "invUnitWeight", <!-- 库存单重 -->
INV_WEIGHT as "invWeight" <!-- 库存重量 -->
FROM ${hggpSchema}.HGKC010 FROM ${hggpSchema}.HGKC010
WHERE 1=1 WHERE 1=1
<include refid="condition"/> <include refid="condition"/>
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
A.INV_WEIGHT as "invWeight", <!-- 库存重量 --> A.INV_WEIGHT as "invWeight", <!-- 库存重量 -->
A.FACTORY_CODE as "factoryCode", <!-- 厂区编码 --> A.FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
A.FACTORY_NAME as "factoryName", <!-- 厂区名称 --> A.FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
B.WARN_NUM as warnNum, <!-- 预警值 --> B.WARN_NUM as warnNum <!-- 预警值 -->
C.PRINC as "princ" <!-- 负责人 --> <!-- C.PRINC as "princ" 负责人 -->
</sql> </sql>
<sql id="authCondition"> <sql id="authCondition">
...@@ -106,7 +106,6 @@ ...@@ -106,7 +106,6 @@
SELECT <include refid="column"/> SELECT <include refid="column"/>
FROM ${hggpSchema}.HGKC010 A FROM ${hggpSchema}.HGKC010 A
INNER JOIN ${hggpSchema}.HGPZ010 B ON A.SPEC_ID = B.INVENT_RECORD_ID INNER JOIN ${hggpSchema}.HGPZ010 B ON A.SPEC_ID = B.INVENT_RECORD_ID
LEFT JOIN ${hggpSchema}.hgpz007 C ON A.WH_CODE = C.WH_CODE
WHERE A.INV_QTY &lt;= B.WARN_NUM WHERE A.INV_QTY &lt;= B.WARN_NUM
<include refid="authCondition"/> <include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="spec"> <isNotEmpty prepend=" AND " property="spec">
......
package com.baosight.hggp.hg.kc.tools; package com.baosight.hggp.hg.kc.tools;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.baosight.hggp.common.CheckTypeEnum;
import com.baosight.hggp.core.dao.DaoBase; import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant; import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.domain.*; import com.baosight.hggp.hg.kc.domain.*;
import com.baosight.hggp.hg.sc.domain.HGSC004; import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.sc.domain.HGSC005; import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.zl.domain.HGZL002;
import com.baosight.hggp.hg.zl.domain.HGZL004;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.StringUtils; import com.baosight.hggp.util.StringUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -147,21 +151,103 @@ public class HGKCTools { ...@@ -147,21 +151,103 @@ public class HGKCTools {
private static void checkSaveData(HGKC003 hgkc003,List<HGKC003A> hgkc003aList) { private static void checkSaveData(HGKC003 hgkc003,List<HGKC003A> hgkc003aList) {
AssertUtils.isEmpty(hgkc003.getCompanyCode(), "公司编码不能为空!"); AssertUtils.isEmpty(hgkc003.getCompanyCode(), "公司编码不能为空!");
AssertUtils.isEmpty(hgkc003.getCompanyName(), "公司名称不能为空!"); AssertUtils.isEmpty(hgkc003.getCompanyName(), "公司名称不能为空!");
AssertUtils.isEmpty(hgkc003.getWhCode(), "仓库编码不能为空!");
AssertUtils.isEmpty(hgkc003.getWhName(), "仓库名称不能为空!");
AssertUtils.isEmpty(hgkc003.getProjCode(), "项目编号不能为空!"); AssertUtils.isEmpty(hgkc003.getProjCode(), "项目编号不能为空!");
AssertUtils.isEmpty(hgkc003.getProjName(), "项目名称不能为空!"); AssertUtils.isEmpty(hgkc003.getProjName(), "项目名称不能为空!");
AssertUtils.isTrue(Objects.isNull(hgkc003.getQualityId())||hgkc003.getQualityId()<=0, "质检单ID不能为空!"); AssertUtils.isTrue(Objects.isNull(hgkc003.getQualityId())||hgkc003.getQualityId()<=0, "质检单ID不能为空!");
for(HGKC003A hgkc003a : hgkc003aList){ }
AssertUtils.isEmpty(hgkc003a.getCompanyCode(), "公司编码不能为空!");
AssertUtils.isEmpty(hgkc003a.getCompanyName(), "公司名称不能为空!"); /**
AssertUtils.isEmpty(hgkc003a.getProjCode(), "项目编号不能为空!"); * 校验生产入库信息,整改单就不用校验了
AssertUtils.isEmpty(hgkc003a.getProjName(), "项目名称不能为空!"); * @param hgzl002List
AssertUtils.isEmpty(hgkc003a.getWhCode(), "仓库编码不能为空!"); */
AssertUtils.isEmpty(hgkc003a.getWhName(), "仓库名称不能为空!"); public static void putInStorageCheckData(List<HGZL002> hgzl002List) {
AssertUtils.isEmpty(hgkc003a.getPrdtCode(), "存货编码不能为空!"); for(HGZL002 hgzl002 : hgzl002List){
AssertUtils.isEmpty(hgkc003a.getPrdtName(), "存货名称不能为空!"); AssertUtils.isTrue(hgzl002.getPassQuantity().compareTo(0) <= 0, "合格数量小于等于0!");
AssertUtils.isTrue(Objects.isNull(hgkc003a.getQualityDetailId())||hgkc003a.getQualityDetailId()<=0, "质检单明细ID不能为空!"); AssertUtils.isEmpty(hgzl002.getCompanyCode(), "公司编码不能为空!");
AssertUtils.isEmpty(hgzl002.getCompanyName(), "公司名称不能为空!");
AssertUtils.isEmpty(hgzl002.getProjCode(), "项目编号不能为空!");
AssertUtils.isEmpty(hgzl002.getProjName(), "项目名称不能为空!");
AssertUtils.isEmpty(hgzl002.getProductCode(), "存货编码不能为空!");
AssertUtils.isEmpty(hgzl002.getProductName(), "存货名称不能为空!");
AssertUtils.isTrue(Objects.isNull(hgzl002.getId())||hgzl002.getId()<=0, "质检单明细ID不能为空!");
}
}
/**
* 生产入库(工序质检单)
* @param hgzl002List
*/
public static void putInStorageData(List<HGZL002> hgzl002List) {
List<HGKC003> hgkc003List = new LinkedList<>();
setHgkc003Data(hgzl002List,hgkc003List, null);
DaoUtils.insertBatch(HGKC003.INSERT,hgkc003List);
}
/**
* 对象赋值(工序质检单)
* @param hgzl002List
* @param code
*/
private static void setHgkc003Data(List<HGZL002> hgzl002List, List<HGKC003> hgkc003List, Integer code) {
List<String> inventCodes = hgzl002List.stream().map(HGZL002::getProductCode).collect(Collectors.toList());
List<HGPZ005> hgpz005List = HGPZTools.HgPz005.listByInventCodes(inventCodes);
hgzl002List.forEach(o->{
HGPZ005 hgpz005 = hgpz005List.stream().filter(h->h.getInventCode().equals(o.getProductCode())).findAny().orElse(null);
if(Objects.nonNull(hgpz005)){
HGKC003 hgkc003 = new HGKC003();
hgkc003.setDepositNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PROD_DEPOSIT_NO));
hgkc003.setQualityId(o.getId());
hgkc003.setSubmitStatus(HGConstant.ProductStatus.WTJ);
hgkc003.setCompanyCode(o.getCompanyCode());
hgkc003.setCompanyName(o.getCompanyName());
hgkc003.setAccountCode(o.getAccountCode());
hgkc003.setDepCode(o.getDepCode());
if(Objects.nonNull(code)){
//整改通知单
hgkc003.setInvQty(new BigDecimal(o.getUnpassQuantity()));
}else{
//工序质检单
hgkc003.setInvQty(new BigDecimal(o.getPassQuantity()));
}
//单重
BigDecimal invUnitWeight = HGPZTools.HgPz005.calcUnitWeight(hgpz005);
hgkc003.setInvUnitWeight(invUnitWeight);
//总重
BigDecimal invWeight = invUnitWeight.multiply(hgkc003.getInvQty());
hgkc003.setInvWeight(invWeight);
hgkc003.setProjCode(o.getProjCode());
hgkc003.setProjName(o.getProjName());
hgkc003.setPartCode(o.getProductCode());
hgkc003.setPartName(o.getProductName());
hgkc003.setPartType(o.getProductType());
hgkc003.setPartSpecId(hgpz005.getId());
hgkc003.setPartSpec(hgpz005.getSpec());
hgkc003.setPartCoefficient(hgpz005.getCoefficient());
hgkc003.setPartLength(hgpz005.getLength());
hgkc003.setPartWidth(hgpz005.getWidth());
hgkc003.setPartThick(hgpz005.getThick());
hgkc003List.add(hgkc003);
}
});
}
/**
* 生产入库(整改通知单)
* @param ids
*/
public static void putInStorageByHgzl004(List<Long> ids) {
List<HGKC003> hgkc003List = new LinkedList<>();
Map<String, Object> paramMap = new HashMap();
paramMap.put("ids", ids);
paramMap.put("checkType", CheckTypeEnum.PROCESS_CHECK.getCode());
List<HGZL004> hgzl004List = DaoBase.getInstance().query(HGZL004.QUERY, paramMap);
//获取工序质检单信息,里面包含了不合格数量,在整改单审批通过时就取不合格数量
List<Long> checkIds = hgzl004List.stream().filter(o->o.getCheckType().equals(CheckTypeEnum.PROCESS_CHECK.getCode())).map(HGZL004::getCheckId).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(checkIds)){
Map<String, Object> checkParamMap = new HashMap();
checkParamMap.put("ids", checkIds);
List<HGZL002> hgzl002List = DaoBase.getInstance().query(HGZL002.QUERY, checkParamMap);
//赋值
setHgkc003Data(hgzl002List,hgkc003List,CheckTypeEnum.PROCESS_CHECK.getCode());
DaoUtils.insertBatch(HGKC003.INSERT,hgkc003List);
} }
} }
...@@ -211,7 +297,7 @@ public class HGKCTools { ...@@ -211,7 +297,7 @@ public class HGKCTools {
* @author:songx * @author:songx
* @date:2024/5/15,9:49 * @date:2024/5/15,9:49
*/ */
public static class THGKC003A { public static class Hgkc003a {
public static HGKC003A save(HGKC003A hgkc003a){ public static HGKC003A save(HGKC003A hgkc003a){
...@@ -230,7 +316,8 @@ public class HGKCTools { ...@@ -230,7 +316,8 @@ public class HGKCTools {
AssertUtils.isEmpty(hgkc003a.getWhName(), "仓库名称不能为空!"); AssertUtils.isEmpty(hgkc003a.getWhName(), "仓库名称不能为空!");
AssertUtils.isEmpty(hgkc003a.getPrdtCode(), "存货编码不能为空!"); AssertUtils.isEmpty(hgkc003a.getPrdtCode(), "存货编码不能为空!");
AssertUtils.isEmpty(hgkc003a.getPrdtName(), "存货名称不能为空!"); AssertUtils.isEmpty(hgkc003a.getPrdtName(), "存货名称不能为空!");
AssertUtils.isTrue(Objects.isNull(hgkc003a.getQualityDetailId())||hgkc003a.getQualityDetailId()<=0, "质检单明细ID不能为空!"); AssertUtils.isTrue(Objects.isNull(hgkc003a.getPartSpecId())||hgkc003a.getPartSpecId()<=0, "存货id不能为空");
AssertUtils.isTrue(Objects.isNull(hgkc003a.getQualityId())||hgkc003a.getQualityId()<=0, "质检单明细ID不能为空!");
} }
} }
...@@ -260,6 +347,25 @@ public class HGKCTools { ...@@ -260,6 +347,25 @@ public class HGKCTools {
/** /**
* 查询销售出库信息 * 查询销售出库信息
* *
* @param id
* @return
*/
public static HGKC004 getId(Long id) {
if (StringUtils.isNull(id)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("id", id);
List<HGKC004> results = DaoBase.getInstance().query(HGKC004.QUERY, queryMap);
if (CollectionUtils.isEmpty(results)) {
return null;
}
return results.get(0);
}
/**
* 查询销售出库信息
*
* @param ids * @param ids
* @return * @return
*/ */
...@@ -272,10 +378,19 @@ public class HGKCTools { ...@@ -272,10 +378,19 @@ public class HGKCTools {
return DaoBase.getInstance().query(HGKC004.QUERY, queryMap); return DaoBase.getInstance().query(HGKC004.QUERY, queryMap);
} }
public static List<HGKC004A> getDetailById(Long parentId) {
if (StringUtils.isNull(parentId)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("parentId", parentId);
return DaoBase.getInstance().query(HGKC004A.QUERY, queryMap);
}
/** /**
* 查询销售出库信息 * 查询销售出库信息
* *
* @param saleNos * @param saleNos 销售出库单号
* @return * @return
*/ */
public static List<HGKC004> list(List<String> saleNos) { public static List<HGKC004> list(List<String> saleNos) {
...@@ -474,7 +589,7 @@ public class HGKCTools { ...@@ -474,7 +589,7 @@ public class HGKCTools {
} }
/** /**
* HGKC010 工具类 * HGKC011 工具类
* *
* @author:songx * @author:songx
* @date:2024/5/9,14:33 * @date:2024/5/9,14:33
......
...@@ -211,6 +211,8 @@ public class ServiceHGYX001 extends ServiceEPBase { ...@@ -211,6 +211,8 @@ public class ServiceHGYX001 extends ServiceEPBase {
public void saveOutbound(Map resultRow, String outboundCode) { public void saveOutbound(Map resultRow, String outboundCode) {
// 写入数据 // 写入数据
HGKC004 hgkc004 = new HGKC004(); HGKC004 hgkc004 = new HGKC004();
String id = resultRow.get(HGYX001.FIELD_ID).toString();
hgkc004.setParentId(Long.parseLong(id));
hgkc004.setReceiptDate(DateUtils.formatShort(DateUtils.date())); hgkc004.setReceiptDate(DateUtils.formatShort(DateUtils.date()));
hgkc004.setCompanyCode(resultRow.get(HGYX001.FIELD_COMPANY_CODE).toString()); hgkc004.setCompanyCode(resultRow.get(HGYX001.FIELD_COMPANY_CODE).toString());
//hgkc004.setCompanyName(resultRow.get(HGYX001.FIELD_COMPANY_NAME).toString()); //hgkc004.setCompanyName(resultRow.get(HGYX001.FIELD_COMPANY_NAME).toString());
...@@ -274,6 +276,7 @@ public class ServiceHGYX001 extends ServiceEPBase { ...@@ -274,6 +276,7 @@ public class ServiceHGYX001 extends ServiceEPBase {
hgyx001.setStatus(1); hgyx001.setStatus(1);
this.add(hgyx001); this.add(hgyx001);
HGKC004 hgkc004 = new HGKC004(); HGKC004 hgkc004 = new HGKC004();
hgkc004.setParentId(hgyx001.getId());
hgkc004.setReceiptDate(DateUtils.formatShort(DateUtils.date())); hgkc004.setReceiptDate(DateUtils.formatShort(DateUtils.date()));
hgkc004.setCompanyCode(hgyx001.getCompanyCode()); hgkc004.setCompanyCode(hgyx001.getCompanyCode());
hgkc004.setWhCode(hgyx001.getConsWhCode()); hgkc004.setWhCode(hgyx001.getConsWhCode());
......
...@@ -8,6 +8,7 @@ import com.baosight.hggp.hg.kc.domain.HGKC010; ...@@ -8,6 +8,7 @@ import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.yx.domain.HGYX001; import com.baosight.hggp.hg.yx.domain.HGYX001;
import com.baosight.hggp.hg.yx.domain.HGYX001C; import com.baosight.hggp.hg.yx.domain.HGYX001C;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.StringUtils;
import com.baosight.hggp.util.contants.ACConstants; import com.baosight.hggp.util.contants.ACConstants;
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;
...@@ -24,8 +25,11 @@ public class ServiceHGYX001C extends ServiceEPBase { ...@@ -24,8 +25,11 @@ public class ServiceHGYX001C extends ServiceEPBase {
@Override @Override
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX001C.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX001C.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
String[] specIds = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "specIds").split(","); String specIds = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "specIds");
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "specIds", specIds); if (StringUtils.isNotEmpty(specIds)) {
String[] specIdArray = specIds.split(",");
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "specIds", specIdArray);
}
inInfo = super.query(inInfo, HGYX001C.QUERY, new HGYX001C()); inInfo = super.query(inInfo, HGYX001C.QUERY, new HGYX001C());
CommonMethod.initBlock(inInfo, CommonMethod.initBlock(inInfo,
Arrays.asList( Arrays.asList(
......
...@@ -4,6 +4,7 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; ...@@ -4,6 +4,7 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.CheckStatusEnum; import com.baosight.hggp.common.CheckStatusEnum;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.xs.domain.User; import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.zl.domain.HGZL002; import com.baosight.hggp.hg.zl.domain.HGZL002;
import com.baosight.hggp.hg.zl.tools.HGZLTools; import com.baosight.hggp.hg.zl.tools.HGZLTools;
...@@ -61,11 +62,15 @@ public class ServiceHGZL002 extends ServiceBase { ...@@ -61,11 +62,15 @@ public class ServiceHGZL002 extends ServiceBase {
public EiInfo save(EiInfo inInfo) { public EiInfo save(EiInfo inInfo) {
try { try {
List<HGZL002> hgzl002List = MapUtils.toDaoEPBase(inInfo,HGZL002.class); List<HGZL002> hgzl002List = MapUtils.toDaoEPBase(inInfo,HGZL002.class);
//入库校验
HGKCTools.HgKc003.putInStorageCheckData(hgzl002List);
hgzl002List.forEach( o -> { hgzl002List.forEach( o -> {
o.setCheckStatus(CheckStatusEnum.CHECKED.getCode()); o.setCheckStatus(CheckStatusEnum.CHECKED.getCode());
DaoUtils.update(HGZL002.UPDATE,o); DaoUtils.update(HGZL002.UPDATE,o);
HGZLTools.THGZL004.addByHGZL002(o); HGZLTools.THGZL004.addByHGZL002(o);
}); });
HGKCTools.HgKc003.putInStorageData(hgzl002List);
// putInStorage();
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + hgzl002List.size() + "]条数据保存成功!"); inInfo.setMsg("操作成功!本次对[" + hgzl002List.size() + "]条数据保存成功!");
......
...@@ -4,6 +4,7 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; ...@@ -4,6 +4,7 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.HandleStatusEnum; import com.baosight.hggp.common.HandleStatusEnum;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.sc.domain.HGSC004; import com.baosight.hggp.hg.sc.domain.HGSC004;
import com.baosight.hggp.hg.xs.domain.User; import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.zl.domain.HGZL004; import com.baosight.hggp.hg.zl.domain.HGZL004;
...@@ -101,6 +102,7 @@ public class ServiceHGZL004 extends ServiceBase { ...@@ -101,6 +102,7 @@ public class ServiceHGZL004 extends ServiceBase {
// 销售单号 // 销售单号
List<Long> ids = ObjectUtils.listKey(resultRows, "id"); List<Long> ids = ObjectUtils.listKey(resultRows, "id");
DaoUtils.update(HGZL004.BATCH_COMPLETE, new HashMap<String,Object>(){{put("ids",ids);}}); DaoUtils.update(HGZL004.BATCH_COMPLETE, new HashMap<String,Object>(){{put("ids",ids);}});
HGKCTools.HgKc003.putInStorageByHgzl004(ids);
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据操作成功!"); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据操作成功!");
......
...@@ -195,6 +195,9 @@ ...@@ -195,6 +195,9 @@
<isNotEmpty prepend=" AND " property="checkDateTo"> <isNotEmpty prepend=" AND " property="checkDateTo">
check_date &lt;= #checkDateTo# check_date &lt;= #checkDateTo#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
......
...@@ -141,6 +141,9 @@ ...@@ -141,6 +141,9 @@
<isNotEmpty prepend=" AND " property="checkIds"> <isNotEmpty prepend=" AND " property="checkIds">
check_id IN <iterate close=")" open="(" conjunction="," property="checkIds">#checkIds[]#</iterate> check_id IN <iterate close=")" open="(" conjunction="," property="checkIds">#checkIds[]#</iterate>
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
......
...@@ -46,14 +46,14 @@ ...@@ -46,14 +46,14 @@
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/> <EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="inventRecordId" cname="存货档案ID" hidden="true"/> <EF:EFColumn ename="inventRecordId" cname="存货档案ID" hidden="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="100" align="center">
<EF:EFOptions blockId="invent_type_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="120" align="center" <EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="120" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
blockName="wh_record_block_id" textField="textField" valueField="valueField" blockName="wh_record_block_id" textField="textField" valueField="valueField"
filter="contains"> filter="contains">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="100" align="center">
<EF:EFOptions blockId="invent_type_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="false" width="120" align="center" <EF:EFComboColumn ename="inventCode" cname="存货名称" enable="false" width="120" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
blockName="invent_record_block_id" textField="textField" valueField="valueField" blockName="invent_record_block_id" textField="textField" valueField="valueField"
...@@ -65,11 +65,9 @@ ...@@ -65,11 +65,9 @@
<EF:EFColumn ename="warnNum" cname="预警值" enable="false" width="90" align="right" format="{0:N0}"/> <EF:EFColumn ename="warnNum" cname="预警值" enable="false" width="90" align="right" format="{0:N0}"/>
<EF:EFColumn ename="invQty" cname="库存数量" enable="false" width="90" align="right" format="{0:N0}"/> <EF:EFColumn ename="invQty" cname="库存数量" enable="false" width="90" align="right" format="{0:N0}"/>
<EF:EFColumn ename="invWeight" cname="库存重量(T)" enable="false" width="90" align="right" format="{0:N3}"/> <EF:EFColumn ename="invWeight" cname="库存重量(T)" enable="false" width="90" align="right" format="{0:N3}"/>
<EF:EFComboColumn ename="princ" cname="仓库负责人" width="120" align="center" enable="false" <%--<EF:EFComboColumn ename="princ" cname="仓库负责人" width="120" align="center" enable="false"
blockName="user_block_id" textField="textField" valueField="valueField" blockName="user_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#" filter="contains" />--%>
filter="contains">
</EF:EFComboColumn>
<%--<EF:EFColumn ename="princ" cname="仓库负责人" width="120" align="center"/>--%> <%--<EF:EFColumn ename="princ" cname="仓库负责人" width="120" align="center"/>--%>
<%-- <EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/> <%-- <EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
......
...@@ -7,7 +7,8 @@ $(function () { ...@@ -7,7 +7,8 @@ $(function () {
IPLATUI.EFGrid = { IPLATUI.EFGrid = {
"result": { "result": {
columns: [{ columns: [
{
field: "operator", field: "operator",
title: "操作", title: "操作",
template: function (item) { template: function (item) {
...@@ -45,6 +46,9 @@ $(function () { ...@@ -45,6 +46,9 @@ $(function () {
for (let i = 0; i < companyCodeBox.length; i++) { for (let i = 0; i < companyCodeBox.length; i++) {
if (calloutCompanyCode === companyCodeBox[i]['valueField']) { if (calloutCompanyCode === companyCodeBox[i]['valueField']) {
item['calloutCompanyName'] = companyCodeBox[i]['textField']; item['calloutCompanyName'] = companyCodeBox[i]['textField'];
if (!isBlank(item['allotType'])){
item['callinCompanyCode'] = companyCodeBox[i]['valueField'];
}
return companyCodeBox[i]['textField']; return companyCodeBox[i]['textField'];
} }
} }
...@@ -132,15 +136,17 @@ $(function () { ...@@ -132,15 +136,17 @@ $(function () {
if (e.field === "companyCode"){ if (e.field === "companyCode"){
loadChange(grid,e,"allotType"); loadChange(grid,e,"allotType");
}else if (e.field === "calloutCompanyCode") { }else if (e.field === "calloutCompanyCode") {
if (e.items[0]["allotType"] == 1){
e.items[0]["callinCompanyCode"] = e.items[0]["calloutCompanyCode"];
}
e.items[0]["calloutWhCode"]= ''; e.items[0]["calloutWhCode"]= '';
e.items[0]["calloutWhName"]= ''; e.items[0]["calloutWhName"]= '';
e.items[0]["callinCompanyCode"]= '';
e.items[0]["callinCompanyName"]= '';
e.items[0]["callinWhCode"] = ''; e.items[0]["callinWhCode"] = '';
e.items[0]["callinWhName"] = ''; e.items[0]["callinWhName"] = '';
loadChange(grid,e,"callinCompanyCode");
loadChange(grid,e,"calloutWhCode"); loadChange(grid,e,"calloutWhCode");
}else if (e.field == "calloutWhCode") { }else if (e.field == "calloutWhCode") {
if (e.items[0]["allotType"] == 2){ if (e.items[0]["allotType"] == 2 && isBlank(e.items[0]["callinCompanyCode"])){
e.items[0]["callinCompanyCode"]= ''; e.items[0]["callinCompanyCode"]= '';
loadChange(grid,e,"callinCompanyCode"); loadChange(grid,e,"callinCompanyCode");
}else if (e.items[0]["allotType"] == 1 && isBlank(e.items[0]["callinCompanyCode"])) { }else if (e.items[0]["allotType"] == 1 && isBlank(e.items[0]["callinCompanyCode"])) {
......
...@@ -106,8 +106,6 @@ $(function() { ...@@ -106,8 +106,6 @@ $(function() {
e.items[0]["quantity"] = specIdBox[i]['param4Field']; e.items[0]["quantity"] = specIdBox[i]['param4Field'];
resultGrid.setCellValue(e.items[0],"unitWeight",specIdBox[i]['param5Field']); resultGrid.setCellValue(e.items[0],"unitWeight",specIdBox[i]['param5Field']);
resultGrid.setCellValue(e.items[0],"weight",specIdBox[i]['param6Field']); resultGrid.setCellValue(e.items[0],"weight",specIdBox[i]['param6Field']);
//e.items[0]["unitWeight"] = specIdBox[i]['param5Field'];
//e.items[0]["weight"] = specIdBox[i]['param6Field'];
} }
} }
loadChange(grid,e,"length"); loadChange(grid,e,"length");
...@@ -122,7 +120,20 @@ $(function() { ...@@ -122,7 +120,20 @@ $(function() {
resultGrid.setCellValue(e.items[0],"weight",e.items[0].unitWeight*e.items[0].quantity); resultGrid.setCellValue(e.items[0],"weight",e.items[0].unitWeight*e.items[0].quantity);
} }
}else if (e.field === "inventCode"){ }else if (e.field === "inventCode"){
loadChange(grid,e,"spec"); for (let i = 0; i < inventCodedBox.length; i++) {
if (inventCodedBox[i]['valueField'] === e.items[0]["inventCode"]){
resultGrid.setCellValue(e.items[0],"inventType",inventCodedBox[i]['param1Field']);
resultGrid.setCellValue(e.items[0],"inventRecordId",inventCodedBox[i]['param2Field']);
resultGrid.setCellValue(e.items[0],"spec",inventCodedBox[i]['param3Field']);
resultGrid.setCellValue(e.items[0],"length",inventCodedBox[i]['param4Field']);
resultGrid.setCellValue(e.items[0],"width",inventCodedBox[i]['param5Field']);
resultGrid.setCellValue(e.items[0],"thick",inventCodedBox[i]['param6Field']);
resultGrid.setCellValue(e.items[0],"quantity",inventCodedBox[i]['param7Field']);
resultGrid.setCellValue(e.items[0],"unitWeight",inventCodedBox[i]['param8Field']);
resultGrid.setCellValue(e.items[0],"weight",inventCodedBox[i]['param9Field']);
}
}
loadChange(grid,e,"quantity");
} }
}); });
}, },
......
...@@ -30,13 +30,13 @@ ...@@ -30,13 +30,13 @@
<EF:EFRegion id="result" title="记录集"> <EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="true" width="120" align="center" required="true" <EF:EFComboColumn ename="inventCode" cname="存货名称" enable="true" width="120" align="center" required="true"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField" blockName="invent_code_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains"> filter="contains">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="true" width="120" align="center" required="true" <EF:EFComboColumn ename="inventType" cname="存货类型" enable="true" width="120" align="center" required="true"
blockName="invent_code_box_block_id" textField="textField" valueField="valueField" blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains"> filter="contains">
</EF:EFComboColumn> </EF:EFComboColumn>
......
...@@ -344,11 +344,24 @@ let deleteFunc = function () { ...@@ -344,11 +344,24 @@ let deleteFunc = function () {
function detail() { function detail() {
let ids = []; let ids = [];
let rows = resultGrid.getDataItems(); let rows = resultGrid.getDataItems();
if (rows.length > 0){
$.each(rows, function(index, item) { $.each(rows, function(index, item) {
ids.push(item.inventRecordId) ids.push(item.inventRecordId)
}); });
}
let consCode = $("#inqu_status-0-consCode").val();
if(isBlank(consCode)){
message("请选择发货方!");
return false;
}
let consWhCode = $("#inqu_status-0-consWhCode").val();
if(isBlank(consWhCode)){
message("请选择发货仓库!");
return false;
}
JSColorbox.open({ JSColorbox.open({
href: "HGYX001C?methodName=initLoad&inqu_status-0-companyCode="+$("#inqu_status-0-consCode").val()+"&inqu_status-0-whCode="+$("#inqu_status-0-consWhCode").val()+"&inqu_status-0-specIds="+ids.join(','), href: "HGYX001C?methodName=initLoad&inqu_status-0-companyCode="+consCode+"&inqu_status-0-whCode="+consWhCode+"&inqu_status-0-specIds="+ids.join(','),
title: "<div style='text-align: center;'>选择发货明细</div>", title: "<div style='text-align: center;'>选择发货明细</div>",
width: "90%", width: "90%",
height: "80%", height: "80%",
......
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