Commit 8245f706e89643ac6350e018fa1d8699cc1e842f

Authored by mahuandong
2 parents c01282b8 8fb43f64

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

src/main/java/com/huaheng/pc/inventory/adjustDetail/controller/adjustDetailController.java
@@ -9,6 +9,7 @@ import com.huaheng.common.utils.security.ShiroUtils; @@ -9,6 +9,7 @@ import com.huaheng.common.utils.security.ShiroUtils;
9 import com.huaheng.framework.aspectj.lang.annotation.Log; 9 import com.huaheng.framework.aspectj.lang.annotation.Log;
10 import com.huaheng.framework.aspectj.lang.constant.BusinessType; 10 import com.huaheng.framework.aspectj.lang.constant.BusinessType;
11 import com.huaheng.framework.web.controller.BaseController; 11 import com.huaheng.framework.web.controller.BaseController;
  12 +import com.huaheng.framework.web.domain.AjaxResult;
12 import com.huaheng.framework.web.page.PageDomain; 13 import com.huaheng.framework.web.page.PageDomain;
13 import com.huaheng.framework.web.page.TableDataInfo; 14 import com.huaheng.framework.web.page.TableDataInfo;
14 import com.huaheng.framework.web.page.TableSupport; 15 import com.huaheng.framework.web.page.TableSupport;
@@ -16,6 +17,7 @@ import com.huaheng.pc.inventory.adjustDetail.domain.AdjustDetail; @@ -16,6 +17,7 @@ import com.huaheng.pc.inventory.adjustDetail.domain.AdjustDetail;
16 import com.huaheng.pc.inventory.adjustDetail.service.AdjustDetailService; 17 import com.huaheng.pc.inventory.adjustDetail.service.AdjustDetailService;
17 import com.huaheng.pc.inventory.adjustHeader.service.AdjustHeaderService; 18 import com.huaheng.pc.inventory.adjustHeader.service.AdjustHeaderService;
18 import org.springframework.stereotype.Controller; 19 import org.springframework.stereotype.Controller;
  20 +import org.springframework.ui.ModelMap;
19 import org.springframework.web.bind.annotation.GetMapping; 21 import org.springframework.web.bind.annotation.GetMapping;
20 import org.springframework.web.bind.annotation.PostMapping; 22 import org.springframework.web.bind.annotation.PostMapping;
21 import org.springframework.web.bind.annotation.RequestMapping; 23 import org.springframework.web.bind.annotation.RequestMapping;
@@ -96,7 +98,36 @@ public class adjustDetailController extends BaseController { @@ -96,7 +98,36 @@ public class adjustDetailController extends BaseController {
96 } 98 }
97 } 99 }
98 100
  101 + /**
  102 + * 只调整数量
  103 + * 修改
  104 + */
  105 + @GetMapping("/adjustEdit")
  106 + public String editAdjust(Integer id, ModelMap mmap)
  107 + {
  108 + AdjustDetail adjustDetailEdit = adjustDetailService.getById(id);
  109 + mmap.put("adjustDetailEdit", adjustDetailEdit);
  110 + return prefix + "/adjustEdit";
  111 + }
99 112
  113 + /**
  114 + * 修改保存调整数量
  115 + */
  116 + //@RequiresPermissions("inventory:cyclecountAdjustDetail:addAdjust")
  117 + @Log(title = "库存-调整单", operating = "调整单调整库存差异,调整数量", action = BusinessType.UPDATE)
  118 + @PostMapping("/editAdjustSave")
  119 + @ResponseBody
  120 + public AjaxResult editAdjustSave(AdjustDetail adjustDetail)
  121 + {
  122 + //未上传不允许进行明细差异调整
  123 +// CyclecountAdjust cyclecountAdjust = cycleconutAdjustService.selectEntityById(cyclecountAdjustDetail.getCyclecountAdjustId());
  124 +// if(cyclecountAdjust.getStatus() != 30 ){
  125 +// return AjaxResult.error("单据未上传,没有调整单下发,不允许差异调整!!");
  126 +// //throw new ServiceException("单据未上传,没有调整单下发,不允许差异调整!");
  127 +// }
  128 + AjaxResult result = adjustDetailService.updateAdjustDetail(adjustDetail);
  129 + return result;
  130 + }
100 131
101 132
102 133
src/main/java/com/huaheng/pc/inventory/adjustDetail/domain/AdjustDetail.java
@@ -34,6 +34,13 @@ public class AdjustDetail implements Serializable { @@ -34,6 +34,13 @@ public class AdjustDetail implements Serializable {
34 private String cycleCountCode; 34 private String cycleCountCode;
35 35
36 /** 36 /**
  37 + * 库存明细ID
  38 + */
  39 + @TableField(value = "inventoryDetailId")
  40 + @ApiModelProperty(value = "库存明细ID")
  41 + private Integer inventoryDetailId;
  42 +
  43 + /**
37 * 盘点单号行号 44 * 盘点单号行号
38 */ 45 */
39 @TableField(value = "cycleDetailId") 46 @TableField(value = "cycleDetailId")
@@ -249,6 +256,18 @@ public class AdjustDetail implements Serializable { @@ -249,6 +256,18 @@ public class AdjustDetail implements Serializable {
249 @TableField(value = "containerCode") 256 @TableField(value = "containerCode")
250 @ApiModelProperty(value = "容器编码") 257 @ApiModelProperty(value = "容器编码")
251 private String containerCode; 258 private String containerCode;
  259 + /**
  260 + * 更新人
  261 + * */
  262 + @TableField(value = "lastUpdatedBy")
  263 + @ApiModelProperty(value = "更新人")
  264 + private String lastUpdatedBy;
  265 + /**
  266 + * 更新时间
  267 + */
  268 + @TableField(value = "lastUpdated")
  269 + @ApiModelProperty(value = "更新时间")
  270 + private Date lastUpdated;
252 271
253 272
254 private static final long serialVersionUID = 1L; 273 private static final long serialVersionUID = 1L;
src/main/java/com/huaheng/pc/inventory/adjustDetail/service/AdjustDetailService.java
1 package com.huaheng.pc.inventory.adjustDetail.service; 1 package com.huaheng.pc.inventory.adjustDetail.service;
2 2
3 import com.baomidou.mybatisplus.extension.service.IService; 3 import com.baomidou.mybatisplus.extension.service.IService;
  4 +import com.huaheng.framework.web.domain.AjaxResult;
4 import com.huaheng.pc.inventory.adjustDetail.domain.AdjustDetail; 5 import com.huaheng.pc.inventory.adjustDetail.domain.AdjustDetail;
5 6
6 7
7 8
8 public interface AdjustDetailService extends IService<AdjustDetail> { 9 public interface AdjustDetailService extends IService<AdjustDetail> {
9 10
10 - 11 + AjaxResult updateAdjustDetail(AdjustDetail adjustDetail);
11 12
12 } 13 }
13 14
src/main/java/com/huaheng/pc/inventory/adjustDetail/service/AdjustDetailServiceImpl.java
1 package com.huaheng.pc.inventory.adjustDetail.service; 1 package com.huaheng.pc.inventory.adjustDetail.service;
2 2
  3 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  4 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  5 +import com.huaheng.common.utils.security.ShiroUtils;
  6 +import com.huaheng.framework.web.domain.AjaxResult;
  7 +import com.huaheng.pc.config.container.service.ContainerService;
  8 +import com.huaheng.pc.config.location.service.LocationService;
  9 +import com.huaheng.pc.inventory.adjustHeader.domain.AdjustHeader;
  10 +import com.huaheng.pc.inventory.adjustHeader.service.AdjustHeaderService;
  11 +import com.huaheng.pc.inventory.cycleCountDetail.service.CycleCountDetailService;
  12 +import com.huaheng.pc.inventory.cycleCountHeader.service.CycleCountHeaderService;
  13 +import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail;
  14 +import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService;
  15 +import com.huaheng.pc.inventory.inventoryHeader.domain.InventoryHeader;
  16 +import com.huaheng.pc.inventory.inventoryHeader.service.InventoryHeaderService;
  17 +import com.huaheng.pc.inventory.inventoryTransaction.domain.InventoryTransaction;
  18 +import com.huaheng.pc.inventory.inventoryTransaction.service.InventoryTransactionService;
  19 +import io.swagger.models.auth.In;
3 import org.springframework.stereotype.Service; 20 import org.springframework.stereotype.Service;
4 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 21 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5 import com.huaheng.pc.inventory.adjustDetail.domain.AdjustDetail; 22 import com.huaheng.pc.inventory.adjustDetail.domain.AdjustDetail;
6 import com.huaheng.pc.inventory.adjustDetail.mapper.AdjustDetailMapper; 23 import com.huaheng.pc.inventory.adjustDetail.mapper.AdjustDetailMapper;
  24 +import org.springframework.transaction.annotation.Transactional;
  25 +
  26 +import javax.annotation.Resource;
  27 +import java.math.BigDecimal;
  28 +import java.net.CacheResponse;
  29 +import java.util.Date;
  30 +import java.util.List;
  31 +import java.util.WeakHashMap;
  32 +
7 @Service 33 @Service
8 public class AdjustDetailServiceImpl extends ServiceImpl<AdjustDetailMapper, AdjustDetail> implements AdjustDetailService { 34 public class AdjustDetailServiceImpl extends ServiceImpl<AdjustDetailMapper, AdjustDetail> implements AdjustDetailService {
9 35
  36 +
  37 + @Resource
  38 + private AdjustHeaderService adjustHeaderService;
  39 + @Resource
  40 + private CycleCountHeaderService cycleCountHeaderService;
  41 + @Resource
  42 + private CycleCountDetailService cycleCountDetailService;
  43 + @Resource
  44 + private InventoryHeaderService inventoryHeaderService;
  45 + @Resource
  46 + private InventoryDetailService inventoryDetailService;
  47 + @Resource
  48 + private InventoryTransactionService inventoryTransactionService;
  49 + @Resource
  50 + private LocationService locationService;
  51 + @Resource
  52 + private ContainerService containerService;
  53 +
  54 +
  55 +
  56 +
  57 +
  58 +
  59 +
  60 + /**
  61 + * 调整库存数量
  62 + * @param adjustDetail
  63 + * @return
  64 + */
  65 + @Transactional
  66 + @Override
  67 + public AjaxResult updateAdjustDetail(AdjustDetail adjustDetail) {
  68 + /*修改库存数量,调整单据状态,写入库存交易*/
  69 +
  70 + //已调整过不允许修改。
  71 + if(adjustDetail.getStatus() == 1){
  72 + AjaxResult.error("该单据已调整,不允许再次调整!" );
  73 + }
  74 + //查询调整的库存明细
  75 + InventoryDetail inventoryDetail = inventoryDetailService.getById(adjustDetail.getInventoryDetailId());
  76 + /*调整后的数量写入库存*/
  77 + //比较大小可以用 .compareTo()返回值 -1 小于 0 等于 1 大于
  78 + //Bigdecimal 自带运算方法.add加法 .subtract减法
  79 +
  80 + if(adjustDetail.getToQty().compareTo(BigDecimal.ZERO) == 0){
  81 + //当调整后数量为0时,直接删除该条库存,并写入库存交易
  82 + //删除库存,并查询当前库位还有没有其他物料,没有则删除库存头,恢复容器和库位状态
  83 + InventoryDetail inv = new InventoryDetail();
  84 + inv.setInventoryHeaderId(inventoryDetail.getInventoryHeaderId());
  85 + inv.setLocationCode(inventoryDetail.getLocationCode());
  86 + inv.setContainerCode(inventoryDetail.getContainerCode());
  87 + LambdaQueryWrapper<InventoryDetail> lamdDetail = Wrappers.lambdaQuery(inv);
  88 + List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(lamdDetail);
  89 + inventoryDetailService.removeById(adjustDetail.getInventoryDetailId());//删除实际库存数量为0的库存明细
  90 + if(inventoryDetailList.size() == 0){
  91 + //恢复库位和容器状态,删除库存头
  92 + inventoryHeaderService.removeById(inventoryDetail.getInventoryHeaderId());
  93 + locationService.updateContainerCodeAndStatus(inventoryDetail.getLocationCode(),"","empty");
  94 + containerService.updateLocationCodeAndStatus(inventoryDetail.getContainerCode(),"","empty");
  95 + }
  96 + }else{
  97 + //修改库存
  98 + //BigDecimal temp =(adjustDetail.getFromQty()).add(adjustDetail.getGapQty());
  99 + inventoryDetail.setQty(adjustDetail.getToQty());//调整后的数量
  100 + inventoryDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
  101 + inventoryDetail.setLastUpdated(new Date());
  102 + inventoryDetailService.saveOrUpdate(inventoryDetail);
  103 +
  104 + }
  105 + //写入库存交易记录
  106 + InventoryTransaction inventoryTransaction = new InventoryTransaction();
  107 + inventoryTransaction.setWarehouseCode(inventoryDetail.getWarehouseCode());
  108 + inventoryTransaction.setCompanyCode(inventoryDetail.getCompanyCode());
  109 + inventoryTransaction.setLocationCode(inventoryDetail.getLocationCode());
  110 + inventoryTransaction.setContainerCode(inventoryDetail.getContainerCode());
  111 + inventoryTransaction.setTransactionType(40);
  112 + inventoryTransaction.setMaterialCode(inventoryDetail.getMaterialCode());
  113 + inventoryTransaction.setMaterialName(inventoryDetail.getMaterialName());
  114 + inventoryTransaction.setMaterialSpec(inventoryDetail.getMaterialSpec());
  115 + inventoryTransaction.setMaterialUnit(inventoryDetail.getMaterialUnit());
  116 + inventoryTransaction.setTaskQty(inventoryDetail.getTaskQty());
  117 + inventoryTransaction.setInventorySts(inventoryDetail.getInventorySts());
  118 + inventoryTransaction.setReferCode(inventoryDetail.getReferCode());
  119 + inventoryTransaction.setReferDetailId(inventoryDetail.getReferDetailId());
  120 + inventoryTransaction.setBatch(inventoryDetail.getBatch());
  121 + inventoryTransaction.setLot(inventoryDetail.getLot());
  122 + inventoryTransaction.setProjectNo(inventoryDetail.getProjectNo());
  123 + inventoryTransaction.setQcCheck(inventoryDetail.getQcCheck());
  124 + inventoryTransaction.setWeight(inventoryDetail.getWeight());
  125 + inventoryTransaction.setManufactureDate(inventoryDetail.getManufactureDate());
  126 + inventoryTransaction.setExpirationDate(inventoryDetail.getExpirationDate());
  127 + inventoryTransaction.setAgingDate(inventoryDetail.getCreated());
  128 + inventoryTransaction.setAttributeId(inventoryDetail.getAttributeId());
  129 + inventoryTransaction.setAttribute1(inventoryDetail.getAttribute1());
  130 + inventoryTransaction.setAttribute2(inventoryDetail.getAttribute2());
  131 + inventoryTransaction.setAttribute3(inventoryDetail.getAttribute3());
  132 +// inventoryTransaction.setLockCode(inventoryDetail.getLockCode());//交易锁
  133 + inventoryTransaction.setCreated(new Date());
  134 + inventoryTransaction.setCreatedBy(ShiroUtils.getLoginName());
  135 +// inventoryTransaction.setVersion();
  136 +// inventoryTransaction.setUserDef1();
  137 +// inventoryTransaction.setUserDef2();
  138 +// inventoryTransaction.setUserDef3();
  139 +// inventoryTransaction.setProcessStamp();
  140 +// inventoryTransaction.setBillCode();
  141 + inventoryTransaction.setBillDetailId(inventoryDetail.getReceiptDetailId());
  142 + inventoryTransaction.setSupplierCode(inventoryDetail.getSupplierCode());
  143 + inventoryTransactionService.saveOrUpdate(inventoryTransaction);
  144 +
  145 + //修改调整单明细状态
  146 + adjustDetail.setStatus(1);
  147 + adjustDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
  148 + adjustDetail.setLastUpdated(new Date());
  149 + this.saveOrUpdate(adjustDetail);
  150 +
  151 + return AjaxResult.success("调整库存数量成功!");
  152 + }
  153 +
  154 +
  155 +
  156 +
  157 +
  158 +
  159 +
  160 +
  161 +
  162 +
  163 +
  164 +
  165 +
  166 +
10 } 167 }
src/main/java/com/huaheng/pc/inventory/cycleCountHeader/service/CycleCountHeaderServiceImpl.java
@@ -205,6 +205,7 @@ public class CycleCountHeaderServiceImpl extends ServiceImpl&lt;CycleCountHeaderMap @@ -205,6 +205,7 @@ public class CycleCountHeaderServiceImpl extends ServiceImpl&lt;CycleCountHeaderMap
205 adjustDetail.setAdjustCode(adjustHeader.getCode()); 205 adjustDetail.setAdjustCode(adjustHeader.getCode());
206 adjustDetail.setWarehouseCode(adjustHeader.getWarehouseCode()); 206 adjustDetail.setWarehouseCode(adjustHeader.getWarehouseCode());
207 adjustDetail.setCompanyCode(adjustHeader.getCompanyCode()); 207 adjustDetail.setCompanyCode(adjustHeader.getCompanyCode());
  208 + adjustDetail.setInventoryDetailId(item.getInventoryDetailId());//库存明细
208 adjustDetail.setLocationCode(item.getLocationCode()); 209 adjustDetail.setLocationCode(item.getLocationCode());
209 adjustDetail.setContainerCode(item.getContainerCode()); 210 adjustDetail.setContainerCode(item.getContainerCode());
210 adjustDetail.setCycleCountCode(cyclecountHeader.getCode()); 211 adjustDetail.setCycleCountCode(cyclecountHeader.getCode());
@@ -217,7 +218,8 @@ public class CycleCountHeaderServiceImpl extends ServiceImpl&lt;CycleCountHeaderMap @@ -217,7 +218,8 @@ public class CycleCountHeaderServiceImpl extends ServiceImpl&lt;CycleCountHeaderMap
217 adjustDetail.setToInventorySts(item.getInventorySts());//盘点不涉及属性 218 adjustDetail.setToInventorySts(item.getInventorySts());//盘点不涉及属性
218 adjustDetail.setFromInventorySts(item.getInventorySts()); 219 adjustDetail.setFromInventorySts(item.getInventorySts());
219 adjustDetail.setFromQty(item.getSystemQty());//调整前数量 220 adjustDetail.setFromQty(item.getSystemQty());//调整前数量
220 - adjustDetail.setToQty(null);//调整后数量 221 + BigDecimal toqty = item.getSystemQty().add(item.getGapQty());//调整后数量
  222 + adjustDetail.setToQty(toqty);
221 adjustDetail.setGapQty(item.getGapQty());//调整数量 223 adjustDetail.setGapQty(item.getGapQty());//调整数量
222 adjustDetail.setCreated(new Date()); 224 adjustDetail.setCreated(new Date());
223 adjustDetail.setCreatedBy(ShiroUtils.getLoginName()); 225 adjustDetail.setCreatedBy(ShiroUtils.getLoginName());
src/main/java/com/huaheng/pc/inventory/inventoryTransaction/domain/InventoryTransaction.java
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName; @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
7 import io.swagger.annotations.ApiModel; 7 import io.swagger.annotations.ApiModel;
8 import io.swagger.annotations.ApiModelProperty; 8 import io.swagger.annotations.ApiModelProperty;
9 import java.io.Serializable; 9 import java.io.Serializable;
  10 +import java.math.BigDecimal;
10 import java.util.Date; 11 import java.util.Date;
11 import lombok.Data; 12 import lombok.Data;
12 13
@@ -93,7 +94,7 @@ public class InventoryTransaction implements Serializable { @@ -93,7 +94,7 @@ public class InventoryTransaction implements Serializable {
93 */ 94 */
94 @TableField(value = "taskQty") 95 @TableField(value = "taskQty")
95 @ApiModelProperty(value="任务数量") 96 @ApiModelProperty(value="任务数量")
96 - private Integer taskQty; 97 + private BigDecimal taskQty;
97 98
98 /** 99 /**
99 * 库存状态 100 * 库存状态
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/service/ShipmentContainerHeaderService.java
@@ -5,6 +5,7 @@ import com.huaheng.pc.shipment.shipmentContainerDetail.domain.ShipmentContainerD @@ -5,6 +5,7 @@ import com.huaheng.pc.shipment.shipmentContainerDetail.domain.ShipmentContainerD
5 import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentCombinationModel; 5 import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentCombinationModel;
6 import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader; 6 import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader;
7 import com.baomidou.mybatisplus.extension.service.IService; 7 import com.baomidou.mybatisplus.extension.service.IService;
  8 +import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail;
8 import org.apache.ibatis.annotations.Param; 9 import org.apache.ibatis.annotations.Param;
9 10
10 import java.util.List; 11 import java.util.List;
@@ -28,6 +29,8 @@ public interface ShipmentContainerHeaderService extends IService&lt;ShipmentContain @@ -28,6 +29,8 @@ public interface ShipmentContainerHeaderService extends IService&lt;ShipmentContain
28 29
29 AjaxResult autoCombination(String shipmentCode); 30 AjaxResult autoCombination(String shipmentCode);
30 31
  32 + AjaxResult autoCombination(List<ShipmentDetail> shipmentDetailList);
  33 +
31 AjaxResult checkForCancelCombination(List<Integer> shipmentContainerIds); 34 AjaxResult checkForCancelCombination(List<Integer> shipmentContainerIds);
32 35
33 AjaxResult createTask(List<Integer> idList); 36 AjaxResult createTask(List<Integer> idList);
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/service/ShipmentContainerHeaderServiceImpl.java
@@ -387,16 +387,21 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont @@ -387,16 +387,21 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont
387 @Override 387 @Override
388 @Transactional 388 @Transactional
389 public AjaxResult autoCombination(String shipmentCode) { 389 public AjaxResult autoCombination(String shipmentCode) {
390 - int num=0;  
391 - AjaxResult ajaxResult=new AjaxResult();  
392 -  
393 - LambdaQueryWrapper<ShipmentDetail> lambdaQueryWrapper=Wrappers.lambdaQuery();  
394 - lambdaQueryWrapper.eq(ShipmentDetail::getShipmentCode,shipmentCode)  
395 - .eq(ShipmentDetail::getWarehouseCode,ShiroUtils.getWarehouseCode()); 390 + LambdaQueryWrapper<ShipmentDetail> lambdaQueryWrapper = Wrappers.lambdaQuery();
  391 + lambdaQueryWrapper.eq(ShipmentDetail::getShipmentCode, shipmentCode)
  392 + .eq(ShipmentDetail::getWarehouseCode, ShiroUtils.getWarehouseCode());
396 List<ShipmentDetail> shipmentDetailList = shipmentDetailService.list(lambdaQueryWrapper); 393 List<ShipmentDetail> shipmentDetailList = shipmentDetailService.list(lambdaQueryWrapper);
397 - if(shipmentDetailList.size()<1 || shipmentDetailList==null){ 394 + if (shipmentDetailList.size() < 1 || shipmentDetailList == null) {
398 return AjaxResult.error("找不到子单链"); 395 return AjaxResult.error("找不到子单链");
399 } 396 }
  397 + return this.autoCombination(shipmentDetailList);
  398 + }
  399 +
  400 +
  401 + //出库自动组盘
  402 + public AjaxResult autoCombination(List<ShipmentDetail> shipmentDetailList){
  403 + int num = 0;
  404 + List<Integer> list=new ArrayList<>();
400 for (ShipmentDetail item : shipmentDetailList) { 405 for (ShipmentDetail item : shipmentDetailList) {
401 //获取需要出库数量 406 //获取需要出库数量
402 BigDecimal shipmentQty = item.getShipQty().subtract(item.getRequestQty()); 407 BigDecimal shipmentQty = item.getShipQty().subtract(item.getRequestQty());
@@ -412,6 +417,9 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont @@ -412,6 +417,9 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont
412 // search.setInventorySts(item.getInventorySts()); //物料状态 417 // search.setInventorySts(item.getInventorySts()); //物料状态
413 418
414 List<InventoryDetail> inventoryList = shippingCombinationService.getInventorys(item); 419 List<InventoryDetail> inventoryList = shippingCombinationService.getInventorys(item);
  420 + if(inventoryList.size() < 1 && item.getWaveId() != 0){
  421 + return AjaxResult.error("主单为"+item.getShipmentCode()+"子单id为"+item.getId() + "的单据没有库存,波次失败");
  422 + }
415 if (inventoryList.size() < 1) { 423 if (inventoryList.size() < 1) {
416 num = num + 1; 424 num = num + 1;
417 } else { 425 } else {
@@ -426,11 +434,12 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont @@ -426,11 +434,12 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont
426 shipmentCombination.setInventoryDetailId(inventory.getId()); 434 shipmentCombination.setInventoryDetailId(inventory.getId());
427 shipmentCombination.setShipmentDetailId(item.getId()); 435 shipmentCombination.setShipmentDetailId(item.getId());
428 shipmentCombination.setType((short) 300); 436 shipmentCombination.setType((short) 300);
429 - List<Integer> list=new ArrayList<>(); 437 +
430 //如果库存数 >= 待出库数,组盘数就是待出库数并且结束组盘,否则组盘数就是库存数 438 //如果库存数 >= 待出库数,组盘数就是待出库数并且结束组盘,否则组盘数就是库存数
431 if (inventoryQty.compareTo(shipmentQty) > -1) { 439 if (inventoryQty.compareTo(shipmentQty) > -1) {
432 shipmentCombination.setShipQty(shipmentQty); 440 shipmentCombination.setShipQty(shipmentQty);
433 ShipmentContainerHeader shipmentContainerHeader=this.combination(shipmentCombination); 441 ShipmentContainerHeader shipmentContainerHeader=this.combination(shipmentCombination);
  442 + list.add(shipmentContainerHeader.getId());
434 } else { 443 } else {
435 shipmentCombination.setShipQty(inventoryQty); 444 shipmentCombination.setShipQty(inventoryQty);
436 ShipmentContainerHeader shipmentContainerHeader=this.combination(shipmentCombination); 445 ShipmentContainerHeader shipmentContainerHeader=this.combination(shipmentCombination);
@@ -443,7 +452,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont @@ -443,7 +452,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont
443 if(num==shipmentDetailList.size()){ 452 if(num==shipmentDetailList.size()){
444 throw new ServiceException("单据物料在此库区没有库存,无法出库"); 453 throw new ServiceException("单据物料在此库区没有库存,无法出库");
445 } 454 }
446 - return AjaxResult.success("成功"); 455 + return AjaxResult.success("成功",list);
447 } 456 }
448 457
449 /** 458 /**
src/main/java/com/huaheng/pc/shipment/wave/controller/WaveController.java
@@ -165,9 +165,12 @@ public class WaveController extends BaseController { @@ -165,9 +165,12 @@ public class WaveController extends BaseController {
165 @Log(title = "出库-波次", operating = "开始波次", action = BusinessType.UPDATE) 165 @Log(title = "出库-波次", operating = "开始波次", action = BusinessType.UPDATE)
166 @PostMapping("/startWave") 166 @PostMapping("/startWave")
167 @ResponseBody 167 @ResponseBody
168 - public AjaxResult editSave(Wave wave) {  
169 - wave.setLastUpdatedBy(ShiroUtils.getLoginName());  
170 - return toAjax(waveService.updateById(wave)); 168 + public AjaxResult starWave(String ids) {
  169 + if (StringUtils.isEmpty(ids)){
  170 + return AjaxResult.error("id不能为空");
  171 + }
  172 + AjaxResult result=waveService.startWave(ids);
  173 + return result;
171 } 174 }
172 175
173 } 176 }
src/main/java/com/huaheng/pc/shipment/wave/service/WaveService.java
1 package com.huaheng.pc.shipment.wave.service; 1 package com.huaheng.pc.shipment.wave.service;
2 2
  3 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  4 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
3 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 5 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  6 +import com.huaheng.common.support.Convert;
  7 +import com.huaheng.common.utils.security.ShiroUtils;
  8 +import com.huaheng.framework.web.domain.AjaxResult;
  9 +import com.huaheng.pc.shipment.shipmentContainerHeader.service.ShipmentContainerHeaderService;
  10 +import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail;
  11 +import com.huaheng.pc.shipment.shipmentDetail.service.ShipmentDetailService;
4 import com.huaheng.pc.shipment.wave.domain.Wave; 12 import com.huaheng.pc.shipment.wave.domain.Wave;
5 import com.huaheng.pc.shipment.wave.mapper.WaveMapper; 13 import com.huaheng.pc.shipment.wave.mapper.WaveMapper;
  14 +import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.stereotype.Service; 15 import org.springframework.stereotype.Service;
  16 +import org.springframework.transaction.annotation.Transactional;
  17 +
  18 +import java.util.ArrayList;
  19 +import java.util.Arrays;
  20 +import java.util.List;
7 21
8 @Service 22 @Service
9 public class WaveService extends ServiceImpl<WaveMapper, Wave> { 23 public class WaveService extends ServiceImpl<WaveMapper, Wave> {
10 24
  25 +
  26 + @Autowired
  27 + private ShipmentDetailService shipmentDetailService;
  28 + @Autowired
  29 + private ShipmentContainerHeaderService shipmentContainerHeaderService;
  30 +
  31 + //开始波次,对带有此波次号的单据进行后续的后台操作
  32 +
  33 + @Transactional
  34 + public AjaxResult startWave(String ids) {
  35 + List<ShipmentDetail> list = new ArrayList<>();
  36 + for (Integer id : Convert.toIntArray(ids)) {
  37 + //找到此波次的单据
  38 + LambdaQueryWrapper<ShipmentDetail> lam = Wrappers.lambdaQuery();
  39 + lam.eq(ShipmentDetail::getWaveId,id)
  40 + .eq(ShipmentDetail::getWarehouseCode, ShiroUtils.getWarehouseCode());
  41 + List<ShipmentDetail> shipmentDetails=shipmentDetailService.list(lam);
  42 +
  43 + //整合所有加入波次的单据
  44 + if(shipmentDetails != null){
  45 + list.addAll(shipmentDetails);
  46 + }
  47 + }
  48 +
  49 + //自动组盘
  50 + AjaxResult ajaxResult=shipmentContainerHeaderService.autoCombination(list);
  51 + if(ajaxResult.getData() != null){
  52 + //生成任务
  53 + shipmentContainerHeaderService.createTask(Arrays.asList(Convert.toIntArray(ajaxResult.getData().toString())));
  54 + }
  55 + return AjaxResult.success("波次运行成功");
  56 + }
11 } 57 }
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
@@ -502,6 +502,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -502,6 +502,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
502 detail.setMaterialCode(DataUtils.getString(map.get("materialCode")));//物料号 502 detail.setMaterialCode(DataUtils.getString(map.get("materialCode")));//物料号
503 detail.setMaterialName(DataUtils.getString(map.get("materialName")));//物料名称 503 detail.setMaterialName(DataUtils.getString(map.get("materialName")));//物料名称
504 detail.setMaterialSpec(DataUtils.getString(map.get("materialSpec")));//物料规格 504 detail.setMaterialSpec(DataUtils.getString(map.get("materialSpec")));//物料规格
  505 + detail.setMaterialUnit(DataUtils.getString(map.get("materialUnit")));//物料单位
505 detail.setReceiptCode(DataUtils.getString(map.get("receiptCode")));//入库单编码 506 detail.setReceiptCode(DataUtils.getString(map.get("receiptCode")));//入库单编码
506 detail.setReceiptDetailId(DataUtils.getInteger(map.get("receiptDetailId")));//入库单明细ID 507 detail.setReceiptDetailId(DataUtils.getInteger(map.get("receiptDetailId")));//入库单明细ID
507 detail.setBatch(DataUtils.getString(map.get("batch")));//批次 508 detail.setBatch(DataUtils.getString(map.get("batch")));//批次
@@ -534,6 +535,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -534,6 +535,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
534 inventoryTransaction.setContainerCode(DataUtils.getString(map.get("containerCode"))); 535 inventoryTransaction.setContainerCode(DataUtils.getString(map.get("containerCode")));
535 inventoryTransaction.setMaterialCode(DataUtils.getString(map.get("materialCode"))); 536 inventoryTransaction.setMaterialCode(DataUtils.getString(map.get("materialCode")));
536 inventoryTransaction.setMaterialName(DataUtils.getString(map.get("materialName"))); 537 inventoryTransaction.setMaterialName(DataUtils.getString(map.get("materialName")));
  538 + inventoryTransaction.setMaterialSpec(DataUtils.getString(map.get("materialSpec")));//物料规格
  539 + inventoryTransaction.setMaterialUnit(DataUtils.getString(map.get("materialUnit")));//物料单位
537 inventoryTransaction.setBillCode(DataUtils.getString(map.get("receiptCode"))); 540 inventoryTransaction.setBillCode(DataUtils.getString(map.get("receiptCode")));
538 inventoryTransaction.setBillDetailId(DataUtils.getInteger(map.get("receiptDetailId"))); 541 inventoryTransaction.setBillDetailId(DataUtils.getInteger(map.get("receiptDetailId")));
539 inventoryTransaction.setBatch(DataUtils.getString(map.get("batch"))); 542 inventoryTransaction.setBatch(DataUtils.getString(map.get("batch")));
@@ -541,7 +544,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -541,7 +544,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
541 // inventoryTransaction.setManufactureDate(new SimpleDateFormat("yyyy-MM-dd").parse(map.get("manufactureDate").toString()));//生产日期 544 // inventoryTransaction.setManufactureDate(new SimpleDateFormat("yyyy-MM-dd").parse(map.get("manufactureDate").toString()));//生产日期
542 // inventoryTransaction.setExpirationDate(DataUtils.getDateTime(map.get("expirationDate"))); 545 // inventoryTransaction.setExpirationDate(DataUtils.getDateTime(map.get("expirationDate")));
543 inventoryTransaction.setInventorySts(DataUtils.getString((map.get("inventorySts")))); 546 inventoryTransaction.setInventorySts(DataUtils.getString((map.get("inventorySts"))));
544 - inventoryTransaction.setTaskQty(DataUtils.getInteger(map.get("qty"))); 547 + inventoryTransaction.setTaskQty(DataUtils.getBigDecimal(map.get("qty")));
545 inventoryTransaction.setCreated(new Date()); 548 inventoryTransaction.setCreated(new Date());
546 inventoryTransaction.setCreatedBy(ShiroUtils.getLoginName()); 549 inventoryTransaction.setCreatedBy(ShiroUtils.getLoginName());
547 if (!inventoryTransactionService.save(inventoryTransaction)) 550 if (!inventoryTransactionService.save(inventoryTransaction))
@@ -774,7 +777,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -774,7 +777,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
774 inventoryTransaction.setMaterialName(item.getMaterialName()); 777 inventoryTransaction.setMaterialName(item.getMaterialName());
775 inventoryTransaction.setMaterialSpec(item.getMaterialSpec()); 778 inventoryTransaction.setMaterialSpec(item.getMaterialSpec());
776 inventoryTransaction.setMaterialUnit(item.getMaterialUnit()); 779 inventoryTransaction.setMaterialUnit(item.getMaterialUnit());
777 - inventoryTransaction.setTaskQty(0); 780 + inventoryTransaction.setTaskQty(BigDecimal.ZERO);
778 inventoryTransaction.setInventorySts(item.getInventorySts()); 781 inventoryTransaction.setInventorySts(item.getInventorySts());
779 //inventoryTransaction.setReferCode(); 782 //inventoryTransaction.setReferCode();
780 //inventoryTransaction.setQcCheck(); 783 //inventoryTransaction.setQcCheck();
@@ -1229,7 +1232,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -1229,7 +1232,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
1229 inventoryTransaction.setExpirationDate(shipmentDetail.getExpirationDate()); 1232 inventoryTransaction.setExpirationDate(shipmentDetail.getExpirationDate());
1230 inventoryTransaction.setInventorySts(inventoryDetail.getInventorySts()); 1233 inventoryTransaction.setInventorySts(inventoryDetail.getInventorySts());
1231 //这里取反,更符合出库的语义,同时方便对记录进行统计 1234 //这里取反,更符合出库的语义,同时方便对记录进行统计
1232 - inventoryTransaction.setTaskQty(taskDetail.getQty().intValue()); 1235 + inventoryTransaction.setTaskQty(taskDetail.getQty());
1233 // inventoryTransaction.setCostPrice(shipmentDetail.); 1236 // inventoryTransaction.setCostPrice(shipmentDetail.);
1234 inventoryTransaction.setCreated(null); 1237 inventoryTransaction.setCreated(null);
1235 inventoryTransaction.setCreatedBy(ShiroUtils.getLoginName()); 1238 inventoryTransaction.setCreatedBy(ShiroUtils.getLoginName());
@@ -1293,8 +1296,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -1293,8 +1296,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
1293 shipmentContainerHeaderLambdaUpdateWrapper.eq(ShipmentContainerHeader::getId,task.getAllocationHeadId()); 1296 shipmentContainerHeaderLambdaUpdateWrapper.eq(ShipmentContainerHeader::getId,task.getAllocationHeadId());
1294 if (! shipmentContainerHeaderService.update(shipmentContainerHeader, shipmentContainerHeaderLambdaUpdateWrapper)) 1297 if (! shipmentContainerHeaderService.update(shipmentContainerHeader, shipmentContainerHeaderLambdaUpdateWrapper))
1295 throw new ServiceException("更新组盘头状态失败"); 1298 throw new ServiceException("更新组盘头状态失败");
1296 -  
1297 -  
1298 //修改出库单状态 1299 //修改出库单状态
1299 LambdaQueryWrapper<TaskDetail> taskDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); 1300 LambdaQueryWrapper<TaskDetail> taskDetailLambdaQueryWrapper = Wrappers.lambdaQuery();
1300 taskDetailLambdaQueryWrapper.eq(TaskDetail::getTaskId,task.getId()); 1301 taskDetailLambdaQueryWrapper.eq(TaskDetail::getTaskId,task.getId());
src/main/resources/mybatis/inventory/AdjustDetailMapper.xml
@@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
6 <id column="id" jdbcType="INTEGER" property="id" /> 6 <id column="id" jdbcType="INTEGER" property="id" />
7 <result column="adjustCode" jdbcType="VARCHAR" property="adjustCode" /> 7 <result column="adjustCode" jdbcType="VARCHAR" property="adjustCode" />
8 <result column="cycleCountCode" jdbcType="VARCHAR" property="cycleCountCode" /> 8 <result column="cycleCountCode" jdbcType="VARCHAR" property="cycleCountCode" />
  9 + <result column="inventoryDetailId" jdbcType="INTEGER" property="inventoryDetailId" />
9 <result column="cycleDetailId" jdbcType="INTEGER" property="cycleDetailId" /> 10 <result column="cycleDetailId" jdbcType="INTEGER" property="cycleDetailId" />
10 <result column="checkCode" jdbcType="VARCHAR" property="checkCode" /> 11 <result column="checkCode" jdbcType="VARCHAR" property="checkCode" />
11 <result column="checkDetailId" jdbcType="VARCHAR" property="checkDetailId" /> 12 <result column="checkDetailId" jdbcType="VARCHAR" property="checkDetailId" />
@@ -29,6 +30,8 @@ @@ -29,6 +30,8 @@
29 <result column="status" jdbcType="INTEGER" property="status" /> 30 <result column="status" jdbcType="INTEGER" property="status" />
30 <result column="createdBy" jdbcType="VARCHAR" property="createdBy" /> 31 <result column="createdBy" jdbcType="VARCHAR" property="createdBy" />
31 <result column="created" jdbcType="TIMESTAMP" property="created" /> 32 <result column="created" jdbcType="TIMESTAMP" property="created" />
  33 + <result column="lastUpdatedBy" jdbcType="VARCHAR" property="lastUpdatedBy" />
  34 + <result column="lastUpdated" jdbcType="TIMESTAMP" property="lastUpdated" />
32 <result column="agreeBy" jdbcType="VARCHAR" property="agreeBy" /> 35 <result column="agreeBy" jdbcType="VARCHAR" property="agreeBy" />
33 <result column="agreeTime" jdbcType="TIMESTAMP" property="agreeTime" /> 36 <result column="agreeTime" jdbcType="TIMESTAMP" property="agreeTime" />
34 <result column="Remark" jdbcType="VARCHAR" property="remark" /> 37 <result column="Remark" jdbcType="VARCHAR" property="remark" />
@@ -40,10 +43,10 @@ @@ -40,10 +43,10 @@
40 </resultMap> 43 </resultMap>
41 <sql id="Base_Column_List"> 44 <sql id="Base_Column_List">
42 <!--@mbg.generated--> 45 <!--@mbg.generated-->
43 - id, adjustCode, cycleCountCode, cycleDetailId, checkCode, checkDetailId, referCode, 46 + id, adjustCode, cycleCountCode, inventoryDetailId, cycleDetailId, checkCode, checkDetailId, referCode,
44 referDetailId, warehouseCode, companyCode, containerCode, locationCode ,materialCode, materialName, 47 referDetailId, warehouseCode, companyCode, containerCode, locationCode ,materialCode, materialName,
45 materialSpec, materialUnit, problemType, attributeId, fromInventorySts, toInventorySts, 48 materialSpec, materialUnit, problemType, attributeId, fromInventorySts, toInventorySts,
46 - fromQty, toQty, gapQty, `status`, created, createdBy, agreeTime, Remark, 49 + fromQty, toQty, gapQty, `status`, created, createdBy,lastUpdatedBy,lastUpdated, agreeTime, Remark,
47 version, userDef1, userDef2, userDef3, processStamp 50 version, userDef1, userDef2, userDef3, processStamp
48 </sql> 51 </sql>
49 </mapper> 52 </mapper>
50 \ No newline at end of file 53 \ No newline at end of file
src/main/resources/mybatis/inventory/InventoryTransactionMapper.xml
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 <result column="materialName" jdbcType="VARCHAR" property="materialName" /> 13 <result column="materialName" jdbcType="VARCHAR" property="materialName" />
14 <result column="materialSpec" jdbcType="VARCHAR" property="materialSpec" /> 14 <result column="materialSpec" jdbcType="VARCHAR" property="materialSpec" />
15 <result column="materialUnit" jdbcType="VARCHAR" property="materialUnit" /> 15 <result column="materialUnit" jdbcType="VARCHAR" property="materialUnit" />
16 - <result column="taskQty" jdbcType="INTEGER" property="taskQty" /> 16 + <result column="taskQty" jdbcType="DECIMAL" property="taskQty" />
17 <result column="inventorySts" jdbcType="VARCHAR" property="inventorySts" /> 17 <result column="inventorySts" jdbcType="VARCHAR" property="inventorySts" />
18 <result column="referCode" jdbcType="VARCHAR" property="referCode" /> 18 <result column="referCode" jdbcType="VARCHAR" property="referCode" />
19 <result column="referDetailId" jdbcType="VARCHAR" property="referDetailId" /> 19 <result column="referDetailId" jdbcType="VARCHAR" property="referDetailId" />
src/main/resources/templates/inventory/adjustDetail/adjustDetail.html
@@ -94,18 +94,13 @@ @@ -94,18 +94,13 @@
94 <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()"> 94 <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()">
95 <i class="fa fa-plus"></i> 新增 95 <i class="fa fa-plus"></i> 新增
96 </a> 96 </a>
97 - <!--<a class="btn btn-outline btn-danger btn-rounded" onclick="addAdjust()"/>  
98 - &lt;!&ndash;shiro:hasPermission="inventory:cyclecountAdjustDetail:addAdjust"&ndash;&gt; 97 + <a class="btn btn-outline btn-primary btn-rounded" onclick="">
  98 + <i class="fa fa-edit"></i> 审核
  99 + </a>
  100 + <a class="btn btn-outline btn-danger btn-rounded" onclick="addAdjust()"/>
  101 + <!--shiro:hasPermission="inventory:cyclecountAdjustDetail:addAdjust"-->
99 <i class="fa fa-vcard"></i>调整 102 <i class="fa fa-vcard"></i>调整
100 - </a>-->  
101 - <!--<a class="btn btn-outline btn-danger btn-rounded" onclick="createCyclecountWithGapQty()"  
102 - shiro:hasPermission="inventoryHeader:cycleCountDetail:cyclecountRepeat">  
103 - <i class="fa fa-vcard"></i> 差异复盘  
104 - </a>-->  
105 - <!--<a class="btn btn-outline btn-danger btn-rounded" onclick="adjust()"  
106 - shiro:hasPermission="inventoryHeader:cycleCountDetail:adjust">  
107 - <i class="fa fa-vcard"></i> 差异库存调整  
108 - </a>--> 103 + </a>
109 <!--<a class="btn btn-outline btn-success btn-rounded" onclick="$.table.refresh()"> 104 <!--<a class="btn btn-outline btn-success btn-rounded" onclick="$.table.refresh()">
110 <i class="fa fa-refresh"></i> 刷新 105 <i class="fa fa-refresh"></i> 刷新
111 </a>--> 106 </a>-->
@@ -138,15 +133,15 @@ @@ -138,15 +133,15 @@
138 { 133 {
139 radio: true 134 radio: true
140 }, 135 },
141 - { 136 + /*{
142 title: '调整操作', 137 title: '调整操作',
143 align: 'center', 138 align: 'center',
144 formatter: function (value, row, index) { 139 formatter: function (value, row, index) {
145 var actions = []; 140 var actions = [];
146 - actions.push('<a class="btn btn-warning btn-xs " href="#" onclick="$.operate.addAdjust()"><i class="fa fa-trash-o"></i>调整</a> '); 141 + actions.push('<a class="btn btn-warning btn-xs " href="#" onclick="addAdjust(\'' + row.id + '\')"><i class="fa fa-send"></i>&nbsp;调整</a> ');
147 return actions.join(''); 142 return actions.join('');
148 } 143 }
149 - }, 144 + },*/
150 { 145 {
151 field: 'id', 146 field: 'id',
152 title: '明细id', 147 title: '明细id',
@@ -158,6 +153,12 @@ @@ -158,6 +153,12 @@
158 visible: true 153 visible: true
159 }, 154 },
160 { 155 {
  156 + field: 'inventoryDetailId',
  157 + title: '库存明细',
  158 + visible: true
  159 + },
  160 +
  161 + {
161 field: 'warehouseCode', 162 field: 'warehouseCode',
162 title: '仓库', 163 title: '仓库',
163 visible: false 164 visible: false
@@ -380,21 +381,13 @@ @@ -380,21 +381,13 @@
380 381
381 $.modal.confirm("注意:该操作将更改库存,当实盘数量为0且库位上只剩空容器时,请手动执行空托出库任务,容器上有货则无需其他操作!", 382 $.modal.confirm("注意:该操作将更改库存,当实盘数量为0且库位上只剩空容器时,请手动执行空托出库任务,容器上有货则无需其他操作!",
382 function () { 383 function () {
383 - var cyclecountAdjustId = $('#cyclecountAdjustId').val();  
384 - var companyCode = $('#companyCode').val();  
385 - var code = $('#code').val();  
386 - var cyclecountHeadCode = $('#sourceCode').val();  
387 - //判断有没有选取明细条目,进的页面不同  
388 - if (row.length !== 0) {  
389 /*判断是否已经调整过*/ 384 /*判断是否已经调整过*/
390 - if (row[0].status == 40) { 385 + if (row[0].status == 2) {
391 $.modal.msg('该条明细已调整,请勿重复调整!') 386 $.modal.msg('该条明细已调整,请勿重复调整!')
392 } else { 387 } else {
393 $.modal.open("差异调整单", prefix + "/adjustEdit?id=" + row[0].id) 388 $.modal.open("差异调整单", prefix + "/adjustEdit?id=" + row[0].id)
394 } 389 }
395 - } else {  
396 - $.modal.open("调整单", prefix + "/addAdjust?cyclecountAdjustId=" + cyclecountAdjustId + "&companyCode=" + companyCode + "&code=" + code + "&cyclecountHeadCode=" + cyclecountHeadCode);  
397 - } 390 +
398 }); 391 });
399 } 392 }
400 393