Commit c9f2992c51e1a23754ce0b2cc54a59ed262305a2

Authored by mahuandong
2 parents cb6b5d05 4eb481b8

Merge remote-tracking branch 'origin/develop' into develop

src/main/java/com/huaheng/pc/shipment/shipmentHeader/controller/ShipmentHeaderController.java
... ... @@ -34,6 +34,7 @@ import org.springframework.web.bind.annotation.*;
34 34  
35 35 import javax.annotation.Resource;
36 36 import java.lang.reflect.InvocationTargetException;
  37 +import java.util.Date;
37 38 import java.util.List;
38 39  
39 40  
... ... @@ -157,6 +158,7 @@ public class ShipmentHeaderController extends BaseController {
157 158 temp.setCustomerCode(shipmentHeader.getCustomerCode());
158 159 temp.setPriority(shipmentHeader.getPriority());
159 160 temp.setLastUpdatedBy(ShiroUtils.getLoginName());
  161 + temp.setLastUpdated(new Date());
160 162 return toAjax(shipmentHeaderService.saveOrUpdate(temp));
161 163 }
162 164  
... ...
src/main/java/com/huaheng/pc/shipment/shipmentHeader/service/ShipmentHeaderServiceImpl.java
... ... @@ -159,28 +159,36 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper,
159 159 @Override
160 160 @Transactional
161 161 public AjaxResult addHistory(ShipmentHeader shipmentHeader) throws InvocationTargetException, IllegalAccessException {
162   - //历史出库主单
163   - ShipmentHeaderHistory shipmentHeaderHistory=new ShipmentHeaderHistory();
164   - BeanUtils.copyProperties(shipmentHeaderHistory,shipmentHeader);
165   - if(shipmentHeaderHistoryService.save(shipmentHeaderHistory)==false){
166   - throw new ServiceException("存入历史出库主单失败");
167   - }
168   - LambdaQueryWrapper<ShipmentDetail> lambdaQueryWrapper=Wrappers.lambdaQuery();
169   - lambdaQueryWrapper.eq(ShipmentDetail::getWarehouseCode,shipmentHeader.getWarehouseCode())
170   - .eq(ShipmentDetail::getShipmentCode,shipmentHeader.getCode());
171   - List<ShipmentDetail> shipmentDetails=shipmentDetailService.list(lambdaQueryWrapper);
172   -
173   - //历史出库子单
174   - List<ShipmentDetailHistory> shipmentDetailHistories=new ArrayList<>();
175   - for(ShipmentDetail item:shipmentDetails){
176   - ShipmentDetailHistory shipmentDetailHistory=new ShipmentDetailHistory();
177   - BeanUtils.copyProperties(shipmentDetailHistory,item);
178   - shipmentDetailHistories.add(shipmentDetailHistory);
179   - }
180   - Boolean flag=shipmentDetailHistoryService.saveBatch(shipmentDetailHistories);
181   - if(flag==false){
182   - throw new ServiceException("存入历史出库子单失败");
  162 + //单据主单重复
  163 + LambdaQueryWrapper<ShipmentHeaderHistory> headerHistoryLamb = Wrappers.lambdaQuery();
  164 + headerHistoryLamb.eq(ShipmentHeaderHistory::getCode,shipmentHeader.getCode())
  165 + .eq(ShipmentHeaderHistory::getWarehouseCode,shipmentHeader.getWarehouseCode());
  166 +
  167 + ShipmentHeaderHistory headerHistory =shipmentHeaderHistoryService.getOne(headerHistoryLamb);
  168 + if(headerHistory == null) {
  169 + //历史出库主单
  170 + ShipmentHeaderHistory shipmentHeaderHistory = new ShipmentHeaderHistory();
  171 + BeanUtils.copyProperties(shipmentHeaderHistory, shipmentHeader);
  172 + if (shipmentHeaderHistoryService.save(shipmentHeaderHistory) == false) {
  173 + throw new ServiceException("存入历史出库主单失败");
  174 + }
183 175 }
  176 + LambdaQueryWrapper<ShipmentDetail> lambdaQueryWrapper = Wrappers.lambdaQuery();
  177 + lambdaQueryWrapper.eq(ShipmentDetail::getWarehouseCode, shipmentHeader.getWarehouseCode())
  178 + .eq(ShipmentDetail::getShipmentCode, shipmentHeader.getCode());
  179 + List<ShipmentDetail> shipmentDetails = shipmentDetailService.list(lambdaQueryWrapper);
  180 +
  181 + //历史出库子单
  182 + List<ShipmentDetailHistory> shipmentDetailHistories = new ArrayList<>();
  183 + for (ShipmentDetail item : shipmentDetails) {
  184 + ShipmentDetailHistory shipmentDetailHistory = new ShipmentDetailHistory();
  185 + BeanUtils.copyProperties(shipmentDetailHistory, item);
  186 + shipmentDetailHistories.add(shipmentDetailHistory);
  187 + }
  188 + Boolean flag = shipmentDetailHistoryService.saveBatch(shipmentDetailHistories);
  189 + if (flag == false) {
  190 + throw new ServiceException("存入历史出库子单失败");
  191 + }
184 192 return null;
185 193 }
186 194  
... ...
src/main/resources/templates/shipment/shipmentHeader/shipmentHeader.html
... ... @@ -726,21 +726,6 @@
726 726 }
727 727  
728 728  
729   - function localHeaderSubmit (url, type, dataType, data) {
730   - $.modal.loading("正在处理中,请稍后...");
731   - var config = {
732   - url: url, type: type, dataType: dataType, data: data, success: function (result) {
733   - if (result.code == web_status.SUCCESS) {
734   - $.modal.msgSuccess(result.msg);
735   - loadDetail(shipmentId, shipmentCode)
736   - } else {
737   - $.modal.alertError(result.msg)
738   - }
739   - $.modal.closeLoading()
740   - }
741   - };
742   - $.ajax(config)
743   - }
744 729  
745 730 /* 出库组盘 */
746 731 function Toshipping(auto) {
... ...
src/main/resources/templates/shipment/shipmentHeaderHistory/shipmentHeaderHistory.html
... ... @@ -289,14 +289,14 @@
289 289 title: '路线',
290 290 sortable:true
291 291 },
292   - {
293   - field: 'totalQty',
294   - title: '总数量'
295   - },
296   - {
297   - field: 'totalLines',
298   - title: '总行数'
299   - },
  292 + // {
  293 + // field: 'totalQty',
  294 + // title: '总数量'
  295 + // },
  296 + // {
  297 + // field: 'totalLines',
  298 + // title: '总行数'
  299 + // },
300 300 {
301 301 field: 'firstStatus',
302 302 title: '头状态',
... ...
src/main/resources/templates/shipment/shippingCombination/combination.html
... ... @@ -12,7 +12,7 @@
12 12 <ul th:object="${shipmentDetail}">
13 13 <li style="display: none"><input type="hidden" id="zoneCode" th:value="*{zoneCode}"></li>
14 14 <li style="display: none"><input type="hidden" id="shipmentDetailId" th:value="*{id}"></li>
15   - <li style="display: none"><input type="hidden" id="inventoryStatus" th:value="*{inventoryStatus}"></li>
  15 + <li style="display: none"><input type="hidden" id="inventorySts" th:value="*{inventorySts}"></li>
16 16 <li>出库单号:<input type="text" readonly="readonly" id="code" th:value="*{shipmentCode}"></li>
17 17 <li>存货编码:<input type="text" readonly="readonly" th:value="*{materialCode}"></li>
18 18 <li>物料名称:<input type="text" readonly="readonly" th:value="*{materialName}"></li>
... ... @@ -62,7 +62,7 @@
62 62 </li>
63 63 <li>
64 64 库存状态:
65   - <select name="inventoryStatus" th:with="type=${@dict.getType('inventoryStatus')}">
  65 + <select name="inventorySts" th:with="type=${@dict.getType('inventorySts')}">
66 66 <option value="">所有</option>
67 67 <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
68 68 </select>
... ... @@ -93,7 +93,7 @@
93 93 <script th:inline="javascript">
94 94 var addFlag = [[${@permission.hasPermi('shipment:shippingCombination:combination')}]];
95 95 var prefix = ctx + "shipment/shippingCombination";
96   - var inventoryStatus=[[${@dict.getType('inventoryStatus')}]];
  96 + var inventoryStatus=[[${@dict.getType('inventorySts')}]];
97 97 $(function() {
98 98 $("#bootstrap-table").bootstrapTable({
99 99 url: prefix + "/getInventory",
... ... @@ -190,7 +190,7 @@
190 190 title : '数量'
191 191 },
192 192 {
193   - field : 'status',
  193 + field : 'inventorySts',
194 194 title : '库存状态' ,
195 195 formatter: function(value, row, index) {
196 196 return $.table.selectDictLabel(inventoryStatus, value);
... ...
src/main/resources/templates/shipment/shippingCombination/shippingCombination.html
... ... @@ -69,7 +69,7 @@
69 69 var cancelFlag = [[${@permission.hasPermi('shipment:shippingCombination:remove')}]];
70 70 var taskTypeReal=[[${@dict.getType('taskType')}]];
71 71 var containerHeaderStatus = [[${@dict.getType('shipmentContainerHeaderStatus')}]];
72   - var inventoryStatus = [[${@dict.getType('inventoryStatus')}]];
  72 + var inventoryStatus = [[${@dict.getType('inventorySts')}]];
73 73  
74 74 var prefix = ctx + "shipment/shippingCombination";
75 75  
... ...