diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryController.java b/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryController.java index cdaaf5f0..90878cc0 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryController.java @@ -1458,7 +1458,7 @@ public class DepositoryController { return true; } // 查询当前仓库 - Depository depositoryById = depositoryService.findDepositoryById(ObjectFormatUtil.toInteger(did)); + Depository depositoryById = depositoryService.findDepositoryById(ObjectFormatUtil.toInteger(did.trim())); // 查询当前仓库及子仓库 List childForDepositoryByParent = findChildForDepositoryByParent(depositoryById); List depositories = depositoryService.selectDepositoryRecordByIds(childForDepositoryByParent); diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java b/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java index 426a8514..6d9ab6f3 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java @@ -135,9 +135,9 @@ public class DepositoryRecordController { // 如果获取未完成 split = ongoingSplit.split(","); } - for (int i = 0; i < split.length; i++) { + for (String s : split) { // 获取子订单编码 - String[] strings = split[i].split(":"); + String[] strings = s.split(":"); String minRecordId = ""; if (strings.length > 1) { minRecordId = strings[1]; @@ -146,7 +146,7 @@ public class DepositoryRecordController { continue; } // 获取数据库中子订单信息 - ApplicationOutRecordMin applicationOutMinById = depositoryRecordService.findApplicationOutMinById(ObjectFormatUtil.toInteger(minRecordId)); + ApplicationOutRecordMin applicationOutMinById = depositoryRecordService.findApplicationOutMinById(ObjectFormatUtil.toInteger(minRecordId.trim())); // 获取仓库信息 Depository depositoryRecordById = depositoryService.findDepositoryById(applicationOutMinById.getDepositoryId()); // 获取子订单对应主订单 @@ -212,11 +212,11 @@ public class DepositoryRecordController { Integer placeId = ObjectFormatUtil.toInteger(map.get("placeId")); if (placeId == 0) {// 如果插入到仓库 map.put("placeId", 0); // 到默认库位 - integer += depositoryRecordService.applicationInPlace(map); + integer += depositoryRecordService.applicationInPlace(map,false); recordIds.add(ObjectFormatUtil.toInteger(map.get("applicationInId"))); depositoryIds.add(ObjectFormatUtil.toInteger(map.get("depositoryId"))); } else { // 如果具体到库位 - Integer flag = depositoryRecordService.applicationInPlace(map); + Integer flag = depositoryRecordService.applicationInPlace(map,false); if (flag != -1) { integer += flag; recordIds.add(ObjectFormatUtil.toInteger(map.get("applicationInId"))); @@ -257,7 +257,7 @@ public class DepositoryRecordController { } else { if (placeId == -1) { // 如果插入到仓库 insert.put("placeId", 0); - Integer add = depositoryRecordService.applicationInPlace(insert); + Integer add = depositoryRecordService.applicationInPlace(insert,false); if (add == -1) { errMsg.add(integer); } else { @@ -269,7 +269,7 @@ public class DepositoryRecordController { } } else {// 如果具体到库位 insert.put("placeId", placeId); - Integer flag = depositoryRecordService.applicationInPlace(insert); + Integer flag = depositoryRecordService.applicationInPlace(insert,false); if (flag == -1) { insert.put("err", "存储失败,请重新选择存储位"); errMsg.add(insert); @@ -299,7 +299,7 @@ public class DepositoryRecordController { if (placeId != null) { if (placeId == -1) {// 如果插入到仓库 map.put("placeId", 0); - Integer add = depositoryRecordService.applicationInPlace(map); + Integer add = depositoryRecordService.applicationInPlace(map,false); if (add == -1) { errMsg.add(map); } else { @@ -310,7 +310,7 @@ public class DepositoryRecordController { } } else { // 如果具体到库位 - Integer flag = depositoryRecordService.applicationInPlace(map); + Integer flag = depositoryRecordService.applicationInPlace(map,false); if (flag == -1) { map.put("err", "存储失败,请重新选择存储位"); errMsg.add(map); @@ -1071,7 +1071,7 @@ public class DepositoryRecordController { success += addSplitInventory; } } else { - success += depositoryRecordService.applicationInPlace(map); + success += depositoryRecordService.applicationInPlace(map,false); } } else if ("out".equals(type)) { // 获取部门负责人 @@ -1205,7 +1205,7 @@ public class DepositoryRecordController { success += addSplitInventory; } } else { - success += depositoryRecordService.applicationInPlace(inRecord); + success += depositoryRecordService.applicationInPlace(inRecord,false); } } } else if ("out".equals(type)) { diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java b/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java index 9669cc23..9f9bb916 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java @@ -360,7 +360,7 @@ public class PageController { if ("".equals(s)) { continue; } - Integer minRecordId = ObjectFormatUtil.toInteger(s.split(":")[1]); + Integer minRecordId = ObjectFormatUtil.toInteger(s.split(":")[1].trim()); ApplicationOutRecordMin applicationOutMinById = depositoryRecordService.findApplicationOutMinById(minRecordId); ApplicationOutRecordP applicationOutRecordPById = depositoryRecordService.findApplicationOutRecordPById(applicationOutMinById.getParentId()); UserByPort userByPort = LinkInterfaceUtil.FindUserById(applicationOutRecordPById.getApplicantId(), userToken); @@ -736,7 +736,7 @@ public class PageController { InventoryP inventoryP = new InventoryP(); if (code != null) { Map map = new HashMap<>(); - Depository depositoryByCode = depositoryService.findDepositoryById(ObjectFormatUtil.toInteger(depositoryId)); + Depository depositoryByCode = depositoryService.findDepositoryById(ObjectFormatUtil.toInteger(depositoryId.trim())); map.put("depositoryId", depositoryByCode.getId()); map.put("mcode", code); List inventory = materialService.findInventory(map); @@ -1403,7 +1403,7 @@ public class PageController { if ("".equals(value)) { continue; } - UserByPort departmenthead = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(value), userToken); + UserByPort departmenthead = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(value.trim()), userToken); departmentHeadName.append(departmenthead.getName()).append(","); } @@ -1419,7 +1419,7 @@ public class PageController { if ("".equals(s)) { continue; } - Integer managerid = ObjectFormatUtil.toInteger(s); + Integer managerid = ObjectFormatUtil.toInteger(s.trim()); UserByPort user = LinkInterfaceUtil.FindUserById(managerid, userToken); depositoryManager.add(user); depositoryManagerNames.append(user.getName()).append(","); @@ -1446,6 +1446,13 @@ public class PageController { mv.setViewName("pages/application/form-step-look"); if (id != null) { ApplicationInRecordP applicationInRecordPById = depositoryRecordService.findApplicationInRecordPById(id); + + String airapproverTime = applicationInRecordPById.getAirapproverTime(); + if(airapproverTime != null && !"".equals(airapproverTime)){ + airapproverTime = DateUtil.TimeStampToDateTime(Long.valueOf(airapproverTime)); + applicationInRecordPById.setAirapproverTime(airapproverTime); + } + // 获取入库库位id Integer placeId = applicationInRecordPById.getPlaceId(); String placeCode = "默认库位"; @@ -1475,7 +1482,6 @@ public class PageController { applicationInRecordPById.setApplicantTime(DateUtil.TimeStampToDateTime(Long.valueOf(applicationInRecordPById.getApplicantTime()))); if (applicationInRecordPById.getPrice() != null) { applicationInRecordPById.setPrice(applicationInRecordPById.getPrice() / 100); - } else { applicationInRecordPById.setPrice(0.0); } diff --git a/src/main/java/com/dreamchaser/depository_manage/service/DepositoryRecordService.java b/src/main/java/com/dreamchaser/depository_manage/service/DepositoryRecordService.java index 3adde139..c663078e 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/DepositoryRecordService.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/DepositoryRecordService.java @@ -358,7 +358,7 @@ public interface DepositoryRecordService { * @param map * @return */ - Integer applicationInPlace(Map map); + Integer applicationInPlace(Map map,boolean isApprovalPass); /** diff --git a/src/main/java/com/dreamchaser/depository_manage/service/SplitUnitService.java b/src/main/java/com/dreamchaser/depository_manage/service/SplitUnitService.java index 77b10289..4238d59d 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/SplitUnitService.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/SplitUnitService.java @@ -186,5 +186,5 @@ public interface SplitUnitService { * @param placeAndMaterialByMidAndPid 物料库位对应关系 * @return */ - Integer realInInventoryToDepository(Double quantity, SplitInventory splitInventory, Map map, SplitInfo splitInfoForUnit, MaterialAndPlace placeAndMaterialByMidAndPid); + Integer realInInventoryToDepository(Double quantity, SplitInventory splitInventory, Map map, SplitInfo splitInfoForUnit, MaterialAndPlace placeAndMaterialByMidAndPid,boolean flagForApprovalPass); } diff --git a/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java b/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java index a79264fd..e405bcd5 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java @@ -641,13 +641,13 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { /** * 将物料入库到库位 - * + * @param isApprovalPass 判断是否为审批完成时调用,true为审批通过后调用,false为正常调用 * @param map * @return */ @Override @Transactional(rollbackFor = Exception.class) - public Integer applicationInPlace(Map map) { + public Integer applicationInPlace(Map map,boolean isApprovalPass) { Integer placeId = ObjectFormatUtil.toInteger(map.get("placeId")); if (placeId == null) { placeId = 0; @@ -668,6 +668,11 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { if (depositoryListForIn.size() > 0) { flagForApproval = true; } + if(isApprovalPass){ + if(flagForApproval){ + flagForApproval = false; + } + } map.put("flagForApproval", flagForApproval); if (placeById.getMax() - placeById.getQuantity() > quantity) { @@ -1675,9 +1680,9 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { managerSplit = new String[0]; } } - for (int i = 0; i < managerSplit.length; i++) { + for (String item : managerSplit) { // 删除其他管理员的订单记录 - String otherManager = "user:" + managerSplit[i]; + String otherManager = "user:" + item; String minRecord = (String) redisTemplate.opsForHash().get(otherManager, "minRecord"); // 删除其他管理员中当前已完成的订单 if (minRecord == null) { @@ -2052,6 +2057,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { * @param spStatus 审批状态 * @param spNo 审批订单号 */ + @Transactional(rollbackFor = Exception.class) @Override public void reviewByQyWxApprovalIn(String mainId, ApprovalInfo_Details approvalInfo_details, String userAgent, String spStatus, String spNo) { // 获取当前入库订单id @@ -2068,20 +2074,31 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { map.put("approverTime", System.currentTimeMillis()); // 如果同意 - for (String sid : split - ) { + for (String sid : split) + { if ("2".equals(spStatus)) { map.put("approverPass", 1); + map.put("state","已入库"); } else { // 如果驳回 + map.put("state","驳回"); map.put("approverPass", 2); + break; } + if (!"".equals(sid)) { - Integer id = ObjectFormatUtil.toInteger(sid); + Integer id = ObjectFormatUtil.toInteger(sid.trim()); // 获取具体入库订单 ApplicationInRecordP recordP = depositoryRecordMapper.findApplicationInRecordPById(id); // 获取当前入库对应的物料 Material materialById = materialMapper.findMaterialById(recordP.getMid()); + + // 用于调用入库方法而创建的 + Map paramForUpdateInventory = new HashMap<>(); + paramForUpdateInventory.put("mid", recordP.getMid()); + paramForUpdateInventory.put("quantity", recordP.getQuantity()); + paramForUpdateInventory.put("depositoryId", recordP.getDepositoryId()); + paramForUpdateInventory.put("placeId", recordP.getPlaceId()); if (materialById.getUnit().equals(recordP.getAirUnit())) { // 如果是基础单位 @@ -2092,11 +2109,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { // 判断该仓库中有无该物物料 List materialByCondition = materialMapper.findInventory(param); - // 用于调用入库方法而创建的 - Map paramForUpdateInventory = new HashMap<>(); - paramForUpdateInventory.put("mid", recordP.getMid()); - paramForUpdateInventory.put("quantity", recordP.getQuantity()); - // 修改仓库库存 Long mproducedDate = recordP.getMproducedDate(); @@ -2108,7 +2120,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { paramForUpdateInventory.put("newInMid", newMid); paramForUpdateInventory.put("id", recordP.getId()); paramForUpdateInventory.put("producedDate", recordP.getMproducedDate()); - paramForUpdateInventory.put("depositoryId", recordP.getDepositoryId()); Place placeById = placeMapper.findPlaceById(recordP.getPlaceId()); updateInventoryInfoForApproval(paramForUpdateInventory, recordP.getQuantity(), materialById, placeById); } else { @@ -2131,6 +2142,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { MaterialAndPlace placeAndMaterialByMidAndPid = null; // 用于存储拆单库存处理操作的数据 Map paramForInsertSplitInventory = new HashMap<>(); + paramForInsertSplitInventory.put("sid",splitInfoForUnit.getId()); Map paramForInventory = new HashMap<>(); paramForInventory.put("depositoryId", recordP.getDepositoryId()); @@ -2154,9 +2166,10 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { splitInventory = splitUnitMapper.findSplitInventoryByIidAndSid(paramForInsertSplitInventory); } } - - splitUnitService.realInInventoryToDepository((double) recordP.getQuantity(), splitInventory, map, splitInfoForUnit, placeAndMaterialByMidAndPid); - + splitUnitService.realInInventoryToDepository((double) recordP.getQuantity(), splitInventory, paramForUpdateInventory, splitInfoForUnit, placeAndMaterialByMidAndPid,true); + if(paramForUpdateInventory.containsKey("applicationInId")){ + depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(paramForUpdateInventory.get("applicationInId"))); + } } } } @@ -2758,7 +2771,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { } // 进行入库操作 - applicationInPlace(map); + applicationInPlace(map,false); } else { // 如果不在该仓库,插入一条新记录 Map insert = new HashMap<>(); @@ -2906,7 +2919,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { SplitInfo parentSplitInfo = splitUnitMapper.findSplitInfoById(splitInfo.getParentId()); splitUnitService.updateSplitInfoSaveQuantity(parentSplitInfo, disposeQuantity, placeAndMaterial.getId(), map, quantity, splitInfo); } else { - applicationInPlace(map); + applicationInPlace(map,false); map.put("applicationInId", map.get("id")); map.remove("id"); } @@ -2984,7 +2997,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { SplitInfo parentSplitInfo = splitUnitMapper.findSplitInfoById(splitInfo.getParentId()); splitUnitService.updateSplitInfoSaveQuantity(parentSplitInfo, disposeQuantity, placeAndMaterial.getId(), map, quantity, splitInfo); } else { - applicationInPlace(map); + applicationInPlace(map,false); map.put("applicationInId", map.get("id")); map.remove("id"); } @@ -3143,7 +3156,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { SplitInfo parentSplitInfo = splitUnitMapper.findSplitInfoById(splitInfo.getParentId()); splitUnitService.updateSplitInfoSaveQuantity(parentSplitInfo, disposeQuantity, ObjectFormatUtil.toInteger(insertForMaterialAndPlace.get("id")), map, quantity, splitInfo); } else { - applicationInPlace(map); + applicationInPlace(map,false); map.put("applicationInId", map.get("id")); map.remove("id"); } diff --git a/src/main/java/com/dreamchaser/depository_manage/service/impl/GroupServiceImpl.java b/src/main/java/com/dreamchaser/depository_manage/service/impl/GroupServiceImpl.java index 4745a4e0..28e5184a 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/impl/GroupServiceImpl.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/impl/GroupServiceImpl.java @@ -748,7 +748,7 @@ public class GroupServiceImpl implements GroupService { Material material = materialMapper.findMaterialById(groupInfo.getMid()); insertForApplicationInRecord.put("unit",material.getUnit()); insertForApplicationInRecord.put("price", String.valueOf(0)); - result += depositoryRecordService.applicationInPlace(insertForApplicationInRecord); + result += depositoryRecordService.applicationInPlace(insertForApplicationInRecord,false); depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(insertForApplicationInRecord.get("id"))); }else{ insertForApplicationInRecord.put("unit",unit); @@ -804,7 +804,7 @@ public class GroupServiceImpl implements GroupService { insertForApplicationInRecord.put("price", String.valueOf(0)); Material material = materialMapper.findMaterialById(groupInfo.getMid()); insertForApplicationInRecord.put("unit",material.getUnit()); - result += depositoryRecordService.applicationInPlace(insertForApplicationInRecord); + result += depositoryRecordService.applicationInPlace(insertForApplicationInRecord,false); depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(insertForApplicationInRecord.get("id"))); }else{ insertForApplicationInRecord.put("price", String.valueOf(0)); diff --git a/src/main/java/com/dreamchaser/depository_manage/service/impl/MaterialServiceImpl.java b/src/main/java/com/dreamchaser/depository_manage/service/impl/MaterialServiceImpl.java index f2cc539d..20caf434 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/impl/MaterialServiceImpl.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/impl/MaterialServiceImpl.java @@ -1593,7 +1593,7 @@ public class MaterialServiceImpl implements MaterialService { paramForNewMap.put("price", Double.toString(inventoryByMid.getPrice() / 100)); paramForNewMap.put("realQuantity", String.valueOf(dispose)); paramForNewMap.put("quantity", String.valueOf(dispose)); - depositoryRecordService.applicationInPlace(paramForNewMap); + depositoryRecordService.applicationInPlace(paramForNewMap,false); depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(paramForNewMap.get("id"))); } // 调用新算法 @@ -1640,7 +1640,7 @@ public class MaterialServiceImpl implements MaterialService { paramForNewMap.put("price", Double.toString(inventoryByMid.getPrice() / 100)); paramForNewMap.put("realQuantity", String.valueOf(dispose)); paramForNewMap.put("quantity", String.valueOf(dispose)); - depositoryRecordService.applicationInPlace(paramForNewMap); + depositoryRecordService.applicationInPlace(paramForNewMap,false); depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(paramForNewMap.get("id"))); } } else { @@ -1689,7 +1689,7 @@ public class MaterialServiceImpl implements MaterialService { paramForNewMap.put("price", Double.toString(inventoryByMid.getPrice() / 100)); paramForNewMap.put("realQuantity", String.valueOf(dispose)); paramForNewMap.put("quantity", String.valueOf(dispose)); - depositoryRecordService.applicationInPlace(paramForNewMap); + depositoryRecordService.applicationInPlace(paramForNewMap,false); depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(paramForNewMap.get("id"))); } diff --git a/src/main/java/com/dreamchaser/depository_manage/service/impl/SplitUnitServiceImpl.java b/src/main/java/com/dreamchaser/depository_manage/service/impl/SplitUnitServiceImpl.java index 95cdd914..4eeae5bc 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/impl/SplitUnitServiceImpl.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/impl/SplitUnitServiceImpl.java @@ -162,7 +162,7 @@ public class SplitUnitServiceImpl implements SplitUnitService { Double quantity = ObjectFormatUtil.toDouble(map.get("quantity")); if ("in".equals(type) && !flagForApproval) { // 如果是入库并且不需要审批 - result = realInInventoryToDepository(quantity, splitInventory, map, splitInfoForUnit, placeAndMaterialByMidAndPid); + result = realInInventoryToDepository(quantity, splitInventory, map, splitInfoForUnit, placeAndMaterialByMidAndPid,false); map.remove("applicationInId"); }else if("in".equals(type)){ // 如果是入库且需要审批 @@ -187,9 +187,10 @@ public class SplitUnitServiceImpl implements SplitUnitService { * @param map 调剂 * @param splitInfoForUnit 拆单记录 * @param placeAndMaterialByMidAndPid 物料库位对应关系 + * @param flagForApprovalPass 用于标志是否为审批后调用该方法 * @return */ - public Integer realInInventoryToDepository(Double quantity, SplitInventory splitInventory, Map map, SplitInfo splitInfoForUnit, MaterialAndPlace placeAndMaterialByMidAndPid) { + public Integer realInInventoryToDepository(Double quantity, SplitInventory splitInventory, Map map, SplitInfo splitInfoForUnit, MaterialAndPlace placeAndMaterialByMidAndPid,boolean flagForApprovalPass) { Integer result = 0; // 获取当前进制 @@ -248,7 +249,7 @@ public class SplitUnitServiceImpl implements SplitUnitService { updateSplitInfoSaveQuantity(parentSplitInfo, disposeQuantity, placeAndMaterialByMidAndPid.getId(), map, quantity.intValue(), splitInfoForUnit); } else { map.put("price", Double.toString(0)); - depositoryRecordService.applicationInPlace(map); + depositoryRecordService.applicationInPlace(map,flagForApprovalPass); map.put("applicationInId", map.get("id")); map.remove("id"); } @@ -282,7 +283,7 @@ public class SplitUnitServiceImpl implements SplitUnitService { updateSplitInfoSaveQuantity(parentSplitInfo, ObjectFormatUtil.toInteger(String.valueOf(saveQuantity)), placeAndMaterialByMidAndPid.getId(), map, quantity.intValue(), splitInfoForUnit); } else { map.put("price", Double.toString(0)); - result += depositoryRecordService.applicationInPlace(map); + result += depositoryRecordService.applicationInPlace(map,flagForApprovalPass); map.put("applicationInId", map.get("id")); map.remove("id"); Map paramForInventoryToPlace = new HashMap<>(); @@ -293,7 +294,7 @@ public class SplitUnitServiceImpl implements SplitUnitService { } } else { map.put("price", Double.toString(0)); - result += depositoryRecordService.applicationInPlace(map); + result += depositoryRecordService.applicationInPlace(map,flagForApprovalPass); map.put("applicationInId", map.get("id")); map.remove("id"); } @@ -319,14 +320,14 @@ public class SplitUnitServiceImpl implements SplitUnitService { // 先插入一条库存记录用于后续操作 map.put("quantity", "0"); - depositoryRecordService.applicationInPlace(map); + depositoryRecordService.applicationInPlace(map,flagForApprovalPass); map.put("applicationInId", map.get("id")); depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(map.get("id"))); map.remove("id"); } else { // 如果没有父级 - depositoryRecordService.applicationInPlace(map); + depositoryRecordService.applicationInPlace(map,flagForApprovalPass); map.put("applicationInId", map.get("id")); map.remove("id"); } @@ -609,7 +610,7 @@ public class SplitUnitServiceImpl implements SplitUnitService { map.put("price", Double.toString(0)); map.put("quantity", String.valueOf(disposeQuantity)); map.put("realQuantity", String.valueOf(inQuantity)); - depositoryRecordService.applicationInPlace(map); + depositoryRecordService.applicationInPlace(map,false); // 删除入库订单 // depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(map.get("id"))); map.put("applicationInId", map.get("id")); @@ -625,7 +626,7 @@ public class SplitUnitServiceImpl implements SplitUnitService { map.put("price", "0"); map.put("quantity", "0"); map.put("realQuantity", String.valueOf(inQuantity)); - depositoryRecordService.applicationInPlace(map); + depositoryRecordService.applicationInPlace(map,false); // 删除入库订单 // depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(map.get("id"))); map.put("applicationInId", map.get("id")); @@ -661,7 +662,7 @@ public class SplitUnitServiceImpl implements SplitUnitService { map.put("price", Double.toString(0)); map.put("quantity", String.valueOf(quantity_scale)); map.put("realQuantity", String.valueOf(inQuantity)); - depositoryRecordService.applicationInPlace(map); + depositoryRecordService.applicationInPlace(map,false); // 删除入库订单 // depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(map.get("id"))); map.put("applicationInId", map.get("id")); @@ -674,7 +675,7 @@ public class SplitUnitServiceImpl implements SplitUnitService { map.put("quantity", "0"); map.put("realQuantity", String.valueOf(inQuantity)); map.put("price", "0"); - depositoryRecordService.applicationInPlace(map); + depositoryRecordService.applicationInPlace(map,false); // 删除入库订单 // depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(map.get("id"))); map.put("applicationInId", map.get("id")); diff --git a/src/main/java/com/dreamchaser/depository_manage/service/impl/StockTakingServiceImpl.java b/src/main/java/com/dreamchaser/depository_manage/service/impl/StockTakingServiceImpl.java index 894bfa9d..3db447bc 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/impl/StockTakingServiceImpl.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/impl/StockTakingServiceImpl.java @@ -339,7 +339,7 @@ public class StockTakingServiceImpl implements StockTakingService { String departmentManager = mainRecord.getDepartmentManager(); String[] split = departmentManager.split(","); for (String s : split) { - if ("".equals(s)) { + if ("".equals(s.trim())) { continue; } UserByPort userByPort = PortConfig.findUserByPortByNumber(s); @@ -539,7 +539,7 @@ public class StockTakingServiceImpl implements StockTakingService { StringBuilder QyWxUid = new StringBuilder(); for (int i = 0; i < split.length; i++) { String s = split[i]; - if("".equals(s)){ + if("".equals(s.trim())){ continue; } UserByPort userByPort = PortConfig.findUserByPortByNumber(s); @@ -587,7 +587,7 @@ public class StockTakingServiceImpl implements StockTakingService { String departmentManager = mainRecord.getDepartmentManager(); String[] split = departmentManager.split(","); for (String s : split) { - if ("".equals(s)) { + if ("".equals(s.trim())) { continue; } UserByPort userByPort = PortConfig.findUserByPortByNumber(s); @@ -1399,7 +1399,7 @@ public class StockTakingServiceImpl implements StockTakingService { String[] split = departmentManager.split(","); for (int i = 0; i < split.length; i++) { String s = split[i]; - if ("".equals(s)) { + if ("".equals(s.trim())) { continue; } UserByPort userByPort1 = PortConfig.findUserByPortByNumber(s); @@ -1463,7 +1463,7 @@ public class StockTakingServiceImpl implements StockTakingService { String[] split = departmentManager.split(","); for (int i = 0; i < split.length; i++) { String s = split[i]; - if ("".equals(s)) { + if ("".equals(s.trim())) { continue; } UserByPort userByPort = PortConfig.findUserByPortByNumber(s); @@ -1828,7 +1828,7 @@ public class StockTakingServiceImpl implements StockTakingService { map.put("price", String.valueOf(inventoryById.getPrice() / 100)); // 调用现有入库逻辑进行修改库存 - depositoryRecordService.applicationInPlace(map); + depositoryRecordService.applicationInPlace(map,false); // 删除入库单 depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(map.get("id"))); map.remove("id"); @@ -1924,7 +1924,7 @@ public class StockTakingServiceImpl implements StockTakingService { // 获取当前的单价 map.put("price", String.valueOf(inventoryById.getPrice() / 100)); - depositoryRecordService.applicationInPlace(map); + depositoryRecordService.applicationInPlace(map,false); depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(map.get("id"))); map.remove("id"); } @@ -1984,7 +1984,7 @@ public class StockTakingServiceImpl implements StockTakingService { // 设置单价 map.put("price", String.valueOf(inventoryById.getPrice() / 100)); // 调用相关的入库逻辑 - depositoryRecordService.applicationInPlace(map); + depositoryRecordService.applicationInPlace(map,false); // 删除对应的入库订单 depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(map.get("id"))); map.remove("id"); @@ -2104,7 +2104,7 @@ public class StockTakingServiceImpl implements StockTakingService { // 如果没有父级 map.put("price", String.valueOf(inventoryById.getPrice() / 100));; map.put("quantity", String.valueOf(disposeQuantity)); - depositoryRecordService.applicationInPlace(map); + depositoryRecordService.applicationInPlace(map,false); depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(map.get("id"))); map.remove("id"); } @@ -2322,7 +2322,7 @@ public class StockTakingServiceImpl implements StockTakingService { // 获取当前的单价 map.put("price", String.valueOf(inventoryById.getPrice() / 100)); - depositoryRecordService.applicationInPlace(map); + depositoryRecordService.applicationInPlace(map,false); depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(map.get("id"))); map.remove("id"); } @@ -2382,7 +2382,7 @@ public class StockTakingServiceImpl implements StockTakingService { // 设置单价 map.put("price", String.valueOf(inventoryById.getPrice() / 100)); // 调用相关的入库逻辑 - depositoryRecordService.applicationInPlace(map); + depositoryRecordService.applicationInPlace(map,false); // 删除对应的入库订单 depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(map.get("id"))); map.remove("id"); @@ -2449,7 +2449,7 @@ public class StockTakingServiceImpl implements StockTakingService { // 设置单价 map.put("price", String.valueOf(inventoryById.getPrice() / 100)); // 调用现有入库逻辑进行修改库存 - depositoryRecordService.applicationInPlace(map); + depositoryRecordService.applicationInPlace(map,false); // 删除入库单 depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(map.get("id"))); map.remove("id"); diff --git a/src/main/resources/templates/pages/application/form-step-look.html b/src/main/resources/templates/pages/application/form-step-look.html index 24c20816..a53d7dae 100644 --- a/src/main/resources/templates/pages/application/form-step-look.html +++ b/src/main/resources/templates/pages/application/form-step-look.html @@ -109,11 +109,11 @@ if(approverPass !== "4"){ $("#approverNameT").show(); $("#approverMessgaeT").show(); - let approverTime = $("#applicantTime"); + let approverTime = $("#approverTime"); if(approverTime.text() === ""){ approverTime.hide(); }else{ - approverTime.show(); + $("#approverTimeT").show(); } } }) diff --git a/src/test/java/com/dreamchaser/depository_manage/TestOther.java b/src/test/java/com/dreamchaser/depository_manage/TestOther.java index 71f96c54..e8e13343 100644 --- a/src/test/java/com/dreamchaser/depository_manage/TestOther.java +++ b/src/test/java/com/dreamchaser/depository_manage/TestOther.java @@ -44,12 +44,12 @@ public class TestOther { @Test public void Test() throws IOException { - String mainId = (String) redisTemplate.opsForHash().get("202302220008", "mainId"); + String spNo = "202302220012"; + String mainId = (String) redisTemplate.opsForHash().get(spNo, "mainId"); ApprovalInfo_Details finalApprovalInfo_details = new ApprovalInfo_Details(); ApprovalInfo_Details_Approver approver = new ApprovalInfo_Details_Approver(); approver.setUserId("PangFuZhen"); finalApprovalInfo_details.setApprover(approver); - String spNo = "202302220008"; String crypt = "4dc6ed4606a02bb4df643536b80cc48b"; String spStatus = "2"; depositoryRecordService.reviewByQyWxApprovalIn(mainId, finalApprovalInfo_details,crypt,spStatus,spNo); diff --git a/target/classes/templates/pages/application/form-step-look.html b/target/classes/templates/pages/application/form-step-look.html index 24c20816..a53d7dae 100644 --- a/target/classes/templates/pages/application/form-step-look.html +++ b/target/classes/templates/pages/application/form-step-look.html @@ -109,11 +109,11 @@ if(approverPass !== "4"){ $("#approverNameT").show(); $("#approverMessgaeT").show(); - let approverTime = $("#applicantTime"); + let approverTime = $("#approverTime"); if(approverTime.text() === ""){ approverTime.hide(); }else{ - approverTime.show(); + $("#approverTimeT").show(); } } })