From abf47c944cf2d9002daad65a312045c87e5ed80f Mon Sep 17 00:00:00 2001 From: erdanergou Date: Fri, 17 Mar 2023 16:06:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=87=BA=E5=BA=93=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E4=B8=8E=E5=B1=95=E7=A4=BA=E9=A1=B5=E9=9D=A2=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DepositoryRecordController.java | 14 +- .../controller/PageController.java | 49 +++--- .../entity/ApplicationOutRecord.java | 72 ++++++-- .../mapper/DepositoryRecordMapper.java | 16 +- .../mapper/DepositoryRecordMapper.xml | 2 +- .../pojo/ApplicationOutRecordMinP.java | 9 +- .../pojo/ApplicationOutRecordP.java | 38 ++++- .../pojo/SimpleApplicationOutMinRecordP.java | 4 +- .../depository_manage/pojo/SimpleTaskP.java | 2 +- .../service/DepositoryRecordService.java | 8 +- .../impl/DepositoryRecordServiceImpl.java | 160 +++++++++++------- .../service/impl/QyWxOperationService.java | 12 +- .../pages/application/application-out.html | 8 +- .../depository_manage/TestForOther.java | 3 +- .../mapper/DepositoryRecordMapper.xml | 2 +- .../pages/application/application-out.html | 8 +- 16 files changed, 267 insertions(+), 140 deletions(-) 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 b69d52fe..b86e0efd 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java @@ -153,7 +153,7 @@ public class DepositoryRecordController { Map params = new HashMap<>(); params.put("checkId", userToken.getId()); // 获取当前用户所有已完成的订单 - List applicationOutMinByCondition = depositoryRecordService.findApplicationOutMinByCondition(params); + List applicationOutMinByCondition = depositoryRecordService.findApplicationOutMinByCondition(params); split = new String[applicationOutMinByCondition.size()]; for (int i = 0; i < applicationOutMinByCondition.size(); i++) { String tempSplit = "minRecord:" + applicationOutMinByCondition.get(i).getId(); @@ -175,7 +175,7 @@ public class DepositoryRecordController { continue; } // 获取数据库中子订单信息 - ApplicationOutRecordMin applicationOutMinById = depositoryRecordService.findApplicationOutMinById(ObjectFormatUtil.toInteger(minRecordId.trim())); + ApplicationOutRecordMinP applicationOutMinById = depositoryRecordService.findApplicationOutMinById(ObjectFormatUtil.toInteger(minRecordId.trim())); // 获取仓库信息 Depository depositoryRecordById = depositoryService.findDepositoryById(applicationOutMinById.getDepositoryId()); // 获取子订单对应主订单 @@ -690,7 +690,7 @@ public class DepositoryRecordController { param.put("depositoryId", depositoryId); param.put("checkId", userToken.getId()); // 获取所有发送请求用户处理完成的子订单 - List applicationOutMinByCondition = depositoryRecordService.findApplicationOutMinByCondition(param); + List applicationOutMinByCondition = depositoryRecordService.findApplicationOutMinByCondition(param); split = new String[applicationOutMinByCondition.size()]; for (int i = 0; i < applicationOutMinByCondition.size(); i++) { split[i] = "minRecord:" + applicationOutMinByCondition.get(i).getId(); @@ -711,7 +711,7 @@ public class DepositoryRecordController { // 获取子订单编码 String minRecordId = split[i].split(":")[1]; // 获取数据库中子订单信息 - ApplicationOutRecordMin applicationOutMinById = depositoryRecordService.findApplicationOutMinById(ObjectFormatUtil.toInteger(minRecordId)); + ApplicationOutRecordMinP applicationOutMinById = depositoryRecordService.findApplicationOutMinById(ObjectFormatUtil.toInteger(minRecordId)); // 如果该子订单仓库是当前仓库 if (Integer.compare(applicationOutMinById.getDepositoryId(), depositoryId) == 0) { // 获取子订单对应主订单 @@ -811,13 +811,13 @@ public class DepositoryRecordController { for (ApplicationOutRecordP outRecordP : list) { // 根据主订单获取所有子订单 - List applicationOutMinByParentId = depositoryRecordService.findApplicationOutMinByParentId(outRecordP.getId()); + List applicationOutMinByParentId = depositoryRecordService.findApplicationOutMinByParentId(outRecordP.getId()); StringBuilder mname = new StringBuilder(); StringBuilder mcode = new StringBuilder(); StringBuilder depositoryName = new StringBuilder(); - Integer sumQuantity = 0; + double sumQuantity = 0; double sumPrice = 0.0; - for (ApplicationOutRecordMin applicationOutRecordMin : applicationOutMinByParentId) { + for (ApplicationOutRecordMinP applicationOutRecordMin : applicationOutMinByParentId) { // 获取子订单信息 // 获取出库物料信息 Inventory inventory = materialService.findInventoryById(applicationOutRecordMin.getMid()); 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 fd0098c7..a0591783 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java @@ -385,7 +385,7 @@ public class PageController { continue; } Integer minRecordId = ObjectFormatUtil.toInteger(s.split(":")[1].trim()); - ApplicationOutRecordMin applicationOutMinById = depositoryRecordService.findApplicationOutMinById(minRecordId); + ApplicationOutRecordMinP applicationOutMinById = depositoryRecordService.findApplicationOutMinById(minRecordId); ApplicationOutRecordP applicationOutRecordPById = depositoryRecordService.findApplicationOutRecordPById(applicationOutMinById.getParentId()); UserByPort userByPort = LinkInterfaceUtil.FindUserById(applicationOutRecordPById.getApplicantId(), userToken); applicationOutRecordPById.setApplicantName(userByPort.getName()); @@ -1558,19 +1558,19 @@ public class PageController { ApplicationOutRecordP recordP = depositoryRecordService.findApplicationOutRecordPById(id); // 获取所有子订单 - List applicationOutRecordMinByParent = depositoryRecordService.findApplicationOutRecordMinByParent(recordP.getId()); + List applicationOutRecordMinByParent = depositoryRecordService.findApplicationOutRecordMinByParent(recordP.getId()); // 展示出库的仓库名 StringBuilder depositoryName = new StringBuilder(); // 展示出库的库位编码 StringBuilder placeCode = new StringBuilder(); // 当前订单总数 - Integer sumQuantity = 0; + Double sumQuantity = 0.0; // 当前总额 Double sumPrice = 0.0; // 计量单位 StringBuffer sumUnit = new StringBuffer(); - for (ApplicationOutRecordMin applicationOutRecordMin : applicationOutRecordMinByParent) { + for (ApplicationOutRecordMinP applicationOutRecordMin : applicationOutRecordMinByParent) { // 获取子订单信息 // 获取出库物料信息 Inventory inventoryById = materialService.findInventoryById(applicationOutRecordMin.getMid()); @@ -1809,17 +1809,16 @@ public class PageController { mv.setViewName("pages/application/form-step-look_minRecordOut"); if (id != null) { // 获取当前子订单 - ApplicationOutRecordMin recordMin = depositoryRecordService.findApplicationOutMinById(id); + ApplicationOutRecordMinP recordMinP = depositoryRecordService.findApplicationOutMinById(id); - ApplicationOutRecordMinP recordMinP = new ApplicationOutRecordMinP(recordMin); // 获取出库物料信息 - Inventory inventoryById = materialService.findInventoryById(recordMin.getMid()); + Inventory inventoryById = materialService.findInventoryById(recordMinP.getMid()); // 获取出库物料仓库信息 - Depository depository = depositoryService.findDepositoryById(recordMin.getDepositoryId()); + Depository depository = depositoryService.findDepositoryById(recordMinP.getDepositoryId()); // 获取出库库位 - Place placeById = placeService.findPlaceById(recordMin.getPlaceId()); + Place placeById = placeService.findPlaceById(recordMinP.getPlaceId()); // 获取处理人 - UserByPort userByPort = LinkInterfaceUtil.FindUserById(recordMin.getCheckId(), userToken); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(recordMinP.getCheckId(), userToken); if(recordMinP.getAdminorgId() != null){ Administration company = LinkInterfaceUtil.getCompany(recordMinP.getAdminorgId(), userToken); @@ -1875,7 +1874,7 @@ public class PageController { // 如果是转移订单 mv.addObject("display", "table-row"); // 获取订单详情 - TransferRecord transferRecord = depositoryRecordService.findTransferRecordById(recordMin.getTransferId()); + TransferRecord transferRecord = depositoryRecordService.findTransferRecordById(recordMinP.getTransferId()); Place place = placeService.findPlaceById(transferRecord.getToPlaceId()); Depository depositoryById = depositoryService.findDepositoryById(transferRecord.getToId()); mv.addObject("toLocation", depositoryById.getDname() + "-" + place.getCode()); @@ -1902,7 +1901,7 @@ public class PageController { // 获取出库主单 ApplicationOutRecordP applicationOutRecordPById = depositoryRecordService.findApplicationOutRecordPById(id); // 获取出库子单 - List applicationOutRecordMinByParent = depositoryRecordService.findApplicationOutRecordMinByParent(applicationOutRecordPById.getId()); + List applicationOutRecordMinByParent = depositoryRecordService.findApplicationOutRecordMinByParent(applicationOutRecordPById.getId()); // 展示物料名 StringBuilder mname = new StringBuilder(); // 展示物料编码 @@ -1914,31 +1913,29 @@ public class PageController { // 展示当前子订单的处理人 StringBuilder outDisposer = new StringBuilder(); // 当前订单总数 - Integer sumQuantity = 0; + Double sumQuantity = 0.0; // 每个物料数量 StringBuilder quantityByMaterial = new StringBuilder(); List recordMinPList = new ArrayList<>(); // 当前总额 double sumPrice = 0.0; - for (ApplicationOutRecordMin applicationOutRecordMin : applicationOutRecordMinByParent) { + for (ApplicationOutRecordMinP recordMinP : applicationOutRecordMinByParent) { // 获取子订单信息 - // 获取输出子订单信息 - ApplicationOutRecordMinP recordMinP = new ApplicationOutRecordMinP(applicationOutRecordMin); // 获取出库物料信息 - Inventory inventoryById = materialService.findInventoryById(applicationOutRecordMin.getMid()); + Inventory inventoryById = materialService.findInventoryById(recordMinP.getMid()); // 获取出库物料仓库信息 - Depository depository = depositoryService.findDepositoryById(applicationOutRecordMin.getDepositoryId()); + Depository depository = depositoryService.findDepositoryById(recordMinP.getDepositoryId()); // 获取出库库位 - Place placeById = placeService.findPlaceById(applicationOutRecordMin.getPlaceId()); + Place placeById = placeService.findPlaceById(recordMinP.getPlaceId()); if (placeById != null) { placeCode.append(placeById.getCode()).append(","); } recordMinP.setMname(inventoryById.getMname()); recordMinP.setDepositoryName(depository.getDname()); recordMinP.setPlaceCode(placeById.getCode()); - Integer checkId = applicationOutRecordMin.getCheckId(); + Integer checkId = recordMinP.getCheckId(); if (checkId != null) { // 如果当前子订单已经处理 // 获取当前处理人 @@ -1953,14 +1950,14 @@ public class PageController { mname.append(inventoryById.getMname()).append(","); mcode.append(inventoryById.getCode()).append(","); depositoryName.append(depository.getDname()).append(","); - quantityByMaterial.append(applicationOutRecordMin.getQuantity()).append(","); - sumQuantity += applicationOutRecordMin.getQuantity(); + quantityByMaterial.append(recordMinP.getQuantity()).append(","); + sumQuantity += recordMinP.getQuantity(); // 获取当前计量单位 String unit = recordMinP.getUnit(); if ("-1".equals(unit)) { // 如果是基础单位 if (inventoryById.getPrice() != null) { - sumPrice += (inventoryById.getPrice() * applicationOutRecordMin.getQuantity()); + sumPrice += (inventoryById.getPrice() * recordMinP.getQuantity()); } else { sumPrice += 0.0; } @@ -1977,7 +1974,7 @@ public class PageController { // 获取当前拆单记录与基础单位的进制 int scale = splitUnitService.findSplitInfoScaleQuantity(splitInfo, -1); if (inventoryById.getPrice() != null) { - sumPrice += (inventoryById.getPrice() / scale * applicationOutRecordMin.getQuantity()); + sumPrice += (inventoryById.getPrice() / scale * recordMinP.getQuantity()); } else { sumPrice += 0.0; } @@ -2497,7 +2494,7 @@ public class PageController { public ModelAndView scanQrCodeByOut(Integer id, HttpServletRequest request) { ModelAndView mv = new ModelAndView(); // 获取当前要处理的子订单 - ApplicationOutRecordMin applicationOutMinById = depositoryRecordService.findApplicationOutMinById(id); + ApplicationOutRecordMinP applicationOutMinById = depositoryRecordService.findApplicationOutMinById(id); mv.setViewName("pages/scanQrCode/scanQrCodeOut"); Material materialById = materialService.findMaterialById(applicationOutMinById.getMid()); mv.addObject("materialById", materialById); @@ -2510,7 +2507,7 @@ public class PageController { public ModelAndView scanBarOrQrCodeOut(Integer id, HttpServletRequest request) { ModelAndView mv = new ModelAndView(); // 获取当前要处理的子订单 - ApplicationOutRecordMin applicationOutMinById = depositoryRecordService.findApplicationOutMinById(id); + ApplicationOutRecordMinP applicationOutMinById = depositoryRecordService.findApplicationOutMinById(id); mv.setViewName("pages/scanQrCode/ScanBarOrQrCodeOut"); Inventory materialById = materialService.findInventoryById(applicationOutMinById.getMid()); mv.addObject("materialById", materialById); diff --git a/src/main/java/com/dreamchaser/depository_manage/entity/ApplicationOutRecord.java b/src/main/java/com/dreamchaser/depository_manage/entity/ApplicationOutRecord.java index 54fa9da5..59709d84 100644 --- a/src/main/java/com/dreamchaser/depository_manage/entity/ApplicationOutRecord.java +++ b/src/main/java/com/dreamchaser/depository_manage/entity/ApplicationOutRecord.java @@ -14,20 +14,35 @@ public class ApplicationOutRecord { */ private Integer mid; + /** + * 物料名称 + */ + private String mname; + /** * 仓库id */ private Integer depositoryId; + /** + * 仓库名称 + */ + private String depositoryName; + /** * 申请人id */ private Integer applicantId; /** - * 申请时间 + * 申请人名称 + */ + private String applicantName; + + /** + * 申请时间 */ - private Long applicantTime; + private String applicantTime; /** @@ -43,7 +58,7 @@ public class ApplicationOutRecord { /** * 金额 */ - private Integer price; + private Double price; /** * 数量 @@ -51,19 +66,24 @@ public class ApplicationOutRecord { private Integer quantity; /** - * 部门负责人 + * 部门负责人编号 */ private String departmenthead; + /** + * 部门负责人姓名 + */ + private String departmentheadName; + /** * 部门负责人意见(1通过2退回) */ - private Integer departmentheadPass; + private String departmentheadPass; /** * 部门负责人处理时间 */ - private Long departmentheadTime; + private String departmentheadTime; /** * 部门负责人审核备注 @@ -73,17 +93,21 @@ public class ApplicationOutRecord { /** * 仓库管理员 */ - private Integer depositoryManager; + private String depositoryManager; + /** + * 仓库管理员名称 + */ + private String depositoryManagerName; /** - * 仓库管理员意见(1通过2退回) + * 仓库管理员意见(1通过2退回3待处理4不需其处理) */ - private Integer depositoryManagerPass; + private String depositoryManagerPass; /** * 仓库管理员处理时间 */ - private Long depositoryManagerTime; + private String depositoryManagerTime; /** * 仓库管理员审核备注 @@ -100,21 +124,45 @@ public class ApplicationOutRecord { */ private Integer istransfer; + /** - * 转移申请编号 + * 物料存货编码 */ - private String transferId; + private String mcode; /** * 对应库位id */ private Integer placeId; + /** + * 对应库位编码 + */ + private String pCode; + /** * 订单状态 */ private Integer pass; + /** + * 出库单位 + */ + private String unit; + + /** + * 施工单位id + */ + private Integer constructionUnitId; + /** + * 施工单位名称 + */ + private String constructionUnitName; + /** + * 部门id + */ + private Integer adminorgId; + } diff --git a/src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.java b/src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.java index 52b0cf1c..ea51cc11 100644 --- a/src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.java +++ b/src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.java @@ -1,8 +1,6 @@ package com.dreamchaser.depository_manage.mapper; import com.dreamchaser.depository_manage.entity.*; -import com.dreamchaser.depository_manage.pojo.ApplicationOutRecordMinP; -import com.dreamchaser.depository_manage.pojo.ApplicationOutRecordP; import org.apache.ibatis.annotations.Mapper; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; @@ -97,14 +95,14 @@ public interface DepositoryRecordMapper { * 查找所有出库记录 * @return */ - List findApplicationOutRecordPAll(); + List findApplicationOutRecordPAll(); /** * 查询一段时间内的出库记录 * @param map 条件,起止时间 * @return */ - List findApplicationOutRecordPForAPeriodOfTime(Map map); + List findApplicationOutRecordPForAPeriodOfTime(Map map); /** * 根据条件查询仓库调度记录,同时支持分页查询(需要begin和size参数) @@ -271,7 +269,7 @@ public interface DepositoryRecordMapper { * @param depositoryId 待查询仓库id * @return */ - List findApplicationOutRecordByDepository(String depositoryId); + List findApplicationOutRecordByDepository(String depositoryId); /** @@ -279,14 +277,14 @@ public interface DepositoryRecordMapper { * @param map * @return */ - List findApplicationOutRecordPByCondition(Map map); + List findApplicationOutRecordPByCondition(Map map); /** * 查询当前用户出库记录及其管理仓库的出库记录 * @param map 查询条件 * @return */ - List findApplicationOutRecordPByUser(Map map); + List findApplicationOutRecordPByUser(Map map); /** * 查询当前用户出库记录及其管理仓库的出库记录数目 @@ -334,7 +332,7 @@ public interface DepositoryRecordMapper { * @param id * @return */ - ApplicationOutRecordP findApplicationOutRecordPById(Integer id); + ApplicationOutRecord findApplicationOutRecordPById(Integer id); /** @@ -342,7 +340,7 @@ public interface DepositoryRecordMapper { * @param list * @return */ - List findApplicationOutRecordPByIds(List list); + List findApplicationOutRecordPByIds(List list); /** * 根据id删除入库记录 diff --git a/src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml b/src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml index c7c09be5..c7bb3ede 100644 --- a/src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml +++ b/src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml @@ -87,7 +87,7 @@ - + diff --git a/src/main/java/com/dreamchaser/depository_manage/pojo/ApplicationOutRecordMinP.java b/src/main/java/com/dreamchaser/depository_manage/pojo/ApplicationOutRecordMinP.java index ee88b34f..e5138208 100644 --- a/src/main/java/com/dreamchaser/depository_manage/pojo/ApplicationOutRecordMinP.java +++ b/src/main/java/com/dreamchaser/depository_manage/pojo/ApplicationOutRecordMinP.java @@ -50,7 +50,7 @@ public class ApplicationOutRecordMinP { /** * 数量 */ - private Integer quantity; + private Double quantity; /** * 出库单号 */ @@ -121,6 +121,10 @@ public class ApplicationOutRecordMinP { * 部门名称 */ private String adminorgName; + /** + * 已经出库的数量 + */ + private Integer trueOut; @@ -130,7 +134,7 @@ public class ApplicationOutRecordMinP { this.depositoryId = recordMin.getDepositoryId(); this.checkId = recordMin.getCheckId(); this.code = recordMin.getCode(); - this.quantity = recordMin.getQuantity(); + this.quantity = (double)(recordMin.getQuantity() / 100); this.state = recordMin.getState(); this.parentId = recordMin.getParentId(); this.placeId = recordMin.getPlaceId(); @@ -138,5 +142,6 @@ public class ApplicationOutRecordMinP { this.transferId = recordMin.getTransferId(); this.constructionUnitId = recordMin.getConstructionUnitId(); this.adminorgId = recordMin.getAdminorgId(); + this.trueOut = recordMin.getTrueOut(); } } diff --git a/src/main/java/com/dreamchaser/depository_manage/pojo/ApplicationOutRecordP.java b/src/main/java/com/dreamchaser/depository_manage/pojo/ApplicationOutRecordP.java index efaf25e9..b2ab9833 100644 --- a/src/main/java/com/dreamchaser/depository_manage/pojo/ApplicationOutRecordP.java +++ b/src/main/java/com/dreamchaser/depository_manage/pojo/ApplicationOutRecordP.java @@ -1,5 +1,6 @@ package com.dreamchaser.depository_manage.pojo; +import com.dreamchaser.depository_manage.entity.ApplicationOutRecord; import lombok.Data; @Data @@ -63,7 +64,7 @@ public class ApplicationOutRecordP { /** * 数量 */ - private Integer quantity; + private Double quantity; /** * 部门负责人编号 @@ -162,4 +163,39 @@ public class ApplicationOutRecordP { * 部门id */ private Integer adminorgId; + + public ApplicationOutRecordP(ApplicationOutRecord aor) { + this.id = aor.getId(); + this.mid = aor.getMid(); + this.mname = aor.getMname(); + this.depositoryId = aor.getDepositoryId(); + this.depositoryName = aor.getDepositoryName(); + this.applicantId = aor.getApplicantId(); + this.applicantName = aor.getApplicantName(); + this.applicantTime = aor.getApplicantTime(); + this.applyRemark = aor.getApplyRemark(); + this.code = aor.getCode(); + this.price = aor.getPrice(); + this.quantity = (double)aor.getQuantity() / 100; + this.departmenthead = aor.getDepartmenthead(); + this.departmentheadName = aor.getDepartmentheadName(); + this.departmentheadPass = aor.getDepartmentheadPass(); + this.departmentheadTime = aor.getDepartmentheadTime(); + this.departmentheadMessage = aor.getDepartmentheadMessage(); + this.depositoryManager = aor.getDepositoryManager(); + this.depositoryManagerName = aor.getDepositoryManagerName(); + this.depositoryManagerPass = aor.getDepositoryManagerPass(); + this.depositoryManagerTime = aor.getDepositoryManagerTime(); + this.depositoryManagerMessage = aor.getDepositoryManagerMessage(); + this.state = aor.getState(); + this.istransfer = aor.getIstransfer(); + this.mcode = aor.getMcode(); + this.placeId = aor.getPlaceId(); + this.pCode = aor.getPCode(); + this.pass = aor.getPass(); + this.unit = aor.getUnit(); + this.constructionUnitId = aor.getConstructionUnitId(); + this.constructionUnitName = aor.getConstructionUnitName(); + this.adminorgId = aor.getAdminorgId(); + } } diff --git a/src/main/java/com/dreamchaser/depository_manage/pojo/SimpleApplicationOutMinRecordP.java b/src/main/java/com/dreamchaser/depository_manage/pojo/SimpleApplicationOutMinRecordP.java index 38cb3f60..9597a293 100644 --- a/src/main/java/com/dreamchaser/depository_manage/pojo/SimpleApplicationOutMinRecordP.java +++ b/src/main/java/com/dreamchaser/depository_manage/pojo/SimpleApplicationOutMinRecordP.java @@ -43,7 +43,7 @@ public class SimpleApplicationOutMinRecordP { /** * 申请数目 */ - private Integer quantity; + private Double quantity; /** * 仓库编号 */ @@ -92,7 +92,7 @@ public class SimpleApplicationOutMinRecordP { */ private String version; - public SimpleApplicationOutMinRecordP(ApplicationOutRecordMin applicationOutRecordMin) { + public SimpleApplicationOutMinRecordP(ApplicationOutRecordMinP applicationOutRecordMin) { this.id = applicationOutRecordMin.getId(); this.parentId = applicationOutRecordMin.getParentId(); this.quantity = applicationOutRecordMin.getQuantity(); diff --git a/src/main/java/com/dreamchaser/depository_manage/pojo/SimpleTaskP.java b/src/main/java/com/dreamchaser/depository_manage/pojo/SimpleTaskP.java index 946b4e30..0b04d34c 100644 --- a/src/main/java/com/dreamchaser/depository_manage/pojo/SimpleTaskP.java +++ b/src/main/java/com/dreamchaser/depository_manage/pojo/SimpleTaskP.java @@ -65,7 +65,7 @@ public class SimpleTaskP { this.type = "库存盘点请求"; } - public SimpleTaskP(ApplicationOutRecordP aor,ApplicationOutRecordMin aorm){ + public SimpleTaskP(ApplicationOutRecordP aor,ApplicationOutRecordMinP aorm){ this.id = Long.valueOf(aorm.getDepositoryId().toString()); this.code = aorm.getCode(); this.applicantTime = DateUtil.TimeStampToDateTime(Long.valueOf(aor.getApplicantTime())); 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 6c7acf86..b9b9e365 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/DepositoryRecordService.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/DepositoryRecordService.java @@ -469,7 +469,7 @@ public interface DepositoryRecordService { * @param id * @return */ - List findApplicationOutRecordMinByParent(Integer id); + List findApplicationOutRecordMinByParent(Integer id); /** * 根据主键获取子表信息 @@ -477,7 +477,7 @@ public interface DepositoryRecordService { * @param id * @return */ - ApplicationOutRecordMin findApplicationOutMinById(Integer id); + ApplicationOutRecordMinP findApplicationOutMinById(Integer id); /** * 根据条件获取子订单 @@ -485,7 +485,7 @@ public interface DepositoryRecordService { * @param map * @return */ - List findApplicationOutMinByCondition(Map map); + List findApplicationOutMinByCondition(Map map); /** * 根据主订单获取子订单 @@ -493,7 +493,7 @@ public interface DepositoryRecordService { * @param parentId * @return */ - List findApplicationOutMinByParentId(Integer parentId); + List findApplicationOutMinByParentId(Integer parentId); /** 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 dc940dfb..35d4072d 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 @@ -276,7 +276,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { @Override public Integer deleteApplicationOutRecordById(Integer id, UserByPort userByPort) { // 获取主单 - ApplicationOutRecordP recordP = depositoryRecordMapper.findApplicationOutRecordPById(id); + ApplicationOutRecord recordP = depositoryRecordMapper.findApplicationOutRecordPById(id); // 删除主单 Integer integer = depositoryRecordMapper.deleteApplicationOutRecordById(id); @@ -329,7 +329,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { @Override public Integer deleteApplicationOutRecordByIds(List list, UserByPort userByPort) { // 获取出库单列表 - List recordPList = depositoryRecordMapper.findApplicationOutRecordPByIds(list); + List recordPList = depositoryRecordMapper.findApplicationOutRecordPByIds(list); Integer integer = depositoryRecordMapper.deleteApplicationOutRecordByIds(list); @@ -339,7 +339,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { public void run() { - for (ApplicationOutRecordP recordP : recordPList + for (ApplicationOutRecord recordP : recordPList ) { // 获取该用户在redis中的订单记录 String key = "user:" + recordP.getApplicantId(); @@ -493,22 +493,22 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { Map result = new HashMap<>(); // 获取今天的额度 - Double priceForToday = 0.0; + double priceForToday = 0.0; // 获取今天的总数 - Integer countForToday = 0; + Double countForToday = 0.0; // 获取昨天的额度 - Double priceForYesterday = 0.0; + double priceForYesterday = 0.0; // 获取昨天的总数 - Integer countForYesterday = 0; + Double countForYesterday = 0.0; if (state.isEmpty()) { // 获取今天为止的出库记录 - List applicationOutRecordPForToday = depositoryRecordMapper.findApplicationOutRecordPForAPeriodOfTime(mapForToday); + List applicationOutRecordPForToday = depositoryRecordMapper.findApplicationOutRecordPForAPeriodOfTime(mapForToday); // 今天的出库记录数 int todaySize = applicationOutRecordPForToday.size(); // 获取昨天的出库记录 - List applicationOutRecordPForYesterday = depositoryRecordMapper.findApplicationOutRecordPForAPeriodOfTime(mapForYesterday); + List applicationOutRecordPForYesterday = depositoryRecordMapper.findApplicationOutRecordPForAPeriodOfTime(mapForYesterday); // 昨天的出库记录数 int yesterdaySize = applicationOutRecordPForYesterday.size(); @@ -521,9 +521,8 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { CompletionService completionServiceForToday = new ExecutorCompletionService(exsForToday); // 开启线程计算今天的额度 - for (int i = 0; i < todaySize; i++) { + for (ApplicationOutRecord recordP : applicationOutRecordPForToday) { // 获取当前主记录 - ApplicationOutRecordP recordP = applicationOutRecordPForToday.get(i); Future submit = completionServiceForToday.submit(new CalcApplicationOutInfo(recordP)); futureListForToday.add(submit); } @@ -549,8 +548,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { // 1.定义CompletionService CompletionService completionServiceForYesterday = new ExecutorCompletionService(exsForYesterday); // 开启线程计算昨天的额度 - for (int i = 0; i < yesterdaySize; i++) { - ApplicationOutRecordP recordP = applicationOutRecordPForYesterday.get(i); + for (ApplicationOutRecord recordP : applicationOutRecordPForYesterday) { Future submit = completionServiceForYesterday.submit(new CalcApplicationOutInfo(recordP)); futureListForYesterday.add(submit); } @@ -576,10 +574,10 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { Double ratioForCount = 0.0; Double ratioForPrice = 0.0; if (Double.compare(countForYesterday, 0.0) != 0) { - ratioForCount = ((countForToday - countForYesterday) / Double.parseDouble(countForYesterday.toString())); + ratioForCount = ((countForToday - countForYesterday) / countForYesterday); } if (Double.compare(priceForYesterday, 0.0) != 0) { - ratioForPrice = (priceForToday - priceForYesterday) / Double.parseDouble(priceForYesterday.toString()); + ratioForPrice = (priceForToday - priceForYesterday) / Double.parseDouble(Double.toString(priceForYesterday)); } BigDecimal bgForSum = new BigDecimal(ratioForCount); BigDecimal bgForPrice = new BigDecimal(ratioForPrice); @@ -623,10 +621,10 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { Double ratioForCount = 0.0; Double ratioForPrice = 0.0; if (Double.compare(countForYesterday, 0.0) != 0) { - ratioForCount = ((countForToday - countForYesterday) / Double.parseDouble(countForYesterday.toString())); + ratioForCount = ((countForToday - countForYesterday) / countForYesterday); } if (Double.compare(priceForYesterday, 0.0) != 0) { - ratioForPrice = (priceForToday - priceForYesterday) / Double.parseDouble(priceForYesterday.toString()); + ratioForPrice = (priceForToday - priceForYesterday) / Double.parseDouble(Double.toString(priceForYesterday)); } BigDecimal bgForSum = new BigDecimal(ratioForCount); BigDecimal bgForPrice = new BigDecimal(ratioForPrice); @@ -848,13 +846,12 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { String unit = (String) map.get("unit"); if ("-1".equals(unit)) { // 获取出库数量 - Integer quantity = ObjectFormatUtil.toInteger(map.get("quantity")); + Double quantity = ObjectFormatUtil.toDouble(map.get("quantity")); // 设置当前暂时出库数量 - inventoryById.setNumberOfTemporary(inventoryById.getNumberOfTemporary() + quantity); + inventoryById.setNumberOfTemporary(inventoryById.getNumberOfTemporary() + quantity.intValue()); // 修改库存记录 materialMapper.updateInventory(inventoryById); } - map.put("quantity",ObjectFormatUtil.toDouble(map.get("quantity")) * 100); return depositoryRecordMapper.insertApplicationOutRecordMin(map); } @@ -865,8 +862,15 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { * @return */ @Override - public List findApplicationOutRecordMinByParent(Integer id) { - return depositoryRecordMapper.findApplicationOutRecordMinByParent(id); + public List findApplicationOutRecordMinByParent(Integer id) { + List outRecordMinByParent = depositoryRecordMapper.findApplicationOutRecordMinByParent(id); + List recordMinPList = new ArrayList<>(); + for (ApplicationOutRecordMin aorm:outRecordMinByParent + ) { + ApplicationOutRecordMinP aormP = new ApplicationOutRecordMinP(aorm); + recordMinPList.add(aormP); + } + return recordMinPList; } /** @@ -876,8 +880,8 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { * @return */ @Override - public ApplicationOutRecordMin findApplicationOutMinById(Integer id) { - return depositoryRecordMapper.findApplicationOutMinById(id); + public ApplicationOutRecordMinP findApplicationOutMinById(Integer id) { + return new ApplicationOutRecordMinP(depositoryRecordMapper.findApplicationOutMinById(id)); } /** @@ -887,8 +891,14 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { * @return */ @Override - public List findApplicationOutMinByCondition(Map map) { - return depositoryRecordMapper.findApplicationOutMinByCondition(map); + public List findApplicationOutMinByCondition(Map map) { + List condition = depositoryRecordMapper.findApplicationOutMinByCondition(map); + List result = new ArrayList<>(); + for (ApplicationOutRecordMin aorm:condition + ) { + result.add(new ApplicationOutRecordMinP(aorm)); + } + return result; } /** @@ -898,10 +908,17 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { * @return */ @Override - public List findApplicationOutMinByParentId(Integer parentId) { + public List findApplicationOutMinByParentId(Integer parentId) { Map map = new HashMap<>(); map.put("parentId", parentId); - return depositoryRecordMapper.findApplicationOutMinByCondition(map); + List applicationOutMinByCondition = depositoryRecordMapper.findApplicationOutMinByCondition(map); + List applicationOutRecordMinPList = new ArrayList<>(); + for (ApplicationOutRecordMin recordMin:applicationOutMinByCondition + ) { + ApplicationOutRecordMinP recordMinP = new ApplicationOutRecordMinP(recordMin); + applicationOutRecordMinPList.add(recordMinP); + } + return applicationOutRecordMinPList; } /** @@ -927,7 +944,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { // 获取库存信息 Inventory inventory = materialMapper.findInventoryById(mid); // 获取子订单对应的主订单 - ApplicationOutRecordP record = depositoryRecordMapper.findApplicationOutRecordPById(applicationOutMinById.getParentId()); + ApplicationOutRecord record = depositoryRecordMapper.findApplicationOutRecordPById(applicationOutMinById.getParentId()); // 设置标志位 boolean flag = true; // 设置最终返回值 @@ -1656,7 +1673,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { * @param userAgent user-agent */ @Transactional(rollbackFor = Exception.class) - void updateApplicationMinOutInfo(Integer id, ApplicationOutRecordMin applicationOutMinById, ApplicationOutRecordP record, Integer trueOut, UserByPort userByPort, Integer placeId, String userAgent) { + void updateApplicationMinOutInfo(Integer id, ApplicationOutRecordMin applicationOutMinById, ApplicationOutRecord record, Integer trueOut, UserByPort userByPort, Integer placeId, String userAgent) { String redisMinRecordKey = "minRecord:" + id; // 设置redis中子订单键值 // 修改redis中本子订单状态 // redisTemplate.opsForHash().put(redisMinRecordKey,"state","2"); @@ -1822,7 +1839,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { // 获取审核订单 Integer outId = ObjectFormatUtil.toInteger(mainId); // 获取对应的出库订单 - ApplicationOutRecordP recordP = depositoryRecordMapper.findApplicationOutRecordPById(outId); + ApplicationOutRecord recordP = depositoryRecordMapper.findApplicationOutRecordPById(outId); // 获取当前审批所在部门 // Integer maindeparment = userByPort.getMaindeparment(); @@ -2016,7 +2033,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { @Override public boolean judgeApplicationOutRecordStatus(Integer id) { // 获取当前出库记录 - ApplicationOutRecordP recordPById = depositoryRecordMapper.findApplicationOutRecordPById(id); + ApplicationOutRecord recordPById = depositoryRecordMapper.findApplicationOutRecordPById(id); Integer pass = recordPById.getPass(); if (Integer.compare(pass, 2) == 0) { // 如果审核未通过 @@ -2278,7 +2295,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { * * @param recordP 拒绝的订单 */ - private void updateInventoryForOutRefused(ApplicationOutRecordP recordP) { + private void updateInventoryForOutRefused(ApplicationOutRecord recordP) { // 获取该订单下的子订单 List recordMinByParent = depositoryRecordMapper.findApplicationOutRecordMinByParent(recordP.getId()); // 循环该记录 @@ -2314,7 +2331,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { @Transactional(rollbackFor = Exception.class) public Integer review(Map map, Integer userid, UserByPort userToken, String userAgent) { Object id = map.get("id"); // 主订单编号 - ApplicationOutRecordP record = depositoryRecordMapper.findApplicationOutRecordPById(ObjectFormatUtil.toInteger(id)); + ApplicationOutRecord record = depositoryRecordMapper.findApplicationOutRecordPById(ObjectFormatUtil.toInteger(id)); map.remove("id"); List minByParent = depositoryRecordMapper.findApplicationOutRecordMinByParent(record.getId()); @@ -2718,7 +2735,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { // 获取审核订单 Integer outId = ObjectFormatUtil.toInteger(clickKeys[2].split("outId")[1]); // 获取对应的出库订单 - ApplicationOutRecordP recordP = depositoryRecordMapper.findApplicationOutRecordPById(outId); + ApplicationOutRecord recordP = depositoryRecordMapper.findApplicationOutRecordPById(outId); // 获取当前用户的身份 String optionId = templateCard.getSelectedItems().getSelectedItem().getOptionIds().getOptionId(); String[] optionsKey = optionId.split("_"); @@ -3397,7 +3414,8 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { applicationInRecord.setMcode(group.getCode()); applicationInRecord.setMversion("组合"); } - ApplicationInRecordP ap = new ApplicationInRecordP(); + ApplicationInRecordP ap = new ApplicationInRecordP(applicationInRecord); + result.add(ap); } return result; } @@ -3508,15 +3526,18 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { } map.put("depositoryIdList", depositoryIdList); map.put("applicantId", userByPort.getId()); - List list = depositoryRecordMapper.findApplicationOutRecordPByUser(map); - for (ApplicationOutRecordP recordP : list) { - UserByPort userByPortById = LinkInterfaceUtil.FindUserById(recordP.getApplicantId(), userByPort); - String time = DateUtil.TimeStampToDateTime(Long.valueOf(recordP.getApplicantTime())); - recordP.setApplicantName(userByPortById.getName()); - recordP.setApplicantTime(time); - recordP.setApplyRemark(recordP.getApplyRemark() == null ? "" : recordP.getApplyRemark()); + List list = depositoryRecordMapper.findApplicationOutRecordPByUser(map); + List result = new ArrayList<>(); + for (ApplicationOutRecord record : list) { + UserByPort userByPortById = LinkInterfaceUtil.FindUserById(record.getApplicantId(), userByPort); + String time = DateUtil.TimeStampToDateTime(Long.valueOf(record.getApplicantTime())); + record.setApplicantName(userByPortById.getName()); + record.setApplicantTime(time); + record.setApplyRemark(record.getApplyRemark() == null ? "" : record.getApplyRemark()); + ApplicationOutRecordP recordP = new ApplicationOutRecordP(record); + result.add(recordP); } - return list; + return result; } /** @@ -3567,15 +3588,18 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { String applyTime = (String) map.get("applyTime"); map.put("applicantTime", DateUtil.DateTimeByDayToTimeStamp(applyTime)); } - List list = depositoryRecordMapper.findApplicationOutRecordPByCondition(map); - for (int i = 0; i < list.size(); i++) { - UserByPort userByPortById = LinkInterfaceUtil.FindUserById(list.get(i).getApplicantId(), userToken); - String time = DateUtil.TimeStampToDateTime(Long.valueOf(list.get(i).getApplicantTime())); - list.get(i).setApplicantName(userByPortById.getName()); - list.get(i).setApplicantTime(time); - list.get(i).setApplyRemark(list.get(i).getApplyRemark() == null ? "" : list.get(i).getApplyRemark()); + List list = depositoryRecordMapper.findApplicationOutRecordPByCondition(map); + List result = new ArrayList<>(); + for (ApplicationOutRecord recordP : list) { + UserByPort userByPortById = LinkInterfaceUtil.FindUserById(recordP.getApplicantId(), userToken); + String time = DateUtil.TimeStampToDateTime(Long.valueOf(recordP.getApplicantTime())); + recordP.setApplicantName(userByPortById.getName()); + recordP.setApplicantTime(time); + recordP.setApplyRemark(recordP.getApplyRemark() == null ? "" : recordP.getApplyRemark()); + ApplicationOutRecordP aorp = new ApplicationOutRecordP(recordP); + result.add(aorp); } - return list; + return result; } /** @@ -3604,7 +3628,14 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { */ @Override public List findApplicationOutRecordByDepository(String depositoryId) { - return depositoryRecordMapper.findApplicationOutRecordByDepository(depositoryId); + List recordList = depositoryRecordMapper.findApplicationOutRecordByDepository(depositoryId); + List result = new ArrayList<>(); + for (ApplicationOutRecord record:recordList + ) { + ApplicationOutRecordP recordP = new ApplicationOutRecordP(record); + result.add(recordP); + } + return result; } /** @@ -3626,7 +3657,9 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { */ @Override public ApplicationOutRecordP findApplicationOutRecordPById(Integer id) { - return depositoryRecordMapper.findApplicationOutRecordPById(id); + ApplicationOutRecord record = depositoryRecordMapper.findApplicationOutRecordPById(id); + ApplicationOutRecordP recordP = new ApplicationOutRecordP(record); + return recordP; } /** @@ -3843,11 +3876,11 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { */ @Override public Double CalculateAllApplicationOutPrice(String state) { - List applicationOutRecordPAll = depositoryRecordMapper.findApplicationOutRecordPAll(); + List applicationOutRecordPAll = depositoryRecordMapper.findApplicationOutRecordPAll(); double sum = 0.0; if (state.isEmpty()) { // 如果要获取所有待出库的金额 - for (ApplicationOutRecordP applicationOutRecordP : applicationOutRecordPAll) { + for (ApplicationOutRecord applicationOutRecordP : applicationOutRecordPAll) { // 获取所有子物料 Map map = new HashMap<>(); map.put("parentId", applicationOutRecordP.getId()); @@ -3857,7 +3890,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { Material materialById = materialMapper.findMaterialById(mid); if (materialById.getPrice() != null) { - sum += (materialById.getPrice() / 100) * applicationOutRecordMin.getQuantity(); + sum += (materialById.getPrice() / 100) * ((double)applicationOutRecordMin.getQuantity() / 100); } else { sum += 0; } @@ -4543,9 +4576,9 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { */ class CalcApplicationOutInfo implements Callable { - ApplicationOutRecordP mainRecord; + ApplicationOutRecord mainRecord; - CalcApplicationOutInfo(ApplicationOutRecordP mainRecord) { + CalcApplicationOutInfo(ApplicationOutRecord mainRecord) { this.mainRecord = mainRecord; } @@ -4555,17 +4588,18 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { // 获取当前订单的子订单 List minList = depositoryRecordMapper.findApplicationOutRecordMinByParent(mainRecord.getId()); // 额度 - Double price = 0.0; + double price = 0.0; // 数量 - Integer count = 0; + double count = 0; for (ApplicationOutRecordMin recordMin : minList) { - count += recordMin.getQuantity(); + double quantity =(double) recordMin.getQuantity() / 100; + count += quantity ; // 获取当前出库物料 Inventory materialById = materialMapper.findInventoryById(recordMin.getMid()); // 计算当前出库金额 double price_out = 0.0; if (materialById.getPrice() != null) { - price_out = materialById.getPrice() * recordMin.getQuantity(); + price_out = materialById.getPrice() * quantity; } BigDecimal bg = new BigDecimal(price_out / 100); price_out = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); diff --git a/src/main/java/com/dreamchaser/depository_manage/service/impl/QyWxOperationService.java b/src/main/java/com/dreamchaser/depository_manage/service/impl/QyWxOperationService.java index 47908caf..b6b01680 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/impl/QyWxOperationService.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/impl/QyWxOperationService.java @@ -69,7 +69,7 @@ public class QyWxOperationService { public JSONObject sendQyWxToApplicationOutMessage(String uid, Integer outId, Boolean flag, String userAgent) { // 获取将要发送申请的订单记录 - ApplicationOutRecordP applicationOutRecordPById = depositoryRecordMapper.findApplicationOutRecordPById(outId); + ApplicationOutRecord applicationOutRecordPById = depositoryRecordMapper.findApplicationOutRecordPById(outId); // 申请人id Integer applicantId = applicationOutRecordPById.getApplicantId(); // 申请人 @@ -729,7 +729,7 @@ public class QyWxOperationService { */ public JSONObject sendCcMessageToUsers(String uid, Integer outId, String userAgent) { // 获取已经完成的订单 - ApplicationOutRecordP recordP = depositoryRecordMapper.findApplicationOutRecordPById(outId); + ApplicationOutRecord recordP = depositoryRecordMapper.findApplicationOutRecordPById(outId); // 申请人id Integer applicantId = recordP.getApplicantId(); // 申请人 @@ -1156,7 +1156,7 @@ public class QyWxOperationService { // 需要出库的子订单 ApplicationOutRecordMin recordMin = depositoryRecordMapper.findApplicationOutMinById(outMinId); // 获取其主订单 - ApplicationOutRecordP outRecordP = depositoryRecordMapper.findApplicationOutRecordPById(recordMin.getParentId()); + ApplicationOutRecord outRecordP = depositoryRecordMapper.findApplicationOutRecordPById(recordMin.getParentId()); // 申请人id Integer applicantId = outRecordP.getApplicantId(); // 申请人 @@ -1374,7 +1374,7 @@ public class QyWxOperationService { public JSONObject sendOutApprovalTemplate(String userAgent, UserByPort userToken, Integer mainId) { // 获取当前出库主订单 - ApplicationOutRecordP mainRecord = depositoryRecordMapper.findApplicationOutRecordPById(mainId); + ApplicationOutRecord mainRecord = depositoryRecordMapper.findApplicationOutRecordPById(mainId); // 获取当前出库明细 List minRecordList = depositoryRecordMapper.findApplicationOutRecordMinByParent(mainId); // 定义审批模板 @@ -1575,7 +1575,7 @@ public class QyWxOperationService { detail_list_control_info_outNumber.put("title", detail_list_control_info_title_list_outNumber); Map detail_list_control_info_value_outNumber = new HashMap<>(); - detail_list_control_info_value_outNumber.put("new_number", recordMin.getQuantity().toString()); + detail_list_control_info_value_outNumber.put("new_number", String.valueOf(recordMin.getQuantity() / 100)); detail_list_control_info_outNumber.put("value", detail_list_control_info_value_outNumber); // 请求单位 @@ -2610,7 +2610,7 @@ public class QyWxOperationService { public JSONObject sendMessageForOtherUserByCard(Integer mainId, String uid, String userAgent, Integer flag) { // 获取当前申请主订单 - ApplicationOutRecordP aorp = null; + ApplicationOutRecord aorp = null; StockTaking stockTaking = null; // 用于暂存申请人id Integer applicantId = null; diff --git a/src/main/resources/templates/pages/application/application-out.html b/src/main/resources/templates/pages/application/application-out.html index 96e10b47..7aaef5c3 100644 --- a/src/main/resources/templates/pages/application/application-out.html +++ b/src/main/resources/templates/pages/application/application-out.html @@ -418,7 +418,9 @@ success: function (data) { layer.close(this.layerIndex); if (data.status >= 300) { - layer.msg(data.statusInfo.message);//失败的表情 + layer.msg(data.statusInfo.message,{icon:0,time:500},function () { + flagForForm = false; + });//失败的表情 } else { layer.msg("申请提交成功", { @@ -480,7 +482,9 @@ success: function (d) { layer.close(this.layerIndex); if (d.status >= 300) { - layer.msg(d.statusInfo.detail);//失败的表情 + layer.msg(data.statusInfo.message,{icon:0,time:500},function () { + flagForForm = false; + });//失败的表情 } else { layer.msg("申请提交成功", { diff --git a/src/test/java/com/dreamchaser/depository_manage/TestForOther.java b/src/test/java/com/dreamchaser/depository_manage/TestForOther.java index d53e1c1e..5770a3ef 100644 --- a/src/test/java/com/dreamchaser/depository_manage/TestForOther.java +++ b/src/test/java/com/dreamchaser/depository_manage/TestForOther.java @@ -26,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.web.jsf.FacesContextUtils; import java.io.File; import java.io.IOException; @@ -46,7 +47,7 @@ public class TestForOther { ApprovalInfo_Details_Approver approver = new ApprovalInfo_Details_Approver(); approver.setUserId("PangFuZhen"); approvalInfo.setApprover(approver); - depositoryRecordService.reviewByQyWxApprovalIn("[12]",approvalInfo,"460f46eaefb46bb0c171029f62e2cea6","2","202303170025"); + depositoryRecordService.reviewByQyWxApprovalOut("1",approvalInfo,"460f46eaefb46bb0c171029f62e2cea6","2","202303170033", false,2); } diff --git a/target/classes/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml b/target/classes/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml index c7c09be5..c7bb3ede 100644 --- a/target/classes/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml +++ b/target/classes/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml @@ -87,7 +87,7 @@ - + diff --git a/target/classes/templates/pages/application/application-out.html b/target/classes/templates/pages/application/application-out.html index 96e10b47..7aaef5c3 100644 --- a/target/classes/templates/pages/application/application-out.html +++ b/target/classes/templates/pages/application/application-out.html @@ -418,7 +418,9 @@ success: function (data) { layer.close(this.layerIndex); if (data.status >= 300) { - layer.msg(data.statusInfo.message);//失败的表情 + layer.msg(data.statusInfo.message,{icon:0,time:500},function () { + flagForForm = false; + });//失败的表情 } else { layer.msg("申请提交成功", { @@ -480,7 +482,9 @@ success: function (d) { layer.close(this.layerIndex); if (d.status >= 300) { - layer.msg(d.statusInfo.detail);//失败的表情 + layer.msg(data.statusInfo.message,{icon:0,time:500},function () { + flagForForm = false; + });//失败的表情 } else { layer.msg("申请提交成功", {