Commit 206f332ca0c4f3e98fa7ea9e0dcfcc6a53cc1011

Authored by 谭毅彬
2 parents d70f0351 b9adf1d0

Merge branch 'develop' of http://www.huahengrobot.com:90/wms/wms4.git into develop

ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountDetailList.vue
... ... @@ -77,8 +77,8 @@
77 77 <cycle-count-detail-chi-id-modal ref="adjustmentModal" @ok="modalFormOk" :id="record.id"/>
78 78 <a @click="createMany()"><a-icon/>新增</a>
79 79 <a-divider type="vertical"/>
80   - <a v-if="record.enableStatus === 1" @click="selectPort(record)">生成盘点任务</a>
81   - <a-divider v-if="record.enableStatus === 1" type="vertical"/>
  80 + <a v-if="record.enableStatus == '1'" @click="selectPort(record)">生成盘点任务</a>
  81 + <a-divider v-if="record.enableStatus == '1'" type="vertical"/>
82 82 <a @click="loadDatas(record.cycleCountHeadId)"><a-icon type="sync"/>刷新</a>
83 83 </template>
84 84  
... ...
ant-design-vue-jeecg/src/views/system/stocktaking/subTables/CycleCountDetailChildSubTable.vue
... ... @@ -23,7 +23,7 @@
23 23  
24 24 <template slot="action" slot-scope="text, record">
25 25 <adjustment-doc-modal ref="adjustmentModal" @ok="modalFormOk"/>
26   - <a v-if="record.childStatus != 1" @click="createMany(record.id)"><a-icon />实盘登记</a>
  26 + <a v-if="record.childStatus != 1" @click="createMany(record)"><a-icon />实盘登记</a>
27 27 </template>
28 28  
29 29 <template slot="fileSlot" slot-scope="text">
... ...
ant-design-vue-jeecg/src/views/system/task/TaskDetailList.vue
... ... @@ -80,7 +80,7 @@
80 80  
81 81 <span slot="action" slot-scope="text, record">
82 82 <adjustment-doc-modal ref="adjustmentModal" @ok="modalFormOk" :id="record.id" :taskHeaderId="record.taskHeaderId"/>
83   - <a v-if="record.taskType==700" @click="createMany(record)">实盘登记</a>
  83 + <a v-if="record.taskType==700" @click="createMany(record)">实盘登记<a-divider type="vertical" /></a>
84 84 <a v-has="'taskDetail:edit'" @click="handleEdit(record)">编辑<a-divider type="vertical" /></a>
85 85 <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
86 86 <a v-has="'taskDetail:delete'">删除</a>
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailServiceImpl.java
... ... @@ -4,9 +4,11 @@ import java.io.Serializable;
4 4 import java.math.BigDecimal;
5 5 import java.util.Collection;
6 6 import java.util.List;
  7 +import java.util.stream.Collectors;
7 8  
8 9 import javax.annotation.Resource;
9 10  
  11 +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
10 12 import org.jeecg.common.api.vo.Result;
11 13 import org.jeecg.common.exception.JeecgBootException;
12 14 import org.jeecg.modules.wms.config.container.entity.Container;
... ... @@ -17,7 +19,9 @@ import org.jeecg.modules.wms.config.material.entity.Material;
17 19 import org.jeecg.modules.wms.config.material.service.impl.MaterialServiceImpl;
18 20 import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService;
19 21 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail;
  22 +import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryHeader;
20 23 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService;
  24 +import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService;
21 25 import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService;
22 26 import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerHeaderService;
23 27 import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetail;
... ... @@ -79,6 +83,8 @@ public class CycleCountDetailServiceImpl extends ServiceImpl&lt;CycleCountDetailMap
79 83 private IReceiptContainerHeaderService receiptContainerHeaderService;
80 84 @Resource
81 85 private IShipmentContainerHeaderService shipmentContainerHeaderService;
  86 + @Resource
  87 + private IInventoryHeaderService inventoryHeaderService;
82 88  
83 89 @Override
84 90 @Transactional
... ... @@ -160,6 +166,10 @@ public class CycleCountDetailServiceImpl extends ServiceImpl&lt;CycleCountDetailMap
160 166 if (locationByCode.getStatus().equals(QuantityConstant.STATUS_CONTAINER_LOCK)) {
161 167 return Result.error("当前库位已锁定 请检查数据 库存里面不是锁定 实际上库位里面锁定了");
162 168 }
  169 + InventoryHeader inventoryHeader = inventoryHeaderService.getById(taskId);
  170 + if (inventoryHeader == null) {
  171 + return Result.error("根据库存头ID:" + taskId + "没有找到库存头");
  172 + }
163 173  
164 174 CycleCountDetail cycleCountDetail = new CycleCountDetail();
165 175 cycleCountDetail.setCycleCountHeadId(headerId);
... ... @@ -170,9 +180,9 @@ public class CycleCountDetailServiceImpl extends ServiceImpl&lt;CycleCountDetailMap
170 180 cycleCountDetail.setInventoryHeaderId(inventoryDetails.get(0).getInventoryHeaderId());
171 181 cycleCountDetail.setLocationCode(inventoryDetails.get(0).getLocationCode());
172 182 cycleCountDetail.setInventorySts(inventoryDetails.get(0).getInventoryStatus());
173   - cycleCountDetail.setSystemQty(BigDecimal.ZERO);
174   - cycleCountDetail.setCountedQty(BigDecimal.ZERO);
175   - cycleCountDetail.setGapQty(BigDecimal.ZERO);
  183 + cycleCountDetail.setSystemQty(inventoryHeader.getTotalQty());
  184 +// cycleCountDetail.setCountedQty(BigDecimal.ZERO);
  185 +// cycleCountDetail.setGapQty(BigDecimal.ZERO);
176 186 cycleCountDetail.setEnableStatus(QuantityConstant.CYCLECOUNT_STATUS_BUILD);
177 187 cycleCountDetailService.save(cycleCountDetail);
178 188 for (InventoryDetail inventoryDetail : inventoryDetails) {
... ... @@ -196,6 +206,24 @@ public class CycleCountDetailServiceImpl extends ServiceImpl&lt;CycleCountDetailMap
196 206 cycleCountDetailChildServiceImpl.save(cycleCountDetailChild);
197 207 }
198 208 }
  209 + LambdaQueryWrapper <CycleCountDetail> cycleCountDetailLambdaQueryWrapper = Wrappers.lambdaQuery();
  210 + cycleCountDetailLambdaQueryWrapper.eq(CycleCountDetail::getCycleCountHeadCode, code);
  211 + List<CycleCountDetail> cycleCountDetailList = cycleCountDetailService.list(cycleCountDetailLambdaQueryWrapper);
  212 + if (CollectionUtils.isEmpty(cycleCountDetailList)) {
  213 + throw new JeecgBootException("没有找到盘点头信息");
  214 + }
  215 + BigDecimal countSystemQty = BigDecimal.ZERO;
  216 + List<BigDecimal> systemQty = cycleCountDetailList.stream().map(i -> i.getSystemQty()).collect(Collectors.toList());
  217 + for (BigDecimal bigDecimal : systemQty) {
  218 + countSystemQty = countSystemQty.add(bigDecimal);
  219 + }
  220 + CycleCountHeader cycleCountHeader = new CycleCountHeader();
  221 + cycleCountHeader.setId(cycleCountDetailList.get(0).getCycleCountHeadId());
  222 + cycleCountHeader.setTotalLocs(cycleCountDetailList.size());
  223 + cycleCountHeader.setTotalItems(countSystemQty);
  224 + if (!cycleCountHeaderService.updateById(cycleCountHeader)) {
  225 + throw new JeecgBootException("修改盘点头数量信息失败");
  226 + }
199 227 return Result.OK("生成完成", headerId);
200 228 }
201 229  
... ... @@ -330,6 +358,9 @@ public class CycleCountDetailServiceImpl extends ServiceImpl&lt;CycleCountDetailMap
330 358 if (cycleCountDetail.getEnableStatus().equals(QuantityConstant.CYCLECOUNT_STATUS_BUILD)) {
331 359 return Result.error("当前盘点明细是新建状态 不能调整");
332 360 }
  361 + if (cycleCountDetail.getEnableStatus().equals(QuantityConstant.CYCLECOUNT_STATUS_COMPLETED)) {
  362 + return Result.error("当前盘点明细是完成状态 不能调整");
  363 + }
333 364  
334 365 if (cycleCountDetailChild.getCountedQty().compareTo(BigDecimal.ZERO) == 0) {
335 366 return Result.error("别闹");
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/ITaskHeaderService.java
... ... @@ -4,6 +4,7 @@ import java.io.Serializable;
4 4 import java.util.Collection;
5 5 import java.util.List;
6 6  
  7 +import javafx.concurrent.Task;
7 8 import org.jeecg.common.api.vo.Result;
8 9 import org.jeecg.modules.wms.config.location.entity.Location;
9 10 import org.jeecg.modules.wms.task.taskHeader.entity.QucikReceiptEntity;
... ... @@ -310,6 +311,13 @@ public interface ITaskHeaderService extends IService&lt;TaskHeader&gt; {
310 311 Result cancelShipmentTask(TaskHeader taskHeader);
311 312  
312 313 /**
  314 + * 修改盘点明细状态
  315 + * @param taskHeader
  316 + * @return
  317 + */
  318 + Result updateCycleCountDetailByEnableStatus(TaskHeader taskHeader);
  319 +
  320 + /**
313 321 * 更新状态
314 322 * @param status
315 323 * @param id
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... ... @@ -910,6 +910,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
910 910 case QuantityConstant.TASK_TYPE_WHOLESHIPMENT:
911 911 case QuantityConstant.TASK_TYPE_SORTINGSHIPMENT:
912 912 result = taskHeaderService.cancelShipmentTask(taskHeader);
  913 + case QuantityConstant.TASK_TYPE_CYCLECOUNT:
  914 + result = taskHeaderService.updateCycleCountDetailByEnableStatus(taskHeader);
913 915 break;
914 916 }
915 917 taskHeaderService.cancelLocationAndContainerStatus(taskHeader);
... ... @@ -2772,6 +2774,24 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
2772 2774 }
2773 2775  
2774 2776 @Override
  2777 + public Result updateCycleCountDetailByEnableStatus(TaskHeader taskHeader) {
  2778 + log.info("开始取消盘点任务");
  2779 + LambdaQueryWrapper<CycleCountDetail> cycleCountDetailLambdaQueryWrapper = Wrappers.lambdaQuery();
  2780 + cycleCountDetailLambdaQueryWrapper.eq(CycleCountDetail::getContainerCode, taskHeader.getContainerCode())
  2781 + .ne(CycleCountDetail::getEnableStatus, QuantityConstant.SHIPMENT_RECEIVE_SUCCESS);
  2782 + CycleCountDetail cycleCountDetail = cycleCountDetailService.getOne(cycleCountDetailLambdaQueryWrapper);
  2783 + if (cycleCountDetail == null) {
  2784 + throw new JeecgBootException("取消盘点任务,没有找到盘点明细");
  2785 + }
  2786 + cycleCountDetail.setEnableStatus(QuantityConstant.CYCLECOUNT_STATUS_BUILD);
  2787 + if (!cycleCountDetailService.updateById(cycleCountDetail)) {
  2788 + throw new JeecgBootException("取消盘点任务,修改盘点明细状态失败");
  2789 + }
  2790 + log.info("完成取消盘点任务");
  2791 + return Result.ok("取消盘点任务成功");
  2792 + }
  2793 +
  2794 + @Override
2775 2795 public boolean updateStatusById(int status, int id) {
2776 2796 TaskHeader taskHeader = new TaskHeader();
2777 2797 taskHeader.setId(id);
... ...