Commit 4591e354aefcdbf8f78d5f5df4950ba011c7a408

Authored by 李泰瑜
1 parent 34a09f47

优化盘点

ant-design-vue-jeecg/src/components/jeecgbiz/JButtonBizComponent/JSelectBizComponentModal.vue
... ... @@ -331,6 +331,7 @@ export default {
331 331 that.$emit('ok');
332 332 that.model.containerCode = '';
333 333 that.model.toPortCode = '';
  334 + that.close();
334 335 } else {
335 336 that.$message.warning(res.message);
336 337 }
... ...
ant-design-vue-jeecg/src/components/jeecgbiz/JSelectMultiCycleCount.vue
... ... @@ -8,6 +8,7 @@
8 8 v-on="$listeners"
9 9 v-bind="attrs"
10 10 />
  11 +
11 12 </template>
12 13  
13 14 <script>
... ...
ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountDetailList.vue
... ... @@ -14,38 +14,14 @@
14 14 <div class="table-operator">
15 15 <j-select-multi-cycle-count :query-config="selectUserQueryConfig"/>
16 16 <a-button type="primary" icon="download" @click="handleExportXls('盘点明细表')">导出</a-button>
17   - <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
18   - <a-button type="primary" icon="import">导入</a-button>
19   - </a-upload>
20 17 <!-- 高级查询区域 -->
21   - <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
22   - <a-dropdown v-if="selectedRowKeys.length > 0">
23   - <a-menu slot="overlay">
24   - <a-menu-item key="1" @click="batchDel">
25   - <a-icon type="delete"/>
26   - <span>删除</span>
27   - </a-menu-item>
28   - </a-menu>
29   - <a-button>
30   - <span>批量操作</span>
31   - <a-icon type="down"/>
32   - </a-button>
33   - </a-dropdown>
  18 +
34 19 </div>
35 20 <!-- 操作按钮区域 end -->
36 21  
37 22 <!-- table区域 begin -->
38 23 <div>
39 24  
40   - <a-alert type="info" showIcon style="margin-bottom: 16px;">
41   - <template slot="message">
42   - <span>已选择</span>
43   - <a style="font-weight: 600;padding: 0 4px;">{{ selectedRowKeys.length }}</a>
44   - <span>项</span>
45   - <a style="margin-left: 24px" @click="onClearSelected">清空</a>
46   - </template>
47   - </a-alert>
48   -
49 25 <a-table
50 26 ref="table"
51 27 size="middle"
... ... @@ -66,7 +42,7 @@
66 42 <!-- 内嵌table区域 begin -->
67 43 <template slot="expandedRowRender" slot-scope="record">
68 44 <a-tabs tabPosition="top">
69   - <a-tab-pane tab="盘点容器明细表" key="cycleCountDetailChild" forceRender>
  45 + <a-tab-pane tab="物料详情表" key="cycleCountDetailChild" forceRender>
70 46 <cycle-count-detail-child-sub-table :record="record"/>
71 47 </a-tab-pane>
72 48 </a-tabs>
... ... @@ -100,18 +76,11 @@
100 76 </template>
101 77  
102 78 <template slot="action" slot-scope="text, record">
103   - <a @click="handleEdit(record)">编辑</a>
  79 + <a @click="handleEdit(record)">生成盘点任务</a>
104 80 <a-divider type="vertical"/>
105   - <a-dropdown>
106   - <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
107   - <a-menu slot="overlay">
108   - <a-menu-item>
109   - <a-popconfirm title="确定删除吗?" @confirm="handleDelete(record.id)">
110   - <a>删除</a>
111   - </a-popconfirm>
112   - </a-menu-item>
113   - </a-menu>
114   - </a-dropdown>
  81 + <a-popconfirm title="确定删除吗?" @confirm="handleDelete(record.id)">
  82 + <a>删除</a>
  83 + </a-popconfirm>
115 84  
116 85 </template>
117 86  
... ... @@ -203,7 +172,7 @@
203 172 {
204 173 title: '库存状态',
205 174 align: 'center',
206   - dataIndex: 'inventorySts',
  175 + dataIndex: 'inventorySts_dictText',
207 176 },
208 177 {
209 178 title: '系统数量',
... ... @@ -238,7 +207,7 @@
238 207 {
239 208 title: '状态',
240 209 align: 'center',
241   - dataIndex: 'enableStatus',
  210 + dataIndex: 'enableStatus_dictText',
242 211 },
243 212 {
244 213 title: '操作',
... ...
ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountHeaderList.vue
... ... @@ -46,7 +46,15 @@
46 46 :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
47 47 class="j-table-force-nowrap"
48 48 @change="handleTableChange">
49   -
  49 + <!-- 内嵌table区域 begin -->
  50 + <template slot="expandedRowRender" slot-scope="record">
  51 + <a-tabs tabPosition="top">
  52 + <a-tab-pane tab="盘点明细" key="cycleCountHetailChild" forceRender>
  53 + <cycle-count-detail-list :record="record"/>
  54 + </a-tab-pane>
  55 + </a-tabs>
  56 + </template>
  57 + <!-- 内嵌table区域 end -->
50 58 <span slot="companyCode" slot-scope="companyCode">
51 59 <a-tag :key="companyCode" color=blue>
52 60 {{ solutionCompany(companyCode) }}
... ... @@ -114,12 +122,14 @@
114 122 import {getCompanyList} from '@/api/api'
115 123 import {getCountTypeList} from '@/api/api'
116 124 import CycleCountHeaderModal from './modules/CycleCountHeaderModal'
  125 + import CycleCountDetailList from "./CycleCountDetailList";
117 126  
118 127 export default {
119 128 name: 'CycleCountHeaderList',
120 129 mixins:[JeecgListMixin, mixinDevice],
121 130 components: {
122   - CycleCountHeaderModal
  131 + CycleCountHeaderModal,
  132 + CycleCountDetailList,
123 133 },
124 134 data () {
125 135 return {
... ...
ant-design-vue-jeecg/src/views/system/stocktaking/subTables/CycleCountDetailChildSubTable.vue
... ... @@ -115,7 +115,7 @@
115 115 {
116 116 title: '明细状态',
117 117 align: 'center',
118   - dataIndex: 'childStatus',
  118 + dataIndex: 'childStatus_dictText',
119 119 },
120 120 {
121 121 title: '库存明细ID',
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/controller/CycleCountDetailController.java
... ... @@ -11,6 +11,8 @@ import java.util.stream.Collectors;
11 11  
12 12 import javax.annotation.Resource;
13 13 import javax.servlet.http.HttpServletRequest;
  14 +
  15 +import org.apache.shiro.authz.annotation.RequiresPermissions;
14 16 import org.jeecg.modules.wms.framework.controller.HuahengBaseController;
15 17 import javax.servlet.http.HttpServletResponse;
16 18  
... ... @@ -20,6 +22,7 @@ import org.jeecg.modules.wms.framework.Convert;
20 22 import org.jeecg.modules.wms.framework.controller.HuahengBaseController;
21 23 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail;
22 24 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService;
  25 +import org.jeecg.utils.HuahengJwtUtil;
23 26 import org.jeecg.utils.StringUtils;
24 27 import org.jeecgframework.poi.excel.ExcelImportUtil;
25 28 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
... ... @@ -172,6 +175,23 @@ public class CycleCountDetailController extends HuahengBaseController {
172 175  
173 176 }
174 177  
  178 +
  179 + /**
  180 + * 生成单条盘点任务
  181 + *
  182 + */
  183 + @AutoLog(value = "生成单条盘点任务")
  184 + @ApiOperation(value="生成单条盘点任务", notes="生成单条盘点任务")
  185 + @PostMapping(value = "/createCycleCoutTaskByDetailId")
  186 + public Result createCycleCoutTaskByDetailId(Integer cycleCoutdetailId, HttpServletRequest req){
  187 + if(cycleCoutdetailId ==null){
  188 + return Result.error("生成盘点任务时盘点明细ID不能为空!");
  189 + }
  190 + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
  191 + return cycleCountDetailService.createCycleCoutTaskByDetailId(cycleCoutdetailId,warehouseCode);
  192 + }
  193 +
  194 +
175 195 /**
176 196 * 添加盘点
177 197 *
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/entity/CycleCountDetail.java
... ... @@ -57,7 +57,7 @@ public class CycleCountDetail implements Serializable {
57 57 /**库存明细头*/
58 58 @Excel(name = "库存明细头", width = 15)
59 59 @ApiModelProperty(value = "库存明细头")
60   - private Integer inventoryDetailId;
  60 + private Integer inventoryHeaderId;
61 61 /**库位*/
62 62 @Excel(name = "库位", width = 15)
63 63 @ApiModelProperty(value = "库位")
... ... @@ -69,19 +69,20 @@ public class CycleCountDetail implements Serializable {
69 69 /**库存状态*/
70 70 @Excel(name = "库存状态", width = 15)
71 71 @ApiModelProperty(value = "库存状态")
  72 + @Dict(dicCode = "inventory_status")
72 73 private String inventorySts;
73 74 /**系统数量*/
74 75 @Excel(name = "系统数量", width = 15)
75 76 @ApiModelProperty(value = "系统数量")
76   - private String systemQty;
  77 + private Integer systemQty;
77 78 /**实盘数量*/
78 79 @Excel(name = "实盘数量", width = 15)
79 80 @ApiModelProperty(value = "实盘数量")
80   - private String countedQty;
  81 + private Integer countedQty;
81 82 /**差异数量*/
82 83 @Excel(name = "差异数量", width = 15)
83 84 @ApiModelProperty(value = "差异数量")
84   - private String gapQty;
  85 + private Integer gapQty;
85 86 /**失败原因*/
86 87 @Excel(name = "失败原因", width = 15)
87 88 @ApiModelProperty(value = "失败原因")
... ... @@ -97,6 +98,7 @@ public class CycleCountDetail implements Serializable {
97 98 /**盘点明细状态*/
98 99 @Excel(name = "盘点明细状态", width = 15)
99 100 @ApiModelProperty(value = "盘点明细状态")
  101 + @Dict(dicCode = "cyclecount_status")
100 102 private Integer enableStatus;
101 103 /**创建人*/
102 104 @ApiModelProperty(value = "创建人")
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/entity/CycleCountDetailChild.java
... ... @@ -40,7 +40,8 @@ public class CycleCountDetailChild implements Serializable {
40 40 /**盘点明细子单状态*/
41 41 @Excel(name = "盘点明细子单状态", width = 15)
42 42 @ApiModelProperty(value = "盘点明细子单状态")
43   - private String childStatus;
  43 + @Dict(dicCode = "cyclecount_status")
  44 + private Integer childStatus;
44 45 /**库位*/
45 46 @Excel(name = "库位", width = 15)
46 47 @ApiModelProperty(value = "库位")
... ... @@ -68,15 +69,15 @@ public class CycleCountDetailChild implements Serializable {
68 69 /**系统数量*/
69 70 @Excel(name = "系统数量", width = 15)
70 71 @ApiModelProperty(value = "系统数量")
71   - private String systemQty;
  72 + private Integer systemQty;
72 73 /**实盘数量*/
73 74 @Excel(name = "实盘数量", width = 15)
74 75 @ApiModelProperty(value = "实盘数量")
75   - private String countedQty;
  76 + private Integer countedQty;
76 77 /**差异数量*/
77 78 @Excel(name = "差异数量", width = 15)
78 79 @ApiModelProperty(value = "差异数量")
79   - private String gapQty;
  80 + private Integer gapQty;
80 81 /**库存明细id*/
81 82 @Excel(name = "库存明细id", width = 15)
82 83 @ApiModelProperty(value = "库存明细id")
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/ICycleCountDetailService.java
... ... @@ -39,4 +39,7 @@ public interface ICycleCountDetailService extends IService&lt;CycleCountDetail&gt; {
39 39 public void delBatchMain (Collection<? extends Serializable> idList);
40 40  
41 41 Result stockDetailAdd(int taskId);
  42 +
  43 + Result createCycleCoutTaskByDetailId(Integer cycleCoutdetailId,String warehouseCode);
  44 +
42 45 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailServiceImpl.java
1 1 package org.jeecg.modules.wms.stocktaking.cycleCountDetail.service.impl;
2 2  
  3 +import com.aliyun.oss.ServiceException;
3 4 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4 5 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
5 6 import org.jeecg.common.api.vo.Result;
  7 +import org.jeecg.modules.wms.config.location.entity.Location;
  8 +import org.jeecg.modules.wms.config.location.service.impl.LocationServiceImpl;
6 9 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail;
7 10 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService;
8 11 import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetail;
... ... @@ -10,11 +13,22 @@ import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetai
10 13 import org.jeecg.modules.wms.stocktaking.cycleCountDetail.mapper.CycleCountDetailChildMapper;
11 14 import org.jeecg.modules.wms.stocktaking.cycleCountDetail.mapper.CycleCountDetailMapper;
12 15 import org.jeecg.modules.wms.stocktaking.cycleCountDetail.service.ICycleCountDetailService;
  16 +import org.jeecg.modules.wms.stocktaking.cycleCountHeader.entity.CycleCountHeader;
  17 +import org.jeecg.modules.wms.stocktaking.cycleCountHeader.service.impl.CycleCountHeaderServiceImpl;
  18 +import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail;
  19 +import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader;
  20 +import org.jeecg.modules.wms.task.taskHeader.service.impl.TaskDetailServiceImpl;
  21 +import org.jeecg.modules.wms.task.taskHeader.service.impl.TaskHeaderServiceImpl;
  22 +import org.jeecg.utils.StringUtils;
  23 +import org.jeecg.utils.constant.QuantityConstant;
13 24 import org.springframework.stereotype.Service;
14 25 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
15 26 import org.springframework.beans.factory.annotation.Autowired;
16 27 import org.springframework.transaction.annotation.Transactional;
  28 +
  29 +import javax.annotation.Resource;
17 30 import java.io.Serializable;
  31 +import java.util.Date;
18 32 import java.util.List;
19 33 import java.util.Collection;
20 34  
... ... @@ -33,6 +47,17 @@ public class CycleCountDetailServiceImpl extends ServiceImpl&lt;CycleCountDetailMap
33 47 private CycleCountDetailChildMapper cycleCountDetailChildMapper;
34 48 @Autowired
35 49 private IInventoryDetailService inventoryDetailService;
  50 + @Resource
  51 + private CycleCountDetailChildServiceImpl cycleCountDetailChildServiceImpl;
  52 + @Resource
  53 + private LocationServiceImpl locationService;
  54 + @Resource
  55 + private TaskHeaderServiceImpl taskHeaderService;
  56 + @Resource
  57 + private TaskDetailServiceImpl taskDetailService;
  58 + @Resource
  59 + private CycleCountHeaderServiceImpl cycleCountHeaderService;
  60 +
36 61  
37 62 @Override
38 63 @Transactional
... ... @@ -93,17 +118,184 @@ public class CycleCountDetailServiceImpl extends ServiceImpl&lt;CycleCountDetailMap
93 118 inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getInventoryHeaderId,taskId);
94 119 List<InventoryDetail> inventoryDetails = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper);
95 120  
96   - CycleCountDetail cycleCountDetailChild = new CycleCountDetail();
97   - cycleCountDetailChild.setCompanyCode(inventoryDetails.get(0).getCompanyCode());
98   - cycleCountDetailChild.setContainerCode(inventoryDetails.get(0).getContainerCode());
99   -
  121 + CycleCountDetail cycleCountDetail = new CycleCountDetail();
  122 + cycleCountDetail.setCompanyCode(inventoryDetails.get(0).getCompanyCode());
  123 + cycleCountDetail.setInventoryHeaderId(inventoryDetails.get(0).getInventoryHeaderId());
  124 + cycleCountDetail.setLocationCode(inventoryDetails.get(0).getLocationCode());
  125 + cycleCountDetail.setContainerCode(inventoryDetails.get(0).getContainerCode());
  126 + cycleCountDetail.setInventorySts(inventoryDetails.get(0).getInventoryStatus());
  127 + cycleCountDetail.setSystemQty(inventoryDetails.size());
  128 + cycleCountDetail.setCountedQty(0);
  129 + cycleCountDetail.setGapQty(0);
  130 + cycleCountDetail.setEnableStatus(QuantityConstant.CYCLECOUNT_STATUS_BUILD);
  131 + this.save(cycleCountDetail);
100 132  
  133 + CycleCountDetailChild cycleCountDetailChild=new CycleCountDetailChild();
101 134 for(InventoryDetail inventoryDetail:inventoryDetails)
102 135 {
103   -
  136 +// cycleCountDetailChild.setCyclecountheadcode();
  137 + cycleCountDetailChild.setCycleCountDetailid(cycleCountDetail.getId());
  138 + cycleCountDetailChild.setChildStatus(QuantityConstant.CYCLECOUNT_STATUS_BUILD);
  139 + cycleCountDetailChild.setLocationCode(inventoryDetail.getLocationCode());
  140 + cycleCountDetailChild.setContainerCode(inventoryDetail.getContainerCode());
  141 + cycleCountDetailChild.setMaterialCode(inventoryDetail.getMaterialCode());
  142 + cycleCountDetailChild.setMaterialName(inventoryDetail.getMaterialName());
  143 + cycleCountDetailChild.setMaterialSpec(inventoryDetail.getMaterialSpec());
  144 + cycleCountDetailChild.setMaterialUnit(inventoryDetail.getMaterialUnit());
  145 + cycleCountDetailChild.setSystemQty(inventoryDetail.getQty().intValue());
  146 + cycleCountDetailChild.setCountedQty(0);
  147 + cycleCountDetailChild.setGapQty(0);
  148 + cycleCountDetailChild.setInventoryDetaiId(inventoryDetail.getId());
  149 + cycleCountDetailChildServiceImpl.save(cycleCountDetailChild);
104 150 }
105 151  
106   - return Result.ok("添加成功");
  152 + return Result.OK();
  153 + }
  154 +
  155 +
  156 +
  157 + /**
  158 + * 生成单条盘点任务
  159 + * @param cycleCoutDetailId
  160 + * @return
  161 + */
  162 + @Override
  163 + public Result createCycleCoutTaskByDetailId(Integer cycleCoutDetailId,String warehouseCode) {
  164 + /*任务主表中存在库位,在盘点明细中生成任务时,不同的容器生成不同的主任务*/
  165 + //校验有没有相同容器正在执行任务.
  166 +// CycleCountDetail cycleCountDetail = this.getById(cycleCoutDetailId);
  167 +// if(StringUtils.isNull(cycleCountDetail)){
  168 +// return Result.error("盘点明细ID错误,没有该条明细");
  169 +// }
  170 +// //查出明细的子单
  171 +// CycleCountDetailChild child = new CycleCountDetailChild();
  172 +// child.setCyclecountheadcode(cycleCountDetail.getCycleCountHeadCode());
  173 +// child.setCycleCountDetailid(cycleCountDetail.getId());
  174 +// LambdaQueryWrapper<CycleCountDetailChild> childLambdaQueryWrapper = Wrappers.lambdaQuery(child);
  175 +// List<CycleCountDetailChild> childList = cycleCountDetailChildServiceImpl.list(childLambdaQueryWrapper);
  176 +// if(childList.size() < 1){
  177 +// return Result.error("盘点明细没有子单");
  178 +// }
  179 +// Location location = locationService.getLocationByCode(
  180 +// cycleCountDetail.getLocationCode(), warehouseCode);
  181 +// /*if(!loc.getStatus().equals(QuantityConstant.STATUS_EMPTY)){
  182 +// return AjaxResult.error(cycleCountDetail.getLocationCode() + "库位不在空闲状态,请先完成其他任务,操作失败!");
  183 +// }*/
  184 +// if(StringUtils.isEmpty(location.getContainerCode())){
  185 +// return Result.error(cycleCountDetail.getLocationCode() + "库位中没有容器,操作失败!");
  186 +// }
  187 +// //生成任务同时锁定库位
  188 +// locationService.updateStatus(location.getCode(), QuantityConstant.STATUS_LOCATION_LOCK);
  189 +// //每个明细单生成一张主任务,子单就是任务明细。
  190 +// TaskHeader task = new TaskHeader();
  191 +// task.setWarehouseCode(warehouseCode);
  192 +// task.setCompanyCode(cycleCountDetail.getCompanyCode());
  193 +// task.setAllocationHeadId(cycleCountDetail.getId());//明细ID写入主任务
  194 +// if(location != null) {
  195 +// task.setZoneCode(location.getZoneCode());
  196 +// }
  197 +// task.setReferenceCode(cycleCountDetail.getCycleCountHeadCode()); //写入盘点主单号
  198 +// task.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_CYCLECOUNT);
  199 +// task.setTaskType(QuantityConstant.TASK_TYPE_CYCLECOUNT);
  200 +// task.setContainerCode(cycleCountDetail.getContainerCode());
  201 +// task.setStatus(QuantityConstant.TASK_STATUS_BUILD);
  202 +// task.setFromLocation(cycleCountDetail.getLocationCode());
  203 +// task.setPortGroup("P10");
  204 +// task.setBack(1);
  205 +// task.setSequenceNumber(1);
  206 +// task.setSequence(1);
  207 +// task.setShipmentOrder(System.currentTimeMillis());
  208 +//
  209 +// task.setToLocation(cycleCountDetail.getLocationCode());
  210 +// task.setCreated(new Date());
  211 +// task.setCreatedBy(ShiroUtils.getLoginName());
  212 +// task.setLastUpdatedBy(ShiroUtils.getLoginName());
  213 +// task.setLastUpdated(new Date());
  214 +// if(taskHeaderService.save(task)){
  215 +// //锁定库位状态
  216 +// locationService.updateStatus(location.getContainerCode(), QuantityConstant.STATUS_LOCATION_LOCK);
  217 +// cycleCountDetail.setTaskHeaderId(task.getId()); //盘点明细修改状态task数据源
  218 +// }else{
  219 +// throw new ServiceException("盘点任务主表生成失败!");
  220 +// }
  221 +//
  222 +// //写入任务细表
  223 +// TaskDetail taskDetail = new TaskDetail();
  224 +// for(CycleCountDetailChild item: childList){
  225 +//
  226 +// taskDetail.setTaskId(task.getId());//主单ID
  227 +// taskDetail.setTaskType(task.getTaskType());
  228 +// taskDetail.setFromLocation(task.getFromLocation());
  229 +// taskDetail.setToLocation(task.getToLocation());
  230 +// taskDetail.setContainerCode(task.getContainerCode());
  231 +// taskDetail.setInternalTaskType(task.getTaskType());
  232 +// taskDetail.setWarehouseCode(task.getWarehouseCode());
  233 +// taskDetail.setBillCode(item.getCycleCountHeadCode());
  234 +// taskDetail.setBoxCode(item.getBoxCode());
  235 +// taskDetail.setBillDetailId(item.getCycleCountDetailId());
  236 +// taskDetail.setMaterialCode(item.getMaterialCode());
  237 +// taskDetail.setMaterialName(item.getMaterialName());
  238 +// taskDetail.setMaterialSpec(item.getMaterialSpec());
  239 +// taskDetail.setMaterialUnit(item.getMaterialUnit());
  240 +// taskDetail.setQty(item.getSystemQty());
  241 +// //taskDetail.setBatch(cycleCountDetail.getBatch());
  242 +// //taskDetail.setFromInventoryId(cycleCountDetail.getInventoryDetailId());
  243 +// //taskDetail.setLot(cycleCountDetail.getLot());
  244 +// //taskDetail.setProjectNo(cycleCountDetail.getProjectNo());
  245 +// taskDetail.setCompanyCode(cycleCountDetail.getCompanyCode());
  246 +// taskDetail.setCreated(new Date());
  247 +// taskDetail.setCreatedBy(ShiroUtils.getLoginName());
  248 +// taskDetail.setLastUpdated(new Date());
  249 +// taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
  250 +// if(taskDetailService.save(taskDetail) == false){
  251 +// throw new ServiceException("盘点任务明细生成失败!");
  252 +// }
  253 +// // 修改子单状态
  254 +// item.setChildStatus(QuantityConstant.CYCLECOUNT_STATUS_BUILDTASK);
  255 +// cycleCountDetailChildServiceImpl.updateById(item);
  256 +// }
  257 +//
  258 +// //修改细单状态
  259 +// cycleCountDetail.setTaskHeaderId(task.getId()); //盘点明细修改状态task数据源
  260 +// cycleCountDetail.setLastUpdated(new Date());
  261 +// cycleCountDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
  262 +// cycleCountDetail.setEnableStatus(QuantityConstant.CYCLECOUNT_STATUS_BUILDTASK);
  263 +// cycleCountDetail.setTaskHeaderId(task.getId());
  264 +// //cycleCountDetail.setTaskDetailId(taskDetail.getId());
  265 +// this.updateById(cycleCountDetail);
  266 +// //修改主单状态
  267 +// CycleCountHeader cycleCountHeader = new CycleCountHeader();
  268 +// cycleCountHeader.setCode(cycleCountDetail.getCycleCountHeadCode());
  269 +// cycleCountHeader.setWarehouseCode(cycleCountDetail.getWarehouseCode());
  270 +// //cycleCountHeader.setCompanyCode(cycleCountDetail.getCompanyCode());
  271 +// LambdaQueryWrapper<CycleCountHeader> lamb = Wrappers.lambdaQuery(cycleCountHeader);
  272 +// cycleCountHeader = cycleCountHeaderService.getOne(lamb);
  273 +// cycleCountHeader.setStatusCyc(QuantityConstant.CYCLECOUNT_STATUS_BUILDTASK);
  274 +// cycleCountHeaderService.updateById(cycleCountHeader);
  275 +//
  276 +//
  277 +//
  278 +// LambdaQueryWrapper<InventoryDetail> lambdaQueryWrapper = Wrappers.lambdaQuery();
  279 +// lambdaQueryWrapper.eq(InventoryDetail::getContainerCode,task.getContainerCode());
  280 +// List<InventoryDetail> inventoryDetails = inventoryDetailService.list(lambdaQueryWrapper);
  281 +//
  282 +// for (InventoryDetail inventoryDetail:inventoryDetails)
  283 +// {
  284 +//
  285 +// if (StringUtils.isNotEmpty(inventoryDetail.getChipCode2()))
  286 +// {
  287 +// if (inventoryDetail.getChipCode2().equals("盘盈片码"))
  288 +// {
  289 +// inventoryDetail.setChipCode2("");
  290 +// inventoryDetailService.updateById(inventoryDetail);
  291 +// }
  292 +// }
  293 +// }
  294 +//
  295 +
  296 +
  297 +
  298 + return Result.ok("盘点任务生成成功");
107 299 }
108 300  
109 301 }
... ...