diff --git a/src/main/java/com/huaheng/pc/shipment/shipmentHeader/controller/ShipmentHeaderController.java b/src/main/java/com/huaheng/pc/shipment/shipmentHeader/controller/ShipmentHeaderController.java index 466d994..5219784 100644 --- a/src/main/java/com/huaheng/pc/shipment/shipmentHeader/controller/ShipmentHeaderController.java +++ b/src/main/java/com/huaheng/pc/shipment/shipmentHeader/controller/ShipmentHeaderController.java @@ -34,6 +34,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.lang.reflect.InvocationTargetException; +import java.util.Date; import java.util.List; @@ -157,6 +158,7 @@ public class ShipmentHeaderController extends BaseController { temp.setCustomerCode(shipmentHeader.getCustomerCode()); temp.setPriority(shipmentHeader.getPriority()); temp.setLastUpdatedBy(ShiroUtils.getLoginName()); + temp.setLastUpdated(new Date()); return toAjax(shipmentHeaderService.saveOrUpdate(temp)); } diff --git a/src/main/java/com/huaheng/pc/shipment/shipmentHeader/service/ShipmentHeaderServiceImpl.java b/src/main/java/com/huaheng/pc/shipment/shipmentHeader/service/ShipmentHeaderServiceImpl.java index a6b09cc..bde18f4 100644 --- a/src/main/java/com/huaheng/pc/shipment/shipmentHeader/service/ShipmentHeaderServiceImpl.java +++ b/src/main/java/com/huaheng/pc/shipment/shipmentHeader/service/ShipmentHeaderServiceImpl.java @@ -159,28 +159,36 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, @Override @Transactional public AjaxResult addHistory(ShipmentHeader shipmentHeader) throws InvocationTargetException, IllegalAccessException { - //历史出库主单 - ShipmentHeaderHistory shipmentHeaderHistory=new ShipmentHeaderHistory(); - BeanUtils.copyProperties(shipmentHeaderHistory,shipmentHeader); - if(shipmentHeaderHistoryService.save(shipmentHeaderHistory)==false){ - throw new ServiceException("存入历史出库主单失败"); - } - LambdaQueryWrapper<ShipmentDetail> lambdaQueryWrapper=Wrappers.lambdaQuery(); - lambdaQueryWrapper.eq(ShipmentDetail::getWarehouseCode,shipmentHeader.getWarehouseCode()) - .eq(ShipmentDetail::getShipmentCode,shipmentHeader.getCode()); - List<ShipmentDetail> shipmentDetails=shipmentDetailService.list(lambdaQueryWrapper); - - //历史出库子单 - List<ShipmentDetailHistory> shipmentDetailHistories=new ArrayList<>(); - for(ShipmentDetail item:shipmentDetails){ - ShipmentDetailHistory shipmentDetailHistory=new ShipmentDetailHistory(); - BeanUtils.copyProperties(shipmentDetailHistory,item); - shipmentDetailHistories.add(shipmentDetailHistory); - } - Boolean flag=shipmentDetailHistoryService.saveBatch(shipmentDetailHistories); - if(flag==false){ - throw new ServiceException("存入历史出库子单失败"); + //单据主单重复 + LambdaQueryWrapper<ShipmentHeaderHistory> headerHistoryLamb = Wrappers.lambdaQuery(); + headerHistoryLamb.eq(ShipmentHeaderHistory::getCode,shipmentHeader.getCode()) + .eq(ShipmentHeaderHistory::getWarehouseCode,shipmentHeader.getWarehouseCode()); + + ShipmentHeaderHistory headerHistory =shipmentHeaderHistoryService.getOne(headerHistoryLamb); + if(headerHistory == null) { + //历史出库主单 + ShipmentHeaderHistory shipmentHeaderHistory = new ShipmentHeaderHistory(); + BeanUtils.copyProperties(shipmentHeaderHistory, shipmentHeader); + if (shipmentHeaderHistoryService.save(shipmentHeaderHistory) == false) { + throw new ServiceException("存入历史出库主单失败"); + } } + LambdaQueryWrapper<ShipmentDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(); + lambdaQueryWrapper.eq(ShipmentDetail::getWarehouseCode, shipmentHeader.getWarehouseCode()) + .eq(ShipmentDetail::getShipmentCode, shipmentHeader.getCode()); + List<ShipmentDetail> shipmentDetails = shipmentDetailService.list(lambdaQueryWrapper); + + //历史出库子单 + List<ShipmentDetailHistory> shipmentDetailHistories = new ArrayList<>(); + for (ShipmentDetail item : shipmentDetails) { + ShipmentDetailHistory shipmentDetailHistory = new ShipmentDetailHistory(); + BeanUtils.copyProperties(shipmentDetailHistory, item); + shipmentDetailHistories.add(shipmentDetailHistory); + } + Boolean flag = shipmentDetailHistoryService.saveBatch(shipmentDetailHistories); + if (flag == false) { + throw new ServiceException("存入历史出库子单失败"); + } return null; } diff --git a/src/main/resources/templates/shipment/shipmentHeader/shipmentHeader.html b/src/main/resources/templates/shipment/shipmentHeader/shipmentHeader.html index d3f9f1c..bc07eb8 100644 --- a/src/main/resources/templates/shipment/shipmentHeader/shipmentHeader.html +++ b/src/main/resources/templates/shipment/shipmentHeader/shipmentHeader.html @@ -726,21 +726,6 @@ } - function localHeaderSubmit (url, type, dataType, data) { - $.modal.loading("正在处理中,请稍后..."); - var config = { - url: url, type: type, dataType: dataType, data: data, success: function (result) { - if (result.code == web_status.SUCCESS) { - $.modal.msgSuccess(result.msg); - loadDetail(shipmentId, shipmentCode) - } else { - $.modal.alertError(result.msg) - } - $.modal.closeLoading() - } - }; - $.ajax(config) - } /* 出库组盘 */ function Toshipping(auto) { diff --git a/src/main/resources/templates/shipment/shipmentHeaderHistory/shipmentHeaderHistory.html b/src/main/resources/templates/shipment/shipmentHeaderHistory/shipmentHeaderHistory.html index 9debfe9..07ca0de 100644 --- a/src/main/resources/templates/shipment/shipmentHeaderHistory/shipmentHeaderHistory.html +++ b/src/main/resources/templates/shipment/shipmentHeaderHistory/shipmentHeaderHistory.html @@ -289,14 +289,14 @@ title: '路线', sortable:true }, - { - field: 'totalQty', - title: '总数量' - }, - { - field: 'totalLines', - title: '总行数' - }, + // { + // field: 'totalQty', + // title: '总数量' + // }, + // { + // field: 'totalLines', + // title: '总行数' + // }, { field: 'firstStatus', title: '头状态', diff --git a/src/main/resources/templates/shipment/shippingCombination/combination.html b/src/main/resources/templates/shipment/shippingCombination/combination.html index 1906000..93ba72b 100644 --- a/src/main/resources/templates/shipment/shippingCombination/combination.html +++ b/src/main/resources/templates/shipment/shippingCombination/combination.html @@ -12,7 +12,7 @@ <ul th:object="${shipmentDetail}"> <li style="display: none"><input type="hidden" id="zoneCode" th:value="*{zoneCode}"></li> <li style="display: none"><input type="hidden" id="shipmentDetailId" th:value="*{id}"></li> - <li style="display: none"><input type="hidden" id="inventoryStatus" th:value="*{inventoryStatus}"></li> + <li style="display: none"><input type="hidden" id="inventorySts" th:value="*{inventorySts}"></li> <li>出库单号:<input type="text" readonly="readonly" id="code" th:value="*{shipmentCode}"></li> <li>存货编码:<input type="text" readonly="readonly" th:value="*{materialCode}"></li> <li>物料名称:<input type="text" readonly="readonly" th:value="*{materialName}"></li> @@ -62,7 +62,7 @@ </li> <li> 库存状态: - <select name="inventoryStatus" th:with="type=${@dict.getType('inventoryStatus')}"> + <select name="inventorySts" th:with="type=${@dict.getType('inventorySts')}"> <option value="">所有</option> <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option> </select> @@ -93,7 +93,7 @@ <script th:inline="javascript"> var addFlag = [[${@permission.hasPermi('shipment:shippingCombination:combination')}]]; var prefix = ctx + "shipment/shippingCombination"; - var inventoryStatus=[[${@dict.getType('inventoryStatus')}]]; + var inventoryStatus=[[${@dict.getType('inventorySts')}]]; $(function() { $("#bootstrap-table").bootstrapTable({ url: prefix + "/getInventory", @@ -190,7 +190,7 @@ title : '数量' }, { - field : 'status', + field : 'inventorySts', title : '库存状态' , formatter: function(value, row, index) { return $.table.selectDictLabel(inventoryStatus, value); diff --git a/src/main/resources/templates/shipment/shippingCombination/shippingCombination.html b/src/main/resources/templates/shipment/shippingCombination/shippingCombination.html index cf6ddb3..e3dc58a 100644 --- a/src/main/resources/templates/shipment/shippingCombination/shippingCombination.html +++ b/src/main/resources/templates/shipment/shippingCombination/shippingCombination.html @@ -69,7 +69,7 @@ var cancelFlag = [[${@permission.hasPermi('shipment:shippingCombination:remove')}]]; var taskTypeReal=[[${@dict.getType('taskType')}]]; var containerHeaderStatus = [[${@dict.getType('shipmentContainerHeaderStatus')}]]; - var inventoryStatus = [[${@dict.getType('inventoryStatus')}]]; + var inventoryStatus = [[${@dict.getType('inventorySts')}]]; var prefix = ctx + "shipment/shippingCombination";