Browse Source

组合入库企业微信审批完成

lwx_dev
erdanergou 3 years ago
parent
commit
cadd5e500c
  1. 2
      src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml
  2. 11
      src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java
  3. 20
      src/main/java/com/dreamchaser/depository_manage/service/impl/SplitUnitServiceImpl.java
  4. 2
      src/test/java/com/dreamchaser/depository_manage/TestOther.java
  5. 2
      target/classes/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml

2
src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml

@ -161,7 +161,7 @@
</sql>
<sql id="ApplicationInRecordInfo">
airid,did,airmproducedDate,mname,quantity,price,tname,applicant_time,aircode,dname,applicant_id,applyRemark,mcode,mversion,munit,mtexture,mkingdeecode,mdepositoryCode,airUnit,flagForGroup,mid,airPlaceId,airapproverPass,airapproverTime,airapproverId,airstate,airapproverMessage
airid,did,airmproducedDate,mname,quantity,price,tname,applicant_time,aircode,dname,applicant_id,applyRemark,mcode,mversion,munit,mtexture,mkingdeecode,mdepositoryCode,airUnit,flagForGroup,mid,airPlaceId,airapproverPass,airapproverTime,airapproverId,airstate,airapproverMessage,airtoGroupId
</sql>
<sql id="ApplicationOutRecordInfo">

11
src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java

@ -2093,6 +2093,11 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
Integer id = ObjectFormatUtil.toInteger(sid.trim());
// 获取具体入库订单
ApplicationInRecordP recordP = depositoryRecordMapper.findApplicationInRecordPById(id);
if(Integer.compare(recordP.getAirapproverPass(),1) == 0){
// 如果当前入库单已经被处理过,则跳过
continue;
}
// 获取当前入库对应的物料
Material materialById = materialMapper.findMaterialById(recordP.getMid());
@ -2122,12 +2127,14 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
if (mproducedDate == null) {
mproducedDate = 0L;
}
// 获取当前库存id
Integer newMid = updateOrInsertInventory(paramForUpdateInventory, materialByCondition, (double) recordP.getQuantity(), materialById.getId(), recordP.getDepositoryId(), mproducedDate);
// 修改库位库存
paramForUpdateInventory.put("newInMid", newMid);
paramForUpdateInventory.put("id", recordP.getId());
paramForUpdateInventory.put("producedDate", recordP.getMproducedDate());
Place placeById = placeMapper.findPlaceById(recordP.getPlaceId());
// 修改当前库存容量
updateInventoryInfoForApproval(paramForUpdateInventory, recordP.getQuantity(), materialById, placeById);
}
else {
@ -2185,7 +2192,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
map.put("id", sid);
depositoryRecordMapper.updateApplicationInRecord(map);
}else{
depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(sid));
depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(sid.trim()));
String mainGidId = (String)redisTemplate.opsForHash().get(spNo, "mainGidId");
String replace = mainGidId.replace("[", "").replace("]", "");
map.put("id",replace);
@ -2596,8 +2603,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// 获取具体入库订单
ApplicationInRecordP recordP = depositoryRecordMapper.findApplicationInRecordPById(ObjectFormatUtil.toInteger(id));
// 用于判断当前入库的是组合还是物料
Integer flagForGroup = recordP.getFlagForGroup();
// 获取当前入库对应的物料
Material materialById = materialMapper.findMaterialById(recordP.getMid());

20
src/main/java/com/dreamchaser/depository_manage/service/impl/SplitUnitServiceImpl.java

@ -250,8 +250,6 @@ public class SplitUnitServiceImpl implements SplitUnitService {
} else {
map.put("price", Double.toString(0));
depositoryRecordService.applicationInPlace(map,flagForApprovalPass);
map.put("applicationInId", map.get("id"));
map.remove("id");
}
@ -284,8 +282,6 @@ public class SplitUnitServiceImpl implements SplitUnitService {
} else {
map.put("price", Double.toString(0));
result += depositoryRecordService.applicationInPlace(map,flagForApprovalPass);
map.put("applicationInId", map.get("id"));
map.remove("id");
Map<String, Object> paramForInventoryToPlace = new HashMap<>();
paramForInventoryToPlace.put("mid", map.get("newInMid"));
paramForInventoryToPlace.put("pid", map.get("placeId"));
@ -295,8 +291,6 @@ public class SplitUnitServiceImpl implements SplitUnitService {
} else {
map.put("price", Double.toString(0));
result += depositoryRecordService.applicationInPlace(map,flagForApprovalPass);
map.put("applicationInId", map.get("id"));
map.remove("id");
}
} else {
// 如果不大于设置的进制数量
@ -321,15 +315,11 @@ public class SplitUnitServiceImpl implements SplitUnitService {
// 先插入一条库存记录用于后续操作
map.put("quantity", "0");
depositoryRecordService.applicationInPlace(map,flagForApprovalPass);
map.put("applicationInId", map.get("id"));
depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(map.get("id")));
map.remove("id");
depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(map.get("applicationInId")));
} else {
// 如果没有父级
depositoryRecordService.applicationInPlace(map,flagForApprovalPass);
map.put("applicationInId", map.get("id"));
map.remove("id");
}
Map<String, Object> paramForInventoryToPlace = new HashMap<>();
paramForInventoryToPlace.put("mid", map.get("newInMid"));
@ -613,8 +603,6 @@ public class SplitUnitServiceImpl implements SplitUnitService {
depositoryRecordService.applicationInPlace(map,false);
// 删除入库订单
// depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(map.get("id")));
map.put("applicationInId", map.get("id"));
map.remove("id");
}
} else {
// 当前库存拆单记录与新入库的数目不大于预设的进制
@ -629,8 +617,6 @@ public class SplitUnitServiceImpl implements SplitUnitService {
depositoryRecordService.applicationInPlace(map,false);
// 删除入库订单
// depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(map.get("id")));
map.put("applicationInId", map.get("id"));
map.remove("id");
}
} else {
@ -665,8 +651,6 @@ public class SplitUnitServiceImpl implements SplitUnitService {
depositoryRecordService.applicationInPlace(map,false);
// 删除入库订单
// depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(map.get("id")));
map.put("applicationInId", map.get("id"));
map.remove("id");
}
} else {
// 如果不大于
@ -678,8 +662,6 @@ public class SplitUnitServiceImpl implements SplitUnitService {
depositoryRecordService.applicationInPlace(map,false);
// 删除入库订单
// depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(map.get("id")));
map.put("applicationInId", map.get("id"));
map.remove("id");
}
}

2
src/test/java/com/dreamchaser/depository_manage/TestOther.java

@ -44,7 +44,7 @@ public class TestOther {
@Test
public void Test() throws IOException {
String spNo = "202302220024";
String spNo = "202302230016";
String mainId = (String) redisTemplate.opsForHash().get(spNo, "mainId");
ApprovalInfo_Details finalApprovalInfo_details = new ApprovalInfo_Details();
ApprovalInfo_Details_Approver approver = new ApprovalInfo_Details_Approver();

2
target/classes/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml

@ -161,7 +161,7 @@
</sql>
<sql id="ApplicationInRecordInfo">
airid,did,airmproducedDate,mname,quantity,price,tname,applicant_time,aircode,dname,applicant_id,applyRemark,mcode,mversion,munit,mtexture,mkingdeecode,mdepositoryCode,airUnit,flagForGroup,mid,airPlaceId,airapproverPass,airapproverTime,airapproverId,airstate,airapproverMessage
airid,did,airmproducedDate,mname,quantity,price,tname,applicant_time,aircode,dname,applicant_id,applyRemark,mcode,mversion,munit,mtexture,mkingdeecode,mdepositoryCode,airUnit,flagForGroup,mid,airPlaceId,airapproverPass,airapproverTime,airapproverId,airstate,airapproverMessage,airtoGroupId
</sql>
<sql id="ApplicationOutRecordInfo">

Loading…
Cancel
Save