Commit b3a04c68df47e47efacd18aa8d713dbbcc8b3bbc
1 parent
8d50d2b3
组盘新增任务报错
Showing
5 changed files
with
22 additions
and
11 deletions
src/main/java/com/huaheng/pc/inventory/cycleCountDetail/controller/CycleCountDetailController.java
... | ... | @@ -121,17 +121,20 @@ public class CycleCountDetailController extends BaseController { |
121 | 121 | * 新增盘点明细 |
122 | 122 | */ |
123 | 123 | @GetMapping("/add") |
124 | - public String add(Integer cycleCountHeadId,String companyCode, ModelMap m) | |
124 | + public String add(String cycleCountHeadCode,String companyCode, ModelMap m) | |
125 | 125 | { |
126 | - if(cycleCountHeadId == null){ | |
126 | + if(cycleCountHeadCode == null){ | |
127 | 127 | throw new SecurityException("盘点头ID不能为空!"); |
128 | 128 | } |
129 | 129 | //相同货主才能盘点,取出盘点头的货主 |
130 | - CycleCountHeader cycleCountHeader = cycleCountHeaderService.getById(cycleCountHeadId); | |
130 | + CycleCountHeader cycleCountHeader = new CycleCountHeader(); | |
131 | + cycleCountHeader.setCode(cycleCountHeadCode); | |
132 | + cycleCountHeader.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
133 | + LambdaQueryWrapper<CycleCountHeader> lamd = Wrappers.lambdaQuery(cycleCountHeader); | |
134 | + cycleCountHeader = cycleCountHeaderService.getOne(lamd); | |
131 | 135 | companyCode = cycleCountHeader.getCompanyCode(); |
132 | 136 | m.put("companyCode",companyCode); |
133 | - m.put("cycleCountHeadId",cycleCountHeadId); | |
134 | - | |
137 | + m.put("cycleCountHeadCode",cycleCountHeadCode); | |
135 | 138 | return prefix + "/add"; |
136 | 139 | } |
137 | 140 | |
... | ... |
src/main/java/com/huaheng/pc/inventory/cycleCountDetail/service/CycleCountDetailServiceImpl.java
... | ... | @@ -55,6 +55,9 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
55 | 55 | @Transactional |
56 | 56 | public AjaxResult addDetails(String cycleCountHeadCode, Integer[] inventoryDetailIdIds) { |
57 | 57 | |
58 | + if(cycleCountHeadCode == null){ | |
59 | + throw new ServiceException("盘点主单编码不能为空!"); | |
60 | + } | |
58 | 61 | CycleCountHeader cyclecountHeader =new CycleCountHeader(); |
59 | 62 | cyclecountHeader.setCode(cycleCountHeadCode); |
60 | 63 | LambdaQueryWrapper<CycleCountHeader> ch = Wrappers.lambdaQuery(cyclecountHeader); |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
... | ... | @@ -52,6 +52,8 @@ import java.util.Date; |
52 | 52 | import java.util.List; |
53 | 53 | import java.util.Map; |
54 | 54 | import java.util.*; |
55 | +import java.util.concurrent.CopyOnWriteArrayList; | |
56 | + | |
55 | 57 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
56 | 58 | import com.huaheng.pc.task.taskHeader.domain.TaskHeader; |
57 | 59 | import com.huaheng.pc.task.taskHeader.mapper.TaskHeaderMapper; |
... | ... | @@ -922,7 +924,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
922 | 924 | taskDetail.setTaskId(taskHeader.getId()); |
923 | 925 | LambdaQueryWrapper lambdaQueryWrapper = Wrappers.lambdaQuery(taskDetail); |
924 | 926 | List<TaskDetail> taskDetailList = taskDetailService.list(lambdaQueryWrapper);//查询子单 |
925 | - List<CycleCountDetail> cycleCountDetailList = new ArrayList<>(); | |
927 | + List<CycleCountDetail> cycleCountDetailList = new CopyOnWriteArrayList<>(); | |
926 | 928 | for (TaskDetail item : taskDetailList) { |
927 | 929 | item.setStatus(100); |
928 | 930 | item.setLastUpdatedBy(ShiroUtils.getLoginName()); //更新用户 |
... | ... |
src/main/resources/templates/inventory/cycleCountDetail/add.html
... | ... | @@ -8,7 +8,7 @@ |
8 | 8 | <div class="row"> |
9 | 9 | <div class="col-sm-12 select-info"> |
10 | 10 | <form id="inventory-form"> |
11 | - <input type="hidden" id="cycleCountHeadId" name="cycleCountHeadId" th:value="${cycleCountHeadId}"> | |
11 | + <input type="hidden" id="cycleCountHeadCode" name="cycleCountHeadCode" th:value="${cycleCountHeadCode}"> | |
12 | 12 | <div class="select-list"> |
13 | 13 | <ul> |
14 | 14 | <ul> |
... | ... | @@ -329,16 +329,16 @@ |
329 | 329 | rows.forEach(function (item) { |
330 | 330 | ids.push(item.id); |
331 | 331 | }); |
332 | - addInner($('#cycleCountHeadId').val(),ids.join(',')); | |
332 | + addInner($('#cycleCountHeadCode').val(),ids.join(',')); | |
333 | 333 | } |
334 | 334 | |
335 | - function addInner(cycleCountHeadId,ids) { | |
335 | + function addInner(cycleCountHeadCode,ids) { | |
336 | 336 | $.ajax({ |
337 | 337 | cache : true, |
338 | 338 | type : "post", |
339 | 339 | url : prefix_cycleDetails + "/add", |
340 | 340 | data:{ |
341 | - cycleCountHeadId:cycleCountHeadId, | |
341 | + cycleCountHeadCode:cycleCountHeadCode, | |
342 | 342 | inventoryDetailIdIds:ids |
343 | 343 | }, |
344 | 344 | async : false, |
... | ... |
src/main/resources/templates/inventory/cycleCountHeader/add.html
... | ... | @@ -33,9 +33,12 @@ |
33 | 33 | <div class="form-group"> |
34 | 34 | <label class="col-sm-3 control-label">货主:</label> |
35 | 35 | <div class="col-sm-8"> |
36 | - <input id="companyCode" name="companyCode" class="form-control" type="text"> | |
36 | + <select id="companyCode" name="companyCode" class="form-control" th:with="list=${@companyService.getCode()}"> | |
37 | + <option th:each="item : ${list}" th:text="${item['name']}" th:value="${item['code']}" th:attr = " code = ${item['code']}"></option> | |
38 | + </select> | |
37 | 39 | </div> |
38 | 40 | </div> |
41 | + | |
39 | 42 | <div class="form-group"> |
40 | 43 | <label class="col-sm-3 control-label">总货位数:</label> |
41 | 44 | <div class="col-sm-8"> |
... | ... |