Commit 5e67d5358f9894aae34eb516b681de2c336f5187

Authored by 游杰
1 parent ccdeec60

增加出库 生成任务之前选择站台

Showing 20 changed files with 539 additions and 84 deletions
.gitignore
... ... @@ -11,6 +11,7 @@ target/
11 11 *.iml
12 12 *.ipr
13 13 .idea/*
  14 +*.log
14 15  
15 16  
16 17 ### NetBeans ###
... ...
src/main/java/com/huaheng/pc/inventory/adjustDetail/service/AdjustDetailServiceImpl.java
... ... @@ -437,7 +437,6 @@ public class AdjustDetailServiceImpl extends ServiceImpl<AdjustDetailMapper, Adj
437 437 inventoryDetail.setMaterialUnit(adjustDetail.getMaterialUnit());
438 438 inventoryDetail.setQty(adjustDetail.getToQty());
439 439 inventoryDetail.setTaskQty(adjustDetail.getToQty());
440   - inventoryDetail.setLockedQty(BigDecimal.ONE);
441 440 inventoryDetail.setInventorySts(adjustDetail.getFromInventorySts());
442 441 inventoryDetail.setSupplierCode(adjustDetail.getSupplierCode());
443 442 inventoryDetail.setReferCode(adjustDetail.getAdjustCode());
... ...
src/main/java/com/huaheng/pc/inventory/inventoryDetail/domain/InventoryDetail.java
... ... @@ -96,12 +96,6 @@ public class InventoryDetail implements Serializable {
96 96 @ApiModelProperty(value="任务数量")
97 97 private BigDecimal taskQty;
98 98  
99   - /**
100   - * 冻结数量
101   - */
102   - @TableField(value = "lockedQty")
103   - @ApiModelProperty(value="冻结数量")
104   - private BigDecimal lockedQty;
105 99  
106 100 /**
107 101 * 库存状态
... ...
src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/controller/ReceiptContainerHeaderController.java
... ... @@ -126,12 +126,14 @@ public class ReceiptContainerHeaderController extends BaseController {
126 126 /**
127 127 * 选择出库口
128 128 */
129   - @GetMapping("/chooseStation/{containerHeaderId}")
130   - public String chooseStation(@PathVariable("containerHeaderId")String containerHeaderId, ModelMap mmap) {
131   - ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getById(containerHeaderId);
  129 + @GetMapping("/chooseStation/{ids}")
  130 + public String chooseStation(@PathVariable("ids")String ids, ModelMap mmap) {
  131 + List<Integer> idList = Arrays.asList(Convert.toIntArray(ids));
  132 + List<Integer> idsList = idList.stream().distinct().collect(Collectors.toList());
  133 + ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getById(idsList.get(0));
132 134 String containerCode = receiptContainerHeader.getContainerCode();
133 135 mmap.put("containerCode", containerCode);
134   - mmap.put("id", containerHeaderId);
  136 + mmap.put("id", ids);
135 137 int taskType = receiptContainerHeader.getTaskType().intValue();
136 138 if(taskType == QuantityConstant.TASK_TYPE_WHOLESHIPMENT ||
137 139 taskType == QuantityConstant.TASK_TYPE_EMPTYSHIPMENT) {
... ... @@ -150,14 +152,17 @@ public class ReceiptContainerHeaderController extends BaseController {
150 152 @Log(title = "设置站台", operating = "设置站台", action = BusinessType.GRANT)
151 153 @PostMapping("/setStation")
152 154 @ResponseBody
153   - public AjaxResult setStation (ReceiptContainerHeader receiptContainerHeader){
154   - Integer containerHeaderId = receiptContainerHeader.getId();
155   - LambdaQueryWrapper<ReceiptContainerHeader> receiptContainerHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
156   - receiptContainerHeaderLambdaQueryWrapper.eq(ReceiptContainerHeader::getId, containerHeaderId);
157   - ReceiptContainerHeader receiptContainerHeader1 = receiptContainerHeaderService.getOne(receiptContainerHeaderLambdaQueryWrapper);
158   - receiptContainerHeader1.setPort(receiptContainerHeader.getPort());
159   - receiptContainerHeaderService.update(receiptContainerHeader1, receiptContainerHeaderLambdaQueryWrapper);
160   - return addTask(String.valueOf(containerHeaderId));
  155 + public AjaxResult setStation (String ids, String type, String containerCode, String port){
  156 + List<Integer> idList = Arrays.asList(Convert.toIntArray(ids));
  157 + List<Integer> idsList = idList.stream().distinct().collect(Collectors.toList());
  158 + for(Integer id : idsList) {
  159 + LambdaQueryWrapper<ReceiptContainerHeader> receiptContainerHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
  160 + receiptContainerHeaderLambdaQueryWrapper.eq(ReceiptContainerHeader::getId, id);
  161 + ReceiptContainerHeader receiptContainerHeader1 = receiptContainerHeaderService.getOne(receiptContainerHeaderLambdaQueryWrapper);
  162 + receiptContainerHeader1.setPort(port);
  163 + receiptContainerHeaderService.update(receiptContainerHeader1, receiptContainerHeaderLambdaQueryWrapper);
  164 + }
  165 + return addTask(ids);
161 166 }
162 167  
163 168 /**
... ...
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/controller/ShipmentContainerHeaderController.java
... ... @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4 4 import com.baomidou.mybatisplus.core.metadata.IPage;
5 5 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
6 6 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  7 +import com.huaheng.common.constant.QuantityConstant;
7 8 import com.huaheng.common.support.Convert;
8 9 import com.huaheng.common.utils.StringUtils;
9 10 import com.huaheng.common.utils.security.ShiroUtils;
... ... @@ -165,10 +166,10 @@ public class ShipmentContainerHeaderController extends BaseController
165 166 for (Integer id : idList) {
166 167 //获取表头
167 168 ShipmentContainerHeader shipmentContainerHeader = shipmentContainerHeaderService.getById(id);
168   - if(shipmentContainerHeader == null){
  169 + if(shipmentContainerHeader == null) {
169 170 return AjaxResult.error("出库货箱id:" + id + "未找到,操作中止");
170 171 }
171   - if(shipmentContainerHeader.getStatus() > 9){
  172 + if(shipmentContainerHeader.getStatus() >= QuantityConstant.TASK_STATUS_RELEASE){
172 173 return AjaxResult.error("出库货箱编码(" + shipmentContainerHeader.getContainerCode() + ")已经生成任务,请不要重复生成,操作中止");
173 174 }
174 175 }
... ...
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/domain/ShipmentContainerHeader.java
... ... @@ -50,6 +50,13 @@ public class ShipmentContainerHeader implements Serializable {
50 50 private String containerType;
51 51  
52 52 /**
  53 + * 任务类型
  54 + */
  55 + @TableField(value = "taskType")
  56 + @ApiModelProperty(value="任务类型")
  57 + private Integer taskType;
  58 +
  59 + /**
53 60 * 状态
54 61 */
55 62 @TableField(value = "status")
... ... @@ -989,4 +996,12 @@ public class ShipmentContainerHeader implements Serializable {
989 996 public void setWaveId(Integer waveId) {
990 997 this.waveId = waveId;
991 998 }
  999 +
  1000 + public Integer getTaskType() {
  1001 + return taskType;
  1002 + }
  1003 +
  1004 + public void setTaskType(Integer taskType) {
  1005 + this.taskType = taskType;
  1006 + }
992 1007 }
993 1008 \ No newline at end of file
... ...
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/service/ShipmentContainerHeaderService.java
... ... @@ -37,4 +37,5 @@ public interface ShipmentContainerHeaderService extends IService&lt;ShipmentContain
37 37  
38 38 boolean cancelShipment(Integer combineHeaderId);
39 39  
  40 + AjaxResult getShipmentInfoByCode(String code);
40 41 }
... ...
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/service/ShipmentContainerHeaderServiceImpl.java
... ... @@ -16,6 +16,7 @@ import com.huaheng.pc.config.material.service.MaterialService;
16 16 import com.huaheng.pc.config.shipmentPreference.service.ShipmentPreferenceService;
17 17 import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail;
18 18 import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService;
  19 +import com.huaheng.pc.receipt.receiptContainerDetail.domain.ReceiptContainerDetail;
19 20 import com.huaheng.pc.shipment.shipmentContainerDetail.domain.ShipmentContainerDetail;
20 21 import com.huaheng.pc.shipment.shipmentContainerDetail.service.ShipmentContainerDetailService;
21 22 import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentCombinationModel;
... ... @@ -33,6 +34,7 @@ import com.huaheng.pc.task.taskHeader.domain.ShipmentTaskCreateModel;
33 34 import com.huaheng.pc.task.taskHeader.domain.TaskHeader;
34 35 import com.huaheng.pc.task.taskHeader.service.ShipmentTaskService;
35 36 import com.huaheng.pc.task.taskHeader.service.TaskHeaderService;
  37 +import io.swagger.models.auth.In;
36 38 import org.springframework.beans.factory.annotation.Autowired;
37 39 import org.springframework.stereotype.Service;
38 40 import javax.annotation.Resource;
... ... @@ -121,7 +123,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont
121 123 throw new ServiceException("录入数量超出明细待出数量");
122 124 }
123 125 //校验库存可用数量
124   - if(inventoryDetail.getQty().subtract(inventoryDetail.getTaskQty()).subtract(inventoryDetail.getLockedQty()).compareTo(shipmentCombinationModel.getShipQty())<0){
  126 + if(inventoryDetail.getQty().subtract(inventoryDetail.getTaskQty()).compareTo(shipmentCombinationModel.getShipQty())<0){
125 127 throw new ServiceException("录入数量超出可出数量");
126 128 }
127 129 if(!shipmentDetail.getMaterialCode().equals(inventoryDetail.getMaterialCode())){
... ... @@ -139,19 +141,14 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont
139 141 //2.更新库存分配数
140 142 inventoryDetail.setTaskQty(inventoryDetail.getTaskQty().add(shipmentCombinationModel.getShipQty()));
141 143 inventoryDetailService.saveOrUpdate(inventoryDetail);
142   - //获取库位,然后锁定
143   -// if(QuantityConstant.STATUS_EMPTY.equals(location.getStatus())) {
144   -// location.setStatus(QuantityConstant.STATUS_LOCK);
145   -// locationService.saveOrUpdate(location);
146   -// }
147 144 //3.更新单据明细的已出库数量
148 145 shipmentDetail.setRequestQty(shipmentDetail.getRequestQty().add(shipmentCombinationModel.getShipQty()));
149 146 int i = shipmentDetail.getShipQty().compareTo(shipmentDetail.getRequestQty());
150 147 if(i > 0){
151 148 shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_WAVE);
152   - }else if(i == 0){
  149 + }else if(i == 0) {
153 150 shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_GROUPDISK);
154   - }else if(i < 0){
  151 + }else if(i < 0) {
155 152 throw new ServiceException("出库数量不能大于单据数量!");
156 153 }
157 154 shipmentDetailService.saveOrUpdate(shipmentDetail);
... ... @@ -185,7 +182,6 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont
185 182 */
186 183 private ShipmentContainerHeader ShipmentContainerHeaderAdd(Location location,
187 184 ShipmentDetail shipmentDetail) {
188   -
189 185 //1.查看是否有状态小于等于20的组盘头,有就需新建组盘头,没有就新建
190 186 LambdaQueryWrapper<ShipmentContainerHeader> lambdaQueryWrapper=Wrappers.lambdaQuery();
191 187 lambdaQueryWrapper.eq(ShipmentContainerHeader::getLocationCode,location.getCode())
... ... @@ -203,25 +199,38 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont
203 199 containerLam.eq(Container::getCode,location.getContainerCode())
204 200 .eq(Container::getWarehouseCode,ShiroUtils.getWarehouseCode());
205 201 Container container = containerService.getOne(containerLam);
206   - if(container == null){
  202 + if(container == null) {
207 203 throw new ServiceException("系统没有此容器编码");
208 204 }
209   - shipmentContainerHeader = new ShipmentContainerHeader();
210   - shipmentContainerHeader.setContainerCode(location.getContainerCode());
211   - shipmentContainerHeader.setLocationCode(location.getCode());
212   - shipmentContainerHeader.setWarehouseCode(ShiroUtils.getWarehouseCode());
213   - shipmentContainerHeader.setCompanyCode(shipmentDetail.getCompanyCode());
214   - shipmentContainerHeader.setPort(shipmentDetail.getPort());
215   - shipmentContainerHeader.setContainerType(container.getContainerType());
216   - shipmentContainerHeader.setStatus(QuantityConstant.SHIPMENT_CONTAINER_BUILD);
217   - shipmentContainerHeader.setTaskCreated(0);
218   - shipmentContainerHeader.setCreatedBy(ShiroUtils.getLoginName());
219   - Boolean flag = this.save(shipmentContainerHeader);
220   - if(flag == false){
221   - throw new ServiceException("新建组盘头失败,sql错误");
  205 + LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery();
  206 + inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getContainerCode, container.getCode());
  207 + List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper);
  208 + int taskType = QuantityConstant.TASK_TYPE_WHOLESHIPMENT;
  209 + if(inventoryDetailList != null && inventoryDetailList.size() > 0) {
  210 + for(InventoryDetail inventoryDetail : inventoryDetailList) {
  211 + if(inventoryDetail.getQty().subtract(inventoryDetail.getTaskQty()).
  212 + compareTo(BigDecimal.ZERO) > 0) {
  213 + taskType = QuantityConstant.TASK_TYPE_SORTINGSHIPMENT;
  214 + }
222 215 }
223   - return shipmentContainerHeader;
224 216 }
  217 + shipmentContainerHeader = new ShipmentContainerHeader();
  218 + shipmentContainerHeader.setContainerCode(location.getContainerCode());
  219 + shipmentContainerHeader.setLocationCode(location.getCode());
  220 + shipmentContainerHeader.setWarehouseCode(ShiroUtils.getWarehouseCode());
  221 + shipmentContainerHeader.setCompanyCode(shipmentDetail.getCompanyCode());
  222 + shipmentContainerHeader.setPort(shipmentDetail.getPort());
  223 + shipmentContainerHeader.setContainerType(container.getContainerType());
  224 + shipmentContainerHeader.setStatus(QuantityConstant.SHIPMENT_CONTAINER_BUILD);
  225 + shipmentContainerHeader.setTaskType(taskType);
  226 + shipmentContainerHeader.setTaskCreated(0);
  227 + shipmentContainerHeader.setCreatedBy(ShiroUtils.getLoginName());
  228 + Boolean flag = this.save(shipmentContainerHeader);
  229 + if (flag == false) {
  230 + throw new ServiceException("新建组盘头失败,sql错误");
  231 + }
  232 + return shipmentContainerHeader;
  233 + }
225 234 }
226 235  
227 236 /**
... ... @@ -624,4 +633,14 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont
624 633 return true;
625 634 }
626 635  
  636 + @Override
  637 + public AjaxResult getShipmentInfoByCode(String code) {
  638 + LambdaQueryWrapper<ShipmentContainerDetail> lambdaQueryWrapper = Wrappers.lambdaQuery();
  639 + lambdaQueryWrapper.eq(ShipmentContainerDetail::getShipmentCode, code)
  640 + .eq(ShipmentContainerDetail::getWarehouseCode, ShiroUtils.getWarehouseCode());
  641 +
  642 + List<ShipmentContainerDetail> shipmentContainerDetails = shipmentContainerDetailService.list(lambdaQueryWrapper);
  643 + return AjaxResult.success(shipmentContainerDetails);
  644 + }
  645 +
627 646 }
... ...
src/main/java/com/huaheng/pc/shipment/shippingCombination/controller/ShippingCombinationController.java
... ... @@ -4,14 +4,18 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4 4 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
5 5 import com.huaheng.common.constant.QuantityConstant;
6 6 import com.huaheng.common.exception.service.ServiceException;
  7 +import com.huaheng.common.support.Convert;
7 8 import com.huaheng.common.utils.StringUtils;
8 9 import com.huaheng.common.utils.security.ShiroUtils;
  10 +import com.huaheng.framework.aspectj.lang.annotation.Log;
  11 +import com.huaheng.framework.aspectj.lang.constant.BusinessType;
9 12 import com.huaheng.framework.web.controller.BaseController;
10 13 import com.huaheng.framework.web.domain.AjaxResult;
11 14 import com.huaheng.framework.web.page.TableDataInfo;
12 15 import com.huaheng.mobile.shipment.Shipment;
13 16 import com.huaheng.pc.config.shipmentPreference.service.ShipmentPreferenceService;
14 17 import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail;
  18 +import com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerHeader;
15 19 import com.huaheng.pc.shipment.shipmentContainerDetail.service.ShipmentContainerDetailService;
16 20 import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentCombinationModel;
17 21 import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader;
... ... @@ -32,7 +36,9 @@ import org.springframework.web.bind.annotation.*;
32 36  
33 37 import javax.annotation.Resource;
34 38 import java.util.ArrayList;
  39 +import java.util.Arrays;
35 40 import java.util.List;
  41 +import java.util.stream.Collectors;
36 42  
37 43 @Controller
38 44 @RequestMapping("/shipment/shippingCombination")
... ... @@ -231,5 +237,84 @@ public class ShippingCombinationController extends BaseController {
231 237 return shipmentContainerHeaderService.cancelCombinationDetail(shipmentContainerDetailIds);
232 238 }
233 239  
  240 + /**
  241 + * 获取出库组盘信息
  242 + */
  243 + @ResponseBody
  244 + @PostMapping("/getShipmentInfoByCode")
  245 + @Log(title = "出库-获取出库组盘信息", operating ="获取出库组盘信息", action = BusinessType.OTHER)
  246 + public AjaxResult getShipmentInfoByCode(String code) {
  247 + AjaxResult result = shipmentContainerHeaderService.getShipmentInfoByCode(code);
  248 + return result;
  249 + }
  250 +
  251 + /**
  252 + * 选择出库口
  253 + */
  254 + @GetMapping("/chooseStation/{ids}")
  255 + public String chooseStation(@PathVariable("ids")String ids, ModelMap mmap) {
  256 + List<Integer> idList = Arrays.asList(Convert.toIntArray(ids));
  257 + List<Integer> idsList = idList.stream().distinct().collect(Collectors.toList());
  258 + ShipmentContainerHeader shipmentContainerHeader = shipmentContainerHeaderService.getById(idsList.get(0));
  259 + String containerCode = shipmentContainerHeader.getContainerCode();
  260 + mmap.put("containerCode", containerCode);
  261 + mmap.put("id", ids);
  262 + int taskType = shipmentContainerHeader.getTaskType().intValue();
  263 + if(taskType == QuantityConstant.TASK_TYPE_WHOLESHIPMENT ||
  264 + taskType == QuantityConstant.TASK_TYPE_EMPTYSHIPMENT) {
  265 + mmap.put("type", QuantityConstant.STATION_OUT);
  266 + } else if(taskType == QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT ||
  267 + taskType == QuantityConstant.TASK_TYPE_SORTINGSHIPMENT ||
  268 + taskType == QuantityConstant.TASK_TYPE_VIEW ||
  269 + taskType == QuantityConstant.TASK_TYPE_CYCLECOUNT) {
  270 + mmap.put("type", QuantityConstant.STATION_PICK);
  271 + } else {
  272 + throw new ServiceException("任务类型不需要选站台");
  273 + }
  274 + return prefix + "/chooseStation";
  275 + }
  276 +
  277 + @Log(title = "设置站台", operating = "设置站台", action = BusinessType.GRANT)
  278 + @PostMapping("/setStation")
  279 + @ResponseBody
  280 + public AjaxResult setStation (String ids, String type, String containerCode, String port){
  281 + List<Integer> idList = Arrays.asList(Convert.toIntArray(ids));
  282 + List<Integer> idsList = idList.stream().distinct().collect(Collectors.toList());
  283 + for(Integer id : idsList) {
  284 + LambdaQueryWrapper<ShipmentContainerHeader> shipmentContainerHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
  285 + shipmentContainerHeaderLambdaQueryWrapper.eq(ShipmentContainerHeader::getId, id);
  286 + ShipmentContainerHeader shipmentContainerHeader1 = shipmentContainerHeaderService.getOne(shipmentContainerHeaderLambdaQueryWrapper);
  287 + shipmentContainerHeader1.setPort(port);
  288 + shipmentContainerHeaderService.update(shipmentContainerHeader1, shipmentContainerHeaderLambdaQueryWrapper);
  289 + }
  290 + return createTask(ids);
  291 + }
234 292  
  293 + /**
  294 + * 生成任务
  295 + */
  296 + @RequiresPermissions("shipment:container:add")
  297 + @Log(title ="出库-任务生成", operating = "批量生成任务", action = BusinessType.UPDATE)
  298 + @PostMapping( "/createTask")
  299 + @ResponseBody
  300 + public AjaxResult createTask(String ids)
  301 + {
  302 + AjaxResult ajaxResult = new AjaxResult();
  303 + if (StringUtils.isEmpty(ids)) {
  304 + return AjaxResult.error("id不能为空");
  305 + }
  306 + List<Integer> idList = Arrays.asList(Convert.toIntArray(ids));
  307 + for (Integer id : idList) {
  308 + //获取表头
  309 + ShipmentContainerHeader shipmentContainerHeader = shipmentContainerHeaderService.getById(id);
  310 + if(shipmentContainerHeader == null) {
  311 + return AjaxResult.error("出库货箱id:" + id + "未找到,操作中止");
  312 + }
  313 + if(shipmentContainerHeader.getStatus() >= QuantityConstant.TASK_STATUS_RELEASE){
  314 + return AjaxResult.error("出库货箱编码(" + shipmentContainerHeader.getContainerCode() + ")已经生成任务,请不要重复生成,操作中止");
  315 + }
  316 + }
  317 + ajaxResult = shipmentContainerHeaderService.createTask(idList);
  318 + return ajaxResult;
  319 + }
235 320 }
... ...
src/main/java/com/huaheng/pc/task/taskHeader/service/ReceiptTaskService.java
... ... @@ -35,6 +35,7 @@ import com.huaheng.pc.receipt.receiptDetail.domain.ReceiptDetail;
35 35 import com.huaheng.pc.receipt.receiptDetail.service.ReceiptDetailService;
36 36 import com.huaheng.pc.receipt.receiptHeader.domain.ReceiptHeader;
37 37 import com.huaheng.pc.receipt.receiptHeader.service.ReceiptHeaderService;
  38 +import com.huaheng.pc.system.config.domain.Config;
38 39 import com.huaheng.pc.task.taskDetail.domain.TaskDetail;
39 40 import com.huaheng.pc.task.taskDetail.service.TaskDetailService;
40 41 import com.huaheng.pc.task.taskHeader.domain.TaskHeader;
... ... @@ -412,7 +413,6 @@ public class ReceiptTaskService {
412 413 inventoryDetail.setMaterialUnit(material.getUnit());
413 414 inventoryDetail.setQty(receiptQty);
414 415 inventoryDetail.setTaskQty(new BigDecimal(0));
415   - inventoryDetail.setLockedQty(new BigDecimal(0));
416 416 inventoryDetail.setInventorySts(taskDetail.getInventorySts());
417 417 inventoryDetail.setSupplierCode(receiptDetail.getSupplierCode());
418 418 inventoryDetail.setReferCode(receiptDetail.getReferCode());
... ...
src/main/java/com/huaheng/pc/task/taskHeader/service/ShipmentTaskService.java
... ... @@ -366,7 +366,7 @@ public class ShipmentTaskService {
366 366 //设置出库货箱表头状态为拣货任务完成
367 367 LambdaUpdateWrapper<ShipmentContainerHeader> shipmentContainerHeaderLambdaUpdateWrapper = Wrappers.lambdaUpdate();
368 368 shipmentContainerHeaderLambdaUpdateWrapper.eq(ShipmentContainerHeader::getId, task.getAllocationHeadId())
369   - .set(ShipmentContainerHeader::getStatus, QuantityConstant.SHIPMENT_CONTAINER_REVIEWSUCCESS);
  369 + .set(ShipmentContainerHeader::getStatus, QuantityConstant.SHIPMENT_CONTAINER_FINISHED);
370 370 if (!containerHeaderService.update(shipmentContainerHeaderLambdaUpdateWrapper)) {
371 371 throw new ServiceException("更新组盘头状态失败");
372 372 }
... ...
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
... ... @@ -219,8 +219,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
219 219 .ne(ReceiptContainerHeader::getStatus, QuantityConstant.RECEIPT_CONTAINER_FINISHED)
220 220 .eq(ReceiptContainerHeader::getWarehouseCode, ShiroUtils.getWarehouseCode());
221 221 ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getOne(lambda);
222   - receiptContainerHeader.setToLocation("");
223   - receiptContainerHeaderService.update(receiptContainerHeader, lambda);
  222 + String value = configService.getKey(QuantityConstant.RULE_TASK_LOCATION);
  223 + int taskLocationRule = Integer.parseInt(value);
  224 + if (taskLocationRule == QuantityConstant.RULE_TASK_NOT_LOCATION) {
  225 + receiptContainerHeader.setToLocation("");
  226 + receiptContainerHeaderService.update(receiptContainerHeader, lambda);
  227 + }
224 228 LambdaQueryWrapper<ReceiptContainerDetail> receiptContainerDetailLambdaQueryWrapper = Wrappers.lambdaQuery();
225 229 receiptContainerDetailLambdaQueryWrapper.eq(ReceiptContainerDetail::getReceiptContainerId, receiptContainerHeader.getId());
226 230 List<ReceiptContainerDetail> receiptContainerDetailList = receiptContainerDetailService.list(receiptContainerDetailLambdaQueryWrapper);
... ...
src/main/java/com/huaheng/pc/task/taskHeader/service/TransferTaskService.java
... ... @@ -175,7 +175,6 @@ public class TransferTaskService {
175 175 taskDetail.setInventorySts(inventoryDetail.getInventorySts());
176 176 taskDetail.setFromInventoryId(inventoryDetail.getId());
177 177 taskDetail.setToInventoryId(inventoryDetail.getId());
178   - inventoryDetail.setLockedQty(inventoryDetail.getQty());
179 178 if (!taskDetailService.save(taskDetail) || !inventoryDetailService.updateById(inventoryDetail)) {
180 179 throw new ServiceException("创建任务失败");
181 180 }
... ... @@ -240,7 +239,6 @@ public class TransferTaskService {
240 239 .in(InventoryHeader::getId, inventoryHeadIdList);
241 240 LambdaUpdateWrapper<InventoryDetail> detailUpdateWrapper = Wrappers.lambdaUpdate();
242 241 detailUpdateWrapper.set(InventoryDetail::getLocationCode, taskHeader.getToLocation())
243   - .set(InventoryDetail::getLockedQty, BigDecimal.ZERO)
244 242 .in(InventoryDetail::getInventoryHeaderId, inventoryHeadIdList);
245 243 if (inventoryHeadIdList.size() != 0) {
246 244 if (!inventoryHeaderService.update(headerUpdateWrapper) ||
... ...
src/main/java/com/huaheng/pc/task/taskHeader/service/WorkTaskService.java
... ... @@ -341,7 +341,6 @@ public class WorkTaskService {
341 341 .eq(InventoryDetail::getLocationCode, locationCode);
342 342 List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(queryWrapper);
343 343 for (InventoryDetail inventoryDetail : inventoryDetailList) {
344   - inventoryDetail.setLockedQty(inventoryDetail.getQty());
345 344 TaskDetail taskDetail = new TaskDetail();
346 345 taskDetail.setTaskId(taskHeader.getId());
347 346 taskDetail.setTaskType(taskHeader.getTaskType());
... ... @@ -444,8 +443,7 @@ public class WorkTaskService {
444 443 LambdaUpdateWrapper<InventoryDetail> queryWrapper = Wrappers.lambdaUpdate();
445 444 queryWrapper.eq(InventoryDetail::getLocationCode, taskHeader.getToLocation())
446 445 .eq(InventoryDetail::getContainerCode, taskHeader.getContainerCode())
447   - .eq(InventoryDetail::getWarehouseCode, ShiroUtils.getWarehouseCode())
448   - .set(InventoryDetail::getLockedQty, BigDecimal.ZERO);
  446 + .eq(InventoryDetail::getWarehouseCode, ShiroUtils.getWarehouseCode());
449 447 if (!inventoryDetailService.update(queryWrapper)) {
450 448 throw new ServiceException("更新失败");
451 449 }
... ...
src/main/resources/templates/receipt/receiptContainerHeader/chooseStation.html
... ... @@ -52,7 +52,24 @@
52 52 },
53 53 },
54 54 submitHandler: function(form) {
55   - $.operate.save(prefix + "/setStation", $('#form-choose-station').serialize());
  55 + $.ajax({
  56 + cache : true,
  57 + type : "POST",
  58 + url : prefix + "/setStation",
  59 + data : {
  60 + "ids": $("input[name='id']").val(),
  61 + "type": $("input[name='type']").val(),
  62 + "containerCode": $("input[name='containerCode']").val(),
  63 + "port": $("#port option:selected").val(),
  64 + },
  65 + async : false,
  66 + error : function(request) {
  67 + $.modal.alertError("请求失败!");
  68 + },
  69 + success : function(data) {
  70 + $.operate.saveSuccess(data);
  71 + }
  72 + });
56 73 }
57 74 });
58 75  
... ...
src/main/resources/templates/receipt/receiptContainerHeader/receiptContainerHeader.html
... ... @@ -151,7 +151,6 @@
151 151 } else {
152 152 actions.push('<a class="btn btn-success btn-xs ' + createTaskFlag + '" href="#" onclick="createTask(\'' + row.id + '\')"><i class="fa fa-edit"></i>生成任务</a> ');
153 153 }
154   - debugger;
155 154 }
156 155 if (row.status == 0) {
157 156 actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>取消配盘</a>');
... ... @@ -315,11 +314,12 @@
315 314 }
316 315  
317 316 function chooseStation(id) {
318   - var url = prefix + "/chooseStation" + "/" + id;
  317 + var url = ctx + "receipt/receiptContainerHeader/chooseStation" + "/" + id;
319 318 $.modal.open("选择站台", url);
320 319 }
321 320  
322 321  
  322 +
323 323 /* 单个生成任务 */
324 324 function createTask(id) {
325 325 var url = prefix + "/createTask";
... ... @@ -334,15 +334,21 @@
334 334 $.modal.alertWarning("请至少选择一条记录");
335 335 return;
336 336 }
337   - var url = prefix + "/createTask";
338   - var ids = "";
339   - for(var i=0; i<rows.length; i++) {
340   - ids = ids + rows[i].id + ","
341   - }
342   - var data = { "ids": ids.substring(0, ids.length-1) };
343   - $.operate.post(url, data);
  337 + var ids = "";
  338 + for (var i = 0; i < rows.length; i++) {
  339 + ids = ids + rows[i].id + ","
  340 + }
  341 + var data = {"ids": ids.substring(0, ids.length - 1)};
  342 + debugger
  343 + chooseStation(ids);
  344 +
344 345 }
345 346  
  347 + function chooseStation(id) {
  348 + var url = ctx + "receipt/receiptContainerHeader/chooseStation" + "/" + id;
  349 + $.modal.open("选择站台", url);
  350 + }
  351 +
346 352 function position(id){
347 353 var url = prefix + "/position/";
348 354 var data = { "ids" : id };
... ...
src/main/resources/templates/receipt/receiving/receiving.html
... ... @@ -53,35 +53,50 @@
53 53 </div>
54 54 <div class="col-sm-12 select-info table-striped-right">
55 55 <ul class="select-list">
56   - <li style="display: none">id:<input type="text" id="detailId" /></li>
57   - <li>收货数量:<input type="text" id="receiveNum" /></li>
58   - <li>容器编号:<input type="text" id="containerCode" /></li>
59   - <li><button class="btn btn-sm btn-success" onclick="receipt()">组盘</button></li>
  56 + <li style="display: none">id:<input type="text" id="detailId"/></li>
  57 + <li>收货数量:<input type="text" id="receiveNum"/></li>
  58 + <li>容器编号:<input type="text" id="containerCode"/></li>
  59 + <li>
  60 + <button class="btn btn-sm btn-success" onclick="receipt()">组盘</button>
  61 + </li>
60 62 </ul>
61 63 <div class="btn-group hidden-xs" id="toolbar1" role="group">
62   - <a class="btn btn-outline btn-success btn-rounded" onclick="positioning()" shiro:hasPermission="receipt:receiptDetail:add">
  64 + <a class="btn btn-outline btn-success btn-rounded" onclick="positioning()"
  65 + shiro:hasPermission="receipt:receiptDetail:add">
63 66 <i class="fa fa-map-pin"></i> 定位
64 67 </a>
65   - <a class="btn btn-outline btn-info btn-rounded" onclick="cancelPositioning()" shiro:hasPermission="receipt:receiptDetail:remove">
  68 + <a class="btn btn-outline btn-info btn-rounded" onclick="cancelPositioning()"
  69 + shiro:hasPermission="receipt:receiptDetail:remove">
66 70 <i class="fa fa-times"></i> 取消定位
67 71 </a>
68   - <a class="btn btn-outline btn-danger btn-rounded" onclick="batRemove()" shiro:hasPermission="receipt:receiptDetail:remove">
  72 + <a class="btn btn-outline btn-danger btn-rounded" onclick="batRemove()"
  73 + shiro:hasPermission="receipt:receiptDetail:remove">
69 74 <i class="fa fa-trash-o"></i> 取消收货
70 75 </a>
71   - <a class="btn btn-outline btn-warning btn-rounded" onclick="createTask()" shiro:hasPermission="receipt:receiptContainer:add">
  76 + <a class="btn btn-outline btn-warning btn-rounded" onclick="createTask()"
  77 + shiro:hasPermission="receipt:receiptContainer:add">
72 78 <i class="fa fa-edit"></i> 生成任务
73 79 </a>
74 80 </div>
75   - <table id="bootstrap-table1" data-mobile-responsive="true" class="table table-bordered table-hover text-nowrap"></table>
76   - <hr style="border-top:1px solid white;">
77   - <ul class="select-list">
  81 + <table id="bootstrap-table1" data-mobile-responsive="true"
  82 + class="table table-bordered table-hover text-nowrap"></table>
  83 + <ul class="select-list top_text">
78 84 <li><span class="table-title">本物料库存</span></li>
79 85 </ul>
80   - <table id="bootstrap-table2" data-mobile-responsive="true" class="table table-bordered table-hover text-nowrap"></table>
81   - <ul class="select-list">
82   - <li><span class="table-title">空料盒</span></li>
  86 + <table id="bootstrap-table2" data-mobile-responsive="true"
  87 + class="table table-bordered table-hover text-nowrap"></table>
  88 +
  89 + <ul class="select-list top_text">
  90 + <li>空容器类型:<select name="type" id="containerType" th:with="typeList=${@containerType.getCode()}">
  91 + <option value="">所有</option>
  92 + <option th:each="c:${typeList}" th:text="${c['name']}" th:value="${c['code']}"></option>
  93 + </select></li>
  94 + <li>
  95 + <button class="btn btn-sm btn-success" onclick="containerTypeSearch()">搜索</button>
  96 + </li>
83 97 </ul>
84   - <table id="bootstrap-table3" data-mobile-responsive="true" class="table table-bordered table-hover text-nowrap"></table>
  98 + <table id="bootstrap-table3" data-mobile-responsive="true"
  99 + class="table table-bordered table-hover text-nowrap"></table>
85 100 </div>
86 101 </div>
87 102 </div>
... ... @@ -613,8 +628,13 @@
613 628 return;
614 629 }
615 630 if(rows[0].taskType == 200) {
  631 + let ids = "";
616 632 for(let i=0; i<rows.length; i++) {
617   - ids = ids + rows[i].receiptContainerId + ","
  633 + if(ids == "") {
  634 + ids = rows[i].receiptContainerId;
  635 + } else {
  636 + ids = ids + "," + rows[i].receiptContainerId
  637 + }
618 638 }
619 639 chooseStation(ids);
620 640 } else {
... ... @@ -642,8 +662,13 @@
642 662 };
643 663 $.ajax(config)
644 664 }
  665 + }
645 666  
646   -
  667 + function containerTypeSearch() {
  668 + var params = {
  669 + query:{containerType:$("#containerType").val()}
  670 + }
  671 + $("#bootstrap-table3").bootstrapTable('refresh',params);
647 672 }
648 673 </script>
649 674 </body>
... ...
src/main/resources/templates/shipment/shipmentContainerHeader/shipmentContainerHeader.html
... ... @@ -175,7 +175,7 @@
175 175 // actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
176 176 actions.push('<a class="btn btn-info btn-xs " href="#" onclick="detail(\'' + row.id + '\')"><i class="fa fa-list-ul"></i>明细</a> ');
177 177 if (row.status == 0) {
178   - actions.push('<a class="btn btn-success btn-xs ' + createTaskFlag + '" href="#" onclick="createTask(\'' + row.id + '\')"><i class="fa fa-cab"></i>生成任务</a> ');
  178 + actions.push('<a class="btn btn-success btn-xs ' + createTaskFlag + '" href="#" onclick="chooseStation(\'' + row.id + '\')"><i class="fa fa-cab"></i>生成任务</a> ');
179 179 actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="removeHead(\'' + row.id + '\')"><i class="fa fa-remove"></i>取消配盘</a>');
180 180 }
181 181 return actions.join('');
... ... @@ -340,8 +340,18 @@
340 340 createtable(url,shippingContainerId);
341 341 }
342 342  
  343 + function chooseStation(id) {
  344 + var url = ctx + "shipment/shippingCombination/chooseStation" + "/" + id;
  345 + $.modal.open("选择站台", url);
  346 + }
  347 +
  348 + function refresh() {
  349 + $.table.search();
  350 + }
  351 +
343 352 /* 单个生成任务 */
344 353 function createTask(id) {
  354 +
345 355 var url = prefix + "/createTask";
346 356 var data = { "ids" : id };
347 357 $.operate.post(url, data);
... ...
src/main/resources/templates/shipment/shippingCombination/chooseStation.html 0 → 100644
  1 +<!DOCTYPE HTML>
  2 +<html lang="zh" xmlns:th="http://www.thymeleaf.org">
  3 +<meta charset="utf-8">
  4 +<head>
  5 + <th:block th:include="include :: header" />
  6 + <th:block th:include="include :: select2-css" />
  7 +</head>
  8 +<body class="white-bg">
  9 +<div class="wrapper wrapper-content animated fadeInRight ibox-content">
  10 + <form class="form-horizontal m" id="form-choose-station">
  11 +
  12 + <div class="form-group">
  13 + <div class="col-sm-8">
  14 + <input id="id" name="id" type="hidden" th:value="${id}" >
  15 + </div>
  16 + </div>
  17 +
  18 + <div class="form-group">
  19 + <div class="col-sm-8">
  20 + <input id="type" name="type" type="hidden" th:value="${type}" >
  21 + </div>
  22 + </div>
  23 +
  24 + <div class="form-group">
  25 + <div class="col-sm-8">
  26 + <input id="containerCode" name="containerCode" type="hidden" th:value="${containerCode}" >
  27 + </div>
  28 + </div>
  29 +
  30 + <div class="form-group">
  31 + <label class="col-sm-3 control-label">出入口:</label>
  32 + <div class="col-sm-8">
  33 + <select id="port" name="port" class="form-control"></select>
  34 + </div>
  35 + </div>
  36 + <div class="form-group">
  37 + <div class="form-control-static col-sm-offset-9">
  38 + <button type="submit" class="btn btn-primary">执行</button>
  39 + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
  40 + </div>
  41 + </div>
  42 + </form>
  43 +</div>
  44 +<div th:include="include::footer"></div>
  45 +<th:block th:include="include :: select2-js" />
  46 +<script type="text/javascript">
  47 + var prefix = ctx + "shipment/shippingCombination";
  48 + $("#form-choose-station").validate({
  49 + rules:{
  50 + port:{
  51 + required:true,
  52 + },
  53 + },
  54 + submitHandler: function(form) {
  55 + $.ajax({
  56 + cache : true,
  57 + type : "POST",
  58 + url : prefix + "/setStation",
  59 + data : {
  60 + "ids": $("input[name='id']").val(),
  61 + "type": $("input[name='type']").val(),
  62 + "containerCode": $("input[name='containerCode']").val(),
  63 + "port": $("#port option:selected").val(),
  64 + },
  65 + async : false,
  66 + error : function(request) {
  67 + $.modal.alertError("请求失败!");
  68 + },
  69 + success : function(data) {
  70 + $.modal.close("成功");
  71 + parent.refresh();
  72 + }
  73 + });
  74 + }
  75 + });
  76 +
  77 + function myFunction() {
  78 + var containerCode = document.getElementById("containerCode").value;
  79 + var type = document.getElementById("type").value;
  80 + var data = { "containerCode": containerCode, "type":type };
  81 + $('#port').select2({
  82 + ajax: {
  83 + url: ctx+'config/station/getStationFromType',
  84 + dataType: 'json',
  85 + type: 'post',
  86 + data: data,
  87 + success: function(data) {
  88 +
  89 + }
  90 + }
  91 + });
  92 + }
  93 +
  94 + $(function () {
  95 + myFunction();
  96 + })
  97 +
  98 +</script>
  99 +
  100 +</body>
  101 +</html>
0 102 \ No newline at end of file
... ...
src/main/resources/templates/shipment/shippingCombination/shippingCombination.html
... ... @@ -60,6 +60,16 @@
60 60 <li>出货数量:<input type="text" id="receiveNum" /></li>
61 61 </ul>
62 62 <table id="bootstrap-table1" data-mobile-responsive="true" class="table table-bordered table-hover"></table>
  63 + <div class="btn-group hidden-xs" id="toolbar1" role="group">
  64 + <a class="btn btn-outline btn-danger btn-rounded" onclick="batchRemoveHead()">
  65 + <i class="fa fa-trash-o"></i> 取消配盘
  66 + </a>
  67 + <a class="btn btn-outline btn-warning btn-rounded" onclick="batchCreateTask()">
  68 + <i class="fa fa-edit"></i> 生成任务
  69 + </a>
  70 + </div>
  71 + <table id="bootstrap-table2" data-mobile-responsive="true"
  72 + class="table table-bordered table-hover text-nowrap"></table>
63 73 </div>
64 74 </div>
65 75 </div>
... ... @@ -84,7 +94,8 @@
84 94 let qtyCompleted_shipment=0;
85 95 for (let i=0;i<value.data.length;i++){
86 96 if(value.data[i].shipQty>value.data[i].requestQty){
87   - $("#bootstrap-table").bootstrapTable('insertRow',{index:0,row:{id:value.data[i].id,
  97 + $("#bootstrap-table").bootstrapTable('insertRow',{index:0,row:{
  98 + id:value.data[i].id,
88 99 shipmentId:value.data[i].shipmentId,
89 100 shipmentCode:value.data[i].shipmentCode,
90 101 materialCode:value.data[i].materialCode,
... ... @@ -201,7 +212,7 @@
201 212 events:'operateEvents',
202 213 formatter: function(value, row, index) {
203 214 let actions = [];
204   - actions.push('<a id="cancel" class="btn btn-success btn-xs" style="background-color: #ac2925" href="#" onclick="Combination(\'' + row.id + '\')"><i class="fa fa-edit"></i>盘</a> ');
  215 + actions.push('<a id="cancel" class="btn btn-success btn-xs" style="background-color: #ac2925" href="#" onclick="Combination(\'' + row.id + '\')"><i class="fa fa-edit"></i>盘</a> ');
205 216 return actions.join('');
206 217 }
207 218 },
... ... @@ -253,6 +264,158 @@
253 264 ]
254 265 });
255 266  
  267 + $("#bootstrap-table2").bootstrapTable({
  268 + removeUrl: ctx + "shipment/shipmentContainerDetail/remove",
  269 + // search: true, //搜索
  270 + showRefresh: true, //刷新
  271 + showToggle:true, //视图切换
  272 + clickToSelect: true,
  273 + showColumns:true, //列选择
  274 + // detailView:true,
  275 + toolbar: "#toolbar1",
  276 + showExport: true, //导出
  277 + exportDataType: "all", //导出类型basic', 'all', 'selected'.当前页、所有数据、选中数据
  278 + modalName: "出库组盘",
  279 + iconSize: "outline",
  280 + toolbar: "#toolbar1",
  281 + contentType: "application/x-www-form-urlencoded",
  282 + onRefresh: function(){
  283 + list_shipmenttInfo($("#code").val());
  284 + },
  285 + columns: [
  286 + {
  287 + checkbox: true
  288 + },
  289 + {
  290 + field : 'containerCode',
  291 + title : '容器编号'
  292 + },
  293 + {
  294 + field : 'locationCode',
  295 + title : '库位编号'
  296 + },
  297 + {
  298 + field : 'materialCode',
  299 + title : '物料编码'
  300 + },
  301 + {
  302 + field:"materialName",
  303 + title:"物料名称"
  304 + },
  305 + {
  306 + field:"materialSpec",
  307 + title:"物料规格"
  308 + },
  309 + {
  310 + field : 'qty',
  311 + title : '数量'
  312 + },
  313 + {
  314 + field : 'status',
  315 + title : '组盘状态',
  316 + align: 'center',
  317 + formatter: function(value, row, index) {
  318 + return $.table.selectDictLabel(containerHeaderStatus, value);
  319 + }
  320 + },
  321 + {
  322 + field : 'created',
  323 + title : '创建时间'
  324 + },
  325 + {
  326 + field : 'createdBy',
  327 + title : '创建人'
  328 + },
  329 + ]
  330 + });
  331 +
  332 + function list_shipmentInfo(code) {
  333 + debugger;
  334 + $.ajax({
  335 + url: prefix + "/getShipmentInfoByCode",
  336 + type: 'post',
  337 + datatype: 'json',
  338 + data: {
  339 + code: code
  340 + },
  341 + error:function (response) {
  342 + console.log(response);
  343 + },
  344 + success: function (value) {
  345 + $("#bootstrap-table2").bootstrapTable('removeAll');
  346 + if(value.data){
  347 + for (var i = 0; i < value.data.length; i++) {
  348 + $("#bootstrap-table2").bootstrapTable('insertRow',{index:0,row:{
  349 + containerCode: value.data[i].containerCode,
  350 + locationCode: value.data[i].locationCode,
  351 + materialCode: value.data[i].materialCode,
  352 + materialName: value.data[i].materialName,
  353 + materialSpec: value.data[i].materialSpec,
  354 + status: value.data[i].status,
  355 + shippingContainerId:value.data[i].shippingContainerId,
  356 + qty: value.data[i].qty,
  357 + created: value.data[i].created,
  358 + createdBy: value.data[i].createdBy,
  359 + }
  360 + });
  361 + }
  362 + }
  363 + else {
  364 + console.log("没有查找到入库容器!")
  365 + }
  366 + }
  367 + })
  368 + }
  369 +
  370 + /* 批量生成任务 */
  371 + function batchCreateTask() {
  372 + let rows=$("#bootstrap-table2").bootstrapTable('getSelections');
  373 + if (rows.length == 0) {
  374 + $.modal.alertWarning("请至少选择一条记录");
  375 + return;
  376 + }
  377 + var ids = "";
  378 + for(var i=0; i<rows.length; i++) {
  379 + if(ids == "") {
  380 + ids = rows[i].shippingContainerId;
  381 + } else {
  382 + ids = ids + "," + rows[i].shippingContainerId
  383 + }
  384 + }
  385 + debugger;
  386 + chooseStation(ids);
  387 + }
  388 +
  389 +
  390 + /* 批量取消组盘 */
  391 + function batchRemoveHead() {
  392 + var rows=$("#bootstrap-table2").bootstrapTable('getSelections');
  393 + if (rows.length == 0) {
  394 + $.modal.alertWarning("请至少选择一条记录");
  395 + return;
  396 + }
  397 + var url = ctx + "shipment/shipmentContainerHeader" + "/remove";
  398 + var ids = "";
  399 + for(var i=0; i<rows.length; i++) {
  400 + ids = ids + rows[i].shippingContainerId + ","
  401 + }
  402 + var data = { "ids": ids.substring(0, ids.length-1) };
  403 + $.ajax({
  404 + url: url,
  405 + type:'post',
  406 + data: data,
  407 + success:function (response) {
  408 + if(response.code===200){
  409 + list_select($("#code").val());
  410 + list_shipmentInfo($("#code").val());
  411 + $.modal.msgSuccess('成功');
  412 + } else {
  413 + $.modal.msg(response.msg)
  414 + }
  415 + }
  416 + })
  417 + }
  418 +
256 419 function Combination(id) {
257 420 let num=$("#receiveNum").val();
258 421 let shipmentDetailId=$("#detailId").val();
... ... @@ -268,6 +431,7 @@
268 431 if(response.code===200){
269 432 $.modal.msgSuccess('成功');
270 433 $("#list-btn").click();
  434 + list_shipmentInfo($("#code").val());
271 435 }
272 436 else {
273 437 $.modal.msg(response.msg)
... ... @@ -276,6 +440,11 @@
276 440 })
277 441 }
278 442  
  443 + function chooseStation(id) {
  444 + let url = ctx + "shipment/shippingCombination/chooseStation" + "/" + id;
  445 + $.modal.open("选择站台", url);
  446 + }
  447 +
279 448 function submit(url, type, dataType, data,content) {
280 449 $.modal.loading("正在处理中,请稍后...");
281 450 var config = {
... ... @@ -297,6 +466,11 @@
297 466 $.ajax(config)
298 467 }
299 468  
  469 + function refresh() {
  470 + list_select($("#code").val());
  471 + list_shipmentInfo($("#code").val());
  472 + }
  473 +
300 474 function initPage() {
301 475 let auto = localStorage.getItem("auto");
302 476 let shipmentCode = localStorage.getItem("shipmentCode");
... ... @@ -319,12 +493,14 @@
319 493 }
320 494 localStorage.removeItem("shipmentCode");
321 495 localStorage.removeItem("auto");
  496 + list_shipmentInfo($("#code").val());
322 497 }
323 498  
324 499 $(function() {
325 500  
326 501 $("#list-btn").click(function () {
327 502 list_select($("#code").val());
  503 + list_shipmentInfo($("#code").val());
328 504 });
329 505  
330 506 initPage();
... ...