From 41046bfc9feabe4970946963f99c4a4c8943f9c9 Mon Sep 17 00:00:00 2001 From: erdanergou Date: Thu, 15 Dec 2022 16:49:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E5=A5=97=E9=A4=90=E5=87=BA?= =?UTF-8?q?=E5=BA=93=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DepositoryController.java | 2 +- .../DepositoryRecordController.java | 11 +- .../controller/GroupController.java | 228 +++++++- .../controller/PageController.java | 33 +- .../depository_manage/entity/Group.java | 8 +- .../depository_manage/entity/GroupInfo.java | 12 +- .../entity/MaterialForGroup.java | 2 +- .../depository_manage/mapper/GroupMapper.java | 56 +- .../depository_manage/mapper/GroupMapper.xml | 13 +- .../depository_manage/pojo/GroupInfoP.java | 12 +- .../service/GroupService.java | 56 +- .../impl/DepositoryRecordServiceImpl.java | 2 +- .../service/impl/GroupServiceImpl.java | 140 ++--- .../js/application-out/application-out.js | 52 +- .../pages/application/application-out.html | 82 +-- .../pages/application/application_multi.html | 36 +- .../templates/pages/chart/chart-out_back.html | 3 - .../pages/chart/chart-stock_back.html | 4 +- .../pages/group/applicationOutForGroup.html | 551 +++++++++++++++++- .../pages/group/application_multi.html | 260 +++++++++ .../templates/pages/group/group-out.html | 115 +++- .../templates/pages/group/group_edit.html | 51 +- .../pages/group/group_material_edit.html | 2 +- .../templates/pages/group/selectGroup.html | 4 +- .../depository_manage/TestForGroupTree.java | 20 +- .../pages/application/application-out.html | 82 +-- .../pages/application/application_multi.html | 36 +- 27 files changed, 1501 insertions(+), 372 deletions(-) create mode 100644 src/main/resources/templates/pages/group/application_multi.html 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 9caa45fb..06de3ab1 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryController.java @@ -337,7 +337,7 @@ public class DepositoryController { List sourceList = (List) previousMonth.get("sourceList"); ArrayList title = new ArrayList<>(); List depositoryAll = depositoryService.findDepositoryByAdminorgAndUser(userByPort); - title.add("depository"); + title.add("product"); for (int i = sourceList.size() - 1; i >= 0; i--) { title.add(((Map) sourceList.get(i)).get("month")); } 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 45f38893..449fb6d9 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java @@ -911,7 +911,14 @@ public class DepositoryRecordController { departmentHeadId.append("78").append(","); departMentHeadQyWxName.append("PangFuZhen").append(","); map.put("departmenthead",departmentHeadId.toString()); - map.put("mid",map.get("iid")); + // 待出库物料id + Integer mid = ObjectFormatUtil.toInteger(map.get("iid")); + // 获取库存信息 + Inventory inventoryByMid = materialService.findInventoryByMid(mid); + if(inventoryByMid.getQuantity() < quantity){ + return new RestResponse("",666,new StatusInfo("申请失败","超出最大存储容量")); + } + map.put("mid",mid); Integer res = depositoryRecordService.insertApplicationOutRecord(map,userToken); // 插入主订单 if(res == 1){ // 如果插入成功 Object id = map.get("id"); // 获取主订单编号 @@ -1052,7 +1059,9 @@ public class DepositoryRecordController { depositoryRecordService.insertApplicationOutRecord(mainRecord,userToken); id = ObjectFormatUtil.toInteger(mainRecord.get("id")); for (int i = 0; i < iids.size(); i++) { + // 出库物料 Integer mid = iids.get(i); + // 出库数量 Integer integer = ObjectFormatUtil.toInteger(quantitys.get(i)); // 获取当前仓库编号 Integer depositoryId = depositoryIds.get(i); diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/GroupController.java b/src/main/java/com/dreamchaser/depository_manage/controller/GroupController.java index 2eede7e7..f88c16e0 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/GroupController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/GroupController.java @@ -3,6 +3,7 @@ package com.dreamchaser.depository_manage.controller; import com.alibaba.fastjson.JSONObject; import com.dreamchaser.depository_manage.entity.*; import com.dreamchaser.depository_manage.exception.MyException; +import com.dreamchaser.depository_manage.pojo.ApplicationModel; import com.dreamchaser.depository_manage.pojo.GroupInfoP; import com.dreamchaser.depository_manage.pojo.RestResponse; import com.dreamchaser.depository_manage.pojo.StatusInfo; @@ -20,10 +21,7 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import java.sql.Time; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import java.util.concurrent.TimeUnit; @RestController @@ -47,7 +45,7 @@ public class GroupController { /** - * 用于添加一条套餐记录 + * 用于添加一条组合记录 * * @param map 添加数据 * @param request @@ -71,7 +69,7 @@ public class GroupController { List depositoryByAdminorg = depositoryService.findDepositoryByAdminorg(userToken.getMaindeparment().toString()); String code = map.get("code").toString(); - // 获取套餐编码 + // 获取组合编码 Group groupByCode = groupService.findGroupByCode(code); if (groupByCode != null) { @@ -80,10 +78,10 @@ public class GroupController { Map paramForGetGroup = new HashMap<>(); paramForGetGroup.put("gid", groupByCode.getId()); - // 获取当前套餐的所有物料数据 + // 获取当前组合的所有物料数据 List groupByGid = groupService.findGroupByCondition(paramForGetGroup); - // 用于标识当前套餐是否可以正常出库 + // 用于标识当前组合是否可以正常出库 boolean flag = true; for (int i = 0; i < groupByGid.size(); i++) { @@ -110,16 +108,16 @@ public class GroupController { if (flag) { return new RestResponse(groupByGid); } else { - return new RestResponse(null, 666, new StatusInfo("不能出库", "当前套餐中有物料库存不足")); + return new RestResponse(null, 666, new StatusInfo("不能出库", "当前组合中有物料库存不足")); } } else { - return new RestResponse(null, 666, new StatusInfo("失败", "暂无该套餐,请确认是否正确")); + return new RestResponse(null, 666, new StatusInfo("失败", "暂无该组合,请确认是否正确")); } } /** - * 用于给套餐添加物料信息 + * 用于给组合添加物料信息 * * @param map 添加物料信息 * @param request @@ -139,7 +137,7 @@ public class GroupController { } /** - * 根据条件获取所有套餐 + * 根据条件获取所有组合 * * @param map 查询条件 * @return @@ -160,9 +158,9 @@ public class GroupController { /** - * 根据套餐名称获取套餐 + * 根据组合名称获取组合 * - * @param map 套餐名称 + * @param map 组合名称 * @return */ @PostMapping("/findGroupByGname") @@ -171,12 +169,12 @@ public class GroupController { List groupOnlyByCondition = groupService.findGroupOnlyByCondition(map); int size = groupOnlyByCondition.size(); if (size > 1) { - // 如果当前名称的套餐大于1个 + // 如果当前名称的组合大于1个 return new RestResponse("", -1, 444); } else if (size == 1) { // 如果刚好只有一个 - // 获取当前套餐的所有物料数据 + // 获取当前组合的所有物料数据 List groupByGid = groupService.findGroupByCondition(map); return new RestResponse(groupByGid, groupByGid.size(), 200); @@ -190,7 +188,7 @@ public class GroupController { } /** - * 查询套餐详情 + * 查询组合详情 * * @param map * @return @@ -206,7 +204,7 @@ public class GroupController { } /** - * 修改套餐中的物料数据 + * 修改组合中的物料数据 * * @param map * @return @@ -222,7 +220,7 @@ public class GroupController { } /** - * 删除套餐中的物料 + * 删除组合中的物料 * * @param map 删除条件 * @return @@ -245,7 +243,7 @@ public class GroupController { /** - * 用于修改套餐的状态 + * 用于修改组合的状态 * * @param map 条件 * @return @@ -262,7 +260,7 @@ public class GroupController { /** - * 用于修改套餐信息 + * 用于修改组合信息 * * @param map 修改条件 * @return @@ -279,7 +277,7 @@ public class GroupController { /** - * 删除套餐(软删除) + * 删除组合(软删除) * * @param map 删除条件 * @return @@ -306,7 +304,7 @@ public class GroupController { /** - * 删除套餐及其明细(硬删除) + * 删除组合及其明细(硬删除) * * @param map 删除条件 * @return @@ -330,10 +328,10 @@ public class GroupController { // 获取当前部门仓库 List depositoryByAdminorg = depositoryService.findDepositoryByAdminorg(userToken.getMaindeparment().toString()); - // 获取当前套餐的所有物料数据 + // 获取当前组合的所有物料数据 List groupByGid = groupService.findGroupByCondition(map); - // 用于标识当前套餐是否可以正常出库 + // 用于标识当前组合是否可以正常出库 boolean flag = true; for (int i = 0; i < groupByGid.size(); i++) { @@ -360,7 +358,7 @@ public class GroupController { if (flag) { return new RestResponse(groupByGid); } else { - return new RestResponse(null, 666, new StatusInfo("不能出库", "当前套餐中有物料库存不足")); + return new RestResponse(null, 666, new StatusInfo("不能出库", "当前组合中有物料库存不足")); } } @@ -376,6 +374,84 @@ public class GroupController { } + /** + * 将选中的物料暂存到redis中 + * + * @param map 暂存的数据 + * @param request + * @return + */ + @PostMapping("/addApplicationToRedis") + public RestResponse addApplicationToRedis(@RequestBody Map map, HttpServletRequest request) { + UserByPort userToken = (UserByPort) request.getAttribute("userToken"); + // 获取暂存的数据 + List gids = (List) map.get("gids"); + // 获取当前已经存在的数据 + List range = redisTemplateForHash.opsForList().range("wms_gids" + userToken.getId(), 0, -1); + for (int i = 0; i < gids.size(); i++) { + if (range.contains(gids.get(i).toString())) { + continue; + } + redisTemplateForHash.opsForList().leftPush("wms_gids" + userToken.getId(), gids.get(i).toString()); + + } + // 设置过期时间为1天 + redisTemplateForHash.expire("wms_gids" + userToken.getId(), 24 * 60 * 60, TimeUnit.SECONDS); + return CrudUtil.postHandle(1, 1); + } + + /** + * 用于查询当前多选选中的组合 + * + * @param map 查询条件 + * @param request + * @return + */ + @GetMapping("/applicant_multi_create") + public RestResponse applicant_multi_create(@RequestParam Map map, HttpServletRequest request) { + Integer page = ObjectFormatUtil.toInteger(map.get("page")); + Integer pagesize = ObjectFormatUtil.toInteger(map.get("size")); + Integer start = (page - 1) * pagesize; + Integer end = page * 10; + UserByPort userToken = (UserByPort) request.getAttribute("userToken"); + Long size = redisTemplateForHash.boundListOps("wms_gids" + userToken.getId()).size(); + if (end > size) { + end = ObjectFormatUtil.toInteger(size); + } + List list = new ArrayList<>(); + Map paramForGroupOnly = new HashMap<>(); + for (int i = start; i < end; i++) { + // 获取组合编号 + Integer gid = ObjectFormatUtil.toInteger(redisTemplateForHash.opsForList().index("wms_gids" + userToken.getId(), i)); + paramForGroupOnly.put("gid", gid); + List groupPByCondition = groupService.findOnlyGroupByCondition(paramForGroupOnly); + for (int j = 0; j < groupPByCondition.size(); j++) { + groupPByCondition.get(j).setQuantity(1); + list.add(groupPByCondition.get(j)); + } + + } + return new RestResponse(list, ObjectFormatUtil.toInteger(size), 200); + } + + /** + * 将选中的组合从redis中删除 + * + * @param map 待删除的数据 + * @param request + * @return + */ + @PostMapping("/deleteApplicationToRedis") + public RestResponse deleteApplicationToRedis(@RequestBody Map map, HttpServletRequest request) { + UserByPort userToken = (UserByPort) request.getAttribute("userToken"); + List gids = (List) map.get("gids"); + for (int i = 0; i < gids.size(); i++) { + redisTemplateForHash.opsForList().remove("wms_gids" + userToken.getId(), 1, gids.get(i).toString()); + } + return CrudUtil.postHandle(1, 1); + } + + @PostMapping("/applicationOutForGroup") public RestResponse applicationOutForGroup(@RequestBody Map map, HttpServletRequest request) { UserByPort userToken = (UserByPort) request.getAttribute("userToken"); @@ -446,9 +522,9 @@ public class GroupController { /** - * 用于判断当前套餐的数量是否合法 + * 用于判断当前组合的数量是否合法 * - * @param map 套餐相关信息 + * @param map 组合相关信息 * @param request * @return */ @@ -458,9 +534,9 @@ public class GroupController { UserByPort userToken = (UserByPort) request.getAttribute("userToken"); // 获取当前部门所拥有的仓库 List depositoryByAdminorg = depositoryService.findDepositoryByAdminorg(userToken.getMaindeparment().toString()); - // 获取套餐id + // 获取组合id Integer gid = ObjectFormatUtil.toInteger(map.get("gid")); - // 获取套餐数量 + // 获取组合数量 Integer quantity = ObjectFormatUtil.toInteger(map.get("quantity")); List groupInfoByGid = groupService.findGroupInfoByGid(gid); // 用于标志该数量是否合法 @@ -491,4 +567,96 @@ public class GroupController { throw new MyException("缺少必要参数"); } } + + /** + * 用于构造组合出库订单 + * + * @param map 出库数据 + * @param request + * @return + */ + @PostMapping("/createMultiApplication") + public RestResponse createMultiApplication(@RequestBody Map map, HttpServletRequest request) { + UserByPort userToken = (UserByPort) request.getAttribute("userToken"); + String header = request.getHeader("user-agent"); + String crypt = Md5.crypt(header); + map.put("applicantId", userToken.getId()); + // 获取当前部门负责人 + List departmentHeadByUsers = LinkInterfaceUtil.findDepartmentHeadByUser(userToken); + // 部门负责人id + StringBuilder departmentHeadId = new StringBuilder(); + // 部门负责人企业微信user + StringBuilder departMentHeadQyWxName = new StringBuilder(); +// for (int i = 0; i < departmentHeadByUsers.size(); i++) { +// departmentHeadId.append(departmentHeadByUsers.get(i).getId()).append(","); +// departMentHeadQyWxName.append(departmentHeadByUsers.get(i).getWorkwechat()+","); +// } + departmentHeadId.append("78").append(","); + departMentHeadQyWxName.append("PangFuZhen").append(","); + map.put("departmenthead", departmentHeadId.toString()); + + // 执行结果 + Integer integer = 0; + // 实际结果 + Integer result = 0; + + // 获取当前出库类型 + String type = (String) map.get("type"); + if("one".equals(type)){ + Integer gid = ObjectFormatUtil.toInteger(map.get("id")); + map.put("gid",gid); + List groupInfoByGid = groupService.findGroupInfoByGid(gid); + if (groupInfoByGid != null) { + result += groupInfoByGid.size(); + } + }else{ + // 用于同步出库算法 + int num = 0; + List params = new ArrayList<>(); + // 获取当前提交数 + List gids = (List) map.get("gids"); + List quantitys = (List) map.get("quantitys"); + for (int i = 0; i < gids.size(); i++) { + Integer temp = gids.get(i); + String quantity = quantitys.get(i); + List groupInfoByGid = groupService.findGroupInfoByGid(temp); + if (groupInfoByGid != null) { + result += groupInfoByGid.size(); + } + if (num == 0) { + map.put("gid", temp); + map.put("quantity",quantity); + num++; + } else { + map.put("gid" + num, temp); + map.put("quantity" + num, quantity); + params.add(String.valueOf((num++))); + } + } + map.put("params",params); + + } + try { + integer += groupService.insertApplicationOutRecord(map, userToken); // 插入主订单 + } catch (Exception e) { + return new RestResponse("", 666, new StatusInfo("出库失败", e.getMessage())); + } + Object id = map.get("id"); // 获取主订单编号 + // 开启一个线程开启审批 + new Thread(new Runnable() { + @Override + public void run() { + JSONObject jsonObject = qyWxOperationService.sendOutApprovalTemplate(crypt, userToken, ObjectFormatUtil.toInteger(id)); + String sp_no = jsonObject.getString("sp_no"); + Map QyWxApprovalMap = new HashMap<>(); + QyWxApprovalMap.put("sp_no", sp_no); + QyWxApprovalMap.put("mainId", id.toString()); + redisTemplateForHash.opsForHash().putAll(sp_no, QyWxApprovalMap); + // 设置过期为7天 + redisTemplateForHash.expire(sp_no, 7, TimeUnit.DAYS); + } + }).start(); + return CrudUtil.postHandle(integer, result); + + } } 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 914f6258..9026abb3 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java @@ -501,7 +501,7 @@ public class PageController { return mv; } - // 套餐树形菜单页面 + // 组合树形菜单页面 @GetMapping("/selectGroup") public ModelAndView selectGroup(String gname,String clickObj){ ModelAndView mv = new ModelAndView(); @@ -603,6 +603,10 @@ public class PageController { return mv; } + /** + * 跳转到库存多选处理页面 + * @return + */ @GetMapping("/application_multi") public ModelAndView application_multi() { ModelAndView mv = new ModelAndView(); @@ -610,6 +614,18 @@ public class PageController { return mv; } + + /** + * 跳转到组合多选处理页面 + * @return + */ + @GetMapping("/application_group_multi") + public ModelAndView application_group_multi() { + ModelAndView mv = new ModelAndView(); + mv.setViewName("pages/group/application_multi"); + return mv; + } + @GetMapping("/application_in_back") public ModelAndView applicationIn(Integer mid, Integer depositoryId) { ModelAndView mv = new ModelAndView(); @@ -734,7 +750,7 @@ public class PageController { } /** - * 跳转到套餐添加页面 + * 跳转到组合添加页面 * @return */ @GetMapping("/group_add") @@ -750,7 +766,7 @@ public class PageController { } /** - * 跳转到套餐查询页面 + * 跳转到组合查询页面 * @return */ @GetMapping("/group_out") @@ -772,15 +788,15 @@ public class PageController { /** - * 跳转到套餐中物料明细中 + * 跳转到组合中物料明细中 * @param mid 物料id - * @param gid 套餐id + * @param gid 组合id * @return */ @GetMapping("/materialForGroup") public ModelAndView materialForGroup(Integer mid,Integer gid){ ModelAndView mv = new ModelAndView(); - // 根据物料id与套餐id查询对应明细 + // 根据物料id与组合id查询对应明细 GroupInfo groupInfoByMidAndGid = groupService.findGroupInfoByMidAndGid(mid, gid); if(groupInfoByMidAndGid != null){ mv.addObject("record",groupInfoByMidAndGid); @@ -1396,11 +1412,12 @@ public class PageController { @GetMapping("/applicationOutForGroup") public ModelAndView applicationOutForGroup(Integer gid,String type){ ModelAndView mv = new ModelAndView(); - mv.addObject("type",type); + List gidList = new ArrayList<>(); if("one".equals(type)) { - mv.addObject("gid",gid); + gidList.add(gid); }else if("more".equals(type)){ } + mv.addObject("gidList",gidList); mv.setViewName("pages/group/applicationOutForGroup"); return mv; } diff --git a/src/main/java/com/dreamchaser/depository_manage/entity/Group.java b/src/main/java/com/dreamchaser/depository_manage/entity/Group.java index cc022065..f11284a8 100644 --- a/src/main/java/com/dreamchaser/depository_manage/entity/Group.java +++ b/src/main/java/com/dreamchaser/depository_manage/entity/Group.java @@ -9,21 +9,21 @@ public class Group { */ private Integer id; /** - * 套餐编码 + * 组合编码 */ private String code; /** - * 套餐创建时间 + * 组合创建时间 */ private Long createTime; /** - * 套餐状态 + * 组合状态 */ private Integer state; /** - * 套餐名称 + * 组合名称 */ private String gname; } diff --git a/src/main/java/com/dreamchaser/depository_manage/entity/GroupInfo.java b/src/main/java/com/dreamchaser/depository_manage/entity/GroupInfo.java index 3951dd38..f9d2fdbe 100644 --- a/src/main/java/com/dreamchaser/depository_manage/entity/GroupInfo.java +++ b/src/main/java/com/dreamchaser/depository_manage/entity/GroupInfo.java @@ -3,7 +3,7 @@ package com.dreamchaser.depository_manage.entity; import lombok.Data; /** - * 用于套餐信息的封装 + * 用于组合信息的封装 */ @Data public class GroupInfo { @@ -16,7 +16,7 @@ public class GroupInfo { */ private Integer mid; /** - * 套餐id + * 组合id */ private Integer gid; /** @@ -24,7 +24,7 @@ public class GroupInfo { */ private Integer quantity; /** - * 套餐对应编码 + * 组合对应编码 */ private String gcode; /** @@ -72,18 +72,18 @@ public class GroupInfo { */ private String remark; /** - * 套餐创建时间 + * 组合创建时间 */ private Long createTime; /** - * 套餐状态(1启用2禁用3删除) + * 组合状态(1启用2禁用3删除) */ private Integer gstate; /** - * 套餐名称 + * 组合名称 */ private String gname; } diff --git a/src/main/java/com/dreamchaser/depository_manage/entity/MaterialForGroup.java b/src/main/java/com/dreamchaser/depository_manage/entity/MaterialForGroup.java index 8369e9f7..1a5d7eb5 100644 --- a/src/main/java/com/dreamchaser/depository_manage/entity/MaterialForGroup.java +++ b/src/main/java/com/dreamchaser/depository_manage/entity/MaterialForGroup.java @@ -13,7 +13,7 @@ public class MaterialForGroup { */ private Integer mid; /** - * 套餐id + * 组合id */ private Integer gid; /** diff --git a/src/main/java/com/dreamchaser/depository_manage/mapper/GroupMapper.java b/src/main/java/com/dreamchaser/depository_manage/mapper/GroupMapper.java index bd683d8e..000d81de 100644 --- a/src/main/java/com/dreamchaser/depository_manage/mapper/GroupMapper.java +++ b/src/main/java/com/dreamchaser/depository_manage/mapper/GroupMapper.java @@ -14,27 +14,27 @@ public interface GroupMapper { /** - * 用于查找所有套餐(不包含其他) + * 用于查找所有组合(不包含其他) * @return */ List findAllGroupOnly(String gname); /** - * 用于查找所有套餐 + * 用于查找所有组合 * @return */ List findAllGroup(); /** - * 根据套餐id查询对应套餐 - * @param id 套餐id + * 根据组合id查询对应组合 + * @param id 组合id * @return */ GroupInfo findGroupById(Integer id); /** - * 根据主键查询套餐(不包含其他数据) + * 根据主键查询组合(不包含其他数据) * @param id 主键 * @return */ @@ -42,42 +42,42 @@ public interface GroupMapper { /** - * 根据套餐id获取具体套餐信息 - * @param gid 套餐id + * 根据组合id获取具体组合信息 + * @param gid 组合id * @return */ List findGroupInfoByGid(Integer gid); /** - * 根据条件查询套餐(不包含其他数据) + * 根据条件查询组合(不包含其他数据) * @param map 查询条件 * @return */ List findGroupOnlyByCondition(Map map); /** - * 根据条件查询对应套餐信息(视图) + * 根据条件查询对应组合信息(视图) * @param map 查询条件 * @return */ List findGroupByCondition(Map map); /** - * 根据套餐id批量获取套餐信息(不包含其他数据) - * @param list 套餐id列表 + * 根据组合id批量获取组合信息(不包含其他数据) + * @param list 组合id列表 * @return */ List findGroupByGids(List list); /** - * 修改套餐中物料的数据 + * 修改组合中物料的数据 * @param map 修改数据及条件 * @return */ Integer updateMaterialForGroup(Map map); /** - * 修改套餐中物料的数据 + * 修改组合中物料的数据 * @param groupInfo 修改数据及条件 * @return */ @@ -85,28 +85,28 @@ public interface GroupMapper { /** - * 根据条件查询对应套餐数目 + * 根据条件查询对应组合数目 * @param map 查询条件 * @return */ Integer findGroupCountByCondition(Map map); /** - * 获取当前套餐数量 + * 获取当前组合数量 * @return */ Integer findAllGroupOnlyCount(Map map); /** - * 添加一条套餐 + * 添加一条组合 * @param map 具体数据 * @return */ Integer addGroup(Map map); /** - * 添加一条套餐 + * 添加一条组合 * @param groupInfo 具体数据 * @return */ @@ -114,7 +114,7 @@ public interface GroupMapper { /** - * 添加套餐中的物料记录 + * 添加组合中的物料记录 * @param map 对应物料数据 * @return */ @@ -122,24 +122,24 @@ public interface GroupMapper { /** - * 通过编码获取对应的套餐 - * @param code 套餐编码 + * 通过编码获取对应的组合 + * @param code 组合编码 * @return */ Group findGroupByCode(String code); /** - * 修改套餐基本信息 - * @param group 待修改套餐 + * 修改组合基本信息 + * @param group 待修改组合 * @return */ Integer updateGroupOnly(Group group); /** - * 修改套餐基本信息 - * @param map 待修改套餐 + * 修改组合基本信息 + * @param map 待修改组合 * @return */ Integer updateGroupOnly(Map map); @@ -147,14 +147,14 @@ public interface GroupMapper { /** - * 根据主键删除一条套餐中的物料明细 + * 根据主键删除一条组合中的物料明细 * @param id 待删除主键 * @return */ Integer delMaterialForGroupById(Integer id); /** - * 根据主键批量删除套餐中的物料明细 + * 根据主键批量删除组合中的物料明细 * @param list 待删除主键 * @return */ @@ -162,8 +162,8 @@ public interface GroupMapper { /** - * 根据主键删除套餐 - * @param id 待删除套餐主键 + * 根据主键删除组合 + * @param id 待删除组合主键 * @return */ Integer delGroup(Integer id); diff --git a/src/main/java/com/dreamchaser/depository_manage/mapper/GroupMapper.xml b/src/main/java/com/dreamchaser/depository_manage/mapper/GroupMapper.xml index 85526fc0..29dad8ef 100644 --- a/src/main/java/com/dreamchaser/depository_manage/mapper/GroupMapper.xml +++ b/src/main/java/com/dreamchaser/depository_manage/mapper/GroupMapper.xml @@ -25,7 +25,7 @@ - + @@ -34,7 +34,7 @@ - + @@ -47,12 +47,12 @@ id,mid,gid,quantity,mtid,shelfLife,gcode,mname,tname,mcode,version,unit,texture,productionPlace,brand,remark,createTime,gstate,gname - + id,code,createTime,state,gname - + id,mid,gid,quantity @@ -73,6 +73,9 @@ and code = #{code} + + and id = #{gid} + and createTime = #{createTime} @@ -325,7 +328,7 @@ createTime = #{createTime}, - state = #{state} + state = #{state}, gname = #{gname} diff --git a/src/main/java/com/dreamchaser/depository_manage/pojo/GroupInfoP.java b/src/main/java/com/dreamchaser/depository_manage/pojo/GroupInfoP.java index f6e2be56..bfe906b2 100644 --- a/src/main/java/com/dreamchaser/depository_manage/pojo/GroupInfoP.java +++ b/src/main/java/com/dreamchaser/depository_manage/pojo/GroupInfoP.java @@ -8,7 +8,7 @@ import java.util.List; import java.util.Map; /** - * 用于展示套餐信息 + * 用于展示组合信息 */ @Data public class GroupInfoP { @@ -19,12 +19,12 @@ public class GroupInfoP { private Integer id; /** - * 套餐创建时间 + * 组合创建时间 */ private String createTime; /** - * 套餐编码 + * 组合编码 */ private String code; @@ -35,17 +35,17 @@ public class GroupInfoP { /** - * 套餐中拥有的物料总数 + * 组合中拥有的物料总数 */ private Integer quantity; /** - * 套餐状态 + * 组合状态 */ private Integer state; /** - * 套餐名称 + * 组合名称 */ private String gname; diff --git a/src/main/java/com/dreamchaser/depository_manage/service/GroupService.java b/src/main/java/com/dreamchaser/depository_manage/service/GroupService.java index 1284ecd5..c8dbbf60 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/GroupService.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/GroupService.java @@ -10,46 +10,46 @@ import java.util.List; import java.util.Map; /** - * 用于套餐的设置 + * 用于组合的设置 */ public interface GroupService { /** - * 用于查找所有套餐 + * 用于查找所有组合 * @return */ List findAllGroup(); /** - * 根据套餐id查询对应套餐 - * @param id 套餐id + * 根据组合id查询对应组合 + * @param id 组合id * @return */ GroupInfo findGroupById(Integer id); /** - * 根据条件查询对应套餐 + * 根据条件查询对应组合 * @param map 查询条件 * @return */ List findGroupByCondition(Map map); /** - * 根据条件查询对应套餐(按group分组) + * 根据条件查询对应组合(按group分组) * @param map 查询条件 * @return */ List findOnlyGroupByCondition(Map map); /** - * 获取当前套餐数量 + * 获取当前组合数量 * @return */ Integer findAllGroupOnlyCount(Map map); /** - * 根据条件查询对应套餐数目 + * 根据条件查询对应组合数目 * @param map 查询条件 * @return */ @@ -57,7 +57,7 @@ public interface GroupService { /** - * 添加一条套餐 + * 添加一条组合 * @param map 具体数据 * @return */ @@ -65,35 +65,35 @@ public interface GroupService { /** - * 通过编码获取对应的套餐 - * @param code 套餐编码 + * 通过编码获取对应的组合 + * @param code 组合编码 * @return */ Group findGroupByCode(String code); /** - * 给套餐添加物料信息 + * 给组合添加物料信息 * @param map 待添加信息 * @return */ Integer addMaterialForGroup(Map map); /** - * 添加一条套餐 + * 添加一条组合 * @param groupInfo 具体数据 * @return */ Integer addGroup(GroupInfo groupInfo); /** - * 根据主键删除一条套餐记录 - * @param id 待删除套餐主键 + * 根据主键删除一条组合记录 + * @param id 待删除组合主键 * @return */ Integer delGroupById(Integer id); /** - * 根据主键批量删除套餐记录 + * 根据主键批量删除组合记录 * @param ids 主键列表 * @return */ @@ -101,7 +101,7 @@ public interface GroupService { /** - * 修改套餐中对应物料信息 + * 修改组合中对应物料信息 * @param map 修改数据及条件 * @return */ @@ -109,22 +109,22 @@ public interface GroupService { /** - * 通过物料id与套餐id查询对应套餐明细 + * 通过物料id与组合id查询对应组合明细 * @param mid 物料id - * @param gid 套餐id - * @return 套餐明细 + * @param gid 组合id + * @return 组合明细 */ GroupInfo findGroupInfoByMidAndGid(Integer mid,Integer gid); /** - * 根据主键删除一条套餐中的物料明细 + * 根据主键删除一条组合中的物料明细 * @param id 待删除主键 * @return */ Integer delMaterialForGroupById(Integer id); /** - * 根据主键批量删除套餐中的物料明细 + * 根据主键批量删除组合中的物料明细 * @param ids 待删除主键 * @return */ @@ -132,7 +132,7 @@ public interface GroupService { /** - * 根据条件修改套餐状态 + * 根据条件修改组合状态 * @param map 修改条件 * @return */ @@ -140,7 +140,7 @@ public interface GroupService { /** - * 根据条件修改套餐信息 + * 根据条件修改组合信息 * @param map 修改条件 * @return */ @@ -148,14 +148,14 @@ public interface GroupService { /** - * 根据条件获取套餐 + * 根据条件获取组合 * @param map 查询条件 * @return */ List findGroupOnlyByCondition(Map map); /** - * 用于构造套餐树 + * 用于构造组合树 * @param gname * @return */ @@ -173,8 +173,8 @@ public interface GroupService { /** - * 根据套餐编号获取套餐具体信息 - * @param gid 待查讯套餐编号 + * 根据组合编号获取组合具体信息 + * @param gid 待查讯组合编号 * @return */ List findGroupInfoByGid(Integer gid); 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 37bbf6a3..5ad1902a 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 @@ -428,7 +428,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { ApplicationOutRecordMin recordMin = applicationOutMinForCompleteForToday.get(i); countForToday += recordMin.getQuantity(); // 获取当前出库物料 - Material materialById = materialMapper.findMaterialById(recordMin.getMid()); + Inventory materialById = materialMapper.findInventoryByMid(recordMin.getMid()); // 计算当前出库金额 double price_out = materialById.getPrice() * recordMin.getQuantity(); BigDecimal bg = new BigDecimal(price_out / 100); 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 e453120b..6196561b 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 @@ -45,7 +45,7 @@ public class GroupServiceImpl implements GroupService { DepositoryMapper depositoryMapper; /** - * 用于查找所有套餐 + * 用于查找所有组合 * * @return */ @@ -55,9 +55,9 @@ public class GroupServiceImpl implements GroupService { } /** - * 根据套餐id查询对应套餐 + * 根据组合id查询对应组合 * - * @param id 套餐id + * @param id 组合id * @return */ @Override @@ -66,7 +66,7 @@ public class GroupServiceImpl implements GroupService { } /** - * 根据条件查询对应套餐 + * 根据条件查询对应组合 * * @param map 查询条件 * @return @@ -79,33 +79,33 @@ public class GroupServiceImpl implements GroupService { /** - * 根据条件查询对应套餐(按group分组) + * 根据条件查询对应组合(按group分组) * * @param map 查询条件 * @return */ @Override public List findOnlyGroupByCondition(Map map) { - // 获取当前所有套餐 + // 获取当前所有组合 List allGroupOnly = groupMapper.findGroupOnlyByCondition(map); - // 用于查询当前套餐中的物料 + // 用于查询当前组合中的物料 Map paramForGroup = new HashMap<>(); // 最终结果 List list = new ArrayList<>(); for (int i = 0; i < allGroupOnly.size(); i++) { - // 获取套餐详情 + // 获取组合详情 Group group = allGroupOnly.get(i); paramForGroup.put("gid", group.getId()); - // 获取当前套餐对应的详情 + // 获取当前组合对应的详情 List groupByCondition = groupMapper.findGroupByCondition(paramForGroup); // 构造输出结果 GroupInfoP groupInfoP = new GroupInfoP(group); - // 设置当前套餐中的数量 + // 设置当前组合中的数量 Integer quantity = 0; // 用于存储物料名称与物料id @@ -122,7 +122,7 @@ public class GroupServiceImpl implements GroupService { } /** - * 获取当前套餐数量 + * 获取当前组合数量 * * @return */ @@ -132,7 +132,7 @@ public class GroupServiceImpl implements GroupService { } /** - * 根据条件查询对应套餐数目 + * 根据条件查询对应组合数目 * * @param map 查询条件 * @return @@ -147,7 +147,7 @@ public class GroupServiceImpl implements GroupService { } /** - * 添加一条套餐 + * 添加一条组合 * * @param map 具体数据 * @return @@ -159,12 +159,12 @@ public class GroupServiceImpl implements GroupService { // 设置当前时间 insertForGroup.put("createTime", System.currentTimeMillis()); - // 获取当前套餐数量 + // 获取当前组合数量 Integer groupCount = groupMapper.findAllGroupOnlyCount(new HashMap<>()); if (groupCount == null) { groupCount = 0; } - // 构造套餐编码 + // 构造组合编码 String code = createCode(groupCount); insertForGroup.put("code", code); insertForGroup.put("state", 1); @@ -172,16 +172,16 @@ public class GroupServiceImpl implements GroupService { // 插入到数据库 groupMapper.addGroup(insertForGroup); - //获取插入的套餐id + //获取插入的组合id Integer gid = ObjectFormatUtil.toInteger(insertForGroup.get("id")); - // 获取套餐中的物料id + // 获取组合中的物料id List mids = (List) map.get("mids"); - // 获取套餐中物料的数量 + // 获取组合中物料的数量 List quantitys = (List) map.get("quantitys"); - // 用于添加套餐中的物料信息 + // 用于添加组合中的物料信息 Map materialForGroupMap = new HashMap<>(); materialForGroupMap.put("gid", gid); @@ -190,7 +190,7 @@ public class GroupServiceImpl implements GroupService { for (int i = 0; i < mids.size(); i++) { // 获取物料id Object mid = mids.get(i); - // 获取套餐中当前物料对应的数量 + // 获取组合中当前物料对应的数量 Object quantity = quantitys.get(i); materialForGroupMap.put("mid", mid); @@ -204,9 +204,9 @@ public class GroupServiceImpl implements GroupService { } /** - * 通过编码获取对应的套餐 + * 通过编码获取对应的组合 * - * @param code 套餐编码 + * @param code 组合编码 * @return */ @Override @@ -216,23 +216,23 @@ public class GroupServiceImpl implements GroupService { /** - * 给套餐添加物料信息 + * 给组合添加物料信息 * * @param map 待添加信息 * @return */ @Override public Integer addMaterialForGroup(Map map) { - //获取插入的套餐id + //获取插入的组合id Integer gid = ObjectFormatUtil.toInteger(map.get("gid")); - // 获取套餐中的物料id + // 获取组合中的物料id List mids = (List) map.get("mids"); - // 获取套餐中物料的数量 + // 获取组合中物料的数量 List quantitys = (List) map.get("quantitys"); - // 用于添加套餐中的物料信息 + // 用于添加组合中的物料信息 Map materialForGroupMap = new HashMap<>(); materialForGroupMap.put("gid", gid); @@ -241,7 +241,7 @@ public class GroupServiceImpl implements GroupService { for (int i = 0; i < mids.size(); i++) { // 获取物料id Object mid = mids.get(i); - // 获取套餐中当前物料对应的数量 + // 获取组合中当前物料对应的数量 Object quantity = quantitys.get(i); materialForGroupMap.put("mid", mid); @@ -255,7 +255,7 @@ public class GroupServiceImpl implements GroupService { } /** - * 添加一条套餐 + * 添加一条组合 * * @param groupInfo 具体数据 * @return @@ -267,9 +267,9 @@ public class GroupServiceImpl implements GroupService { /** - * 根据主键删除一条套餐记录 + * 根据主键删除一条组合记录 * - * @param id 待删除套餐主键 + * @param id 待删除组合主键 * @return */ @Transactional @@ -291,7 +291,7 @@ public class GroupServiceImpl implements GroupService { /** - * 根据主键批量删除套餐记录 + * 根据主键批量删除组合记录 * * @param ids 主键列表 * @return @@ -302,14 +302,14 @@ public class GroupServiceImpl implements GroupService { } /** - * 修改套餐中对应物料信息 + * 修改组合中对应物料信息 * * @param map 修改数据及条件 * @return */ @Override public Integer updateMaterialForGroup(Map map) { - // 获取当前要修改的套餐明细id + // 获取当前要修改的组合明细id Integer id = ObjectFormatUtil.toInteger(map.get("id")); // 获取当前要修改的物料明细数量 Integer quantity = ObjectFormatUtil.toInteger(map.get("quantity")); @@ -317,7 +317,7 @@ public class GroupServiceImpl implements GroupService { // 如果要修改的数量为0则删除该明细 return groupMapper.delMaterialForGroupById(id); } else { - // 根据id获取当前套餐明细 + // 根据id获取当前组合明细 GroupInfo groupById = groupMapper.findGroupById(id); groupById.setQuantity(quantity); return groupMapper.updateMaterialForGroup(groupById); @@ -326,11 +326,11 @@ public class GroupServiceImpl implements GroupService { /** - * 通过物料id与套餐id查询对应套餐明细 + * 通过物料id与组合id查询对应组合明细 * * @param mid 物料id - * @param gid 套餐id - * @return 套餐明细 + * @param gid 组合id + * @return 组合明细 */ @Override public GroupInfo findGroupInfoByMidAndGid(Integer mid, Integer gid) { @@ -345,7 +345,7 @@ public class GroupServiceImpl implements GroupService { } /** - * 根据主键删除一条套餐中的物料明细 + * 根据主键删除一条组合中的物料明细 * * @param id 待删除主键 * @return @@ -356,7 +356,7 @@ public class GroupServiceImpl implements GroupService { } /** - * 根据主键批量删除套餐中的物料明细 + * 根据主键批量删除组合中的物料明细 * * @param ids 待删除主键 * @return @@ -367,16 +367,16 @@ public class GroupServiceImpl implements GroupService { } /** - * 根据条件修改套餐信息 + * 根据条件修改组合信息 * * @param map 修改条件 * @return */ @Override public Integer updateGroupState(Map map) { - // 获取待修改套餐id + // 获取待修改组合id Integer id = ObjectFormatUtil.toInteger(map.get("id")); - // 根据主键获取对应套餐 + // 根据主键获取对应组合 Group group = groupMapper.findGroupOnlyById(id); Integer state = 2; if (map.containsKey("state")) { @@ -388,7 +388,7 @@ public class GroupServiceImpl implements GroupService { /** - * 根据条件修改套餐信息 + * 根据条件修改组合信息 * * @param map 修改条件 * @return @@ -399,7 +399,7 @@ public class GroupServiceImpl implements GroupService { } /** - * 根据条件获取套餐 + * 根据条件获取组合 * * @param map 查询条件 * @return @@ -411,7 +411,7 @@ public class GroupServiceImpl implements GroupService { /** - * 用于构造套餐树 + * 用于构造组合树 * * @param gname * @return @@ -420,7 +420,7 @@ public class GroupServiceImpl implements GroupService { // 定义结果集 List list = new ArrayList<>(); - // 获取所有使用中的套餐 + // 获取所有使用中的组合 List allGroupOnly = groupMapper.findAllGroupOnly(gname); // 获取当前总数 @@ -443,7 +443,7 @@ public class GroupServiceImpl implements GroupService { CompletionService completionService = new ExecutorCompletionService(exs); - // 定义套餐id列表 + // 定义组合id列表 List groupIdList = new ArrayList<>(); @@ -500,12 +500,12 @@ public class GroupServiceImpl implements GroupService { Integer result = 0; Object parentId = null; - // 获取当前要出库的套餐数量 + // 获取当前要出库的组合数量 Integer quantityForGroup = ObjectFormatUtil.toInteger(map.get("quantity")); - // 获取要出库的套餐 + // 获取要出库的组合 Integer gid = ObjectFormatUtil.toInteger(map.get("gid")); - // 获取要出库套餐的具体信息 + // 获取要出库组合的具体信息 List groupInfoByGid = groupMapper.findGroupInfoByGid(gid); // 用于统计出库物料总数 Integer quantityForTotal = 0; @@ -537,16 +537,16 @@ public class GroupServiceImpl implements GroupService { result += insertApplicationOutMinRecord(userToken, code, parentId, gid, quantityForGroup); - if (params.size() > 0) { + if (params != null && params.size() > 0) { // 如果提交的不是单个 // 循环其他 for (String temp : params) { - // 获取当前要出库的套餐数量 + // 获取当前要出库的组合数量 quantityForGroup = ObjectFormatUtil.toInteger(map.get("quantity" + temp)); - // 获取要出库的套餐 + // 获取要出库的组合 gid = ObjectFormatUtil.toInteger(map.get("gid" + temp)); - // 获取当前要出库套餐的具体信息 + // 获取当前要出库组合的具体信息 groupInfoByGid = groupMapper.findGroupInfoByGid(gid); for (GroupInfo groupInfo : groupInfoByGid) { // 获取具体信息 @@ -571,8 +571,8 @@ public class GroupServiceImpl implements GroupService { * @param userToken 申请人 * @param code 出库单号 * @param parentId 主单号 - * @param gid 套餐id - * @param quantityForGroup 出库的套餐数 + * @param gid 组合id + * @param quantityForGroup 出库的组合数 * @return */ @Transactional(rollbackFor = Exception.class) @@ -583,13 +583,13 @@ public class GroupServiceImpl implements GroupService { // 获取当前部门仓库 List depositoryByAdminorg = depositoryMapper.findDepositoryByAdminorg(userToken.getMaindeparment().toString()); - // 获取要出库套餐的具体信息 + // 获取要出库组合的具体信息 List groupInfoByGid = groupMapper.findGroupInfoByGid(gid); for (GroupInfo groupInfo : groupInfoByGid) { // 用于存储出库数据 Map paramForOutMin = new HashMap<>(); paramForOutMin.put("parentId", parentId); - // 套餐中的具体信息 + // 组合中的具体信息 // 实际要出库的物料库存数量 Integer quantity = groupInfo.getQuantity() * quantityForGroup; // 实际出库的仓库编号 @@ -629,9 +629,9 @@ public class GroupServiceImpl implements GroupService { } /** - * 根据套餐编号获取套餐具体信息 + * 根据组合编号获取组合具体信息 * - * @param gid 待查讯套餐编号 + * @param gid 待查讯组合编号 * @return */ @Override @@ -642,7 +642,7 @@ public class GroupServiceImpl implements GroupService { // 用于执行线程任务 class Task implements Callable { - // 套餐id列表 + // 组合id列表 List groupIdList; @@ -654,7 +654,7 @@ public class GroupServiceImpl implements GroupService { @Override public Object call() throws Exception { /** - * 获取当前套餐id对应的套餐 + * 获取当前组合id对应的组合 */ List groupByGids = groupMapper.findGroupByGids(groupIdList); @@ -671,7 +671,7 @@ public class GroupServiceImpl implements GroupService { List list = new ArrayList<>(); for (int i = 0; i < groupByGids.size(); i++) { - // 获取套餐具体信息 + // 获取组合具体信息 Group group = groupByGids.get(i); // 开启线程 Future submit = completionService.submit(new TaskForGroupInfo(group)); @@ -701,10 +701,10 @@ public class GroupServiceImpl implements GroupService { @Override public Object call() throws Exception { - // 用于获取当前套餐的具体信息 + // 用于获取当前组合的具体信息 Map paramForGroup = new HashMap<>(); paramForGroup.put("gid", group.getId()); - // 获取当前套餐的具体信息 + // 获取当前组合的具体信息 List groupByCondition = groupMapper.findGroupByCondition(paramForGroup); // 定义子类结果集 List resultForChildren = new ArrayList<>(); @@ -721,7 +721,7 @@ public class GroupServiceImpl implements GroupService { /** * 构造树形组件数据模板 * - * @param g 套餐 + * @param g 组合 * @param children 子类 * @return */ @@ -741,7 +741,7 @@ public class GroupServiceImpl implements GroupService { /** * 构造树形组件的子组件模板 * - * @param g 套餐详细信息 + * @param g 组合详细信息 * @return */ public Map InitTreeMenus(GroupInfo g) { @@ -757,9 +757,9 @@ public class GroupServiceImpl implements GroupService { /** - * 用于创建套餐编码 + * 用于创建组合编码 * - * @param num 第几个套餐 + * @param num 第几个组合 * @return */ public String createCode(Integer num) { diff --git a/src/main/resources/static/js/application-out/application-out.js b/src/main/resources/static/js/application-out/application-out.js index 8d9addbb..93b46b89 100644 --- a/src/main/resources/static/js/application-out/application-out.js +++ b/src/main/resources/static/js/application-out/application-out.js @@ -7,11 +7,11 @@ function addItem(obj) { function deleteItem(obj) { } -// 用于添加标签(用于套餐) +// 用于添加标签(用于组合) function addItemForGroup(obj) { } -// 用于删除标签(用于套餐) +// 用于删除标签(用于组合) function deleteItemForGroup(obj) { } @@ -19,7 +19,7 @@ function deleteItemForGroup(obj) { function selectCode(obj) { } -// 用于编码查询(用于套餐) +// 用于编码查询(用于组合) function selectCodeForGroup(obj) { } @@ -27,7 +27,7 @@ function selectCodeForGroup(obj) { function selectMaterial(obj) { } -// 用于点击搜索按钮(套餐) +// 用于点击搜索按钮(组合) function selectGroup(obj) { } @@ -37,7 +37,7 @@ function selectMaterialByName(obj) { } -// 用于套餐名称查询 +// 用于组合名称查询 function selectGroupByName() { } @@ -50,7 +50,7 @@ function MaterialQuantityIsTrue() { function scanBarCode() { } -// 用于重新渲染页面(套餐) +// 用于重新渲染页面(组合) function CoverpageForGroup() { } @@ -62,7 +62,7 @@ function scanCodeByOut(obj) { // 用于暂存卡片个数 var params = []; -// 用于暂存卡片个数(套餐) +// 用于暂存卡片个数(组合) var params2 = []; // 用于卡片编号 var NewIdNumber = 1; @@ -243,7 +243,7 @@ layui.use(['form', 'step', 'layer', 'jquery', 'element'], function () { $("#" + parentId).after(materialItem); }; - // 实现卡片添加(套餐) + // 实现卡片添加(组合) addItemForGroup = function (obj) { var parentId = obj.parentNode.id; NewIdNumber = NewIdNumber + 1; @@ -253,10 +253,10 @@ layui.use(['form', 'step', 'layer', 'jquery', 'element'], function () {
- +
- @@ -269,10 +269,10 @@ layui.use(['form', 'step', 'layer', 'jquery', 'element'], function () {
- +
- @@ -282,10 +282,10 @@ layui.use(['form', 'step', 'layer', 'jquery', 'element'], function () {
- +
+ required lay-verify="number" placeholder="请填写组合数量"/>
  • 物料出库
  • -
  • 套餐出库
  • +
  • 组合出库
@@ -172,10 +172,10 @@
- +
- @@ -188,11 +188,11 @@
- +
- +
+ required lay-verify="number" placeholder="请填写组合数量"/>
@@ -270,11 +270,11 @@ function deleteItem(obj) { } - // 用于添加标签(用于套餐) + // 用于添加标签(用于组合) function addItemForGroup(obj) { } - // 用于删除标签(用于套餐) + // 用于删除标签(用于组合) function deleteItemForGroup(obj) { } @@ -282,7 +282,7 @@ function selectCode(obj) { } - // 用于编码查询(用于套餐) + // 用于编码查询(用于组合) function selectCodeForGroup(obj) { } @@ -290,7 +290,7 @@ function selectMaterial(obj) { } - // 用于点击搜索按钮(套餐) + // 用于点击搜索按钮(组合) function selectGroup(obj) { } @@ -300,7 +300,7 @@ } - // 用于套餐名称查询 + // 用于组合名称查询 function selectGroupByName() { } @@ -310,7 +310,7 @@ } - // 用于判断当前套餐数量是否合适 + // 用于判断当前组合数量是否合适 function groupQuantityIsTrue() { } @@ -318,7 +318,7 @@ function scanBarCode() { } - // 用于重新渲染页面(套餐) + // 用于重新渲染页面(组合) function CoverpageForGroup() { } @@ -330,7 +330,7 @@ // 用于暂存卡片个数 var params = []; - // 用于暂存卡片个数(套餐) + // 用于暂存卡片个数(组合) var params2 = []; // 用于卡片编号 var NewIdNumber = 1; @@ -424,7 +424,7 @@ return false; }); - // 提交(套餐出库) + // 提交(组合出库) form.on('submit(formStep2)', function (data) { data = data.field; data.params = params2; @@ -562,7 +562,7 @@ $("#" + parentId).after(materialItem); }; - // 实现卡片添加(套餐) + // 实现卡片添加(组合) addItemForGroup = function (obj) { var parentId = obj.parentNode.id; NewIdNumber = NewIdNumber + 1; @@ -572,10 +572,10 @@
- +
- @@ -588,10 +588,10 @@
- +
- @@ -601,10 +601,10 @@
- +
+ required lay-verify="number" onblur="groupQuantityIsTrue(this)" placeholder="请填写组合数量"/>
@@ -626,7 +626,7 @@ $("#" + parentId).after(materialItem); }; - // 用于重新渲染页面(套餐) + // 用于重新渲染页面(组合) CoverpageForGroup = function (num, obj) { // 获取待添加父类 NewIdNumber = num; @@ -687,7 +687,7 @@ // 获取当前高度 var height = parseInt(($("#stepForm2").css('height')).split("px")[0]); if (NewIdNumber !== "") { - params.push(NewIdNumber) + params2.push(NewIdNumber) } $("#stepForm2").css("height", height + 183 + 'px'); $("#" + "addItemForGroup" + NewIdNumber).before(materialItem); @@ -708,7 +708,7 @@ reparent.removeChild(parent); }; - // 实现卡片删除(套餐) + // 实现卡片删除(组合) deleteItemForGroup = function (obj) { // 获取父节点 var parent = obj.parentNode; @@ -718,7 +718,7 @@ var reparent = parent.parentNode; var height = parseInt(($("#stepForm2").css('height')).split("px")[0]); $("#stepForm2").css("height", height - 289 + 'px'); - params2 = remove(params, parentId); + params2 = remove(params2, parentId); reparent.removeChild(parent); }; @@ -805,7 +805,7 @@ }); }; - // 用于实现通过编码查询套餐 + // 用于实现通过编码查询组合 selectCodeForGroup = function (obj) { // 输入code var code = obj.value; @@ -813,7 +813,7 @@ var parent = obj.parentNode.parentNode.parentNode.parentNode; var pid = Number(parent.id.split("cardItemForGroup")[1]); - // 获取当前卡片中的套餐名称等 + // 获取当前卡片中的组合名称等 let gnameParent = parent.childNodes[5].childNodes[3]; // gid @@ -952,7 +952,7 @@ }); }; - // 用于实现点击搜索按钮(套餐) + // 用于实现点击搜索按钮(组合) selectGroup = function(obj){ var parent = obj.parentNode.parentNode.parentNode.parentNode; var parentId = parent.id; @@ -960,10 +960,10 @@ // 获取对应元素 var pid = Number(parent.id.split("cardItemForGroup")[1]); - // 获取当前卡片中的套餐名称等 + // 获取当前卡片中的组合名称等 let gnameParent = parent.childNodes[5].childNodes[3]; - // 套餐编码 + // 组合编码 let gcodeItem = parent.childNodes[7].childNodes[3].childNodes[1].childNodes[1]; @@ -1043,17 +1043,17 @@ }) }; - // 用于实现套餐名称搜索 + // 用于实现组合名称搜索 selectGroupByName = function(obj){ let gname = obj.value; var parent = obj.parentNode.parentNode.parentNode.parentNode; // 获取对应元素 var pid = Number(parent.id.split("cardItemForGroup")[1]); - // 获取当前卡片中的套餐名称等 + // 获取当前卡片中的组合名称等 let gnameParent = parent.childNodes[5].childNodes[3]; - // 套餐编码 + // 组合编码 let gcodeItem = parent.childNodes[7].childNodes[3].childNodes[1].childNodes[1]; @@ -1073,7 +1073,7 @@ contentType: "application/json;charset=utf-8", success: function (d) { if(d.count === -1){ - // 如果当前套餐名称的数量不止一个 + // 如果当前组合名称的数量不止一个 layer.msg("请点击右侧搜索确定物品", { icon: 0, time: 1500 @@ -1089,8 +1089,8 @@ } }); }else if(d.count === 0){ - // 如果当前套餐名称不存在 - layer.msg("没有该套餐,请确认输入是否正确", { + // 如果当前组合名称不存在 + layer.msg("没有该组合,请确认输入是否正确", { icon: 0, time: 1500 },function () { @@ -1353,12 +1353,12 @@ } }; - //用于判断当前套餐数量是否合适 + //用于判断当前组合数量是否合适 groupQuantityIsTrue = function (obj) { var id = obj.id.split("quantityForGroup")[1]; var gid = $("#gid" + id).val(); // 获取到当前输入的物料编码 if (gid === "" || gid === undefined || gid === null) { - layer.msg("请输入正确的套餐!", {icon: 0, time: 500}, function () { + layer.msg("请输入正确的组合!", {icon: 0, time: 500}, function () { $("#quantityForGroup" + id).val("") }); } else { @@ -1377,7 +1377,7 @@ var flag = res.data; if (!flag) { // 如果当前数目不合适 - layer.msg("当前套餐中有物料库存数量不足", {icon: 0, time: 500}, function () { + layer.msg("当前组合中有物料库存数量不足", {icon: 0, time: 500}, function () { $("#quantityForGroup" + id).val(""); }); diff --git a/src/main/resources/templates/pages/application/application_multi.html b/src/main/resources/templates/pages/application/application_multi.html index 6a6eb20d..40362284 100644 --- a/src/main/resources/templates/pages/application/application_multi.html +++ b/src/main/resources/templates/pages/application/application_multi.html @@ -190,10 +190,25 @@ success: function (d) { layer.close(this.layerIndex); if (d.status >= 300) { - layer.msg(d.statusInfo.message);//失败的表情 + layer.msg(d.statusInfo.detail,{ + icon:0, + time:1000 + },function () { + obj.update({quantity:1}) + });//失败的表情 return; }else if(d.status === 1234){ - layer.msg(d.data) + layer.msg(d.data,{ + icon:0, + time:1000 + },function () { + table.reload('currentTableId', { + url: '/depositoryRecord/applicant_multi_create', + page: { + curr: 1 + }, + }); + }); return } else { @@ -201,9 +216,14 @@ icon: 6,//成功的表情 time: 1000 }, //1秒关闭(如果不配置,默认是3秒) - function(){ + function() { //do something - window.location="/application_multi" + table.reload('currentTableId', { + url: '/depositoryRecord/applicant_multi_create', + page: { + curr: 1 + }, + }); }); } } @@ -257,8 +277,12 @@ success: function (d) { layer.close(this.layerIndex); if (d.status >= 300) { - layer.msg(d.statusInfo.message);//失败的表情 - return; + layer.msg(d.statusInfo.detail,{ + icon:0, + time:1000 + },function () { + obj.update({quantity:1}); + });//失败的表情 } else { layer.msg("申请成功!", { icon: 6,//成功的表情 diff --git a/src/main/resources/templates/pages/chart/chart-out_back.html b/src/main/resources/templates/pages/chart/chart-out_back.html index f9ec0a14..c5d86502 100644 --- a/src/main/resources/templates/pages/chart/chart-out_back.html +++ b/src/main/resources/templates/pages/chart/chart-out_back.html @@ -278,9 +278,6 @@ xAxis: {type: 'category'}, yAxis: {}, series: [ - {type: 'bar'}, - {type: 'bar'}, - {type: 'bar'} ] }; diff --git a/src/main/resources/templates/pages/chart/chart-stock_back.html b/src/main/resources/templates/pages/chart/chart-stock_back.html index 2a0ba065..ab70b59c 100644 --- a/src/main/resources/templates/pages/chart/chart-stock_back.html +++ b/src/main/resources/templates/pages/chart/chart-stock_back.html @@ -207,8 +207,6 @@ xAxis: {type: 'category'}, yAxis: {}, series: [ - {type: 'bar'}, - {type: 'bar'} ] }; @@ -249,7 +247,7 @@ }, success: function (result) { layer.close(this.layerIndex); - if (result.code == 0) { + if (result.code === 0) { echartsRecords.setOption(optionRecords); echartsPies.setOption(optionPies); echartsDataset.setOption(optionDataset); diff --git a/src/main/resources/templates/pages/group/applicationOutForGroup.html b/src/main/resources/templates/pages/group/applicationOutForGroup.html index d74a48d1..e8912c64 100644 --- a/src/main/resources/templates/pages/group/applicationOutForGroup.html +++ b/src/main/resources/templates/pages/group/applicationOutForGroup.html @@ -1,5 +1,5 @@ - + 分步表单 @@ -50,10 +50,37 @@
+