diff --git a/src/main/java/com/glxp/api/entity/inv/InvPreInProductDetailEntity.java b/src/main/java/com/glxp/api/entity/inv/InvPreInProductDetailEntity.java index f258cb6b..e40500e7 100644 --- a/src/main/java/com/glxp/api/entity/inv/InvPreInProductDetailEntity.java +++ b/src/main/java/com/glxp/api/entity/inv/InvPreInProductDetailEntity.java @@ -95,6 +95,13 @@ public class InvPreInProductDetailEntity { @TableField(value = "reCount") private int reCount; + @TableField(value = "inCount") + private int inCount; + + + @TableField(value = "outCount") + private int outCount; + /** * 部门编码 */ @@ -126,7 +133,6 @@ public class InvPreInProductDetailEntity { private Date updateTime; - public static final String COL_ID = "id"; public static final String COL_CODE = "code"; diff --git a/src/main/java/com/glxp/api/entity/inv/InvPreProductDetailEntity.java b/src/main/java/com/glxp/api/entity/inv/InvPreProductDetailEntity.java index 0d10cc4f..bd4b0ae2 100644 --- a/src/main/java/com/glxp/api/entity/inv/InvPreProductDetailEntity.java +++ b/src/main/java/com/glxp/api/entity/inv/InvPreProductDetailEntity.java @@ -89,12 +89,21 @@ public class InvPreProductDetailEntity { @TableField(value = "`count`") private int count; + + @TableField(value = "inCount") + private int inCount; + + + @TableField(value = "outCount") + private int outCount; + /** * 实际数量 */ @TableField(value = "reCount") private int reCount; + /** * 部门编码 */ @@ -126,7 +135,6 @@ public class InvPreProductDetailEntity { private Date updateTime; - public static final String COL_ID = "id"; public static final String COL_CODE = "code"; diff --git a/src/main/java/com/glxp/api/entity/inv/InvProductDetailEntity.java b/src/main/java/com/glxp/api/entity/inv/InvProductDetailEntity.java index 39e7e152..1dab0efb 100644 --- a/src/main/java/com/glxp/api/entity/inv/InvProductDetailEntity.java +++ b/src/main/java/com/glxp/api/entity/inv/InvProductDetailEntity.java @@ -80,6 +80,13 @@ public class InvProductDetailEntity { @TableField(value = "reCount") private int reCount; + + @TableField(value = "inCount") + private int inCount; + + + @TableField(value = "outCount") + private int outCount; /** * 部门编码 */ diff --git a/src/main/java/com/glxp/api/service/inout/IoGenInvService.java b/src/main/java/com/glxp/api/service/inout/IoGenInvService.java index b7dda8f0..f179b977 100644 --- a/src/main/java/com/glxp/api/service/inout/IoGenInvService.java +++ b/src/main/java/com/glxp/api/service/inout/IoGenInvService.java @@ -102,6 +102,12 @@ public class IoGenInvService { invProductDetailEntity.setRelId(codeEntity.getRelId()); invProductDetailEntity.setUpdateTime(new Date()); invProductDetailEntity.setPurchaseType(ConstantStatus.PRUCHASE_COMMON); + if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { + invProductDetailEntity.setInCount(invProductDetailEntity.getReCount()); + } else if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { + invProductDetailEntity.setOutCount(invProductDetailEntity.getReCount()); + } + invProductDetailEntities.add(invProductDetailEntity); } BasicBusTypePreEntity basicBusTypePreEntity = basicBusTypePreService.findByOriginAction(orderEntity.getAction()); @@ -166,6 +172,12 @@ public class IoGenInvService { invProductDetailEntity.setRelId(codeEntity.getRelId()); invProductDetailEntity.setUpdateTime(new Date()); invProductDetailEntity.setPurchaseType(ConstantStatus.PRUCHASE_COMMON); + if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { + invProductDetailEntity.setInCount(invProductDetailEntity.getReCount()); + } else if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { + invProductDetailEntity.setOutCount(invProductDetailEntity.getReCount()); + } + invProductDetailEntities.add(invProductDetailEntity); } invPreProductDetailService.insertList(invProductDetailEntities); @@ -241,6 +253,12 @@ public class IoGenInvService { invProductDetailEntity.setRelId(codeEntity.getRelId()); invProductDetailEntity.setUpdateTime(new Date()); invProductDetailEntity.setPurchaseType(ConstantStatus.PRUCHASE_COMMON); + if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { + invProductDetailEntity.setInCount(invProductDetailEntity.getReCount()); + } else if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { + invProductDetailEntity.setOutCount(invProductDetailEntity.getReCount()); + } + invProductDetailEntities.add(invProductDetailEntity); } invPreinProductDetailService.insertList(invProductDetailEntities); diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvPreInProductDetailServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/InvPreInProductDetailServiceImpl.java index 598e0e36..1b0727ab 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/InvPreInProductDetailServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/InvPreInProductDetailServiceImpl.java @@ -45,6 +45,11 @@ public class InvPreInProductDetailServiceImpl implements InvPreinProductDetailSe @Override public int insert(InvPreInProductDetailEntity invPreInProductDetailEntity) { + if (invPreInProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { + invPreInProductDetailEntity.setInCount(invPreInProductDetailEntity.getReCount()); + } else if (invPreInProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { + invPreInProductDetailEntity.setOutCount(invPreInProductDetailEntity.getReCount()); + } return invPreInProductDetailDao.insert(invPreInProductDetailEntity); } @@ -79,6 +84,11 @@ public class InvPreInProductDetailServiceImpl implements InvPreinProductDetailSe @Override public boolean update(InvPreInProductDetailEntity invPreInProductDetailEntity) { + if (invPreInProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { + invPreInProductDetailEntity.setInCount(invPreInProductDetailEntity.getReCount()); + } else if (invPreInProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { + invPreInProductDetailEntity.setOutCount(invPreInProductDetailEntity.getReCount()); + } return invPreInProductDetailDao.updateById(invPreInProductDetailEntity) == 1 ? true : false; } diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvPreProductDetailServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/InvPreProductDetailServiceImpl.java index 83208de7..a03c7a2b 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/InvPreProductDetailServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/InvPreProductDetailServiceImpl.java @@ -45,6 +45,11 @@ public class InvPreProductDetailServiceImpl implements InvPreProductDetailServic @Override public int insert(InvPreProductDetailEntity invPreProductDetailEntity) { + if (invPreProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { + invPreProductDetailEntity.setInCount(invPreProductDetailEntity.getReCount()); + } else if (invPreProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { + invPreProductDetailEntity.setOutCount(invPreProductDetailEntity.getReCount()); + } return invPreProductDetailDao.insert(invPreProductDetailEntity); } @@ -73,6 +78,11 @@ public class InvPreProductDetailServiceImpl implements InvPreProductDetailServic @Override public boolean update(InvPreProductDetailEntity invPreProductDetailEntity) { + if (invPreProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { + invPreProductDetailEntity.setInCount(invPreProductDetailEntity.getReCount()); + } else if (invPreProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { + invPreProductDetailEntity.setOutCount(invPreProductDetailEntity.getReCount()); + } return invPreProductDetailDao.updateById(invPreProductDetailEntity) == 1 ? true : false; } diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvProductDetailServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/InvProductDetailServiceImpl.java index 3dc23192..fe299fa0 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/InvProductDetailServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/InvProductDetailServiceImpl.java @@ -40,6 +40,11 @@ public class InvProductDetailServiceImpl implements InvProductDetailService { @Override public int insert(InvProductDetailEntity invProductDetailEntity) { invProductDetailEntity.setId(null); + if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { + invProductDetailEntity.setInCount(invProductDetailEntity.getReCount()); + } else if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { + invProductDetailEntity.setOutCount(invProductDetailEntity.getReCount()); + } return invProductDetailDao.insert(invProductDetailEntity); } @@ -73,6 +78,12 @@ public class InvProductDetailServiceImpl implements InvProductDetailService { @Override public int update(InvProductDetailEntity invProductDetailEntity) { + if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { + invProductDetailEntity.setInCount(invProductDetailEntity.getReCount()); + } else if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { + invProductDetailEntity.setOutCount(invProductDetailEntity.getReCount()); + } + return invProductDetailDao.updateById(invProductDetailEntity); } diff --git a/src/main/resources/mybatis/mapper/inv/invProductDao.xml b/src/main/resources/mybatis/mapper/inv/invProductDao.xml index 7b420be4..8b42ac88 100644 --- a/src/main/resources/mybatis/mapper/inv/invProductDao.xml +++ b/src/main/resources/mybatis/mapper/inv/invProductDao.xml @@ -316,13 +316,13 @@ ip.deptCode, ip.invCode from inv_product ip - inner join basic_udirel on ip.relIdFk = basic_udirel.id - inner join basic_products bp on basic_udirel.uuid = bp.uuid - left join basic_corp on ip.supId = basic_corp.erpId - left join auth_dept on auth_dept.code = ip.deptCode - left join auth_warehouse on auth_warehouse.code = ip.invCode - left join inv_product_detail ipd on ip.invCode = ipd.invCode and ip.relIdFk = ipd.relId and - ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty') + inner join basic_udirel on ip.relIdFk = basic_udirel.id + inner join basic_products bp on basic_udirel.uuid = bp.uuid + left join basic_corp on ip.supId = basic_corp.erpId + left join auth_dept on auth_dept.code = ip.deptCode + left join auth_warehouse on auth_warehouse.code = ip.invCode + left join inv_product_detail ipd on ip.invCode = ipd.invCode and ip.relIdFk = ipd.relId and + ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty') bp.diType = 1 diff --git a/src/main/resources/schemas/schema_v2.1.sql b/src/main/resources/schemas/schema_v2.1.sql index e824efc0..4f83b985 100644 --- a/src/main/resources/schemas/schema_v2.1.sql +++ b/src/main/resources/schemas/schema_v2.1.sql @@ -1,9 +1,13 @@ # 字段新增 (表名,字段名,字段类型,修改方式(1:新增,2:修改,3:删除) -CALL Pro_Temp_ColumnWork('auth_user_bustype', 'updateTime', 'datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP', 1); -CALL Pro_Temp_ColumnWork('auth_warehouse_bustype', 'updateTime', 'datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP', 1); -CALL Pro_Temp_ColumnWork('auth_warehouse_user', 'updateTime', 'datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP', 1); -CALL Pro_Temp_ColumnWork('auth_dept_user', 'updateTime', 'datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP', 1); +CALL Pro_Temp_ColumnWork('auth_user_bustype', 'updateTime', + 'datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP', 1); +CALL Pro_Temp_ColumnWork('auth_warehouse_bustype', 'updateTime', + 'datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP', 1); +CALL Pro_Temp_ColumnWork('auth_warehouse_user', 'updateTime', + 'datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP', 1); +CALL Pro_Temp_ColumnWork('auth_dept_user', 'updateTime', + 'datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP', 1); CALL Pro_Temp_ColumnWork('sync_data_set', 'department', 'tinyint ', 1); CALL Pro_Temp_ColumnWork('sync_data_set', 'warehouseDict', 'tinyint ', 1); @@ -183,6 +187,14 @@ CALL Pro_Temp_ColumnWork('inv_product', 'planOutCount', 'int ', 1); CALL Pro_Temp_ColumnWork('inv_product', 'onWayCount', 'int ', 1); CALL Pro_Temp_ColumnWork('inv_product', 'availableStock', 'int ', 1); +CALL Pro_Temp_ColumnWork('inv_product_detail', 'inCount', 'int ', 1); +CALL Pro_Temp_ColumnWork('inv_product_detail', 'outCount', 'int ', 1); +CALL Pro_Temp_ColumnWork('inv_prein_product_detail', 'inCount', 'int ', 1); +CALL Pro_Temp_ColumnWork('inv_prein_product_detail', 'outCount', 'int ', 1); +CALL Pro_Temp_ColumnWork('inv_pre_product_detail', 'inCount', 'int ', 1); +CALL Pro_Temp_ColumnWork('inv_pre_product_detail', 'outCount', 'int ', 1); + + CALL Pro_Temp_ColumnWork('auth_warehouse', 'updateTime', 'datetime ', 1); CALL Pro_Temp_ColumnWork('sync_data_set', 'basicType', 'tinyint', 1);