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 6d9ab6f3..70ff3367 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java @@ -54,14 +54,14 @@ public class DepositoryRecordController { public RestResponse findDepositoryInAndOutRecordPByCondition(@RequestParam Map map, HttpServletRequest request) { UserByPort userToken = (UserByPort) request.getAttribute("userToken"); map.put("applicantId", userToken.getId()); - List applicationInRecordPlist = depositoryRecordService.findApplicationInRecordPByCondition(map, request); + List applicationInRecordPlist = depositoryRecordService.findApplicationInRecordPByCondition(map, userToken); Integer InCount = depositoryRecordService.findApplicationInRecordPCountByCondition(map); for (ApplicationInRecordP applicationInRecordP : applicationInRecordPlist) { if (applicationInRecordP.getPrice() != null) { applicationInRecordP.setPrice(applicationInRecordP.getPrice() / 100); } } - List applicationOutRecordPlist = depositoryRecordService.findApplicationOutRecordPByCondition(map, request); + List applicationOutRecordPlist = depositoryRecordService.findApplicationOutRecordPByCondition(map, userToken); Integer OutCount = depositoryRecordService.findApplicationOutRecordPCountByCondition(map); for (ApplicationOutRecordP recordP : applicationOutRecordPlist) { if (recordP.getPrice() != null) { @@ -76,15 +76,27 @@ public class DepositoryRecordController { return new RestResponse(result, result.size(), 200); } - @GetMapping("/myTask") - public RestResponse myTask(@RequestParam Map map, HttpServletRequest request) { + @GetMapping("/myTaskOut") + public RestResponse myTaskOut(@RequestParam Map map, HttpServletRequest request) { UserByPort userToken = (UserByPort) request.getAttribute("userToken"); map.put("userId", userToken.getId()); - List myTask = depositoryRecordService.findMyTask(map, request); + List myTask = depositoryRecordService.findMyTaskOut(map, userToken); + return new RestResponse(myTask , depositoryRecordService.findMyTaskOutCount(map), 200); } + + @GetMapping("/myTaskIn") + public RestResponse myTaskIn(@RequestParam Map map, HttpServletRequest request) { + UserByPort userToken = (UserByPort) request.getAttribute("userToken"); + map.put("userId", userToken.getId()); + List myTask = depositoryRecordService.findMyTaskIn(map, userToken); + + return new RestResponse(myTask + , depositoryRecordService.findMyTaskInCount(map), 200); + } + // 查找当前用户所有的扫码出库订单 @GetMapping("/myTashForScanQrCode") public RestResponse findAllMinRecordByUser(@RequestParam Map map, HttpServletRequest request) { @@ -789,7 +801,7 @@ public class DepositoryRecordController { return CrudUtil.postHandle(1, 1); } - // 审核 + // 出库审核 @PutMapping("/review") public RestResponse review(@RequestBody Map map, HttpServletRequest request) { UserByPort userToken = (UserByPort) request.getAttribute("userToken"); @@ -803,6 +815,19 @@ public class DepositoryRecordController { } } + @PutMapping("/reviewIn") + public RestResponse reviewIn(@RequestBody Map map, HttpServletRequest request) { + UserByPort userToken = (UserByPort) request.getAttribute("userToken"); + String header = request.getHeader("user-agent"); + String crypt = Md5.crypt(header); + Integer review = depositoryRecordService.reviewIn(map, userToken.getId(), userToken, crypt); + if (review != -1) { + return CrudUtil.postHandle(review, 1); + } else { + return new RestResponse("", 666, new StatusInfo("出库失败", "当前存储位库存不足,请重新选择")); + } + } + // 库存转移 @PutMapping("/transfer") public RestResponse transfer(@RequestBody Map map, HttpServletRequest request) { 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 9f9bb916..220ac5fb 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java @@ -21,7 +21,6 @@ import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.*; @@ -299,7 +298,7 @@ public class PageController { } Map map = new HashMap(2) { { - put("beigin", 0); + put("begin", 0); put("size", 6); } }; @@ -317,10 +316,9 @@ public class PageController { instance.add(Calendar.DATE, -1); days.add(formatter.format(instance.getTime())); Map parm = new HashMap<>(); - map.put("statr", days.get(1)); - map.put("end", days.get(0)); -// Integer warehouseRecord = depositoryRecordService.findWarehouseRecord(parm); - Integer warehouseRecord = 0; + map.put("startDate", days.get(1)); + map.put("endDate", days.get(0)); + int warehouseRecord = 0; Map param = new HashMap<>(); Integer applicationOut = depositoryRecordService.findApplicationOutRecordPCountByCondition(param); Integer applicationIn = depositoryRecordService.findApplicationInRecordPCountByCondition(param); @@ -338,16 +336,22 @@ public class PageController { List list = new ArrayList<>(); // 查询出库任务 - List myTask = depositoryRecordService.findMyTask(paramForTask, request); + List myTaskOut = depositoryRecordService.findMyTaskOut(paramForTask, userToken); - for (int i = 0; i < myTask.size(); i++) { - SimpleTaskP simpleTaskP = new SimpleTaskP(myTask.get(i)); + for (SimpleApplicationOutOrInRecordP simpleApplicationOutOrInRecordP : myTaskOut) { + SimpleTaskP simpleTaskP = new SimpleTaskP(simpleApplicationOutOrInRecordP); list.add(simpleTaskP); } // 查询盘点任务 List task = stockTakingService.findMyTask(paramForTask, request); - for (int i = 0; i < task.size(); i++) { - SimpleTaskP simpleTaskP = new SimpleTaskP(task.get(i)); + for (SimpleStockTakingP simpleStockTakingP : task) { + SimpleTaskP simpleTaskP = new SimpleTaskP(simpleStockTakingP); + list.add(simpleTaskP); + } + // 查询入库任务 + List myTaskIn = depositoryRecordService.findMyTaskIn(paramForTask, userToken); + for (SimpleApplicationOutOrInRecordP simpleApplicationOutOrInRecordP : myTaskIn) { + SimpleTaskP simpleTaskP = new SimpleTaskP(simpleApplicationOutOrInRecordP); list.add(simpleTaskP); } @@ -1503,6 +1507,74 @@ public class PageController { return mv; } + + @GetMapping("/application_in_review") + public ModelAndView application_in_review(Integer id, HttpServletRequest request) { + UserByPort userToken = (UserByPort) request.getAttribute("userToken"); + ModelAndView mv = new ModelAndView(); + mv.setViewName("pages/application/form-step-look_in_review"); + if (id != null) { + ApplicationInRecordP applicationInRecordPById = depositoryRecordService.findApplicationInRecordPById(id); + + String airapproverTime = applicationInRecordPById.getAirapproverTime(); + if(airapproverTime != null && !"".equals(airapproverTime)){ + airapproverTime = DateUtil.TimeStampToDateTime(Long.valueOf(airapproverTime)); + applicationInRecordPById.setAirapproverTime(airapproverTime); + } + + // 获取入库库位id + Integer placeId = applicationInRecordPById.getPlaceId(); + String placeCode = "默认库位"; + if (Integer.compare(placeId, 0) != 0) { + Place placeById = placeService.findPlaceById(placeId); + placeCode = placeById.getCode(); + } + Integer flagForGroup = applicationInRecordPById.getFlagForGroup(); + if(Integer.compare(applicationInRecordPById.getAirapproverPass(),4) != 0){ + String[] airapproverId = applicationInRecordPById.getAirapproverId().split(","); + StringBuilder airapproverName = new StringBuilder(); + for (String approverId:airapproverId + ) { + if(!"".equals(approverId)){ + UserByPort userByPort = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(approverId), userToken); + airapproverName.append(userByPort.getName()).append(","); + } + } + applicationInRecordPById.setAirapproverName(airapproverName.toString()); + } + mv.addObject("record", applicationInRecordPById); + mv.addObject("placeCode", placeCode); + if (Integer.compare(flagForGroup, 2) != 0) { + // 如果不是组合 + UserByPort userByPort = LinkInterfaceUtil.FindUserById(applicationInRecordPById.getApplicantId(), userToken); + applicationInRecordPById.setApplicantName(userByPort.getName()); + applicationInRecordPById.setApplicantTime(DateUtil.TimeStampToDateTime(Long.valueOf(applicationInRecordPById.getApplicantTime()))); + if (applicationInRecordPById.getPrice() != null) { + applicationInRecordPById.setPrice(applicationInRecordPById.getPrice() / 100); + } else { + applicationInRecordPById.setPrice(0.0); + } + + } else { + // 如果是组合 + + // 获取组合数据 + Group group = groupService.findGroupOnlyById(applicationInRecordPById.getMid()); + // 获取组合详情数据 + List groupInfoList = groupService.findGroupInfoByGid(applicationInRecordPById.getMid()); + mv.addObject("group", group); + mv.addObject("groupInfoList", groupInfoList); + mv.setViewName("pages/application/form-step-look_group_review"); + } + } else { + throw new MyException("缺少必要参数!"); + } + return mv; + } + + + + @GetMapping("/form_step_lookByminRecordOut") public ModelAndView form_step_lookByminRecordOut(Integer id, HttpServletRequest request) { UserByPort userToken = (UserByPort) request.getAttribute("userToken"); diff --git a/src/main/java/com/dreamchaser/depository_manage/entity/SimpleApplicationInRecord.java b/src/main/java/com/dreamchaser/depository_manage/entity/SimpleApplicationInRecord.java new file mode 100644 index 00000000..c4c3c93a --- /dev/null +++ b/src/main/java/com/dreamchaser/depository_manage/entity/SimpleApplicationInRecord.java @@ -0,0 +1,22 @@ +package com.dreamchaser.depository_manage.entity; + +import lombok.Data; + +/** + * 简单仓库入库信息,为了前端展示需要,尽量减少字段的传输以提高效率 + * @author Dreamchaser + */ +@Data +public class SimpleApplicationInRecord { + /** 记录id */ + private Integer id; + + /** 申请人id */ + private Integer applicantId; + + /** 申请备注 */ + private String applyRemark; + + /** 申请时间 */ + private Long applicantTime; +} 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 ddc49aac..79a70916 100644 --- a/src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.java +++ b/src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.java @@ -122,12 +122,20 @@ public interface DepositoryRecordMapper { List findMyTask(Map map); /** - * 根据条件查询自己的任务(根据isDone来决定查询已完成或者未完成的任务),同时支持分页查询(需要begin和size参数) + * 根据条件查询自己的出库审批任务(根据isDone来决定查询已完成或者未完成的任务),同时支持分页查询(需要begin和size参数) * @param map 查询参数 * @return 我的任务 */ List findMyTaskOut(Map map); + + /** + * 根据条件查询自己的入库审批任务(根据isDone来决定查询已完成或者未完成的任务),同时支持分页查询(需要begin和size参数) + * @param map 查询参数 + * @return 我的任务 + */ + List findMyTaskIn(Map map); + /** * 根据id删除仓库记录 * @return 受影响的行数 @@ -160,6 +168,13 @@ public interface DepositoryRecordMapper { */ Integer findMyTaskOutCount(Map map); + + /** + * 返回该我的任务数(完成或者未完成) + * @return 条数 + */ + Integer findMyTaskInCount(Map map); + /** * 根据查询条件返回该表的总条数 * @param map 条件参数 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 884e06b7..1574f941 100644 --- a/src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml +++ b/src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml @@ -21,6 +21,14 @@ + + + + + + + @@ -130,6 +138,10 @@ aorid,applicantId, applyRemark, applicantTime,aorcode + + + airid,applicant_id,applicant_time,applyRemark + dr.id, dr.application_id, dr.mname, dr.depository_id, dr.type, dr.quantity, dr.price, dr.state, @@ -309,6 +321,38 @@ + + + + + + + + + + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + + +
+ 组合明细 +
+
+ +
+
+

+
+
+ +
+
+ +
+
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/pages/application/form-step-look_in_review.html b/src/main/resources/templates/pages/application/form-step-look_in_review.html new file mode 100644 index 00000000..b713b39f --- /dev/null +++ b/src/main/resources/templates/pages/application/form-step-look_in_review.html @@ -0,0 +1,182 @@ + + + + + 分步表单 + + + + + + + + +
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
申请编号123456
物料名称骁龙888芯片
存货编码外芯仓库
计量单位外芯仓库
数量409
金额2016-11-28
仓库名称外芯仓库
库位编码默认库位
提交人2016-11-28
提交时间2016-11-28
申请备注2016-11-28
状态2016-11-28
审批人2016-11-28
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+
+ +
+
+ +
+ +
+
+
+
+ + +
+
+
+ +
+
+ + + + + \ No newline at end of file diff --git a/src/main/resources/templates/pages/application/my-task.html b/src/main/resources/templates/pages/application/my-task.html index 01e7ac95..fe2a7d18 100644 --- a/src/main/resources/templates/pages/application/my-task.html +++ b/src/main/resources/templates/pages/application/my-task.html @@ -73,28 +73,35 @@ var data = {}; //先声明 - function openDetail1(data) { - }; + function openDetailForOut(data) { + } + + function openDetailForIn(data) { + } + + //先声明 + function openDetailForOutView(data) { + } //先声明 - function openDetail2(data) { - }; + function openDetailForInView(data) { + } //先声明(用于pc端跳转) function openDetail3(data) { - }; + } // 用于手机端跳转 function openDetail3_mobile(data) { - }; + } //先声明(用于pc端跳转) function openDetail4(data) { - }; + } // 用于手机端跳转 function openDetail4_mobile(data) { - }; + } //先声明(用于pc端跳转) function openDetailForTaking(data) { @@ -113,7 +120,7 @@ util = layui.util; //每页的数量 var size = 8; - let pre1 = 0, pre2 = 0, pre3 = 0, pre4 = 0; + let pre1 = 0, pre2 = 0, pre3 = 0, pre4 = 0, pre5 = 0, pre6 = 0; flow.load({ elem: '#LAY_floor1' //流加载容器 , scrollElem: '#LAY_floor1' //滚动条所在元素,一般不用填,此处只是演示需要。 @@ -121,8 +128,9 @@ , done: function (page, next) { //执行下一页的回调 let lis = []; let lis1 = []; + let lis2 = []; let result; - $.get('/depositoryRecord/myTask?page=' + page + '&size=' + size + '&isDone=0', function (res) { + $.get('/depositoryRecord/myTaskOut?page=' + page + '&size=' + size + '&isDone=0', function (res) { var Width = "25%"; result = res.data; lis.push("
"); @@ -130,7 +138,7 @@ Width = "50%"; } for (let i = 0; i < result.length; i++) { - lis.push('
  • ' + result[i].applicantName + '的'); lis.push('出库请求

    '); @@ -143,6 +151,27 @@ //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 next(lis.join(''), pre1 < res.count); }); + $.get('/depositoryRecord/myTaskIn?page=' + page + '&size=' + size + '&isDone=0', function (res) { + var Width = "25%"; + result = res.data; + lis2.push("
    "); + if (isMobile()) { + Width = "50%"; + } + for (let i = 0; i < result.length; i++) { + lis2.push('
  • ' + + result[i].applicantName + '的'); + lis2.push('入库请求

    '); + lis2.push('
    ' + + result[i].applicantTime + '
  • '); + } + lis2.push('
    '); + pre5 += result.length; + //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 + //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 + next(lis2.join(''), pre5 < res.count); + }); $.get('/stockTaking/myTask?page=' + page + '&size=' + size + '&isDone=0', function (res) { var Width = "25%"; result = res.data; @@ -174,8 +203,9 @@ , done: function (page, next) { //执行下一页的回调 let lis = []; let lis1 = []; + let lis2 = []; let result; - $.get('/depositoryRecord/myTask?page=' + page + '&size=' + size + '&isDone=1', function (res) { + $.get('/depositoryRecord/myTaskOut?page=' + page + '&size=' + size + '&isDone=1', function (res) { var Width = "25%"; result = res.data; lis.push("
    "); @@ -183,14 +213,10 @@ if (isMobile()) { Width = "50%"; } - lis.push('
  • ' - + result[i].applicantName + '的') - if (result[i].type === 1) { - lis.push('入库请求

    '); - } else { - lis.push('出库请求
    '); - } + + result[i].applicantName + '的'); + lis.push('出库请求
    '); lis.push('
    ' + result[i].applicantTime + '
  • '); } @@ -200,6 +226,27 @@ //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 next(lis.join(''), pre2 < res.count); }); + $.get('/depositoryRecord/myTaskIn?page=' + page + '&size=' + size + '&isDone=1', function (res) { + var Width = "25%"; + result = res.data; + lis2.push("
    "); + for (let i = 0; i < result.length; i++) { + if (isMobile()) { + Width = "50%"; + } + lis2.push('
  • ' + + result[i].applicantName + '的'); + lis2.push('入库请求

    '); + lis2.push('
    ' + + result[i].applicantTime + '
  • '); + } + lis2.push("
    "); + pre6 += result.length; + //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 + //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 + next(lis2.join(''), pre6 < res.count); + }); $.get('/stockTaking/myTask?page=' + page + '&size=' + size + '&isDone=1', function (res) { var Width = "25%"; result = res.data; @@ -261,7 +308,6 @@ }); } }); - flow.load({ elem: '#LAY_floor4' //流加载容器 , scrollElem: '#LAY_floor4' //滚动条所在元素,一般不用填,此处只是演示需要。 @@ -300,7 +346,10 @@ }); } }); - openDetail1 = function (item) { + + + // 用于跳转到出库审核页面 + openDetailForOut = function (item) { var index = layer.open({ title: '请求详情', type: 2, @@ -318,7 +367,27 @@ layer.full(index); }); }; - openDetail2 = function (item) { + // 用于跳转到入库审核页面 + openDetailForIn = function (item) { + var index = layer.open({ + title: '请求详情', + type: 2, + shade: 0.2, + maxmin: true, + shadeClose: true, + area: ['100%', '100%'], + content: '/application_in_review?id=' + item, + end: function () { + location.reload() + } + }); + + $(window).on("resize", function () { + layer.full(index); + }); + }; + // 用于跳转到出库任务查看页面 + openDetailForOutView = function (item) { var index = layer.open({ title: '请求详情', type: 2, @@ -335,6 +404,24 @@ layer.full(index); }); }; + // 用于跳转到入库任务查看页面 + openDetailForInView = function (item) { + var index = layer.open({ + title: '请求详情', + type: 2, + shade: 0.2, + maxmin: true, + shadeClose: true, + area: ['100%', '100%'], + content: '/form_step_look?id=' + item, + end: function () { + location.reload() + } + }); + $(window).on("resize", function () { + layer.full(index); + }); + }; // 用于pc端跳转 openDetail3 = function (item) { var index = layer.open({ diff --git a/src/main/resources/templates/pages/other/welcome.html b/src/main/resources/templates/pages/other/welcome.html index f2151bd7..194ecbb0 100644 --- a/src/main/resources/templates/pages/other/welcome.html +++ b/src/main/resources/templates/pages/other/welcome.html @@ -413,7 +413,26 @@ $(window).on("resize", function () { layer.full(index); }); - } else if (type === "库存盘点请求") { + } + else if (type === '入库请求') { + var index = layer.open({ + title: '请求详情', + type: 2, + shade: 0.2, + maxmin: true, + shadeClose: true, + area: ['100%', '100%'], + content: '/application_in_review?id=' + id, + end: function () { + location.reload() + } + }); + + $(window).on("resize", function () { + layer.full(index); + }); + } + else if (type === "库存盘点请求") { var index = layer.open({ title: '请求详情', type: 2, @@ -429,7 +448,8 @@ $(window).on("resize", function () { layer.full(index); }); - } else if (type === "物料出库请求") { + } + else if (type === "物料出库请求") { var index = layer.open({ title: '请求详情', type: 2, diff --git a/src/main/resources/templates/pages/other/welcome_mobile.html b/src/main/resources/templates/pages/other/welcome_mobile.html index 3c364699..53a88da9 100644 --- a/src/main/resources/templates/pages/other/welcome_mobile.html +++ b/src/main/resources/templates/pages/other/welcome_mobile.html @@ -418,7 +418,26 @@ $(window).on("resize", function () { layer.full(index); }); - } else if (type === "库存盘点请求") { + } + else if (type === '入库请求') { + var index = layer.open({ + title: '请求详情', + type: 2, + shade: 0.2, + maxmin: true, + shadeClose: true, + area: ['100%', '100%'], + content: '/application_in_review?id=' + id, + end: function () { + location.reload() + } + }); + + $(window).on("resize", function () { + layer.full(index); + }); + } + else if (type === "库存盘点请求") { var index = layer.open({ title: '请求详情', type: 2, diff --git a/target/classes/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml b/target/classes/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml index 884e06b7..1574f941 100644 --- a/target/classes/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml +++ b/target/classes/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml @@ -21,6 +21,14 @@
    + + + + + + + @@ -130,6 +138,10 @@ aorid,applicantId, applyRemark, applicantTime,aorcode + + + airid,applicant_id,applicant_time,applyRemark + dr.id, dr.application_id, dr.mname, dr.depository_id, dr.type, dr.quantity, dr.price, dr.state, @@ -309,6 +321,38 @@ + + + + + + + +