Commit 70e81aedf62fab3d39fbfb63d783a734d8ffde4a
Merge branch 'develop' of http://172.16.29.40:8010/wms/wms2 into develop
Showing
5 changed files
with
42 additions
and
13 deletions
src/main/java/com/huaheng/pc/inventory/adjustDetail/controller/adjustDetailController.java
... | ... | @@ -130,7 +130,7 @@ public class adjustDetailController extends BaseController { |
130 | 130 | if(adjustDetail.getAdjustCode() == null){ |
131 | 131 | return AjaxResult.error("调整主单编码不能为空,请先选中主单再新增明细!"); |
132 | 132 | } |
133 | - //查询主单及加入仓库和货主 | |
133 | + //查询主单及加入仓库和货主,盘点,质检单编码 | |
134 | 134 | AdjustHeader adjustHeader = new AdjustHeader(); |
135 | 135 | adjustHeader.setCode(adjustDetail.getAdjustCode()); |
136 | 136 | LambdaQueryWrapper<AdjustHeader> lambdaQueryWrapper = Wrappers.lambdaQuery(adjustHeader); |
... | ... | @@ -140,6 +140,8 @@ public class adjustDetailController extends BaseController { |
140 | 140 | } |
141 | 141 | adjustDetail.setWarehouseCode(ah.getWarehouseCode()); |
142 | 142 | adjustDetail.setCompanyCode(ah.getCompanyCode()); |
143 | + adjustDetail.setCycleCountCode(ah.getCycleCountCode()); | |
144 | + adjustDetail.setCheckCode(ah.getCheckCode()); | |
143 | 145 | return adjustDetailService.addDetails(adjustDetail); |
144 | 146 | } |
145 | 147 | |
... | ... | @@ -186,8 +188,10 @@ public class adjustDetailController extends BaseController { |
186 | 188 | Integer[] integers = Convert.toIntArray(ids); |
187 | 189 | for (Integer id : integers){ |
188 | 190 | AdjustDetail adjustDetailEdit = adjustDetailService.getById(id); |
191 | + if(StringUtils.isNotEmpty(adjustDetailEdit.getAgreeBy())){ | |
192 | + return AjaxResult.error("明细已审批,请勿重复审批!"); | |
193 | + } | |
189 | 194 | adjustDetailService.adjustAgree(adjustDetailEdit); |
190 | - | |
191 | 195 | } |
192 | 196 | return AjaxResult.success("审批已下发!"); |
193 | 197 | } |
... | ... |
src/main/java/com/huaheng/pc/inventory/adjustDetail/service/AdjustDetailServiceImpl.java
... | ... | @@ -73,6 +73,8 @@ public class AdjustDetailServiceImpl extends ServiceImpl<AdjustDetailMapper, Adj |
73 | 73 | @Override |
74 | 74 | public AjaxResult addDetails(AdjustDetail adjustDetail) { |
75 | 75 | //数据直接插入表里 |
76 | + //查询主单据 | |
77 | + | |
76 | 78 | |
77 | 79 | //检查库存 |
78 | 80 | if((adjustDetail.getInventoryDetailId()) != null){ |
... | ... |
src/main/java/com/huaheng/pc/inventory/adjustHeader/controller/adjustHeaderController.java
... | ... | @@ -9,6 +9,7 @@ import com.huaheng.common.utils.security.ShiroUtils; |
9 | 9 | import com.huaheng.framework.aspectj.lang.annotation.Log; |
10 | 10 | import com.huaheng.framework.aspectj.lang.constant.BusinessType; |
11 | 11 | import com.huaheng.framework.web.controller.BaseController; |
12 | +import com.huaheng.framework.web.domain.AjaxResult; | |
12 | 13 | import com.huaheng.framework.web.page.PageDomain; |
13 | 14 | import com.huaheng.framework.web.page.TableDataInfo; |
14 | 15 | import com.huaheng.framework.web.page.TableSupport; |
... | ... | @@ -17,6 +18,7 @@ import com.huaheng.pc.inventory.adjustDetail.service.AdjustDetailServiceImpl; |
17 | 18 | import com.huaheng.pc.inventory.adjustHeader.domain.AdjustHeader; |
18 | 19 | import com.huaheng.pc.inventory.adjustHeader.service.AdjustHeaderService; |
19 | 20 | import com.huaheng.pc.inventory.adjustHeader.service.AdjustHeaderServiceImpl; |
21 | +import com.huaheng.pc.inventory.cycleCountHeader.domain.CycleCountHeader; | |
20 | 22 | import org.springframework.stereotype.Controller; |
21 | 23 | import org.springframework.web.bind.annotation.GetMapping; |
22 | 24 | import org.springframework.web.bind.annotation.PostMapping; |
... | ... | @@ -24,6 +26,7 @@ import org.springframework.web.bind.annotation.RequestMapping; |
24 | 26 | import org.springframework.web.bind.annotation.ResponseBody; |
25 | 27 | |
26 | 28 | import javax.annotation.Resource; |
29 | +import java.util.Date; | |
27 | 30 | import java.util.List; |
28 | 31 | |
29 | 32 | @Controller |
... | ... | @@ -86,7 +89,30 @@ public class adjustHeaderController extends BaseController { |
86 | 89 | } |
87 | 90 | } |
88 | 91 | |
92 | + /** | |
93 | + * 新增调整单主 | |
94 | + */ | |
95 | + @GetMapping("/add") | |
96 | + public String add() | |
97 | + { | |
98 | + return prefix + "/add"; | |
99 | + } | |
89 | 100 | |
101 | + /** | |
102 | + * 新增保存调整单主 | |
103 | + */ | |
104 | + //@RequiresPermissions("inventory:cycleCount:add") | |
105 | + @Log(title = "库存-调整",operating = "新增调整主单", action = BusinessType.INSERT) | |
106 | + @PostMapping("/addsave") | |
107 | + @ResponseBody | |
108 | + public AjaxResult addSave(AdjustHeader adjustHeader) | |
109 | + { | |
110 | + adjustHeader.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
111 | + adjustHeader.setCreated(new Date()); | |
112 | + adjustHeader.setCreatedBy(ShiroUtils.getLoginName()); | |
113 | + adjustHeader.setCode(adjustHeaderService.createCode()); | |
114 | + return toAjax(adjustHeaderService.save(adjustHeader)); | |
115 | + } | |
90 | 116 | |
91 | 117 | |
92 | 118 | |
... | ... |
src/main/resources/templates/inventory/adjustHeader/add.html
... | ... | @@ -5,26 +5,23 @@ |
5 | 5 | <body class="white-bg"> |
6 | 6 | <div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
7 | 7 | |
8 | - <form class="form-horizontal m" id="form-cyclecountAdjustDetail-addAdjust" > | |
9 | - <input type="hidden" id="cyclecountAdjustId" name="cyclecountAdjustId" th:value="${cyclecountAdjustId}"> | |
10 | - | |
8 | + <form class="form-horizontal m" id="form-adjustHeader-add" > | |
11 | 9 | <div class="form-group"> |
12 | 10 | <label class="col-sm-3 control-label">调整单编号:</label> |
13 | 11 | <div class="col-sm-8"> |
14 | - <input id="code" name="code" th:value="${code}" class="form-control" type="text" readonly="readonly"> | |
12 | + <input id="code" name="code" class="form-control" type="text"> | |
15 | 13 | </div> |
16 | 14 | </div> |
17 | 15 | <div class="form-group"> |
18 | 16 | <label class="col-sm-3 control-label">货主编码:</label> |
19 | 17 | <div class="col-sm-8"> |
20 | - <input id="companyId" name="companyId" type="hidden" th:value="*{companyId}"> | |
21 | - <input id="companyCode" name="companyCode" th:value="${companyCode}" class="form-control" type="text" readonly="readonly"> | |
18 | + <input id="companyCode" name="companyCode" class="form-control" type="text" readonly="readonly"> | |
22 | 19 | </div> |
23 | 20 | </div> |
24 | 21 | <div class="form-group"> |
25 | 22 | <label class="col-sm-3 control-label">盘点单编号:</label> |
26 | 23 | <div class="col-sm-8"> |
27 | - <input id="cyclecountHeadCode" name="cyclecountHeadCode" th:value="${cyclecountHeadCode}" class="form-control" type="text" readonly="readonly"> | |
24 | + <input id="cyclecountHeadCode" name="cyclecountHeadCode" class="form-control" type="text" readonly="readonly"> | |
28 | 25 | </div> |
29 | 26 | </div> |
30 | 27 | <div class="form-group"> |
... | ... | @@ -120,9 +117,9 @@ |
120 | 117 | </div> |
121 | 118 | <div th:include="include::footer"></div> |
122 | 119 | <script type="text/javascript"> |
123 | - var prefix = ctx + "inventory/cyclecountAdjustDetail" | |
120 | + var prefix = ctx + "inventory/adjustHeader" | |
124 | 121 | |
125 | - $("#form-cyclecountAdjustDetail-addAdjust").validate({ | |
122 | + $("#form-adjustHeader-add").validate({ | |
126 | 123 | rules:{ |
127 | 124 | materialCode:{ |
128 | 125 | required:true, |
... | ... | @@ -149,7 +146,7 @@ |
149 | 146 | //必须填值判定 |
150 | 147 | }, |
151 | 148 | submitHandler: function(form) { |
152 | - $.operate.save(prefix + "/addAdjust", $('#form-cyclecountAdjustDetail-addAdjust').serialize()); | |
149 | + $.operate.save(prefix + "/addsave", $('#form-adjustHeader-add').serialize()); | |
153 | 150 | } |
154 | 151 | }); |
155 | 152 | |
... | ... |
src/main/resources/templates/inventory/adjustHeader/adjustHeader.html