Commit 979460fbeb3da06b3ce21a356d04f11571dc5691

Authored by tongzhonghao
2 parents 2d01b44d b843a757

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

Showing 13 changed files with 533 additions and 167 deletions
ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountDetailList.vue
... ... @@ -74,10 +74,13 @@
74 74 </template>
75 75 <template slot="action" slot-scope="text, record">
76 76 <cycle-count-detail-chi-id-modal ref="adjustmentModal" @ok="modalFormOk" :id="record.id"/>
77   - <a @click="createMany()"><a-icon/>新增</a>
  77 + <a v-if="record.enableStatus != '100'" @click="createMany()"><a-icon/>新增</a>
78 78 <a-divider type="vertical"/>
79   - <a v-if="record.enableStatus == '1'" @click="selectPort(record)">生成盘点任务</a>
80   - <a-divider v-if="record.enableStatus == '1'" type="vertical"/>
  79 + <a-popconfirm v-if="record.enableStatus === 1" v-has="'cycleCountHeader:delete'" title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  80 + <a>删除 <a-divider type="vertical"/> </a>
  81 + </a-popconfirm>
  82 + <a v-if="record.enableStatus == '1' && record.zoneType == 'L'" @click="selectPort(record)">生成盘点任务 <a-divider type="vertical"/></a>
  83 +
81 84 <a @click="loadDatas(record.cycleCountHeadId)"><a-icon type="sync"/>刷新</a>
82 85 </template>
83 86  
... ... @@ -174,6 +177,11 @@
174 177 // dataIndex: 'inventoryDetailId',
175 178 // },
176 179 {
  180 + title: '库区类型',
  181 + align: 'center',
  182 + dataIndex: 'zoneType_dictText',
  183 + },
  184 + {
177 185 title: '库位',
178 186 align: 'center',
179 187 dataIndex: 'locationCode',
... ... @@ -189,6 +197,11 @@
189 197 dataIndex: 'inventorySts_dictText',
190 198 },
191 199 {
  200 + title: '状态',
  201 + align: 'center',
  202 + dataIndex: 'enableStatus_dictText',
  203 + },
  204 + {
192 205 title: '系统数量',
193 206 align: 'center',
194 207 dataIndex: 'systemQty',
... ... @@ -219,11 +232,6 @@
219 232 dataIndex: 'completedAt',
220 233 },
221 234 {
222   - title: '状态',
223   - align: 'center',
224   - dataIndex: 'enableStatus_dictText',
225   - },
226   - {
227 235 title: '操作',
228 236 dataIndex: 'action',
229 237 align: 'center',
... ... @@ -252,7 +260,8 @@
252 260 mounted() {
253 261 let _this = this;
254 262 Utils.$on('methodB',(data)=> {
255   - _this.methodB(data);
  263 + this.methodB(data);
  264 + this.$emit('ok');
256 265 })
257 266 },
258 267 computed: {
... ... @@ -293,6 +302,7 @@
293 302 loadDatas(record) {
294 303 this.loading = true
295 304 this.dataSource = []
  305 + console.log("loadDatas " + record)
296 306 getAction(this.url.list, {
297 307 cycleCountHeadId: record
298 308 }).then((res) => {
... ... @@ -341,7 +351,7 @@
341 351  
342 352 createMany() {
343 353 this.$refs.adjustmentModal.edit();
344   - this.$refs.adjustmentModal.title = "实盘登记";
  354 + this.$refs.adjustmentModal.title = "新增";
345 355 },
346 356 }
347 357 }
... ...
ant-design-vue-jeecg/src/views/system/stocktaking/modules/AdjustmentDocModal.vue
... ... @@ -89,10 +89,10 @@ export default {
89 89 confirmGapQty(this.model).then((res) => {
90 90 if (res.success) {
91 91 that.$message.success(res.message);
92   - that.$emit('ok');
  92 + // Utils.$emit('methodB',res.result);
93 93 that.model.containerCode = '';
94 94 that.model.toLocationCode = '';
95   - Utils.$emit('methodB',res.result);
  95 + that.$emit('ok');
96 96 } else {
97 97 that.$message.warning(res.message);
98 98 }
... ...
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)"><a-icon />实盘登记</a>
  26 + <a v-if="record.childStatus != 1 && record.childStatus != 100" @click="createMany(record)"><a-icon />实盘登记</a>
27 27 </template>
28 28  
29 29 <template slot="fileSlot" slot-scope="text">
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/controller/ShipmentHeaderController.java
... ... @@ -25,8 +25,6 @@ import org.jeecg.modules.wms.api.mobile.service.IMobileService;
25 25 import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService;
26 26 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail;
27 27 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService;
28   -import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail;
29   -import org.jeecg.modules.wms.shipment.shipmentCombination.entity.FlatShipment;
30 28 import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail;
31 29 import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentHeader;
32 30 import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentDetailService;
... ... @@ -280,13 +278,13 @@ public class ShipmentHeaderController extends JeecgController&lt;ShipmentHeader, IS
280 278 * @param ids
281 279 * @return
282 280 */
283   - @AutoLog(value = "出库单详情-批量删除")
284   - @ApiOperation(value = "出库单详情-批量删除", notes = "出库单详情-批量删除")
285   - @RequiresPermissions("shipmentDetail:deleteBatch")
286   - @DeleteMapping(value = "/deleteBatchShipmentDetail")
287   - public Result<String> deleteBatchShipmentDetail(@RequestParam(name = "ids", required = true) String ids) {
288   - return shipmentDetailService.removeDetailListById(Arrays.asList(ids.split(",")));
289   - }
  281 +// @AutoLog(value = "出库单详情-批量删除")
  282 +// @ApiOperation(value = "出库单详情-批量删除", notes = "出库单详情-批量删除")
  283 +// @RequiresPermissions("shipmentDetail:deleteBatch")
  284 +// @DeleteMapping(value = "/deleteBatchShipmentDetail")
  285 +// public Result<String> deleteBatchShipmentDetail(@RequestParam(name = "ids", required = true) String ids) {
  286 +// return shipmentDetailService.removeDetailListById(Arrays.asList(ids.split(",")));
  287 +// }
290 288  
291 289 /**
292 290 * 导出
... ... @@ -460,7 +458,6 @@ public class ShipmentHeaderController extends JeecgController&lt;ShipmentHeader, IS
460 458 return result;
461 459 }
462 460  
463   -
464 461 @AutoLog(value = "自动预配盘出库")
465 462 @ApiOperation(value = "自动预配盘出库", notes = "自动预配盘出库")
466 463 @PostMapping("/autoShipmentAdvice")
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentDetailServiceImpl.java
... ... @@ -14,7 +14,6 @@ import org.jeecg.modules.wms.config.material.entity.Material;
14 14 import org.jeecg.modules.wms.config.material.service.IMaterialService;
15 15 import org.jeecg.modules.wms.config.zone.entity.Zone;
16 16 import org.jeecg.modules.wms.config.zone.service.IZoneService;
17   -import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail;
18 17 import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail;
19 18 import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentHeader;
20 19 import org.jeecg.modules.wms.shipment.shipmentHeader.mapper.ShipmentDetailMapper;
... ... @@ -25,6 +24,7 @@ import org.jeecg.utils.constant.QuantityConstant;
25 24 import org.springframework.beans.factory.annotation.Autowired;
26 25 import org.springframework.stereotype.Service;
27 26 import org.springframework.transaction.annotation.Transactional;
  27 +import org.springframework.util.CollectionUtils;
28 28  
29 29 import com.alibaba.fastjson.JSON;
30 30 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
... ... @@ -33,7 +33,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
33 33  
34 34 import cn.monitor4all.logRecord.annotation.OperationLog;
35 35 import cn.monitor4all.logRecord.context.LogRecordContext;
36   -import org.springframework.util.CollectionUtils;
37 36  
38 37 /**
39 38 * @Description: 出库单详情
... ... @@ -218,13 +217,13 @@ public class ShipmentDetailServiceImpl extends ServiceImpl&lt;ShipmentDetailMapper,
218 217 }
219 218 }
220 219  
221   - @Override
222   - @Transactional(rollbackFor = Exception.class)
223   - public Result removeDetailListById(List<String> idList) {
224   - Result result = null;
225   - for (String id : idList) {
226   - result = shipmentHeaderService.deleteShipmentDetail(id);
227   - }
228   - return result;
229   - }
  220 +// @Override
  221 +// @Transactional(rollbackFor = Exception.class)
  222 +// public Result removeDetailListById(List<String> idList) {
  223 +// Result result = null;
  224 +// for (String id : idList) {
  225 +// result = shipmentHeaderService.deleteShipmentDetail(id);
  226 +// }
  227 +// return result;
  228 +// }
230 229 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/controller/CycleCountDetailController.java
... ... @@ -139,8 +139,11 @@ public class CycleCountDetailController extends HuahengBaseController {
139 139 @ApiOperation(value = "盘点明细表-通过id删除", notes = "盘点明细表-通过id删除")
140 140 @DeleteMapping(value = "/delete")
141 141 public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
142   - cycleCountDetailService.delMain(id);
143   - return Result.OK("删除成功!");
  142 + if (cycleCountDetailService.delMain(id)) {
  143 + return Result.OK("删除成功!");
  144 + } else {
  145 + return Result.OK("删除失败!");
  146 + }
144 147 }
145 148  
146 149 /**
... ... @@ -152,8 +155,11 @@ public class CycleCountDetailController extends HuahengBaseController {
152 155 @ApiOperation(value = "盘点明细表-批量删除", notes = "盘点明细表-批量删除")
153 156 @DeleteMapping(value = "/deleteBatch")
154 157 public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
155   - this.cycleCountDetailService.delBatchMain(Arrays.asList(ids.split(",")));
156   - return Result.OK("批量删除成功!");
  158 + if (this.cycleCountDetailService.delBatchMain(Arrays.asList(ids.split(",")))) {
  159 + return Result.OK("批量删除成功!");
  160 + } else {
  161 + return Result.OK("批量删除失败!");
  162 + }
157 163 }
158 164  
159 165 /**
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/entity/CycleCountDetail.java
1 1 package org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity;
2 2  
3 3 import java.io.Serializable;
4   -import java.io.UnsupportedEncodingException;
5 4 import java.math.BigDecimal;
6 5 import java.util.Date;
  6 +
  7 +import org.jeecg.common.aspect.annotation.Dict;
  8 +import org.jeecgframework.poi.excel.annotation.Excel;
  9 +
7 10 import com.baomidou.mybatisplus.annotation.IdType;
8 11 import com.baomidou.mybatisplus.annotation.TableId;
9 12 import com.baomidou.mybatisplus.annotation.TableName;
10   -import lombok.Data;
11   -import com.fasterxml.jackson.annotation.JsonFormat;
12   -import org.springframework.format.annotation.DateTimeFormat;
13   -import org.jeecgframework.poi.excel.annotation.Excel;
14   -import org.jeecg.common.aspect.annotation.Dict;
  13 +
15 14 import io.swagger.annotations.ApiModel;
16 15 import io.swagger.annotations.ApiModelProperty;
  16 +import lombok.Data;
17 17  
18 18 /**
19 19 * @Description: 盘点明细表
20   - * @Author: jeecg-boot
21   - * @Date: 2023-01-30
22   - * @Version: V1.0
  20 + * @Author: jeecg-boot
  21 + * @Date: 2023-01-30
  22 + * @Version: V1.0
23 23 */
24   -@ApiModel(value="cycle_count_detail对象", description="盘点明细表")
  24 +@ApiModel(value = "cycle_count_detail对象", description = "盘点明细表")
25 25 @Data
26 26 @TableName("cycle_count_detail")
27 27 public class CycleCountDetail implements Serializable {
... ... @@ -31,85 +31,90 @@ public class CycleCountDetail implements Serializable {
31 31 @TableId(type = IdType.AUTO)
32 32 @ApiModelProperty(value = "主键")
33 33 private Integer id;
34   - /**盘点主单id*/
35   - @Excel(name = "盘点主单id", width = 15)
  34 + /** 盘点主单id */
  35 + @Excel(name = "盘点主单id", width = 15)
36 36 @ApiModelProperty(value = "盘点主单id")
37 37 private Integer cycleCountHeadId;
38   - /**盘点主单code*/
39   - @Excel(name = "盘点主单code", width = 15)
  38 + /** 盘点主单code */
  39 + @Excel(name = "盘点主单code", width = 15)
40 40 @ApiModelProperty(value = "盘点主单code")
41 41 private String cycleCountHeadCode;
42   - /**任务表头*/
43   - @Excel(name = "任务表头", width = 15)
  42 + /** 任务表头 */
  43 + @Excel(name = "任务表头", width = 15)
44 44 @ApiModelProperty(value = "任务表头")
45 45 private Integer taskHeaderId;
46   - /**仓库*/
47   - @Excel(name = "仓库", width = 15)
  46 + /** 仓库 */
  47 + @Excel(name = "仓库", width = 15)
48 48 @ApiModelProperty(value = "仓库")
49 49 private String warehouseCode;
50   - /**货主*/
51   - @Excel(name = "货主", width = 15)
  50 + /** 货主 */
  51 + @Excel(name = "货主", width = 15)
52 52 @ApiModelProperty(value = "货主")
53 53 private String companyCode;
54   - /**库存明细头*/
55   - @Excel(name = "库存明细头", width = 15)
  54 + /** 库存明细头 */
  55 + @Excel(name = "库存明细头", width = 15)
56 56 @ApiModelProperty(value = "库存明细头")
57 57 private Integer inventoryHeaderId;
58   - /**库位*/
59   - @Excel(name = "库位", width = 15)
  58 + /** 库区类型 */
  59 + @Excel(name = "库区类型", width = 15)
  60 + @ApiModelProperty(value = "库区类型")
  61 + @Dict(dicCode = "zoneType")
  62 + private String zoneType;
  63 + /** 库位 */
  64 + @Excel(name = "库位", width = 15)
60 65 @ApiModelProperty(value = "库位")
61 66 private String locationCode;
62   - /**容器*/
63   - @Excel(name = "容器", width = 15)
  67 + /** 容器 */
  68 + @Excel(name = "容器", width = 15)
64 69 @ApiModelProperty(value = "容器")
65 70 private String containerCode;
66   - /**库存状态*/
67   - @Excel(name = "库存状态", width = 15)
  71 + /** 库存状态 */
  72 + @Excel(name = "库存状态", width = 15)
68 73 @ApiModelProperty(value = "库存状态")
69 74 @Dict(dicCode = "inventory_status")
70 75 private String inventorySts;
71   - /**系统数量*/
72   - @Excel(name = "系统数量", width = 15)
  76 + /** 系统数量 */
  77 + @Excel(name = "系统数量", width = 15)
73 78 @ApiModelProperty(value = "系统数量")
74 79 private BigDecimal systemQty;
75   - /**实盘数量*/
76   - @Excel(name = "实盘数量", width = 15)
  80 + /** 实盘数量 */
  81 + @Excel(name = "实盘数量", width = 15)
77 82 @ApiModelProperty(value = "实盘数量")
78 83 private BigDecimal countedQty;
79   - /**差异数量*/
80   - @Excel(name = "差异数量", width = 15)
  84 + /** 差异数量 */
  85 + @Excel(name = "差异数量", width = 15)
81 86 @ApiModelProperty(value = "差异数量")
82 87 private BigDecimal gapQty;
83   - /**失败原因*/
84   - @Excel(name = "失败原因", width = 15)
  88 + /** 失败原因 */
  89 + @Excel(name = "失败原因", width = 15)
85 90 @ApiModelProperty(value = "失败原因")
86 91 private String rejectionNote;
87   - /**完成用户*/
88   - @Excel(name = "完成用户", width = 15)
  92 + /** 完成用户 */
  93 + @Excel(name = "完成用户", width = 15)
89 94 @ApiModelProperty(value = "完成用户")
90 95 private String completedBy;
91   - /**完成时间*/
92   - @Excel(name = "完成时间", width = 15)
  96 + /** 完成时间 */
  97 + @Excel(name = "完成时间", width = 15)
93 98 @ApiModelProperty(value = "完成时间")
94 99 private Date completedAt;
95   - /**盘点明细状态*/
96   - @Excel(name = "盘点明细状态", width = 15)
  100 + /** 盘点明细状态 */
  101 + @Excel(name = "盘点明细状态", width = 15)
97 102 @ApiModelProperty(value = "盘点明细状态")
98   - @Dict(dicCode = "cyclecount_status")
  103 + @Dict(dicCode = "cycleCount_status")
99 104 private Integer enableStatus;
100   - /**创建人*/
  105 + /** 创建人 */
101 106 @ApiModelProperty(value = "创建人")
102 107 private String createBy;
103   - /**创建日期*/
  108 + /** 创建日期 */
104 109 @ApiModelProperty(value = "创建日期")
105 110 private Date createTime;
106   - /**更新人*/
  111 + /** 更新人 */
107 112 @ApiModelProperty(value = "更新人")
108 113 private String updateBy;
109   - /**更新日期*/
  114 + /** 更新日期 */
110 115 @ApiModelProperty(value = "更新日期")
111 116 private Date updateTime;
112   - /**所属部门*/
  117 + /** 所属部门 */
113 118 @ApiModelProperty(value = "所属部门")
114 119 private String sysOrgCode;
115 120 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/entity/CycleCountDetailChild.java
1 1 package org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity;
2 2  
3 3 import java.io.Serializable;
  4 +import java.math.BigDecimal;
  5 +import java.util.Date;
  6 +
  7 +import org.jeecg.common.aspect.annotation.Dict;
  8 +import org.jeecgframework.poi.excel.annotation.Excel;
  9 +
4 10 import com.baomidou.mybatisplus.annotation.IdType;
5 11 import com.baomidou.mybatisplus.annotation.TableId;
6 12 import com.baomidou.mybatisplus.annotation.TableName;
7   -import lombok.Data;
8   -import com.fasterxml.jackson.annotation.JsonFormat;
9   -import org.springframework.format.annotation.DateTimeFormat;
10   -import org.jeecgframework.poi.excel.annotation.Excel;
11 13  
12   -import java.math.BigDecimal;
13   -import java.util.Date;
14   -import org.jeecg.common.aspect.annotation.Dict;
15 14 import io.swagger.annotations.ApiModel;
16 15 import io.swagger.annotations.ApiModelProperty;
17   -import java.io.UnsupportedEncodingException;
  16 +import lombok.Data;
18 17  
19 18 /**
20 19 * @Description: 盘点容器明细表
21   - * @Author: jeecg-boot
22   - * @Date: 2023-01-30
23   - * @Version: V1.0
  20 + * @Author: jeecg-boot
  21 + * @Date: 2023-01-30
  22 + * @Version: V1.0
24 23 */
25   -@ApiModel(value="cycle_count_detail_child对象", description="盘点容器明细表")
  24 +@ApiModel(value = "cycle_count_detail_child对象", description = "盘点容器明细表")
26 25 @Data
27 26 @TableName("cycle_count_detail_child")
28 27 public class CycleCountDetailChild implements Serializable {
... ... @@ -32,87 +31,91 @@ public class CycleCountDetailChild implements Serializable {
32 31 @TableId(type = IdType.AUTO)
33 32 @ApiModelProperty(value = "主键")
34 33 private Integer id;
35   - /**盘点主单code*/
36   - @Excel(name = "盘点主单code", width = 15)
  34 + /** 盘点主单code */
  35 + @Excel(name = "盘点主单code", width = 15)
37 36 @ApiModelProperty(value = "盘点主单code")
38 37 private String cyclecountheadcode;
39   - /**盘点明细ID主id*/
  38 + /** 盘点明细ID主id */
40 39 @ApiModelProperty(value = "盘点明细ID主id")
41 40 private Integer cycleCountDetailid;
42   - /**盘点明细子单状态*/
43   - @Excel(name = "盘点明细子单状态", width = 15)
  41 + /** 盘点明细子单状态 */
  42 + @Excel(name = "盘点明细子单状态", width = 15)
44 43 @ApiModelProperty(value = "盘点明细子单状态")
45 44 @Dict(dicCode = "cyclecount_status")
46 45 private Integer childStatus;
47   - /**库位*/
48   - @Excel(name = "库位", width = 15)
  46 + /** 库区类型 */
  47 + @Excel(name = "库区类型", width = 15)
  48 + @ApiModelProperty(value = "库区类型")
  49 + private String zoneType;
  50 + /** 库位 */
  51 + @Excel(name = "库位", width = 15)
49 52 @ApiModelProperty(value = "库位")
50 53 private String locationCode;
51   - /**容器*/
52   - @Excel(name = "容器", width = 15)
  54 + /** 容器 */
  55 + @Excel(name = "容器", width = 15)
53 56 @ApiModelProperty(value = "容器")
54 57 private String containerCode;
55   - /**物料编码*/
56   - @Excel(name = "物料编码", width = 15)
  58 + /** 物料编码 */
  59 + @Excel(name = "物料编码", width = 15)
57 60 @ApiModelProperty(value = "物料编码")
58 61 private String materialCode;
59   - /**物料名称*/
60   - @Excel(name = "物料名称", width = 15)
  62 + /** 物料名称 */
  63 + @Excel(name = "物料名称", width = 15)
61 64 @ApiModelProperty(value = "物料名称")
62 65 private String materialName;
63   - /**物料规格*/
64   - @Excel(name = "物料规格", width = 15)
  66 + /** 物料规格 */
  67 + @Excel(name = "物料规格", width = 15)
65 68 @ApiModelProperty(value = "物料规格")
66 69 private String materialSpec;
67   - /**物料单位*/
68   - @Excel(name = "物料单位", width = 15)
  70 + /** 物料单位 */
  71 + @Excel(name = "物料单位", width = 15)
69 72 @ApiModelProperty(value = "物料单位")
70 73 private String materialUnit;
71   - /**任务明细头*/
  74 + /** 任务明细头 */
72 75 @Excel(name = "任务明细头", width = 15)
73 76 @ApiModelProperty(value = "任务明细头")
74 77 private Integer taskDetailId;
75   - /**系统数量*/
76   - @Excel(name = "系统数量", width = 15)
  78 + /** 系统数量 */
  79 + @Excel(name = "系统数量", width = 15)
77 80 @ApiModelProperty(value = "系统数量")
78 81 private BigDecimal systemQty;
79   - /**实盘数量*/
80   - @Excel(name = "实盘数量", width = 15)
  82 + /** 实盘数量 */
  83 + @Excel(name = "实盘数量", width = 15)
81 84 @ApiModelProperty(value = "实盘数量")
82 85 private BigDecimal countedQty;
83   - /**差异数量*/
84   - @Excel(name = "差异数量", width = 15)
  86 + /** 差异数量 */
  87 + @Excel(name = "差异数量", width = 15)
85 88 @ApiModelProperty(value = "差异数量")
86 89 private BigDecimal gapQty;
87   - /**库存明细id*/
88   - @Excel(name = "库存明细id", width = 15)
  90 + /** 库存明细id */
  91 + @Excel(name = "库存明细id", width = 15)
89 92 @ApiModelProperty(value = "库存明细id")
90 93 private Integer inventoryDetaiId;
91   - /**批次*/
  94 + /** 批次 */
92 95 @Excel(name = "批次*/", width = 15)
93 96 @ApiModelProperty(value = "批次*/")
94 97 private String batch;
95   - /**批号*/
  98 + /** 批号 */
96 99 @Excel(name = "批号", width = 15)
97 100 @ApiModelProperty(value = "批号")
98 101 private String lot;
99   - /**库存状态*/
  102 + /** 库存状态 */
100 103 @Excel(name = "库存状态", width = 15)
101 104 @ApiModelProperty(value = "库存状态")
102 105 private String inventoryStatus;
103   - /**创建人*/
  106 + /** 创建人 */
104 107 @ApiModelProperty(value = "创建人")
105 108 private String createBy;
106   - /**创建日期*/
  109 + /** 创建日期 */
107 110 @ApiModelProperty(value = "创建日期")
108 111 private Date createTime;
109   - /**更新人*/
  112 + /** 更新人 */
110 113 @ApiModelProperty(value = "更新人")
111 114 private String updateBy;
112   - /**更新日期*/
  115 + /** 更新日期 */
113 116 @ApiModelProperty(value = "更新日期")
114 117 private Date updateTime;
115   - /**所属部门*/
  118 + /** 所属部门 */
116 119 @ApiModelProperty(value = "所属部门")
117 120 private String sysOrgCode;
118 121 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/ICycleCountDetailChildService.java
1 1 package org.jeecg.modules.wms.stocktaking.cycleCountDetail.service;
2 2  
  3 +import java.util.List;
  4 +
3 5 import org.jeecg.common.api.vo.Result;
4   -import org.jeecg.modules.wms.config.material.entity.Material;
5 6 import org.jeecg.modules.wms.report.dto.QueryReportCycleCountDto;
6 7 import org.jeecg.modules.wms.report.dto.ReportCycleCountDto;
7 8 import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetailChild;
  9 +
8 10 import com.baomidou.mybatisplus.extension.service.IService;
9   -import java.util.List;
10 11  
11 12 /**
12 13 * @Description: 盘点容器明细表
13   - * @Author: jeecg-boot
14   - * @Date: 2023-01-30
15   - * @Version: V1.0
  14 + * @Author: jeecg-boot
  15 + * @Date: 2023-01-30
  16 + * @Version: V1.0
16 17 */
17 18 public interface ICycleCountDetailChildService extends IService<CycleCountDetailChild> {
18 19  
19   -
20   - Result confirmGapQty(String id, String countedQty,String state);
  20 + Result confirmGapQty(String id, String countedQty, String state);
21 21  
22 22 /**
23 23 * 盘点报表查询
24   - * @param queryReportCycleCountDto 查询参数
25   - * @return 盘点报表信息
  24 + * @param queryReportCycleCountDto 查询参数
  25 + * @return 盘点报表信息
26 26 */
27 27 List<ReportCycleCountDto> getCycleCountReport(QueryReportCycleCountDto queryReportCycleCountDto);
  28 +
  29 + /**
  30 + * 完成平库盘点登记
  31 + * @return
  32 + */
  33 + Result completePingkuConfirmGapQty(String id, String countedQty);
28 34 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/ICycleCountDetailService.java
... ... @@ -36,7 +36,7 @@ public interface ICycleCountDetailService extends IService&lt;CycleCountDetail&gt; {
36 36 /**
37 37 * 批量删除一对多
38 38 */
39   - public void delBatchMain(Collection<? extends Serializable> idList);
  39 + public boolean delBatchMain(Collection<? extends Serializable> idList);
40 40  
41 41 Result createCycleCoutTaskByDetailId(Integer cycleCoutdetailId, String toPort, String warehouseCode);
42 42  
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailChildServiceImpl.java
... ... @@ -2,6 +2,7 @@ package org.jeecg.modules.wms.stocktaking.cycleCountDetail.service.impl;
2 2  
3 3 import java.math.BigDecimal;
4 4 import java.util.Collections;
  5 +import java.util.Date;
5 6 import java.util.List;
6 7  
7 8 import javax.annotation.Resource;
... ... @@ -10,8 +11,22 @@ import org.apache.shiro.SecurityUtils;
10 11 import org.jeecg.common.api.vo.Result;
11 12 import org.jeecg.common.exception.JeecgBootException;
12 13 import org.jeecg.common.system.vo.LoginUser;
  14 +import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail;
  15 +import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryHeader;
  16 +import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService;
  17 +import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService;
  18 +import org.jeecg.modules.wms.inventory.inventoryTransaction.entity.InventoryTransaction;
  19 +import org.jeecg.modules.wms.inventory.inventoryTransaction.service.IInventoryTransactionService;
  20 +import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail;
  21 +import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader;
  22 +import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptDetailService;
  23 +import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptHeaderService;
13 24 import org.jeecg.modules.wms.report.dto.QueryReportCycleCountDto;
14 25 import org.jeecg.modules.wms.report.dto.ReportCycleCountDto;
  26 +import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail;
  27 +import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentHeader;
  28 +import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentDetailService;
  29 +import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentHeaderService;
15 30 import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetail;
16 31 import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetailChild;
17 32 import org.jeecg.modules.wms.stocktaking.cycleCountDetail.mapper.CycleCountDetailChildMapper;
... ... @@ -20,10 +35,12 @@ import org.jeecg.modules.wms.stocktaking.cycleCountHeader.entity.CycleCountHeade
20 35 import org.jeecg.modules.wms.stocktaking.cycleCountHeader.service.impl.CycleCountHeaderServiceImpl;
21 36 import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail;
22 37 import org.jeecg.modules.wms.task.taskHeader.service.ITaskDetailService;
  38 +import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService;
23 39 import org.jeecg.utils.StringUtils;
24 40 import org.jeecg.utils.constant.QuantityConstant;
25 41 import org.springframework.beans.factory.annotation.Autowired;
26 42 import org.springframework.stereotype.Service;
  43 +import org.springframework.transaction.annotation.Transactional;
27 44  
28 45 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
29 46 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
... ... @@ -47,8 +64,27 @@ public class CycleCountDetailChildServiceImpl extends ServiceImpl&lt;CycleCountDeta
47 64 private CycleCountHeaderServiceImpl cycleCountHeaderService;
48 65 @Resource
49 66 private ITaskDetailService taskDetailService;
  67 + @Resource
  68 + private CycleCountDetailChildServiceImpl cycleCountDetailChildService;
  69 + @Resource
  70 + private IInventoryHeaderService inventoryHeaderService;
  71 + @Resource
  72 + private IInventoryDetailService inventoryDetailService;
  73 + @Resource
  74 + private IReceiptHeaderService receiptHeaderService;
  75 + @Resource
  76 + private IReceiptDetailService receiptDetailService;
  77 + @Resource
  78 + private IInventoryTransactionService inventoryTransactionService;
  79 + @Resource
  80 + private IShipmentHeaderService shipmentHeaderService;
  81 + @Resource
  82 + private IShipmentDetailService shipmentDetailService;
  83 + @Resource
  84 + private ITaskHeaderService taskHeaderService;
50 85  
51 86 @Override
  87 + @Transactional
52 88 public Result confirmGapQty(String id, String countedQty, String state) {
53 89 // 接收子单ID和实盘数量
54 90 // 任务未完成可多次登记。
... ... @@ -65,7 +101,10 @@ public class CycleCountDetailChildServiceImpl extends ServiceImpl&lt;CycleCountDeta
65 101 if (StringUtils.isNull(detailChild)) {
66 102 return Result.error("明细子单不存在!");
67 103 }
68   -
  104 + String zoneType = detailChild.getZoneType();
  105 + if (StringUtils.isEmpty(zoneType)) {
  106 + return Result.error("实盘登记, 盘点明细" + id + "库区类型为空!");
  107 + }
69 108 BigDecimal qty = new BigDecimal(countedQty);
70 109 if (qty.compareTo(BigDecimal.ZERO) == -1) {
71 110 return Result.error("实盘登记数不能小于0");
... ... @@ -132,17 +171,20 @@ public class CycleCountDetailChildServiceImpl extends ServiceImpl&lt;CycleCountDeta
132 171 throw new JeecgBootException("更新盘点表单头失败");
133 172 }
134 173  
135   - TaskDetail taskDetail = new TaskDetail();
136   - taskDetail.setId(detailChild.getTaskDetailId());
137   - taskDetail.setCircleQty(qty);
138   - taskDetail.setCircleStatus(QuantityConstant.CIRCLE_REGISTER_STATUS_COMPLETE);
139   - if (!taskDetailService.updateById(taskDetail)) {
140   - throw new JeecgBootException("更新任务详情失败");
  174 + if (zoneType.equals("P")) {
  175 + Result result = cycleCountDetailChildService.completePingkuConfirmGapQty(id, countedQty);
  176 + if (!result.isSuccess()) {
  177 + throw new JeecgBootException("调整平库库存失败");
  178 + }
  179 + } else {
  180 + TaskDetail taskDetail = new TaskDetail();
  181 + taskDetail.setId(detailChild.getTaskDetailId());
  182 + taskDetail.setCircleQty(qty);
  183 + taskDetail.setCircleStatus(QuantityConstant.CIRCLE_REGISTER_STATUS_COMPLETE);
  184 + if (!taskDetailService.updateById(taskDetail)) {
  185 + throw new JeecgBootException("更新任务详情失败");
  186 + }
141 187 }
142   - // Result<Integer> result = new Result<Integer>();
143   - // result.setCode(200);
144   - // result.setMessage("调整成功");
145   - // result.setResult(cycleCountHeader.getId());
146 188 return Result.OK("调整成功");
147 189 }
148 190  
... ... @@ -150,4 +192,264 @@ public class CycleCountDetailChildServiceImpl extends ServiceImpl&lt;CycleCountDeta
150 192 public List<ReportCycleCountDto> getCycleCountReport(QueryReportCycleCountDto queryReportCycleCountDto) {
151 193 return super.baseMapper.selectCycleCount(queryReportCycleCountDto, Collections.singletonList(QuantityConstant.CYCLECOUNT_STATUS_COMPLETED));
152 194 }
  195 +
  196 + @Override
  197 + @Transactional
  198 + public Result completePingkuConfirmGapQty(String id, String countedQty) {
  199 + CycleCountDetailChild cycleCountDetailChild = cycleCountDetailChildService.getById(id);
  200 + if (cycleCountDetailChild == null) {
  201 + return Result.error("完成盘点登记时,盘点容器明细表为空" + id);
  202 + }
  203 + CycleCountDetail cycleCountDetail = cycleCountDetailService.getById(cycleCountDetailChild.getCycleCountDetailid());
  204 + if (cycleCountDetail == null) {
  205 + return Result.error("完成盘点登记时,盘点单详情为空" + cycleCountDetailChild.getCycleCountDetailid());
  206 + }
  207 + CycleCountHeader cycleCountHeader = cycleCountHeaderService.getById(cycleCountDetail.getCycleCountHeadId());
  208 + if (cycleCountHeader == null) {
  209 + return Result.error("完成盘点登记时,盘点主单为空" + cycleCountDetail.getCycleCountHeadId());
  210 + }
  211 + // 2.盘点单主单据查明细单据list
  212 + LambdaQueryWrapper<CycleCountDetailChild> childLambdaQueryWrapper = new LambdaQueryWrapper<CycleCountDetailChild>();
  213 + childLambdaQueryWrapper.eq(CycleCountDetailChild::getCycleCountDetailid, cycleCountDetail.getId());
  214 + List<CycleCountDetailChild> cycleCountDetailChildList = cycleCountDetailChildService.list(childLambdaQueryWrapper);
  215 + if (StringUtils.isEmpty(cycleCountDetailChildList)) {
  216 + return Result.error("完成盘点任务时,盘点单详情明细为空" + cycleCountDetail.getId());
  217 + }
  218 + // 3.单据list如果差异数量+生成入库单,差异数-生成出库单进行回传类型其他出库单
  219 + InventoryHeader inventoryHeader = inventoryHeaderService.getById(cycleCountDetail.getInventoryHeaderId());
  220 + if (inventoryHeader == null) {
  221 + return Result.error("完成盘点任务时,没有找到库存头" + cycleCountDetail.getInventoryHeaderId());
  222 + }
  223 + int outboundOrderId = 0;
  224 + String outboundOrderCode = null;
  225 + int warehousingOrderId = 0;
  226 + String warehousingOrderCode = null;
  227 + boolean success = false;
  228 + for (CycleCountDetailChild child : cycleCountDetailChildList) {
  229 + if (child.getChildStatus().equals(QuantityConstant.CYCLECOUNT_STATUS_COMPLETED)) {
  230 + continue;
  231 + }
  232 + if (child.getCountedQty().compareTo(BigDecimal.ZERO) == 0) {
  233 + continue;
  234 + }
  235 + String toLocationCode = inventoryHeader.getLocationCode();
  236 + String warehouseCode = cycleCountHeader.getWarehouseCode();
  237 + String companyCode = cycleCountHeader.getCompanyCode();
  238 + if (child.getInventoryDetaiId() != null) {
  239 + InventoryDetail inventoryDetail = inventoryDetailService.getById(child.getInventoryDetaiId());
  240 + if (inventoryDetail == null) {
  241 + throw new JeecgBootException("盘点还没完成 库存明细单据就不存在了 可能出现了问题或者所容器没成功");
  242 + }
  243 + success = inventoryDetailService.updateQtyAndTaskQtyAndLocationCode(child.getCountedQty(), BigDecimal.ZERO, toLocationCode, inventoryDetail.getId());
  244 + if (!success) {
  245 + throw new JeecgBootException("完成盘点任务时, 更新库存详情失败");
  246 + }
  247 + } else {
  248 + InventoryDetail inventoryDetail = new InventoryDetail();
  249 + inventoryDetail.setInventoryHeaderId(inventoryHeader.getId());
  250 + inventoryDetail.setWarehouseCode(warehouseCode);
  251 + inventoryDetail.setCompanyCode(companyCode);
  252 + inventoryDetail.setZoneCode(inventoryHeader.getZoneCode());
  253 + inventoryDetail.setContainerCode(inventoryHeader.getContainerCode());
  254 + inventoryDetail.setLocationCode(toLocationCode);
  255 + inventoryDetail.setMaterialCode(child.getMaterialCode());
  256 + inventoryDetail.setMaterialName(child.getMaterialName());
  257 + inventoryDetail.setMaterialSpec(child.getMaterialSpec());
  258 + inventoryDetail.setMaterialUnit(child.getMaterialUnit());
  259 + inventoryDetail.setQty(child.getCountedQty());
  260 + inventoryDetail.setTaskQty(BigDecimal.ZERO);
  261 + inventoryDetail.setInventoryStatus(child.getInventoryStatus());
  262 + inventoryDetail.setBatch(child.getBatch());
  263 + success = inventoryDetailService.save(inventoryDetail);
  264 + if (!success) {
  265 + throw new JeecgBootException("完成盘点任务时, 保存库存详情失败");
  266 + }
  267 + child.setInventoryDetaiId(inventoryDetail.getId());
  268 + }
  269 +
  270 + child.setChildStatus(QuantityConstant.CYCLECOUNT_STATUS_COMPLETED);
  271 + if (child.getGapQty().compareTo(BigDecimal.ZERO) == 1) {
  272 + if (warehousingOrderId == 0) {
  273 + ReceiptHeader receiptHeader = new ReceiptHeader();
  274 + receiptHeader.setWarehouseCode(warehouseCode);
  275 + receiptHeader.setType(QuantityConstant.RECEIPT_BILL_TYPE_QTR);
  276 + receiptHeader.setRemark("盘盈 单号" + cycleCountDetail.getCycleCountHeadCode());
  277 + Result result = receiptHeaderService.saveReceiptHeader(receiptHeader);
  278 + if (!result.isSuccess()) {
  279 + return result;
  280 + }
  281 + receiptHeader.setFirstStatus(QuantityConstant.RECEIPT_HEADER_COMPLETED);
  282 + receiptHeader.setLastStatus(QuantityConstant.RECEIPT_HEADER_COMPLETED);
  283 + success = receiptHeaderService.updateById(receiptHeader);
  284 + if (!success) {
  285 + throw new JeecgBootException("完成盘点任务时, 更新入库表单头失败");
  286 + }
  287 + // 生成入库单并且赋值给warehousingOrderId
  288 + warehousingOrderId = receiptHeader.getId();
  289 + warehousingOrderCode = receiptHeader.getCode();
  290 + }
  291 +
  292 + // 生成明细
  293 + ReceiptDetail receiptDetail = new ReceiptDetail();
  294 + receiptDetail.setReceiptId(warehousingOrderId);
  295 + receiptDetail.setReceiptCode(warehousingOrderCode);
  296 + receiptDetail.setWarehouseCode(warehouseCode);
  297 + receiptDetail.setCompanyCode(companyCode);
  298 + receiptDetail.setMaterialCode(child.getMaterialCode());
  299 + receiptDetail.setMaterialName(child.getMaterialName());
  300 + receiptDetail.setMaterialSpec(child.getMaterialSpec());
  301 + receiptDetail.setMaterialUnit(child.getMaterialUnit());
  302 + receiptDetail.setQty(child.getGapQty().abs());
  303 + receiptDetail.setTaskQty(child.getGapQty().abs());
  304 + receiptDetail.setInventoryStatus(child.getInventoryStatus());
  305 + receiptDetail.setBatch(child.getBatch());
  306 + receiptDetail.setLot(child.getLot());
  307 + receiptDetail.setStatus(QuantityConstant.RECEIPT_HEADER_COMPLETED);
  308 + success = receiptDetailService.save(receiptDetail);
  309 + if (!success) {
  310 + throw new JeecgBootException("完成盘点任务时, 新增入库表单详情失败");
  311 + }
  312 + // 增加库存交易记录
  313 + InventoryTransaction inventoryTransaction = new InventoryTransaction();
  314 + inventoryTransaction.setWarehouseCode(warehouseCode);
  315 + inventoryTransaction.setCompanyCode(companyCode);
  316 + inventoryTransaction.setZoneCode(inventoryHeader.getZoneCode());
  317 + inventoryTransaction.setContainerCode(child.getContainerCode());
  318 + inventoryTransaction.setToLocationCode(child.getLocationCode());
  319 + inventoryTransaction.setType(QuantityConstant.INVENTORY_TRANSACTION_CYCLEINTO);
  320 + inventoryTransaction.setReceiptId(receiptDetail.getReceiptId());
  321 + inventoryTransaction.setReceiptCode(receiptDetail.getReceiptCode());
  322 + inventoryTransaction.setReceiptType(QuantityConstant.RECEIPT_BILL_TYPE_QTR);
  323 + inventoryTransaction.setReceiptDetailId(receiptDetail.getId());
  324 + inventoryTransaction.setMaterialCode(child.getMaterialCode());
  325 + inventoryTransaction.setMaterialName(child.getMaterialName());
  326 + inventoryTransaction.setMaterialSpec(child.getMaterialSpec());
  327 + inventoryTransaction.setMaterialUnit(child.getMaterialUnit());
  328 + inventoryTransaction.setInventoryStatus(child.getInventoryStatus());
  329 + inventoryTransaction.setQty(child.getGapQty());
  330 + inventoryTransaction.setReceiptQty(child.getGapQty());
  331 + inventoryTransaction.setBatch(child.getBatch());
  332 + inventoryTransaction.setLot(child.getLot());
  333 + success = inventoryTransactionService.save(inventoryTransaction);
  334 + if (!success) {
  335 + throw new JeecgBootException("完成盘点任务时, 新增库存交易详情失败");
  336 + }
  337 + success = receiptHeaderService.updateReceiptHeader(warehousingOrderId);
  338 + if (!success) {
  339 + throw new JeecgBootException("完成盘点任务时, 更新入库单失败");
  340 + }
  341 + }
  342 +
  343 + if (child.getGapQty().compareTo(BigDecimal.ZERO) == -1) {
  344 + if (child.getGapQty().abs().compareTo(child.getSystemQty()) > -1) {
  345 + success = inventoryDetailService.removeById(child.getInventoryDetaiId());
  346 + if (!success) {
  347 + throw new JeecgBootException("完成盘点任务时, 删除库存详情失败");
  348 + }
  349 + }
  350 + if (outboundOrderId == 0) {
  351 + ShipmentHeader shipmentHeader = new ShipmentHeader();
  352 + shipmentHeader.setWarehouseCode(warehouseCode);
  353 + shipmentHeader.setCompanyCode(companyCode);
  354 + shipmentHeader.setType(QuantityConstant.SHIPMENT_BILL_TYPE_QTC);
  355 + shipmentHeader.setRemark("盘亏 单号" + cycleCountDetail.getCycleCountHeadCode());
  356 + Result result = shipmentHeaderService.saveShipmentHeader(shipmentHeader);
  357 + if (!result.isSuccess()) {
  358 + return result;
  359 + }
  360 + shipmentHeader.setFirstStatus(QuantityConstant.RECEIPT_HEADER_COMPLETED);
  361 + shipmentHeader.setLastStatus(QuantityConstant.RECEIPT_HEADER_COMPLETED);
  362 + success = shipmentHeaderService.updateById(shipmentHeader);
  363 + if (!success) {
  364 + throw new JeecgBootException("完成盘点任务时, 更新出库单详情失败");
  365 + }
  366 + // 生成出库单并且赋值给outboundOrderId
  367 + outboundOrderId = shipmentHeader.getId();
  368 + outboundOrderCode = shipmentHeader.getCode();
  369 + }
  370 + // 生成明细
  371 + ShipmentDetail shipmentDetail = new ShipmentDetail();
  372 + shipmentDetail.setShipmentId(outboundOrderId);
  373 + shipmentDetail.setShipmentCode(outboundOrderCode);
  374 + shipmentDetail.setWarehouseCode(warehouseCode);
  375 + shipmentDetail.setCompanyCode(companyCode);
  376 + shipmentDetail.setMaterialCode(child.getMaterialCode());
  377 + shipmentDetail.setMaterialName(child.getMaterialName());
  378 + shipmentDetail.setMaterialSpec(child.getMaterialSpec());
  379 + shipmentDetail.setMaterialUnit(child.getMaterialUnit());
  380 + shipmentDetail.setQty(child.getGapQty().abs());
  381 + shipmentDetail.setTaskQty(child.getGapQty().abs());
  382 + shipmentDetail.setInventoryStatus(child.getInventoryStatus());
  383 + shipmentDetail.setBatch(child.getBatch());
  384 + shipmentDetail.setLot(child.getLot());
  385 + shipmentDetail.setStatus(QuantityConstant.RECEIPT_HEADER_COMPLETED);
  386 + success = shipmentDetailService.save(shipmentDetail);
  387 + if (!success) {
  388 + throw new JeecgBootException("完成盘点任务时, 保存出库单详情失败");
  389 + }
  390 + InventoryTransaction inventoryTransaction = new InventoryTransaction();
  391 + inventoryTransaction.setWarehouseCode(warehouseCode);
  392 + inventoryTransaction.setCompanyCode(companyCode);
  393 + inventoryTransaction.setZoneCode(inventoryHeader.getZoneCode());
  394 + inventoryTransaction.setContainerCode(child.getContainerCode());
  395 + inventoryTransaction.setFromLocationCode(child.getLocationCode());
  396 + inventoryTransaction.setType(QuantityConstant.INVENTORY_TRANSACTION_CYCLEOUT);
  397 + inventoryTransaction.setShipmentId(shipmentDetail.getShipmentId());
  398 + inventoryTransaction.setShipmentCode(shipmentDetail.getShipmentCode());
  399 + inventoryTransaction.setShipmentType(QuantityConstant.SHIPMENT_BILL_TYPE_QTC);
  400 + inventoryTransaction.setShipmentDetailId(shipmentDetail.getId());
  401 + inventoryTransaction.setMaterialCode(child.getMaterialCode());
  402 + inventoryTransaction.setMaterialName(child.getMaterialName());
  403 + inventoryTransaction.setMaterialSpec(child.getMaterialSpec());
  404 + inventoryTransaction.setMaterialUnit(child.getMaterialUnit());
  405 + inventoryTransaction.setInventoryStatus(child.getInventoryStatus());
  406 + inventoryTransaction.setQty(child.getGapQty());
  407 + inventoryTransaction.setShipmentQty(child.getGapQty());
  408 + inventoryTransaction.setBatch(child.getBatch());
  409 + inventoryTransaction.setLot(child.getLot());
  410 + success = inventoryTransactionService.save(inventoryTransaction);
  411 + if (!success) {
  412 + throw new JeecgBootException("完成盘点任务时, 保存出库单详情失败");
  413 + }
  414 + success = shipmentHeaderService.updateShipmentHeader(outboundOrderId);
  415 + if (!success) {
  416 + throw new JeecgBootException("完成盘点任务时, 更新出库单失败");
  417 + }
  418 + }
  419 + success = cycleCountDetailChildService.updateById(child);
  420 + if (!success) {
  421 + throw new JeecgBootException("完成盘点任务时, 更新盘点详情失败");
  422 + }
  423 + }
  424 +
  425 + if (inventoryHeader.getTotalQty().compareTo(BigDecimal.ZERO) < 1) {
  426 + success = inventoryHeaderService.removeById(inventoryHeader.getId());
  427 + if (!success) {
  428 + throw new JeecgBootException("完成盘点任务时, 删除库存头失败");
  429 + }
  430 + }
  431 +
  432 + boolean complete = true;
  433 + // 盘点明细状态
  434 + for (CycleCountDetailChild child : cycleCountDetailChildList) {
  435 + if (child.getChildStatus().intValue() != QuantityConstant.CYCLECOUNT_STATUS_COMPLETED) {
  436 + complete = false;
  437 + }
  438 + }
  439 + if (complete) {
  440 + cycleCountDetail.setEnableStatus(QuantityConstant.CYCLECOUNT_STATUS_COMPLETED);
  441 + cycleCountDetail.setCompletedAt(new Date());
  442 + success = cycleCountDetailService.updateById(cycleCountDetail);
  443 + if (!success) {
  444 + throw new JeecgBootException("完成盘点任务时, 更新盘点单详情失败");
  445 + }
  446 + }
  447 +
  448 + // 更新主单状态
  449 + cycleCountHeaderService.updataHeaderStatus(cycleCountDetail.getCycleCountHeadCode());
  450 + if (!taskHeaderService.combineInventoryDetail(inventoryHeader.getContainerCode(), inventoryHeader.getWarehouseCode())) {
  451 + throw new JeecgBootException("完成盘点任务时, 更新库存失败");
  452 + }
  453 + return Result.ok("完成盘点任务成功");
  454 + }
153 455 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailServiceImpl.java
... ... @@ -14,9 +14,12 @@ import org.jeecg.modules.wms.config.container.entity.Container;
14 14 import org.jeecg.modules.wms.config.container.service.impl.ContainerServiceImpl;
15 15 import org.jeecg.modules.wms.config.location.entity.Location;
16 16 import org.jeecg.modules.wms.config.location.service.impl.LocationServiceImpl;
  17 +import org.jeecg.modules.wms.config.locationType.service.ILocationTypeService;
17 18 import org.jeecg.modules.wms.config.material.entity.Material;
18 19 import org.jeecg.modules.wms.config.material.service.impl.MaterialServiceImpl;
19 20 import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService;
  21 +import org.jeecg.modules.wms.config.zone.entity.Zone;
  22 +import org.jeecg.modules.wms.config.zone.service.IZoneService;
20 23 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail;
21 24 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryHeader;
22 25 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService;
... ... @@ -87,6 +90,10 @@ public class CycleCountDetailServiceImpl extends ServiceImpl&lt;CycleCountDetailMap
87 90 private IInventoryHeaderService inventoryHeaderService;
88 91 @Resource
89 92 private ContainerServiceImpl containerService;
  93 + @Resource
  94 + private ILocationTypeService locationTypeService;
  95 + @Resource
  96 + private IZoneService zoneService;
90 97  
91 98 @Override
92 99 @Transactional
... ... @@ -140,13 +147,22 @@ public class CycleCountDetailServiceImpl extends ServiceImpl&lt;CycleCountDetailMap
140 147  
141 148 @Override
142 149 @Transactional
143   - public void delBatchMain(Collection<? extends Serializable> idList) {
  150 + public boolean delBatchMain(Collection<? extends Serializable> idList) {
144 151 for (Serializable id : idList) {
145 152 LambdaQueryWrapper<CycleCountDetailChild> cycleCountDetailChildLambdaQueryWrapper = Wrappers.lambdaQuery();
146 153 cycleCountDetailChildLambdaQueryWrapper.eq(CycleCountDetailChild::getCycleCountDetailid, id.toString());
147   - cycleCountDetailChildMapper.delete(cycleCountDetailChildLambdaQueryWrapper);
148   - cycleCountDetailMapper.deleteById(id);
  154 + int delete = cycleCountDetailChildMapper.delete(cycleCountDetailChildLambdaQueryWrapper);
  155 + if (delete == 0) {
  156 + return false;
  157 + }
  158 + delete = cycleCountDetailMapper.deleteById(id);
  159 + if (delete > 0) {
  160 +
  161 + } else {
  162 + return false;
  163 + }
149 164 }
  165 + return true;
150 166 }
151 167  
152 168 @Override
... ... @@ -172,17 +188,29 @@ public class CycleCountDetailServiceImpl extends ServiceImpl&lt;CycleCountDetailMap
172 188 return Result.error("当前容器已锁定 请检查数据 库存里面不是锁定 实际上容器里面锁定了");
173 189 }
174 190  
175   - Location locationByCode = locationService.getLocationByCode(inventoryDetails.get(0).getLocationCode(), warehouseCode);
176   - if (locationByCode.getStatus().equals(QuantityConstant.STATUS_CONTAINER_LOCK)) {
  191 + Location location = locationService.getLocationByCode(inventoryDetails.get(0).getLocationCode(), warehouseCode);
  192 + if (location.getStatus().equals(QuantityConstant.STATUS_CONTAINER_LOCK)) {
177 193 return Result.error("当前库位已锁定 请检查数据 库存里面不是锁定 实际上库位里面锁定了");
178 194 }
179 195 InventoryHeader inventoryHeader = inventoryHeaderService.getById(taskId);
180 196 if (inventoryHeader == null) {
181 197 return Result.error("根据库存头ID:" + taskId + "没有找到库存头");
182 198 }
183   -
  199 + String zoneCode = location.getZoneCode();
  200 + if (StringUtils.isEmpty(zoneCode)) {
  201 + return Result.error("添加库存盘点时,盘点库存的库区编码为空");
  202 + }
  203 + Zone zone = zoneService.getZoneByCode(zoneCode, warehouseCode);
  204 + if (zone == null) {
  205 + return Result.error("添加库存盘点时,没有找到盘点库存的库区");
  206 + }
  207 + String zoneType = zone.getType();
  208 + if (StringUtils.isEmpty(zoneType)) {
  209 + return Result.error("添加库存盘点时,盘点库存的库区类型编码为空");
  210 + }
184 211 CycleCountDetail cycleCountDetail = new CycleCountDetail();
185 212 cycleCountDetail.setCycleCountHeadId(headerId);
  213 + cycleCountDetail.setZoneType(zoneType);
186 214 cycleCountDetail.setContainerCode(inventoryDetails.get(0).getContainerCode());
187 215 cycleCountDetail.setCycleCountHeadCode(code);
188 216 cycleCountDetail.setCompanyCode(inventoryDetails.get(0).getCompanyCode());
... ... @@ -199,7 +227,12 @@ public class CycleCountDetailServiceImpl extends ServiceImpl&lt;CycleCountDetailMap
199 227 CycleCountDetailChild cycleCountDetailChild = new CycleCountDetailChild();
200 228 cycleCountDetailChild.setCycleCountDetailid(cycleCountDetail.getId());
201 229 cycleCountDetailChild.setCyclecountheadcode(code);
202   - cycleCountDetailChild.setChildStatus(QuantityConstant.CYCLECOUNT_STATUS_BUILD);
  230 + if (zoneType.equals(QuantityConstant.ZONE_TYPE_FLAT)) {
  231 + cycleCountDetailChild.setChildStatus(QuantityConstant.CYCLECOUNT_STATUS_BUILDTASK);
  232 + } else {
  233 + cycleCountDetailChild.setChildStatus(QuantityConstant.CYCLECOUNT_STATUS_BUILD);
  234 + }
  235 + cycleCountDetailChild.setZoneType(zoneType);
203 236 cycleCountDetailChild.setLocationCode(inventoryDetail.getLocationCode());
204 237 cycleCountDetailChild.setContainerCode(inventoryDetail.getContainerCode());
205 238 cycleCountDetailChild.setMaterialCode(inventoryDetail.getMaterialCode());
... ... @@ -393,14 +426,17 @@ public class CycleCountDetailServiceImpl extends ServiceImpl&lt;CycleCountDetailMap
393 426 }
394 427  
395 428 if (cycleCountDetail.getEnableStatus().equals(QuantityConstant.CYCLECOUNT_STATUS_BUILD)) {
396   - return Result.error("当前盘点明细是新建状态 不能调整");
  429 + String zoneType = cycleCountDetail.getZoneType();
  430 + if (!zoneType.equals(QuantityConstant.ZONE_TYPE_FLAT)) {
  431 + return Result.error("当前盘点明细是新建状态 不能调整");
  432 + }
397 433 }
398 434 if (cycleCountDetail.getEnableStatus().equals(QuantityConstant.CYCLECOUNT_STATUS_COMPLETED)) {
399 435 return Result.error("当前盘点明细是完成状态 不能调整");
400 436 }
401 437  
402 438 if (cycleCountDetailChild.getCountedQty().compareTo(BigDecimal.ZERO) == 0) {
403   - return Result.error("别闹");
  439 + return Result.error("盘点登记时,盘点登记数量不能为0");
404 440 }
405 441  
406 442 cycleCountDetailChild.setCyclecountheadcode(cycleCountDetail.getCycleCountHeadCode());
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... ... @@ -1116,7 +1116,9 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
1116 1116 throw new JeecgBootException("完成任务," + containerCode + " 叠盘清空目标库位失败");
1117 1117 }
1118 1118 }
1119   - inventoryHeaderService.clearInentory(containerCode, warehouseCode);
  1119 + if (taskType == QuantityConstant.TASK_TYPE_SORTINGSHIPMENT) {
  1120 + inventoryHeaderService.clearInentory(containerCode, warehouseCode);
  1121 + }
1120 1122 }
1121 1123 return result;
1122 1124 }
... ... @@ -2748,8 +2750,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
2748 2750 inventoryTransaction.setMaterialSpec(child.getMaterialSpec());
2749 2751 inventoryTransaction.setMaterialUnit(child.getMaterialUnit());
2750 2752 inventoryTransaction.setInventoryStatus(child.getInventoryStatus());
2751   - inventoryTransaction.setQty(child.getCountedQty());
2752   - inventoryTransaction.setReceiptQty(child.getCountedQty());
  2753 + inventoryTransaction.setQty(child.getGapQty());
  2754 + inventoryTransaction.setReceiptQty(child.getGapQty());
2753 2755 inventoryTransaction.setBatch(child.getBatch());
2754 2756 inventoryTransaction.setLot(child.getLot());
2755 2757 success = inventoryTransactionService.save(inventoryTransaction);
... ... @@ -2828,8 +2830,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
2828 2830 inventoryTransaction.setMaterialSpec(child.getMaterialSpec());
2829 2831 inventoryTransaction.setMaterialUnit(child.getMaterialUnit());
2830 2832 inventoryTransaction.setInventoryStatus(child.getInventoryStatus());
2831   - inventoryTransaction.setQty(child.getCountedQty());
2832   - inventoryTransaction.setShipmentQty(child.getCountedQty());
  2833 + inventoryTransaction.setQty(child.getGapQty());
  2834 + inventoryTransaction.setShipmentQty(child.getGapQty());
2833 2835 inventoryTransaction.setBatch(child.getBatch());
2834 2836 inventoryTransaction.setLot(child.getLot());
2835 2837 success = inventoryTransactionService.save(inventoryTransaction);
... ...