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,6 +34,7 @@ import org.springframework.web.bind.annotation.*;
34 34
35 import javax.annotation.Resource; 35 import javax.annotation.Resource;
36 import java.lang.reflect.InvocationTargetException; 36 import java.lang.reflect.InvocationTargetException;
  37 +import java.util.Date;
37 import java.util.List; 38 import java.util.List;
38 39
39 40
@@ -157,6 +158,7 @@ public class ShipmentHeaderController extends BaseController { @@ -157,6 +158,7 @@ public class ShipmentHeaderController extends BaseController {
157 temp.setCustomerCode(shipmentHeader.getCustomerCode()); 158 temp.setCustomerCode(shipmentHeader.getCustomerCode());
158 temp.setPriority(shipmentHeader.getPriority()); 159 temp.setPriority(shipmentHeader.getPriority());
159 temp.setLastUpdatedBy(ShiroUtils.getLoginName()); 160 temp.setLastUpdatedBy(ShiroUtils.getLoginName());
  161 + temp.setLastUpdated(new Date());
160 return toAjax(shipmentHeaderService.saveOrUpdate(temp)); 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,28 +159,36 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper,
159 @Override 159 @Override
160 @Transactional 160 @Transactional
161 public AjaxResult addHistory(ShipmentHeader shipmentHeader) throws InvocationTargetException, IllegalAccessException { 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 return null; 192 return null;
185 } 193 }
186 194
src/main/resources/templates/shipment/shipmentHeader/shipmentHeader.html
@@ -726,21 +726,6 @@ @@ -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 function Toshipping(auto) { 731 function Toshipping(auto) {
src/main/resources/templates/shipment/shipmentHeaderHistory/shipmentHeaderHistory.html
@@ -289,14 +289,14 @@ @@ -289,14 +289,14 @@
289 title: '路线', 289 title: '路线',
290 sortable:true 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 field: 'firstStatus', 301 field: 'firstStatus',
302 title: '头状态', 302 title: '头状态',
src/main/resources/templates/shipment/shippingCombination/combination.html
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 <ul th:object="${shipmentDetail}"> 12 <ul th:object="${shipmentDetail}">
13 <li style="display: none"><input type="hidden" id="zoneCode" th:value="*{zoneCode}"></li> 13 <li style="display: none"><input type="hidden" id="zoneCode" th:value="*{zoneCode}"></li>
14 <li style="display: none"><input type="hidden" id="shipmentDetailId" th:value="*{id}"></li> 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 <li>出库单号:<input type="text" readonly="readonly" id="code" th:value="*{shipmentCode}"></li> 16 <li>出库单号:<input type="text" readonly="readonly" id="code" th:value="*{shipmentCode}"></li>
17 <li>存货编码:<input type="text" readonly="readonly" th:value="*{materialCode}"></li> 17 <li>存货编码:<input type="text" readonly="readonly" th:value="*{materialCode}"></li>
18 <li>物料名称:<input type="text" readonly="readonly" th:value="*{materialName}"></li> 18 <li>物料名称:<input type="text" readonly="readonly" th:value="*{materialName}"></li>
@@ -62,7 +62,7 @@ @@ -62,7 +62,7 @@
62 </li> 62 </li>
63 <li> 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 <option value="">所有</option> 66 <option value="">所有</option>
67 <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option> 67 <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
68 </select> 68 </select>
@@ -93,7 +93,7 @@ @@ -93,7 +93,7 @@
93 <script th:inline="javascript"> 93 <script th:inline="javascript">
94 var addFlag = [[${@permission.hasPermi('shipment:shippingCombination:combination')}]]; 94 var addFlag = [[${@permission.hasPermi('shipment:shippingCombination:combination')}]];
95 var prefix = ctx + "shipment/shippingCombination"; 95 var prefix = ctx + "shipment/shippingCombination";
96 - var inventoryStatus=[[${@dict.getType('inventoryStatus')}]]; 96 + var inventoryStatus=[[${@dict.getType('inventorySts')}]];
97 $(function() { 97 $(function() {
98 $("#bootstrap-table").bootstrapTable({ 98 $("#bootstrap-table").bootstrapTable({
99 url: prefix + "/getInventory", 99 url: prefix + "/getInventory",
@@ -190,7 +190,7 @@ @@ -190,7 +190,7 @@
190 title : '数量' 190 title : '数量'
191 }, 191 },
192 { 192 {
193 - field : 'status', 193 + field : 'inventorySts',
194 title : '库存状态' , 194 title : '库存状态' ,
195 formatter: function(value, row, index) { 195 formatter: function(value, row, index) {
196 return $.table.selectDictLabel(inventoryStatus, value); 196 return $.table.selectDictLabel(inventoryStatus, value);
src/main/resources/templates/shipment/shippingCombination/shippingCombination.html
@@ -69,7 +69,7 @@ @@ -69,7 +69,7 @@
69 var cancelFlag = [[${@permission.hasPermi('shipment:shippingCombination:remove')}]]; 69 var cancelFlag = [[${@permission.hasPermi('shipment:shippingCombination:remove')}]];
70 var taskTypeReal=[[${@dict.getType('taskType')}]]; 70 var taskTypeReal=[[${@dict.getType('taskType')}]];
71 var containerHeaderStatus = [[${@dict.getType('shipmentContainerHeaderStatus')}]]; 71 var containerHeaderStatus = [[${@dict.getType('shipmentContainerHeaderStatus')}]];
72 - var inventoryStatus = [[${@dict.getType('inventoryStatus')}]]; 72 + var inventoryStatus = [[${@dict.getType('inventorySts')}]];
73 73
74 var prefix = ctx + "shipment/shippingCombination"; 74 var prefix = ctx + "shipment/shippingCombination";
75 75