Commit 3e216c00129bc2629d943d44acb9811c60cd0154

Authored by 肖超群
1 parent 25ca88d1

开发和完善分配库位的方法

Showing 38 changed files with 1261 additions and 151 deletions
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/LocationHighList.vue
@@ -167,9 +167,14 @@ @@ -167,9 +167,14 @@
167 scopedSlots: { customRender: 'locationTypeCode' } 167 scopedSlots: { customRender: 'locationTypeCode' }
168 }, 168 },
169 { 169 {
  170 + title:'高低位',
  171 + align:"center",
  172 + dataIndex: 'high_dictText'
  173 + },
  174 + {
170 title:'高度值', 175 title:'高度值',
171 align:"center", 176 align:"center",
172 - dataIndex: 'high' 177 + dataIndex: 'highLevel'
173 }, 178 },
174 { 179 {
175 title:'创建人', 180 title:'创建人',
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/modules/LocationHighForm.vue
@@ -19,8 +19,13 @@ @@ -19,8 +19,13 @@
19 </a-form-model-item> 19 </a-form-model-item>
20 </a-col> 20 </a-col>
21 <a-col :span="24"> 21 <a-col :span="24">
  22 + <a-form-model-item label="高低位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="high">
  23 + <j-dict-select-tag type="list" v-model="model.high" dictCode="high_status" placeholder="请选择高低位" />
  24 + </a-form-model-item>
  25 + </a-col>
  26 + <a-col :span="24">
22 <a-form-model-item label="高度值" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="high"> 27 <a-form-model-item label="高度值" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="high">
23 - <a-input-number v-model="model.high" placeholder="请输入高度值" style="width: 100%" /> 28 + <a-input-number v-model="model.highLevel" placeholder="请输入高度值" style="width: 100%" />
24 </a-form-model-item> 29 </a-form-model-item>
25 </a-col> 30 </a-col>
26 </a-row> 31 </a-row>
@@ -123,7 +128,7 @@ @@ -123,7 +128,7 @@
123 that.confirmLoading = false; 128 that.confirmLoading = false;
124 }) 129 })
125 } 130 }
126 - 131 +
127 }) 132 })
128 }, 133 },
129 } 134 }
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/receipt/ReceiptContaienrDetailList.vue renamed to jeecg-boot-master/ant-design-vue-jeecg/src/views/system/receipt/ReceiptContainerDetailList.vue
@@ -119,19 +119,19 @@ @@ -119,19 +119,19 @@
119 </a-table> 119 </a-table>
120 </div> 120 </div>
121 121
122 - <receiptContaienrDetail-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId"></receiptContaienrDetail-modal> 122 + <receiptContainerDetail-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId"></receiptContainerDetail-modal>
123 </a-card> 123 </a-card>
124 </template> 124 </template>
125 125
126 <script> 126 <script>
127 127
128 import { JeecgListMixin } from '@/mixins/JeecgListMixin' 128 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
129 - import ReceiptContaienrDetailModal from './modules/ReceiptContaienrDetailModal' 129 + import ReceiptContainerDetailModal from './modules/ReceiptContainerDetailModal'
130 130
131 export default { 131 export default {
132 - name: "ReceiptContaienrDetailList", 132 + name: "ReceiptContainerDetailList",
133 mixins:[JeecgListMixin], 133 mixins:[JeecgListMixin],
134 - components: { ReceiptContaienrDetailModal }, 134 + components: { ReceiptContainerDetailModal },
135 props:{ 135 props:{
136 mainId:{ 136 mainId:{
137 type:String, 137 type:String,
@@ -238,11 +238,11 @@ @@ -238,11 +238,11 @@
238 } 238 }
239 ], 239 ],
240 url: { 240 url: {
241 - list: "/receipt/receiptContainerHeader/listReceiptContaienrDetailByMainId",  
242 - delete: "/receipt/receiptContainerHeader/deleteReceiptContaienrDetail",  
243 - deleteBatch: "/receipt/receiptContainerHeader/deleteBatchReceiptContaienrDetail",  
244 - exportXlsUrl: "/receipt/receiptContainerHeader/exportReceiptContaienrDetail",  
245 - importUrl: "/receipt/receiptContainerHeader/importReceiptContaienrDetail", 241 + list: "/receipt/receiptContainerHeader/listReceiptContainerDetailByMainId",
  242 + delete: "/receipt/receiptContainerHeader/deleteReceiptContainerDetail",
  243 + deleteBatch: "/receipt/receiptContainerHeader/deleteBatchReceiptContainerDetail",
  244 + exportXlsUrl: "/receipt/receiptContainerHeader/exportReceiptContainerDetail",
  245 + importUrl: "/receipt/receiptContainerHeader/importReceiptContainerDetail",
246 }, 246 },
247 dictOptions:{ 247 dictOptions:{
248 taskType:[], 248 taskType:[],
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/receipt/ReceiptContainerHeaderList.vue
@@ -114,7 +114,7 @@ @@ -114,7 +114,7 @@
114 <span slot="action" slot-scope="text, record"> 114 <span slot="action" slot-scope="text, record">
115 <a @click="handleEdit(record)">编辑</a> 115 <a @click="handleEdit(record)">编辑</a>
116 <a-divider type="vertical" /> 116 <a-divider type="vertical" />
117 - <a @click="createTask(record)">生成任务</a> 117 + <a v-if="record.status == 0" @click="createTask(record)">生成任务</a>
118 <a-divider type="vertical" /> 118 <a-divider type="vertical" />
119 <a-dropdown> 119 <a-dropdown>
120 <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> 120 <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
@@ -133,7 +133,7 @@ @@ -133,7 +133,7 @@
133 133
134 <a-tabs defaultActiveKey="1"> 134 <a-tabs defaultActiveKey="1">
135 <a-tab-pane tab="入库组盘详情" key="1" > 135 <a-tab-pane tab="入库组盘详情" key="1" >
136 - <ReceiptContaienrDetailList :mainId="selectedMainId" /> 136 + <ReceiptContainerDetailList :mainId="selectedMainId" />
137 </a-tab-pane> 137 </a-tab-pane>
138 </a-tabs> 138 </a-tabs>
139 139
@@ -146,7 +146,7 @@ @@ -146,7 +146,7 @@
146 import { JeecgListMixin } from '@/mixins/JeecgListMixin' 146 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
147 import ReceiptContainerHeaderModal from './modules/ReceiptContainerHeaderModal' 147 import ReceiptContainerHeaderModal from './modules/ReceiptContainerHeaderModal'
148 import { getAction } from '@/api/manage' 148 import { getAction } from '@/api/manage'
149 - import ReceiptContaienrDetailList from './ReceiptContaienrDetailList' 149 + import ReceiptContainerDetailList from './ReceiptContainerDetailList'
150 import {initDictOptions,filterMultiDictText} from '@/components/dict/JDictSelectUtil' 150 import {initDictOptions,filterMultiDictText} from '@/components/dict/JDictSelectUtil'
151 import '@/assets/less/TableExpand.less' 151 import '@/assets/less/TableExpand.less'
152 import {createTask} from '@/api/api' 152 import {createTask} from '@/api/api'
@@ -155,7 +155,7 @@ @@ -155,7 +155,7 @@
155 name: "ReceiptContainerHeaderList", 155 name: "ReceiptContainerHeaderList",
156 mixins:[JeecgListMixin], 156 mixins:[JeecgListMixin],
157 components: { 157 components: {
158 - ReceiptContaienrDetailList, 158 + ReceiptContainerDetailList,
159 ReceiptContainerHeaderModal 159 ReceiptContainerHeaderModal
160 }, 160 },
161 data () { 161 data () {
@@ -280,14 +280,20 @@ @@ -280,14 +280,20 @@
280 this.selectedRowKeys = selectedRowKeys; 280 this.selectedRowKeys = selectedRowKeys;
281 this.selectionRows = selectionRows; 281 this.selectionRows = selectionRows;
282 }, 282 },
283 - createTask(record){ 283 + createTask(record) {
284 this.loading = true; 284 this.loading = true;
285 const that = this; 285 const that = this;
286 this.model = Object.assign({}, record); 286 this.model = Object.assign({}, record);
287 that.querySource.id = record.id; 287 that.querySource.id = record.id;
288 createTask(that.querySource).then((res) => { 288 createTask(that.querySource).then((res) => {
289 this.loading = false; 289 this.loading = false;
290 - this.search(); 290 + if (res.success) {
  291 + this.$message.success(res.message);
  292 + }
  293 + else {
  294 + this.$message.error(res.message);
  295 + }
  296 + this.searchQuery();
291 }); 297 });
292 }, 298 },
293 loadData(arg) { 299 loadData(arg) {
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiptContaienrDetailModal.vue renamed to jeecg-boot-master/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiptContainerDetailModal.vue
@@ -58,7 +58,7 @@ @@ -58,7 +58,7 @@
58 import { validateDuplicateValue } from '@/utils/util' 58 import { validateDuplicateValue } from '@/utils/util'
59 59
60 export default { 60 export default {
61 - name: "ReceiptContaienrDetailModal", 61 + name: "ReceiptContainerDetailModal",
62 components: { 62 components: {
63 }, 63 },
64 props:{ 64 props:{
@@ -88,8 +88,8 @@ @@ -88,8 +88,8 @@
88 validatorRules: { 88 validatorRules: {
89 }, 89 },
90 url: { 90 url: {
91 - add: "/receipt/receiptContainerHeader/addReceiptContaienrDetail",  
92 - edit: "/receipt/receiptContainerHeader/editReceiptContaienrDetail", 91 + add: "/receipt/receiptContainerHeader/addReceiptContainerDetail",
  92 + edit: "/receipt/receiptContainerHeader/editReceiptContainerDetail",
93 } 93 }
94 94
95 } 95 }
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/task/TaskHeaderList.vue
@@ -77,7 +77,7 @@ @@ -77,7 +77,7 @@
77 </a-form> 77 </a-form>
78 </div> 78 </div>
79 <!-- 查询区域-END --> 79 <!-- 查询区域-END -->
80 - 80 +
81 <!-- 操作按钮区域 --> 81 <!-- 操作按钮区域 -->
82 <div class="table-operator"> 82 <div class="table-operator">
83 <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> 83 <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
@@ -182,6 +182,11 @@ @@ -182,6 +182,11 @@
182 // 表头 182 // 表头
183 columns: [ 183 columns: [
184 { 184 {
  185 + title:'任务ID',
  186 + align:"center",
  187 + dataIndex: 'id',
  188 + },
  189 + {
185 title:'任务类型', 190 title:'任务类型',
186 align:"center", 191 align:"center",
187 dataIndex: 'taskType_dictText', 192 dataIndex: 'taskType_dictText',
@@ -201,11 +206,11 @@ @@ -201,11 +206,11 @@
201 align:"center", 206 align:"center",
202 dataIndex: 'toLocationCode' 207 dataIndex: 'toLocationCode'
203 }, 208 },
204 - {  
205 - title:'是否空出',  
206 - align:"center",  
207 - dataIndex: 'isEmptyOut_dictText',  
208 - }, 209 + // {
  210 + // title:'是否空出',
  211 + // align:"center",
  212 + // dataIndex: 'isEmptyOut_dictText',
  213 + // },
209 { 214 {
210 title:'是否重入', 215 title:'是否重入',
211 align:"center", 216 align:"center",
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/api/wcs/controller/WcsController.java 0 → 100644
  1 +package org.jeecg.modules.wms.api.wcs.controller;
  2 +
  3 +
  4 +import io.swagger.annotations.ApiOperation;
  5 +import org.jeecg.common.api.vo.Result;
  6 +import org.jeecg.common.aspect.annotation.AutoLog;
  7 +import org.jeecg.modules.wms.api.wcs.entity.WarecellDomain;
  8 +import org.jeecg.modules.wms.api.wcs.service.WcsService;
  9 +import org.jeecg.modules.wms.framework.controller.BaseController;
  10 +import org.jeecg.utils.StringUtils;
  11 +import org.springframework.web.bind.annotation.*;
  12 +
  13 +import javax.annotation.Resource;
  14 +
  15 +@RestController
  16 +@RequestMapping("/API/WMS/v2")
  17 +public class WcsController extends BaseController {
  18 +
  19 + @Resource
  20 + private WcsService wcsService;
  21 +
  22 + /*
  23 + WCS给的长,宽,高,重在有不同规格库位才有用,destination是区域, locationType库位类型
  24 + */
  25 + @AutoLog(value = "WCS仓位分配")
  26 + @PostMapping("/warecellAllocation")
  27 + @ApiOperation(value="wcs仓位分配", notes="wcs仓位分配", httpMethod = "POST")
  28 + @ResponseBody
  29 +// @ApiLogger(apiName = "仓位分配", from="WCS")
  30 + public Result warecellAllocation(@RequestBody WarecellDomain warecellDomain) {
  31 + if (StringUtils.isEmpty(warecellDomain.getTaskNo())) {
  32 + return Result.error("任务号为空");
  33 + }
  34 + if (StringUtils.isEmpty(warecellDomain.getZoneCode())) {
  35 + return Result.error("目的区域为空");
  36 + }
  37 + if (StringUtils.isEmpty(warecellDomain.getHeight())) {
  38 + return Result.error("高度为空");
  39 + }
  40 + Result result = handleMultiProcess(new MultiProcessListener() {
  41 + @Override
  42 + public Result doProcess() {
  43 + Result result = wcsService.warecellAllocation(warecellDomain);
  44 + return result;
  45 + }
  46 + });
  47 + return result;
  48 + }
  49 +}
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/api/wcs/entity/WarecellDomain.java 0 → 100644
  1 +package org.jeecg.modules.wms.api.wcs.entity;
  2 +
  3 +import lombok.Data;
  4 +
  5 +import java.util.List;
  6 +
  7 +@Data
  8 +public class WarecellDomain {
  9 +
  10 + //任务号
  11 + private String taskNo;
  12 +
  13 + //相关任务号
  14 + private String relatedTaskNo;
  15 +
  16 + //仓库编号
  17 + private String warehouseCode;
  18 +
  19 + //区域
  20 + private String zoneCode;
  21 +
  22 + //长
  23 + private String length;
  24 +
  25 + //宽
  26 + private String width;
  27 +
  28 + //高
  29 + private String height;
  30 +
  31 + //重
  32 + private String weight;
  33 + //巷道
  34 + private List<Integer> roadWays;
  35 +}
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/api/wcs/entity/WcsTask.java 0 → 100644
  1 +package org.jeecg.modules.wms.api.wcs.entity;
  2 +
  3 +import lombok.Data;
  4 +
  5 +import java.io.Serializable;
  6 +import java.util.List;
  7 +
  8 +/**
  9 + * wcs任务接口实体层
  10 + * @author ricard
  11 + * @date 2019/10/11
  12 + */
  13 +
  14 +@Data
  15 +public class WcsTask {
  16 +
  17 + //任务号
  18 + private String taskNo;
  19 +
  20 + //前置任务
  21 + private String preTaskNo;
  22 +
  23 + //任务类型
  24 + private Integer taskType;
  25 +
  26 + //任务状态
  27 + private Integer taskStatus;
  28 +
  29 + //平台
  30 + private String platform;
  31 +
  32 + private String warehouseCode;
  33 +
  34 + //容器编码
  35 + private String containerCode;
  36 +
  37 + //来源口”,一般用于指定入库口,string (50),默认0,必填
  38 + private String fromPort;
  39 +
  40 + //目的口”,出库性质的任务必须填写,string (50),默认0,必填
  41 + private String toPort;
  42 +
  43 + //源位置库位编码
  44 + private String fromLocationCode;
  45 +
  46 + //目的位置库位编码
  47 + private String toLocationCode;
  48 +
  49 + //重入后再次分配的位置编码
  50 + private String locationCode;
  51 +
  52 + //优先级,int,默认100 ,数字越小优先级越高",必填
  53 + private Integer priority;
  54 +
  55 + //巷道
  56 + private String roadWay;
  57 +
  58 + //区域
  59 + private String zoneCode;
  60 +
  61 + //备注
  62 + private String remark;
  63 +
  64 +}
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/api/wcs/service/LocationAllocationService.java 0 → 100644
  1 +package org.jeecg.modules.wms.api.wcs.service;
  2 +
  3 +
  4 +import java.util.List;
  5 +
  6 +public interface LocationAllocationService {
  7 +
  8 +
  9 + String allocation(int locationRule, List<String> locationTypeCodeList, int high, String zoneCode,
  10 + List<Integer> raodWays, String warehouseCode, String containerCode,
  11 + String materialAreaCode);
  12 +
  13 +}
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/api/wcs/service/LocationAllocationServiceImpl.java 0 → 100644
  1 +package org.jeecg.modules.wms.api.wcs.service;
  2 +
  3 +import com.aliyun.oss.ServiceException;
  4 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  5 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  6 +import org.jeecg.modules.wms.config.container.entity.Container;
  7 +import org.jeecg.modules.wms.config.container.service.IContainerService;
  8 +import org.jeecg.modules.wms.config.containerType.entity.ContainerType;
  9 +import org.jeecg.modules.wms.config.containerType.service.IContainerTypeService;
  10 +import org.jeecg.modules.wms.config.location.entity.Location;
  11 +import org.jeecg.modules.wms.config.location.service.ILocationService;
  12 +import org.jeecg.modules.wms.config.locationType.entity.LocationType;
  13 +import org.jeecg.modules.wms.config.locationType.service.ILocationTypeService;
  14 +import org.jeecg.modules.wms.config.parameterConfiguration.entity.ParameterConfiguration;
  15 +import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService;
  16 +import org.jeecg.modules.wms.config.zone.entity.Zone;
  17 +import org.jeecg.modules.wms.config.zone.service.IZoneService;
  18 +import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService;
  19 +import org.jeecg.utils.StringUtils;
  20 +import org.jeecg.utils.constant.QuantityConstant;
  21 +import org.springframework.stereotype.Service;
  22 +import org.springframework.transaction.annotation.Transactional;
  23 +import org.springframework.util.StopWatch;
  24 +
  25 +import javax.annotation.Resource;
  26 +import java.util.ArrayList;
  27 +import java.util.Collections;
  28 +import java.util.List;
  29 +
  30 +import static java.util.stream.Collectors.toList;
  31 +
  32 +/**
  33 + * @author 游杰
  34 + */
  35 +@Service
  36 +public class LocationAllocationServiceImpl implements LocationAllocationService {
  37 +
  38 + @Resource
  39 + private ILocationService locationService;
  40 + @Resource
  41 + private ILocationTypeService locationTypeService;
  42 + @Resource
  43 + private IContainerService containerService;
  44 + @Resource
  45 + private IContainerTypeService containerTypeService;
  46 + @Resource
  47 + private ITaskHeaderService taskHeaderService;
  48 + @Resource
  49 + private IZoneService zoneService;
  50 + @Resource
  51 + private IParameterConfigurationService parameterConfigurationService;
  52 +
  53 + @Override
  54 + @Transactional(rollbackFor = Exception.class)
  55 + public String allocation(int locationRule, List<String> locationTypeCodeList,
  56 + int high, String zoneCode, List<Integer> raodWays, String warehouseCode,
  57 + String containerCode, String materialAreaCode) {
  58 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  59 + if(container == null) {
  60 + throw new ServiceException("分配库位时,容器为空");
  61 + }
  62 + ContainerType containerType = containerTypeService.
  63 + getContainerTypeByCode(container.getContainerTypeCode(), warehouseCode);
  64 + if(containerType == null) {
  65 + throw new ServiceException("分配库位时,容器类型为空");
  66 + }
  67 + List<LocationType> locationTypeList = new ArrayList<>();
  68 + if(containerType != null) {
  69 + String locationType = containerType.getLocationType();
  70 + if(StringUtils.isEmpty(locationType)) {
  71 + throw new ServiceException("分配库位时,库位类型为空");
  72 + }
  73 + String[] list = locationType.split(",");
  74 + for (String locationTypeCode : list) {
  75 + LocationType locationType1 = locationTypeService.
  76 + getLocationTypeByCode(locationTypeCode, warehouseCode);
  77 + locationTypeList.add(locationType1);
  78 + }
  79 + } else {
  80 + Zone zone = zoneService.getZoneByCode(zoneCode, warehouseCode);
  81 + if(zone != null) {
  82 + LambdaQueryWrapper<LocationType> locationTypeLambdaQueryWrapper = Wrappers.lambdaQuery();
  83 + locationTypeLambdaQueryWrapper.eq(LocationType::getWarehouseCode, warehouseCode)
  84 + .eq(LocationType::getZoneCode, zoneCode);
  85 + locationTypeList = locationTypeService.list(locationTypeLambdaQueryWrapper);
  86 + }
  87 + }
  88 +
  89 + List<String> locationTypeCodes = locationTypeList.stream().
  90 + map(t -> t.getCode()).collect(toList());
  91 + List<String> mergelocationTypeCodeList = locationTypeCodeList.stream().filter(item -> locationTypeCodes.contains(item)).collect(toList());
  92 + switch (locationRule) {
  93 + case QuantityConstant.DOUBLE_FORK:
  94 + return doubleRk(zoneCode, raodWays, high, warehouseCode, mergelocationTypeCodeList, materialAreaCode);
  95 + case QuantityConstant.SINGLE_FORK:
  96 + return singleRk(zoneCode, raodWays, high, warehouseCode, mergelocationTypeCodeList, materialAreaCode);
  97 + }
  98 + return null;
  99 + }
  100 +
  101 + /**
  102 + * 双伸位库位入库分配库位
  103 + */
  104 + private String doubleRk(String zoneCode, List<Integer> roadWays, int high, String warehouseCode,
  105 + List<String> locationTypeCodeList, String materialAreaCode) {
  106 + if(roadWays == null||roadWays.size() < 1) {
  107 + List<Location> locationList = locationService.getLocationListByZoneCode(zoneCode, warehouseCode);
  108 + roadWays = locationList.stream().map(Location::getRoadWay).distinct().collect(toList());
  109 + }
  110 + String value = parameterConfigurationService.getValueByCode(QuantityConstant.DOUBLE_FORK_RESERVE_LOCATION);
  111 + int reserveNumber = 10;
  112 + if(StringUtils.isNotEmpty(value)) {
  113 + reserveNumber = Integer.parseInt(value);
  114 + }
  115 + value = parameterConfigurationService.getValueByCode(QuantityConstant.DOUBLE_FORK_SEARCH_LOCATION);
  116 + int searchNumber = 20;
  117 + if(StringUtils.isNotEmpty(value)) {
  118 + searchNumber = Integer.parseInt(value);
  119 + }
  120 + String lastString = "ORDER BY layer asc, id asc limit " + searchNumber;
  121 + StopWatch stopWatch = new StopWatch();
  122 + stopWatch.start("aaa");
  123 + List<Integer> removeRoadWays = new ArrayList<>();
  124 + //寻找可用巷道,空闲的空库位低于设定值,那么这个巷道就不能用来分配库位
  125 + for(Integer roadWay : roadWays) {
  126 + LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery();
  127 + locationLambdaQueryWrapper.eq(Location::getZoneCode, zoneCode)
  128 + .eq(Location::getWarehouseCode, warehouseCode)
  129 + .eq(Location::getRoadWay, roadWay)
  130 + .eq(Location::getStatus, QuantityConstant.STATUS_LOCATION_EMPTY)
  131 + .eq(Location::getHigh, high)
  132 + .eq(StringUtils.isNotEmpty(materialAreaCode), Location::getMaterialAreaCode, materialAreaCode)
  133 + .in(Location::getLocationTypeCode, locationTypeCodeList)
  134 + .eq(Location::getContainerCode, QuantityConstant.EMPTY_STRING)
  135 + .last(lastString);
  136 + List<Location> totalLocationList = locationService.list(locationLambdaQueryWrapper);
  137 + if (totalLocationList.size() <= reserveNumber) {
  138 + removeRoadWays.add(roadWay);
  139 + }
  140 + }
  141 + stopWatch.stop();
  142 + System.out.println("waste aa:" + stopWatch.getLastTaskTimeMillis());
  143 + stopWatch.start("bbb");
  144 + roadWays.removeAll(removeRoadWays);
  145 + Collections.shuffle(roadWays);
  146 + if(roadWays == null || roadWays.size() == 0) {
  147 + throw new ServiceException("分配库位时, 巷道为空");
  148 + }
  149 + Integer roadWay = roadWays.get(0);
  150 + //优先找外侧库位
  151 + LambdaQueryWrapper<Location> locationLambda = Wrappers.lambdaQuery();
  152 + locationLambda.eq(Location::getZoneCode, zoneCode)
  153 + .eq(Location::getWarehouseCode, warehouseCode)
  154 + .eq(Location::getRoadWay, roadWay)
  155 + .eq(Location::getStatus, QuantityConstant.STATUS_LOCATION_EMPTY)
  156 + .eq(Location::getHigh, high)
  157 + .eq(StringUtils.isNotEmpty(materialAreaCode), Location::getMaterialAreaCode, materialAreaCode)
  158 + .eq(Location::getRowFlag, QuantityConstant.ROW_OUT)
  159 + .in(Location::getLocationTypeCode, locationTypeCodeList)
  160 + .eq(Location::getContainerCode, QuantityConstant.EMPTY_STRING)
  161 + .last(lastString);
  162 + List<Location> locationList = locationService.list(locationLambda);
  163 + List<Location> removeLocaationList = new ArrayList<>();
  164 + if(locationList.size() > 0) {
  165 + for (Location location1 : locationList) {
  166 + //旁边有任务的库位,不能用来分配库位
  167 + if (taskHeaderService.haveUncompleteTaskInNear(location1)) {
  168 + removeLocaationList.add(location1);
  169 + }
  170 + }
  171 + }
  172 + locationList.removeAll(removeLocaationList);
  173 + stopWatch.stop();
  174 + System.out.println("waste bb:" + stopWatch.getLastTaskTimeMillis());
  175 + if (locationList.size() == 0) {
  176 + locationLambda = Wrappers.lambdaQuery();
  177 + locationLambda.eq(Location::getZoneCode, zoneCode)
  178 + .eq(Location::getWarehouseCode, warehouseCode)
  179 + .eq(Location::getRoadWay, roadWay)
  180 + .eq(Location::getStatus, QuantityConstant.STATUS_LOCATION_EMPTY)
  181 + .eq(Location::getHigh, high)
  182 + .eq(StringUtils.isNotEmpty(materialAreaCode), Location::getMaterialAreaCode, materialAreaCode)
  183 + .eq(Location::getRowFlag, QuantityConstant.ROW_IN)
  184 + .in(Location::getLocationTypeCode, locationTypeCodeList)
  185 + .eq(Location::getContainerCode, QuantityConstant.EMPTY_STRING)
  186 + .last(lastString);
  187 + locationList = locationService.list(locationLambda);
  188 + removeLocaationList = new ArrayList<>();
  189 + if(locationList != null && locationList.size() > 0) {
  190 + for (Location location1 : locationList) {
  191 + if (taskHeaderService.haveUncompleteTaskInNear(location1)) {
  192 + removeLocaationList.add(location1);
  193 + }
  194 + }
  195 + }
  196 + locationList.removeAll(removeLocaationList);
  197 + }
  198 + if (locationList == null || locationList.size() == 0) {
  199 + return null;
  200 + }
  201 + Location location = locationList.stream().findFirst().orElse(null);
  202 + String locationCode = location.getCode();
  203 + return locationCode;
  204 + }
  205 +
  206 + /**
  207 + * 单伸位库位入库分配库位
  208 + */
  209 + private String singleRk(String zoneCode, List<Integer> roadWays, int high, String warehouseCode,
  210 + List<String> locationTypeCodeList, String materialAreaCode) {
  211 + if(roadWays == null||roadWays.size() < 1) {
  212 + List<Location> locationList = locationService.getLocationListByZoneCode(zoneCode, warehouseCode);
  213 + roadWays = locationList.stream().map(Location::getRoadWay).distinct().collect(toList());
  214 + }
  215 + Collections.shuffle(roadWays);
  216 + Integer roadWay = roadWays.get(0);
  217 + LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery();
  218 + locationLambdaQueryWrapper.eq(Location::getZoneCode, zoneCode)
  219 + .eq(Location::getWarehouseCode, warehouseCode)
  220 + .eq(Location::getRoadWay, roadWay)
  221 + .eq(Location::getStatus, QuantityConstant.STATUS_LOCATION_EMPTY)
  222 + .eq(Location::getHigh, high)
  223 + .eq(StringUtils.isNotEmpty(materialAreaCode), Location::getMaterialAreaCode, materialAreaCode)
  224 + .in(Location::getLocationTypeCode, locationTypeCodeList)
  225 + .eq(Location::getContainerCode, QuantityConstant.EMPTY_STRING)
  226 + .last("ORDER BY layer asc, id asc limit 1");
  227 + //单伸位逻辑简单,只需要找到一个空闲库位
  228 + Location location = locationService.getOne(locationLambdaQueryWrapper);
  229 + if (location == null) {
  230 + return null;
  231 + }
  232 + String locationCode = location.getCode();
  233 + return locationCode;
  234 + }
  235 +
  236 +}
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsService.java 0 → 100644
  1 +package org.jeecg.modules.wms.api.wcs.service;
  2 +
  3 +import org.jeecg.common.api.vo.Result;
  4 +import org.jeecg.modules.wms.api.wcs.entity.WarecellDomain;
  5 +
  6 +/**
  7 + * @author 游杰
  8 + */
  9 +public interface WcsService {
  10 +
  11 + /**仓位分配*/
  12 + Result warecellAllocation(WarecellDomain warecellDomain);
  13 +
  14 +}
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java 0 → 100644
  1 +package org.jeecg.modules.wms.api.wcs.service;
  2 +
  3 +
  4 +import com.aliyun.oss.ServiceException;
  5 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  6 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  7 +import org.jeecg.common.api.vo.Result;
  8 +import org.jeecg.modules.wms.api.wcs.entity.WarecellDomain;
  9 +import org.jeecg.modules.wms.api.wcs.entity.WcsTask;
  10 +import org.jeecg.modules.wms.config.container.entity.Container;
  11 +import org.jeecg.modules.wms.config.container.service.IContainerService;
  12 +import org.jeecg.modules.wms.config.location.entity.Location;
  13 +import org.jeecg.modules.wms.config.location.service.ILocationService;
  14 +import org.jeecg.modules.wms.config.locationHigh.entity.LocationHigh;
  15 +import org.jeecg.modules.wms.config.locationHigh.service.ILocationHighService;
  16 +import org.jeecg.modules.wms.config.locationType.entity.LocationType;
  17 +import org.jeecg.modules.wms.config.locationType.service.ILocationTypeService;
  18 +import org.jeecg.modules.wms.config.material.entity.Material;
  19 +import org.jeecg.modules.wms.config.material.service.IMaterialService;
  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;
  23 +import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerDetail;
  24 +import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader;
  25 +import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerDetailService;
  26 +import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService;
  27 +import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail;
  28 +import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader;
  29 +import org.jeecg.modules.wms.task.taskHeader.service.ITaskDetailService;
  30 +import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService;
  31 +import org.jeecg.utils.StringUtils;
  32 +import org.jeecg.utils.constant.QuantityConstant;
  33 +import org.springframework.stereotype.Service;
  34 +import org.springframework.transaction.annotation.Transactional;
  35 +
  36 +import javax.annotation.Resource;
  37 +import java.util.ArrayList;
  38 +import java.util.List;
  39 +import java.util.stream.Collectors;
  40 +
  41 +/**
  42 + * @author 游杰
  43 + */
  44 +@Service
  45 +public class WcsServiceImpl implements WcsService {
  46 +
  47 + @Resource
  48 + private IZoneService zoneService;
  49 + @Resource
  50 + private ITaskHeaderService taskHeaderService;
  51 + @Resource
  52 + private ITaskDetailService taskDetailService;
  53 + @Resource
  54 + private IContainerService containerService;
  55 + @Resource
  56 + private ILocationTypeService locationTypeService;
  57 + @Resource
  58 + private ILocationHighService locationHighService;
  59 + @Resource
  60 + private IParameterConfigurationService parameterConfigurationService;
  61 + @Resource
  62 + private IReceiptContainerDetailService receiptContainerDetailService;
  63 + @Resource
  64 + private IMaterialService materialService;
  65 + @Resource
  66 + private IReceiptContainerHeaderService receiptContainerHeaderService;
  67 + @Resource
  68 + private LocationAllocationService locationAllocationService;
  69 + @Resource
  70 + private ILocationService locationService;
  71 +
  72 + @Override
  73 + @Transactional(rollbackFor = Exception.class)
  74 + public Result warecellAllocation(WarecellDomain warecellDomain) {
  75 + String warehouseCode = warecellDomain.getWarehouseCode();
  76 + String zoneCode = warecellDomain.getZoneCode();
  77 + String height = warecellDomain.getHeight();
  78 + String taskNo = warecellDomain.getTaskNo();
  79 + String locationCode = null;
  80 + List<Integer> roadWays = warecellDomain.getRoadWays();
  81 + if(height == null) {
  82 + return Result.error("分配库位时,高度为空");
  83 + }
  84 + if(roadWays == null) {
  85 + return Result.error("分配库位时,没有获取到可用巷道");
  86 + }
  87 + Zone zone = zoneService.getZoneByCode(zoneCode, warehouseCode);
  88 + if(zone == null) {
  89 + return Result.error("分配库位时,没有找到库区");
  90 + }
  91 + TaskHeader taskHeader = taskHeaderService.getById(taskNo);
  92 + if(taskHeader == null) {
  93 + return Result.error("分配库位时,根据任务号没有找到任务");
  94 + }
  95 + if (taskHeader.getStatus() == QuantityConstant.TASK_STATUS_COMPLETED) {
  96 + return Result.error("任务已经完成,不能再分库位");
  97 + }
  98 + int taskType = taskHeader.getTaskType();
  99 + String containerCode = taskHeader.getContainerCode();
  100 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  101 + if(container == null) {
  102 + return Result.error("分配库位时,任务托盘为空");
  103 + }
  104 + //查询满足条件的库位类型
  105 + LambdaQueryWrapper<LocationType> locationTypeLambdaQueryWrapper = Wrappers.lambdaQuery();
  106 + locationTypeLambdaQueryWrapper.eq(LocationType::getZoneCode, zone.getCode())
  107 + .eq(LocationType::getWarehouseCode, warehouseCode);
  108 + List<LocationType> locationTypeList = locationTypeService.list(locationTypeLambdaQueryWrapper);
  109 + if(locationTypeList.size() == 0) {
  110 + return Result.error("分配库位时,没有找到库位类型");
  111 + }
  112 + int highHeight = Float.valueOf(height).intValue();
  113 + List<String> locationTypeCodeList = locationTypeList.stream().
  114 + map(t -> t.getCode()).collect(Collectors.toList());
  115 + LambdaQueryWrapper<LocationHigh> locationHighLambdaQueryWrapper = Wrappers.lambdaQuery();
  116 + locationHighLambdaQueryWrapper.eq(LocationHigh::getHigh, highHeight)
  117 + .in(LocationHigh::getLocationTypeCode, locationTypeCodeList);
  118 + LocationHigh locationHigh = locationHighService.getOne(locationHighLambdaQueryWrapper);
  119 + if(locationHigh == null) {
  120 + return Result.error("分配库位时,没有找到库位高度");
  121 + }
  122 + int high = locationHigh.getHigh();
  123 + String value = parameterConfigurationService.getValueByCode(QuantityConstant.RULE_ALLOCATION);
  124 + if (StringUtils.isEmpty(value)) {
  125 + return Result.error("分配库位时, 未绑定定位规则");
  126 + }
  127 + int allocationRule = Integer.parseInt(value);
  128 + String materialAreaCode = null;
  129 + //查询任务明细
  130 + LambdaQueryWrapper<TaskDetail> taskDetailLambdaQueryWrapper = Wrappers.lambdaQuery();
  131 + taskDetailLambdaQueryWrapper.eq(TaskDetail::getTaskHeaderId, taskNo);
  132 + List<TaskDetail> taskDetailList = taskDetailService.list(taskDetailLambdaQueryWrapper);
  133 +
  134 + locationCode = locationAllocationService.allocation(allocationRule,
  135 + locationTypeCodeList, high, zoneCode, roadWays, warehouseCode, containerCode, materialAreaCode);
  136 + if (StringUtils.isEmpty(locationCode)) {
  137 + return Result.error("没有库位可分配");
  138 + }
  139 +
  140 + locationService.updateStatus(locationCode,
  141 + QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode);
  142 + if (StringUtils.isNotEmpty(taskHeader.getToLocationCode()) &&
  143 + !locationCode.equals(taskHeader.getToLocationCode())) {
  144 + locationService.updateStatus(taskHeader.getToLocationCode(),
  145 + QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
  146 + }
  147 +
  148 + if(taskType == QuantityConstant.TASK_TYPE_WHOLERECEIPT
  149 + || taskType == QuantityConstant.TASK_TYPE_EMPTYRECEIPT) {
  150 + List<ReceiptContainerDetail> receiptContainerDetailList = new ArrayList<>();
  151 + for (TaskDetail taskDetail : taskDetailList) {
  152 + ReceiptContainerDetail receiptContainerDetail = receiptContainerDetailService.
  153 + getById(taskDetail.getReceiptContainerDetailId());
  154 + if (receiptContainerDetail != null) {
  155 + receiptContainerDetailList.add(receiptContainerDetail);
  156 + }
  157 + }
  158 + receiptContainerDetailList = receiptContainerDetailList.stream().distinct().collect(Collectors.toList());
  159 + if (receiptContainerDetailList != null && receiptContainerDetailList.size() > 0) {
  160 + String materialCode = receiptContainerDetailList.get(0).getMaterialCode();
  161 + Material material = materialService.getMaterialByCode(materialCode);
  162 + materialAreaCode = material.getMaterialareaCode();
  163 + }
  164 +
  165 + if (receiptContainerDetailList.size() > 0) {
  166 + //更新库位编码到组盘头表
  167 + ReceiptContainerDetail receiptContainerDetail = receiptContainerDetailList.get(0);
  168 + if (receiptContainerDetail != null) {
  169 + ReceiptContainerHeader receiptContainerHeader =
  170 + receiptContainerHeaderService.getById(receiptContainerDetail.getReceiptContainerId());
  171 + receiptContainerHeader.setToLocationCode(locationCode);
  172 + if (!receiptContainerHeaderService.updateById(receiptContainerHeader)) {
  173 + throw new ServiceException("更新库位失败");
  174 + }
  175 + }
  176 + }
  177 + }
  178 +
  179 + //修改任务明细目标库位
  180 + Location location = locationService.getLocationByCode(locationCode, warehouseCode);
  181 + int rowFlag = location.getRowFlag().intValue();
  182 + Integer preTaskNo = 0;
  183 + //如果是外侧库位,那么就要判断该库位对应的内侧库位是不是有托盘
  184 + if (rowFlag == QuantityConstant.ROW_OUT) {
  185 + Location insideLocation = locationService.getInsideNear(location);
  186 + if (StringUtils.isNotEmpty(insideLocation.getContainerCode())) {
  187 + Location destinationLocation = locationService.getEmptyLocation(insideLocation);
  188 + if (destinationLocation == null) {
  189 + throw new ServiceException("创建移库任务失败, 目标库位为空");
  190 + }
  191 + Result result = taskHeaderService.createTransferTask(insideLocation.getCode(),
  192 + destinationLocation.getCode(), warehouseCode);
  193 + if (!result.isSuccess()) {
  194 + throw new ServiceException("创建移库任务失败");
  195 + }
  196 + return Result.ok("移库任务先执行");
  197 + }
  198 + } else {
  199 + Location outSideLocation = locationService.getOutSideNear(location);
  200 + if(outSideLocation != null) {
  201 + TaskHeader outSideTaskHeader = taskHeaderService.getTaskHeaderByLocationCode(outSideLocation.getCode());
  202 + if (outSideTaskHeader != null) {
  203 + preTaskNo = outSideTaskHeader.getId();
  204 + }
  205 + }
  206 + }
  207 + taskHeader.setZoneCode(location.getZoneCode());
  208 + taskHeader.setPreTaskNo(preTaskNo);
  209 + taskHeader.setWeight(Integer.parseInt(warecellDomain.getWeight()));
  210 + taskHeader.setToLocationCode(locationCode);
  211 + if (!taskHeaderService.updateById(taskHeader)) {
  212 + throw new ServiceException("更新任务头表目标库位失败");
  213 + }
  214 +
  215 + WcsTask wcsTask = new WcsTask();
  216 + wcsTask.setToLocationCode(locationCode);
  217 + wcsTask.setPreTaskNo(String.valueOf(preTaskNo));
  218 + return Result.OK(wcsTask);
  219 + }
  220 +}
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/container/entity/Container.java
@@ -64,6 +64,10 @@ public class Container implements Serializable { @@ -64,6 +64,10 @@ public class Container implements Serializable {
64 @Dict(dicCode = "container_status") 64 @Dict(dicCode = "container_status")
65 @ApiModelProperty(value = "容器状态") 65 @ApiModelProperty(value = "容器状态")
66 private String status; 66 private String status;
  67 + /**上次容器状态*/
  68 + @Excel(name = "上次容器状态", width = 15)
  69 + @ApiModelProperty(value = "上次容器状态")
  70 + private String lastStatus;
67 /**备用字段1*/ 71 /**备用字段1*/
68 @Excel(name = "备用字段1", width = 15) 72 @Excel(name = "备用字段1", width = 15)
69 @ApiModelProperty(value = "备用字段1") 73 @ApiModelProperty(value = "备用字段1")
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/container/service/IContainerService.java
@@ -17,4 +17,7 @@ public interface IContainerService extends IService&lt;Container&gt; { @@ -17,4 +17,7 @@ public interface IContainerService extends IService&lt;Container&gt; {
17 Container getContainerByCode(String containCode, String warehouseCode); 17 Container getContainerByCode(String containCode, String warehouseCode);
18 18
19 boolean updateStatus(String containerCode, String status, String wareohuseCode); 19 boolean updateStatus(String containerCode, String status, String wareohuseCode);
  20 +
  21 + boolean updateLocationCodeAndStatus(String containerCode, String locationCode,
  22 + String status, String warehouseCode);
20 } 23 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/container/service/impl/ContainerServiceImpl.java
@@ -72,6 +72,18 @@ public class ContainerServiceImpl extends ServiceImpl&lt;ContainerMapper, Container @@ -72,6 +72,18 @@ public class ContainerServiceImpl extends ServiceImpl&lt;ContainerMapper, Container
72 return result; 72 return result;
73 } 73 }
74 74
  75 + @Override
  76 + public boolean updateLocationCodeAndStatus(String containerCode, String locationCode, String status, String warehouseCode) {
  77 + Container container = getContainerByCode(containerCode, warehouseCode);
  78 + if(container == null) {
  79 + return false;
  80 + }
  81 + container.setStatus(status);
  82 + container.setLocationCode(locationCode);
  83 + boolean result = updateById(container);
  84 + return result;
  85 + }
  86 +
75 87
76 private int getStartNumber(String containerTypeCode, String warehouseCode) { 88 private int getStartNumber(String containerTypeCode, String warehouseCode) {
77 LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); 89 LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery();
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/service/ILocationService.java
@@ -3,6 +3,8 @@ package org.jeecg.modules.wms.config.location.service; @@ -3,6 +3,8 @@ package org.jeecg.modules.wms.config.location.service;
3 import com.baomidou.mybatisplus.extension.service.IService; 3 import com.baomidou.mybatisplus.extension.service.IService;
4 import org.jeecg.modules.wms.config.location.entity.Location; 4 import org.jeecg.modules.wms.config.location.entity.Location;
5 5
  6 +import java.util.List;
  7 +
6 /** 8 /**
7 * @Description: 库位管理 9 * @Description: 库位管理
8 * @Author: jeecg-boot 10 * @Author: jeecg-boot
@@ -13,6 +15,8 @@ public interface ILocationService extends IService&lt;Location&gt; { @@ -13,6 +15,8 @@ public interface ILocationService extends IService&lt;Location&gt; {
13 15
14 Location getLocationByCode(String locationCode, String wareohuseCode); 16 Location getLocationByCode(String locationCode, String wareohuseCode);
15 17
  18 + List<Location> getLocationListByZoneCode(String zoneCode, String wareohuseCode);
  19 +
16 boolean updateStatus(String locationCode, String status, String wareohuseCode); 20 boolean updateStatus(String locationCode, String status, String wareohuseCode);
17 21
18 Location getNear(Location location); 22 Location getNear(Location location);
@@ -21,4 +25,12 @@ public interface ILocationService extends IService&lt;Location&gt; { @@ -21,4 +25,12 @@ public interface ILocationService extends IService&lt;Location&gt; {
21 25
22 Location getOutSideNear(Location location); 26 Location getOutSideNear(Location location);
23 27
  28 + Location getEmptyLocation(Location location);
  29 +
  30 + Location getEmptyInsideLocation(Location location);
  31 +
  32 + Location getEmptyOutSideLocation(Location location);
  33 +
  34 + boolean haveUncompleteTaskInNear(Location location);
  35 +
24 } 36 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/service/impl/LocationServiceImpl.java
@@ -5,12 +5,16 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -5,12 +5,16 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
5 import org.jeecg.modules.wms.config.location.entity.Location; 5 import org.jeecg.modules.wms.config.location.entity.Location;
6 import org.jeecg.modules.wms.config.location.mapper.LocationMapper; 6 import org.jeecg.modules.wms.config.location.mapper.LocationMapper;
7 import org.jeecg.modules.wms.config.location.service.ILocationService; 7 import org.jeecg.modules.wms.config.location.service.ILocationService;
  8 +import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService;
8 import org.jeecg.utils.constant.QuantityConstant; 9 import org.jeecg.utils.constant.QuantityConstant;
9 import org.springframework.stereotype.Service; 10 import org.springframework.stereotype.Service;
10 11
11 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 12 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
12 13
13 import javax.annotation.Resource; 14 import javax.annotation.Resource;
  15 +import java.util.ArrayList;
  16 +import java.util.Collections;
  17 +import java.util.Comparator;
14 import java.util.List; 18 import java.util.List;
15 19
16 /** 20 /**
@@ -22,17 +26,30 @@ import java.util.List; @@ -22,17 +26,30 @@ import java.util.List;
22 @Service 26 @Service
23 public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> implements ILocationService { 27 public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> implements ILocationService {
24 28
  29 + @Resource
  30 + private ITaskHeaderService taskHeaderService;
25 31
26 @Override 32 @Override
27 public Location getLocationByCode(String locationCode, String wareohuseCode) { 33 public Location getLocationByCode(String locationCode, String wareohuseCode) {
28 LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery(); 34 LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery();
29 locationLambdaQueryWrapper.eq(Location::getCode, locationCode) 35 locationLambdaQueryWrapper.eq(Location::getCode, locationCode)
  36 + .eq(Location::getEnable, QuantityConstant.STATUS_ENABLE)
30 .eq(Location::getWarehouseCode, wareohuseCode); 37 .eq(Location::getWarehouseCode, wareohuseCode);
31 Location location = this.getOne(locationLambdaQueryWrapper); 38 Location location = this.getOne(locationLambdaQueryWrapper);
32 return location; 39 return location;
33 } 40 }
34 41
35 @Override 42 @Override
  43 + public List<Location> getLocationListByZoneCode(String zoneCode, String wareohuseCode) {
  44 + LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery();
  45 + locationLambdaQueryWrapper.eq(Location::getZoneCode, zoneCode)
  46 + .eq(Location::getEnable, QuantityConstant.STATUS_ENABLE)
  47 + .eq(Location::getWarehouseCode, wareohuseCode);
  48 + List<Location> locationList = this.list(locationLambdaQueryWrapper);
  49 + return locationList;
  50 + }
  51 +
  52 + @Override
36 public boolean updateStatus(String locationCode, String status, String wareohuseCode) { 53 public boolean updateStatus(String locationCode, String status, String wareohuseCode) {
37 Location location = getLocationByCode(locationCode, wareohuseCode); 54 Location location = getLocationByCode(locationCode, wareohuseCode);
38 if(location == null) { 55 if(location == null) {
@@ -94,4 +111,120 @@ public class LocationServiceImpl extends ServiceImpl&lt;LocationMapper, Location&gt; i @@ -94,4 +111,120 @@ public class LocationServiceImpl extends ServiceImpl&lt;LocationMapper, Location&gt; i
94 } 111 }
95 return null; 112 return null;
96 } 113 }
  114 +
  115 + @Override
  116 + public Location getEmptyLocation(Location location) {
  117 + Location location1 = getEmptyOutSideLocation(location);
  118 + if (location1 == null) {
  119 + location1 = getEmptyInsideLocation(location);
  120 + }
  121 + return location1;
  122 + }
  123 +
  124 + @Override
  125 + public Location getEmptyInsideLocation(Location location) {
  126 + LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery();
  127 + locationLambdaQueryWrapper.eq(Location::getWarehouseCode, location.getWarehouseCode())
  128 + .eq(Location::getRoadWay, location.getRoadWay())
  129 + .eq(Location::getRowFlag, QuantityConstant.ROW_IN)
  130 + .eq(Location::getHigh, location.getHigh())
  131 + .eq(Location::getContainerCode, QuantityConstant.EMPTY_STRING)
  132 + .eq(Location::getStatus, QuantityConstant.STATUS_LOCATION_EMPTY)
  133 + .eq(Location::getLocationTypeCode, location.getLocationTypeCode());
  134 + List<Location> locationList = list(locationLambdaQueryWrapper);
  135 + List<Location> removeLocaationList = new ArrayList<>();
  136 + int column = location.getIcolumn();
  137 + Collections.sort(locationList, new Comparator<Location>() {
  138 + @Override
  139 + public int compare(Location o1, Location o2) {
  140 + int dvalue1 = Math.abs(o1.getIcolumn() - column);
  141 + int dvalue2 = Math.abs(o2.getIcolumn() - column);
  142 + return dvalue1 - dvalue2;
  143 + }
  144 + });
  145 + int removeSize = 0;
  146 + for (int i = 0; i < locationList.size(); i++) {
  147 + Location location1 = locationList.get(i);
  148 + if (haveUncompleteTaskInNear(location1)) {
  149 + removeLocaationList.add(location1);
  150 + removeSize++;
  151 + }
  152 + if (i - removeSize >= 3) {
  153 + break;
  154 + }
  155 + }
  156 + locationList.removeAll(removeLocaationList);
  157 + if (locationList == null || locationList.size() <= 0) {
  158 + return null;
  159 + }
  160 + Location location1 = locationList.get(0);
  161 + return location1;
  162 + }
  163 +
  164 + @Override
  165 + public Location getEmptyOutSideLocation(Location location) {
  166 + LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery();
  167 + locationLambdaQueryWrapper.eq(Location::getWarehouseCode, location.getWarehouseCode())
  168 + .eq(Location::getRoadWay, location.getRoadWay())
  169 + .eq(Location::getHigh, location.getHigh())
  170 + .eq(Location::getRowFlag, QuantityConstant.ROW_OUT)
  171 + .eq(Location::getContainerCode, QuantityConstant.EMPTY_STRING)
  172 + .eq(Location::getStatus, QuantityConstant.STATUS_LOCATION_EMPTY)
  173 + .eq(Location::getLocationTypeCode, location.getLocationTypeCode());
  174 + List<Location> locationList = list(locationLambdaQueryWrapper);
  175 + List<Location> removeLocationList = new ArrayList<>();
  176 + int column = location.getIcolumn();
  177 + Collections.sort(locationList, new Comparator<Location>() {
  178 + @Override
  179 + public int compare(Location o1, Location o2) {
  180 + int dvalue1 = Math.abs(o1.getIcolumn() - column);
  181 + int dvalue2 = Math.abs(o2.getIcolumn() - column);
  182 + return dvalue1 - dvalue2;
  183 + }
  184 + });
  185 + int removeSize = 0;
  186 + for (int i = 0; i < locationList.size(); i++) {
  187 + Location location1 = locationList.get(i);
  188 + if (taskHeaderService.haveUncompleteTaskInNear(location1)) {
  189 + removeLocationList.add(location1);
  190 + removeSize++;
  191 + } else if (!getOutSideCanMove(location1)) {
  192 + removeLocationList.add(location1);
  193 + removeSize++;
  194 + }
  195 + if (i - removeSize >= 3) {
  196 + break;
  197 + }
  198 + }
  199 + locationList.removeAll(removeLocationList);
  200 + if (locationList == null || locationList.size() <= 0) {
  201 + return null;
  202 + }
  203 + Location location1 = locationList.get(0);
  204 + return location1;
  205 + }
  206 +
  207 + @Override
  208 + public boolean haveUncompleteTaskInNear(Location location) {
  209 + Location location1 = getNear(location);
  210 + if (location1 == null) {
  211 + return false;
  212 + }
  213 + String status = location1.getStatus();
  214 + if(QuantityConstant.STATUS_LOCATION_LOCK.equals(status)) {
  215 + return true;
  216 + }
  217 + return false;
  218 + }
  219 +
  220 + private boolean getOutSideCanMove(Location location) {
  221 + Location locaiton2 = getInsideNear(location);
  222 + if (locaiton2.getStatus().equals(QuantityConstant.STATUS_LOCATION_LOCK)) {
  223 + return false;
  224 + }
  225 + if (!locaiton2.getContainerCode().equals(QuantityConstant.EMPTY_STRING)) {
  226 + return false;
  227 + }
  228 + return true;
  229 + }
97 } 230 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/locationHigh/entity/LocationHigh.java
@@ -51,9 +51,14 @@ public class LocationHigh implements Serializable { @@ -51,9 +51,14 @@ public class LocationHigh implements Serializable {
51 @Excel(name = "库位类型", width = 15) 51 @Excel(name = "库位类型", width = 15)
52 @ApiModelProperty(value = "库位类型") 52 @ApiModelProperty(value = "库位类型")
53 private String locationTypeCode; 53 private String locationTypeCode;
54 - /**高度值*/  
55 - @Excel(name = "高度值", width = 15) 54 + /**高度值*/
  55 + @Excel(name = "高度值", width = 15)
56 @ApiModelProperty(value = "高度值") 56 @ApiModelProperty(value = "高度值")
  57 + private Integer highLevel;
  58 + /**高低位*/
  59 + @Excel(name = "高低位", width = 15)
  60 + @ApiModelProperty(value = "高低位")
  61 + @Dict(dicCode = "high_status")
57 private Integer high; 62 private Integer high;
58 /**备用字段*/ 63 /**备用字段*/
59 @Excel(name = "备用字段", width = 15) 64 @Excel(name = "备用字段", width = 15)
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/locationType/service/ILocationTypeService.java
@@ -2,6 +2,7 @@ package org.jeecg.modules.wms.config.locationType.service; @@ -2,6 +2,7 @@ package org.jeecg.modules.wms.config.locationType.service;
2 2
3 import com.baomidou.mybatisplus.extension.service.IService; 3 import com.baomidou.mybatisplus.extension.service.IService;
4 import org.jeecg.modules.wms.config.locationType.entity.LocationType; 4 import org.jeecg.modules.wms.config.locationType.entity.LocationType;
  5 +import org.jeecg.modules.wms.config.zone.entity.Zone;
5 6
6 /** 7 /**
7 * @Description: 库位类型 8 * @Description: 库位类型
@@ -11,4 +12,5 @@ import org.jeecg.modules.wms.config.locationType.entity.LocationType; @@ -11,4 +12,5 @@ import org.jeecg.modules.wms.config.locationType.entity.LocationType;
11 */ 12 */
12 public interface ILocationTypeService extends IService<LocationType> { 13 public interface ILocationTypeService extends IService<LocationType> {
13 14
  15 + LocationType getLocationTypeByCode(String locationTypeCode, String wareohuseCode);
14 } 16 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/locationType/service/impl/LocationTypeServiceImpl.java
1 package org.jeecg.modules.wms.config.locationType.service.impl; 1 package org.jeecg.modules.wms.config.locationType.service.impl;
2 2
  3 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  4 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
3 import org.jeecg.modules.wms.config.locationType.entity.LocationType; 5 import org.jeecg.modules.wms.config.locationType.entity.LocationType;
4 import org.jeecg.modules.wms.config.locationType.mapper.LocationTypeMapper; 6 import org.jeecg.modules.wms.config.locationType.mapper.LocationTypeMapper;
5 import org.jeecg.modules.wms.config.locationType.service.ILocationTypeService; 7 import org.jeecg.modules.wms.config.locationType.service.ILocationTypeService;
@@ -16,4 +18,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -16,4 +18,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
16 @Service 18 @Service
17 public class LocationTypeServiceImpl extends ServiceImpl<LocationTypeMapper, LocationType> implements ILocationTypeService { 19 public class LocationTypeServiceImpl extends ServiceImpl<LocationTypeMapper, LocationType> implements ILocationTypeService {
18 20
  21 + @Override
  22 + public LocationType getLocationTypeByCode(String locationTypeCode, String wareohuseCode) {
  23 + LambdaQueryWrapper<LocationType> locationTypeMapperLambdaQueryWrapper = Wrappers.lambdaQuery();
  24 + locationTypeMapperLambdaQueryWrapper.eq(LocationType::getCode, locationTypeCode)
  25 + .eq(LocationType::getWarehouseCode, wareohuseCode);
  26 + LocationType locationType = getOne(locationTypeMapperLambdaQueryWrapper);
  27 + return locationType;
  28 + }
19 } 29 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/parameterConfiguration/service/IParameterConfigurationService.java
@@ -11,4 +11,5 @@ import org.jeecg.modules.wms.config.parameterConfiguration.entity.ParameterConfi @@ -11,4 +11,5 @@ import org.jeecg.modules.wms.config.parameterConfiguration.entity.ParameterConfi
11 */ 11 */
12 public interface IParameterConfigurationService extends IService<ParameterConfiguration> { 12 public interface IParameterConfigurationService extends IService<ParameterConfiguration> {
13 13
  14 + public String getValueByCode(String code);
14 } 15 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/parameterConfiguration/service/impl/ParameterConfigurationServiceImpl.java
1 package org.jeecg.modules.wms.config.parameterConfiguration.service.impl; 1 package org.jeecg.modules.wms.config.parameterConfiguration.service.impl;
2 2
  3 +import com.baomidou.mybatisplus.core.conditions.Wrapper;
  4 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  5 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
3 import org.jeecg.modules.wms.config.parameterConfiguration.entity.ParameterConfiguration; 6 import org.jeecg.modules.wms.config.parameterConfiguration.entity.ParameterConfiguration;
4 import org.jeecg.modules.wms.config.parameterConfiguration.mapper.ParameterConfigurationMapper; 7 import org.jeecg.modules.wms.config.parameterConfiguration.mapper.ParameterConfigurationMapper;
5 import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService; 8 import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService;
@@ -16,4 +19,15 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -16,4 +19,15 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
16 @Service 19 @Service
17 public class ParameterConfigurationServiceImpl extends ServiceImpl<ParameterConfigurationMapper, ParameterConfiguration> implements IParameterConfigurationService { 20 public class ParameterConfigurationServiceImpl extends ServiceImpl<ParameterConfigurationMapper, ParameterConfiguration> implements IParameterConfigurationService {
18 21
  22 + @Override
  23 + public String getValueByCode(String code) {
  24 + LambdaQueryWrapper<ParameterConfiguration> parameterConfigurationLambdaQueryWrapper = Wrappers.lambdaQuery();
  25 + parameterConfigurationLambdaQueryWrapper.eq(ParameterConfiguration::getCode, code);
  26 + ParameterConfiguration parameterConfiguration = getOne(parameterConfigurationLambdaQueryWrapper);
  27 + if(parameterConfiguration == null) {
  28 + return null;
  29 + }
  30 + String value = parameterConfiguration.getValue();
  31 + return value;
  32 + }
19 } 33 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/zone/service/IZoneService.java
1 package org.jeecg.modules.wms.config.zone.service; 1 package org.jeecg.modules.wms.config.zone.service;
2 2
3 import com.baomidou.mybatisplus.extension.service.IService; 3 import com.baomidou.mybatisplus.extension.service.IService;
  4 +import org.jeecg.modules.wms.config.location.entity.Location;
4 import org.jeecg.modules.wms.config.zone.entity.Zone; 5 import org.jeecg.modules.wms.config.zone.entity.Zone;
5 6
6 /** 7 /**
@@ -11,4 +12,5 @@ import org.jeecg.modules.wms.config.zone.entity.Zone; @@ -11,4 +12,5 @@ import org.jeecg.modules.wms.config.zone.entity.Zone;
11 */ 12 */
12 public interface IZoneService extends IService<Zone> { 13 public interface IZoneService extends IService<Zone> {
13 14
  15 + Zone getZoneByCode(String zoneCode, String wareohuseCode);
14 } 16 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/zone/service/impl/ZoneServiceImpl.java
1 package org.jeecg.modules.wms.config.zone.service.impl; 1 package org.jeecg.modules.wms.config.zone.service.impl;
2 2
  3 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  4 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
3 import org.jeecg.modules.wms.config.zone.entity.Zone; 5 import org.jeecg.modules.wms.config.zone.entity.Zone;
4 import org.jeecg.modules.wms.config.zone.mapper.ZoneMapper; 6 import org.jeecg.modules.wms.config.zone.mapper.ZoneMapper;
5 import org.jeecg.modules.wms.config.zone.service.IZoneService; 7 import org.jeecg.modules.wms.config.zone.service.IZoneService;
@@ -16,4 +18,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -16,4 +18,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
16 @Service 18 @Service
17 public class ZoneServiceImpl extends ServiceImpl<ZoneMapper, Zone> implements IZoneService { 19 public class ZoneServiceImpl extends ServiceImpl<ZoneMapper, Zone> implements IZoneService {
18 20
  21 + @Override
  22 + public Zone getZoneByCode(String zoneCode, String wareohuseCode) {
  23 + LambdaQueryWrapper<Zone> zoneLambdaQueryWrapper = Wrappers.lambdaQuery();
  24 + zoneLambdaQueryWrapper.eq(Zone::getCode, zoneCode)
  25 + .eq(Zone::getWarehouseCode, wareohuseCode);
  26 + Zone zone = getOne(zoneLambdaQueryWrapper);
  27 + return zone;
  28 + }
19 } 29 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/framework/controller/BaseController.java 0 → 100644
  1 +package org.jeecg.modules.wms.framework.controller;
  2 +
  3 +import org.jeecg.common.api.vo.Result;
  4 +
  5 +import java.util.concurrent.Semaphore;
  6 +
  7 +/**
  8 + * @author 游杰
  9 + */
  10 +public class BaseController {
  11 +
  12 + Semaphore semaphore=new Semaphore(1);
  13 +
  14 + public Result handleMultiProcess(MultiProcessListener multiProcessListener) {
  15 + Result result = null;
  16 + int max_time = 30 * 1000;
  17 + int now = 0;
  18 + boolean avail = true;
  19 + while(avail) {
  20 + int availablePermits = semaphore.availablePermits();
  21 + if(availablePermits >0) {
  22 + avail = false;
  23 + try {
  24 + semaphore.acquire(1);
  25 + result = multiProcessListener.doProcess();
  26 + } catch (Exception e) {
  27 + e.printStackTrace();
  28 + result = Result.error(e.getMessage());
  29 + } finally {
  30 + semaphore.release(1);
  31 + }
  32 + } else {
  33 + result = Result.error("多线程处理异常");
  34 + try {
  35 + now = now + 200;
  36 + Thread.sleep(200);
  37 + } catch (InterruptedException e) {
  38 + e.printStackTrace();
  39 + }
  40 + if(now >= max_time) {
  41 + avail = false;
  42 + }
  43 + }
  44 + }
  45 + return result;
  46 + }
  47 +
  48 + public interface MultiProcessListener {
  49 + Result doProcess();
  50 + }
  51 +}
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/controller/ReceiptContainerHeaderController.java
@@ -8,11 +8,10 @@ import lombok.extern.slf4j.Slf4j; @@ -8,11 +8,10 @@ import lombok.extern.slf4j.Slf4j;
8 import org.jeecg.common.system.base.controller.JeecgController; 8 import org.jeecg.common.system.base.controller.JeecgController;
9 import org.jeecg.common.api.vo.Result; 9 import org.jeecg.common.api.vo.Result;
10 import org.jeecg.common.system.util.JwtUtil; 10 import org.jeecg.common.system.util.JwtUtil;
11 -import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContaienrDetail; 11 +import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerDetail;
12 import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader; 12 import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader;
13 -import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContaienrDetailService; 13 +import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerDetailService;
14 import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService; 14 import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService;
15 -import org.jeecg.modules.wms.receipt.receiving.domain.Receive;  
16 import org.springframework.beans.factory.annotation.Autowired; 15 import org.springframework.beans.factory.annotation.Autowired;
17 import org.springframework.web.bind.annotation.*; 16 import org.springframework.web.bind.annotation.*;
18 import javax.servlet.http.HttpServletRequest; 17 import javax.servlet.http.HttpServletRequest;
@@ -53,7 +52,7 @@ public class ReceiptContainerHeaderController extends JeecgController&lt;ReceiptCon @@ -53,7 +52,7 @@ public class ReceiptContainerHeaderController extends JeecgController&lt;ReceiptCon
53 private IReceiptContainerHeaderService receiptContainerHeaderService; 52 private IReceiptContainerHeaderService receiptContainerHeaderService;
54 53
55 @Autowired 54 @Autowired
56 - private IReceiptContaienrDetailService receiptContaienrDetailService; 55 + private IReceiptContainerDetailService receiptContainerDetailService;
57 56
58 57
59 /*---------------------------------主表处理-begin-------------------------------------*/ 58 /*---------------------------------主表处理-begin-------------------------------------*/
@@ -158,40 +157,40 @@ public class ReceiptContainerHeaderController extends JeecgController&lt;ReceiptCon @@ -158,40 +157,40 @@ public class ReceiptContainerHeaderController extends JeecgController&lt;ReceiptCon
158 */ 157 */
159 //@AutoLog(value = "入库组盘详情-通过主表ID查询") 158 //@AutoLog(value = "入库组盘详情-通过主表ID查询")
160 @ApiOperation(value="入库组盘详情-通过主表ID查询", notes="入库组盘详情-通过主表ID查询") 159 @ApiOperation(value="入库组盘详情-通过主表ID查询", notes="入库组盘详情-通过主表ID查询")
161 - @GetMapping(value = "/listReceiptContaienrDetailByMainId")  
162 - public Result<IPage<ReceiptContaienrDetail>> listReceiptContaienrDetailByMainId(ReceiptContaienrDetail receiptContaienrDetail, 160 + @GetMapping(value = "/listReceiptContainerDetailByMainId")
  161 + public Result<IPage<ReceiptContainerDetail>> listReceiptContainerDetailByMainId(ReceiptContainerDetail receiptContainerDetail,
163 @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, 162 @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
164 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, 163 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
165 HttpServletRequest req) { 164 HttpServletRequest req) {
166 - QueryWrapper<ReceiptContaienrDetail> queryWrapper = QueryGenerator.initQueryWrapper(receiptContaienrDetail, req.getParameterMap());  
167 - Page<ReceiptContaienrDetail> page = new Page<ReceiptContaienrDetail>(pageNo, pageSize);  
168 - IPage<ReceiptContaienrDetail> pageList = receiptContaienrDetailService.page(page, queryWrapper); 165 + QueryWrapper<ReceiptContainerDetail> queryWrapper = QueryGenerator.initQueryWrapper(receiptContainerDetail, req.getParameterMap());
  166 + Page<ReceiptContainerDetail> page = new Page<ReceiptContainerDetail>(pageNo, pageSize);
  167 + IPage<ReceiptContainerDetail> pageList = receiptContainerDetailService.page(page, queryWrapper);
169 return Result.OK(pageList); 168 return Result.OK(pageList);
170 } 169 }
171 170
172 /** 171 /**
173 * 添加 172 * 添加
174 - * @param receiptContaienrDetail 173 + * @param receiptContainerDetail
175 * @return 174 * @return
176 */ 175 */
177 @AutoLog(value = "入库组盘详情-添加") 176 @AutoLog(value = "入库组盘详情-添加")
178 @ApiOperation(value="入库组盘详情-添加", notes="入库组盘详情-添加") 177 @ApiOperation(value="入库组盘详情-添加", notes="入库组盘详情-添加")
179 - @PostMapping(value = "/addReceiptContaienrDetail")  
180 - public Result<String> addReceiptContaienrDetail(@RequestBody ReceiptContaienrDetail receiptContaienrDetail) {  
181 - receiptContaienrDetailService.save(receiptContaienrDetail); 178 + @PostMapping(value = "/addReceiptContainerDetail")
  179 + public Result<String> addReceiptContainerDetail(@RequestBody ReceiptContainerDetail receiptContainerDetail) {
  180 + receiptContainerDetailService.save(receiptContainerDetail);
182 return Result.OK("添加成功!"); 181 return Result.OK("添加成功!");
183 } 182 }
184 183
185 /** 184 /**
186 * 编辑 185 * 编辑
187 - * @param receiptContaienrDetail 186 + * @param receiptContainerDetail
188 * @return 187 * @return
189 */ 188 */
190 @AutoLog(value = "入库组盘详情-编辑") 189 @AutoLog(value = "入库组盘详情-编辑")
191 @ApiOperation(value="入库组盘详情-编辑", notes="入库组盘详情-编辑") 190 @ApiOperation(value="入库组盘详情-编辑", notes="入库组盘详情-编辑")
192 - @RequestMapping(value = "/editReceiptContaienrDetail", method = {RequestMethod.PUT,RequestMethod.POST})  
193 - public Result<String> editReceiptContaienrDetail(@RequestBody ReceiptContaienrDetail receiptContaienrDetail) {  
194 - receiptContaienrDetailService.updateById(receiptContaienrDetail); 191 + @RequestMapping(value = "/editReceiptContainerDetail", method = {RequestMethod.PUT,RequestMethod.POST})
  192 + public Result<String> editReceiptContainerDetail(@RequestBody ReceiptContainerDetail receiptContainerDetail) {
  193 + receiptContainerDetailService.updateById(receiptContainerDetail);
195 return Result.OK("编辑成功!"); 194 return Result.OK("编辑成功!");
196 } 195 }
197 196
@@ -202,9 +201,9 @@ public class ReceiptContainerHeaderController extends JeecgController&lt;ReceiptCon @@ -202,9 +201,9 @@ public class ReceiptContainerHeaderController extends JeecgController&lt;ReceiptCon
202 */ 201 */
203 @AutoLog(value = "入库组盘详情-通过id删除") 202 @AutoLog(value = "入库组盘详情-通过id删除")
204 @ApiOperation(value="入库组盘详情-通过id删除", notes="入库组盘详情-通过id删除") 203 @ApiOperation(value="入库组盘详情-通过id删除", notes="入库组盘详情-通过id删除")
205 - @DeleteMapping(value = "/deleteReceiptContaienrDetail")  
206 - public Result<String> deleteReceiptContaienrDetail(@RequestParam(name="id",required=true) String id) {  
207 - receiptContaienrDetailService.removeById(id); 204 + @DeleteMapping(value = "/deleteReceiptContainerDetail")
  205 + public Result<String> deleteReceiptContainerDetail(@RequestParam(name="id",required=true) String id) {
  206 + receiptContainerDetailService.removeById(id);
208 return Result.OK("删除成功!"); 207 return Result.OK("删除成功!");
209 } 208 }
210 209
@@ -215,9 +214,9 @@ public class ReceiptContainerHeaderController extends JeecgController&lt;ReceiptCon @@ -215,9 +214,9 @@ public class ReceiptContainerHeaderController extends JeecgController&lt;ReceiptCon
215 */ 214 */
216 @AutoLog(value = "入库组盘详情-批量删除") 215 @AutoLog(value = "入库组盘详情-批量删除")
217 @ApiOperation(value="入库组盘详情-批量删除", notes="入库组盘详情-批量删除") 216 @ApiOperation(value="入库组盘详情-批量删除", notes="入库组盘详情-批量删除")
218 - @DeleteMapping(value = "/deleteBatchReceiptContaienrDetail")  
219 - public Result<String> deleteBatchReceiptContaienrDetail(@RequestParam(name="ids",required=true) String ids) {  
220 - this.receiptContaienrDetailService.removeByIds(Arrays.asList(ids.split(","))); 217 + @DeleteMapping(value = "/deleteBatchReceiptContainerDetail")
  218 + public Result<String> deleteBatchReceiptContainerDetail(@RequestParam(name="ids",required=true) String ids) {
  219 + this.receiptContainerDetailService.removeByIds(Arrays.asList(ids.split(",")));
221 return Result.OK("批量删除成功!"); 220 return Result.OK("批量删除成功!");
222 } 221 }
223 222
@@ -225,15 +224,15 @@ public class ReceiptContainerHeaderController extends JeecgController&lt;ReceiptCon @@ -225,15 +224,15 @@ public class ReceiptContainerHeaderController extends JeecgController&lt;ReceiptCon
225 * 导出 224 * 导出
226 * @return 225 * @return
227 */ 226 */
228 - @RequestMapping(value = "/exportReceiptContaienrDetail")  
229 - public ModelAndView exportReceiptContaienrDetail(HttpServletRequest request, ReceiptContaienrDetail receiptContaienrDetail) { 227 + @RequestMapping(value = "/exportReceiptContainerDetail")
  228 + public ModelAndView exportReceiptContainerDetail(HttpServletRequest request, ReceiptContainerDetail receiptContainerDetail) {
230 // Step.1 组装查询条件 229 // Step.1 组装查询条件
231 - QueryWrapper<ReceiptContaienrDetail> queryWrapper = QueryGenerator.initQueryWrapper(receiptContaienrDetail, request.getParameterMap()); 230 + QueryWrapper<ReceiptContainerDetail> queryWrapper = QueryGenerator.initQueryWrapper(receiptContainerDetail, request.getParameterMap());
232 LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); 231 LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
233 232
234 // Step.2 获取导出数据 233 // Step.2 获取导出数据
235 - List<ReceiptContaienrDetail> pageList = receiptContaienrDetailService.list(queryWrapper);  
236 - List<ReceiptContaienrDetail> exportList = null; 234 + List<ReceiptContainerDetail> pageList = receiptContainerDetailService.list(queryWrapper);
  235 + List<ReceiptContainerDetail> exportList = null;
237 236
238 // 过滤选中数据 237 // 过滤选中数据
239 String selections = request.getParameter("selections"); 238 String selections = request.getParameter("selections");
@@ -247,7 +246,7 @@ public class ReceiptContainerHeaderController extends JeecgController&lt;ReceiptCon @@ -247,7 +246,7 @@ public class ReceiptContainerHeaderController extends JeecgController&lt;ReceiptCon
247 // Step.3 AutoPoi 导出Excel 246 // Step.3 AutoPoi 导出Excel
248 ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); 247 ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
249 mv.addObject(NormalExcelConstants.FILE_NAME, "入库组盘详情"); //此处设置的filename无效 ,前端会重更新设置一下 248 mv.addObject(NormalExcelConstants.FILE_NAME, "入库组盘详情"); //此处设置的filename无效 ,前端会重更新设置一下
250 - mv.addObject(NormalExcelConstants.CLASS, ReceiptContaienrDetail.class); 249 + mv.addObject(NormalExcelConstants.CLASS, ReceiptContainerDetail.class);
251 mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("入库组盘详情报表", "导出人:" + sysUser.getRealname(), "入库组盘详情")); 250 mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("入库组盘详情报表", "导出人:" + sysUser.getRealname(), "入库组盘详情"));
252 mv.addObject(NormalExcelConstants.DATA_LIST, exportList); 251 mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
253 return mv; 252 return mv;
@@ -257,8 +256,8 @@ public class ReceiptContainerHeaderController extends JeecgController&lt;ReceiptCon @@ -257,8 +256,8 @@ public class ReceiptContainerHeaderController extends JeecgController&lt;ReceiptCon
257 * 导入 256 * 导入
258 * @return 257 * @return
259 */ 258 */
260 - @RequestMapping(value = "/importReceiptContaienrDetail/{mainId}")  
261 - public Result<?> importReceiptContaienrDetail(HttpServletRequest request, HttpServletResponse response, @PathVariable("mainId") Integer mainId) { 259 + @RequestMapping(value = "/importReceiptContainerDetail/{mainId}")
  260 + public Result<?> importReceiptContainerDetail(HttpServletRequest request, HttpServletResponse response, @PathVariable("mainId") Integer mainId) {
262 MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; 261 MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
263 Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); 262 Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
264 for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { 263 for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
@@ -268,12 +267,12 @@ public class ReceiptContainerHeaderController extends JeecgController&lt;ReceiptCon @@ -268,12 +267,12 @@ public class ReceiptContainerHeaderController extends JeecgController&lt;ReceiptCon
268 params.setHeadRows(1); 267 params.setHeadRows(1);
269 params.setNeedSave(true); 268 params.setNeedSave(true);
270 try { 269 try {
271 - List<ReceiptContaienrDetail> list = ExcelImportUtil.importExcel(file.getInputStream(), ReceiptContaienrDetail.class, params);  
272 - for (ReceiptContaienrDetail temp : list) { 270 + List<ReceiptContainerDetail> list = ExcelImportUtil.importExcel(file.getInputStream(), ReceiptContainerDetail.class, params);
  271 + for (ReceiptContainerDetail temp : list) {
273 temp.setReceiptContainerId(mainId); 272 temp.setReceiptContainerId(mainId);
274 } 273 }
275 long start = System.currentTimeMillis(); 274 long start = System.currentTimeMillis();
276 - receiptContaienrDetailService.saveBatch(list); 275 + receiptContainerDetailService.saveBatch(list);
277 log.info("消耗时间" + (System.currentTimeMillis() - start) + "毫秒"); 276 log.info("消耗时间" + (System.currentTimeMillis() - start) + "毫秒");
278 return Result.OK("文件导入成功!数据行数:" + list.size()); 277 return Result.OK("文件导入成功!数据行数:" + list.size());
279 } catch (Exception e) { 278 } catch (Exception e) {
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/entity/ReceiptContaienrDetail.java renamed to jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/entity/ReceiptContainerDetail.java
@@ -21,9 +21,9 @@ import java.io.UnsupportedEncodingException; @@ -21,9 +21,9 @@ import java.io.UnsupportedEncodingException;
21 * @Version: V1.0 21 * @Version: V1.0
22 */ 22 */
23 @Data 23 @Data
24 -@TableName("receipt_contaienr_detail")  
25 -@ApiModel(value="receipt_contaienr_detail对象", description="入库组盘详情")  
26 -public class ReceiptContaienrDetail implements Serializable { 24 +@TableName("receipt_container_detail")
  25 +@ApiModel(value="receipt_container_detail对象", description="入库组盘详情")
  26 +public class ReceiptContainerDetail implements Serializable {
27 private static final long serialVersionUID = 1L; 27 private static final long serialVersionUID = 1L;
28 28
29 /**主键*/ 29 /**主键*/
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/mapper/ReceiptContaienrDetailMapper.java renamed to jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/mapper/ReceiptContainerDetailMapper.java
@@ -3,7 +3,7 @@ package org.jeecg.modules.wms.receipt.receiptContainerHeader.mapper; @@ -3,7 +3,7 @@ package org.jeecg.modules.wms.receipt.receiptContainerHeader.mapper;
3 import java.util.List; 3 import java.util.List;
4 import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 import org.apache.ibatis.annotations.Param; 5 import org.apache.ibatis.annotations.Param;
6 -import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContaienrDetail; 6 +import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerDetail;
7 7
8 /** 8 /**
9 * @Description: 入库组盘详情 9 * @Description: 入库组盘详情
@@ -11,10 +11,10 @@ import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContai @@ -11,10 +11,10 @@ import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContai
11 * @Date: 2022-11-09 11 * @Date: 2022-11-09
12 * @Version: V1.0 12 * @Version: V1.0
13 */ 13 */
14 -public interface ReceiptContaienrDetailMapper extends BaseMapper<ReceiptContaienrDetail> { 14 +public interface ReceiptContainerDetailMapper extends BaseMapper<ReceiptContainerDetail> {
15 15
16 public boolean deleteByMainId(@Param("mainId") String mainId); 16 public boolean deleteByMainId(@Param("mainId") String mainId);
17 17
18 - public List<ReceiptContaienrDetail> selectByMainId(@Param("mainId") String mainId); 18 + public List<ReceiptContainerDetail> selectByMainId(@Param("mainId") String mainId);
19 19
20 } 20 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/mapper/xml/ReceiptContaienrDetailMapper.xml
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> 2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 -<mapper namespace="org.jeecg.modules.wms.receipt.receiptContainerHeader.mapper.ReceiptContaienrDetailMapper"> 3 +<mapper namespace="org.jeecg.modules.wms.receipt.receiptContainerHeader.mapper.ReceiptContainerDetailMapper">
4 4
5 <delete id="deleteByMainId" parameterType="java.lang.String"> 5 <delete id="deleteByMainId" parameterType="java.lang.String">
6 DELETE 6 DELETE
7 - FROM receipt_contaienr_detail 7 + FROM receipt_Container_detail
8 WHERE 8 WHERE
9 receipt_container_id = #{mainId} 9 receipt_container_id = #{mainId}
10 </delete> 10 </delete>
11 11
12 - <select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContaienrDetail"> 12 + <select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerDetail">
13 SELECT * 13 SELECT *
14 - FROM receipt_contaienr_detail 14 + FROM receipt_Container_detail
15 WHERE 15 WHERE
16 receipt_container_id = #{mainId} 16 receipt_container_id = #{mainId}
17 </select> 17 </select>
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/IReceiptContaienrDetailService.java renamed to jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/IReceiptContainerDetailService.java
1 package org.jeecg.modules.wms.receipt.receiptContainerHeader.service; 1 package org.jeecg.modules.wms.receipt.receiptContainerHeader.service;
2 2
3 import com.baomidou.mybatisplus.extension.service.IService; 3 import com.baomidou.mybatisplus.extension.service.IService;
4 -import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContaienrDetail; 4 +import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerDetail;
5 5
6 import java.util.List; 6 import java.util.List;
7 7
@@ -11,7 +11,7 @@ import java.util.List; @@ -11,7 +11,7 @@ import java.util.List;
11 * @Date: 2022-11-09 11 * @Date: 2022-11-09
12 * @Version: V1.0 12 * @Version: V1.0
13 */ 13 */
14 -public interface IReceiptContaienrDetailService extends IService<ReceiptContaienrDetail> { 14 +public interface IReceiptContainerDetailService extends IService<ReceiptContainerDetail> {
15 15
16 - public List<ReceiptContaienrDetail> selectByMainId(String mainId); 16 + public List<ReceiptContainerDetail> selectByMainId(String mainId);
17 } 17 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/impl/ReceiptContaienrDetailServiceImpl.java renamed to jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/impl/ReceiptContainerDetailServiceImpl.java
1 package org.jeecg.modules.wms.receipt.receiptContainerHeader.service.impl; 1 package org.jeecg.modules.wms.receipt.receiptContainerHeader.service.impl;
2 2
3 -import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContaienrDetail;  
4 -import org.jeecg.modules.wms.receipt.receiptContainerHeader.mapper.ReceiptContaienrDetailMapper;  
5 -import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContaienrDetailService; 3 +import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerDetail;
  4 +import org.jeecg.modules.wms.receipt.receiptContainerHeader.mapper.ReceiptContainerDetailMapper;
  5 +import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerDetailService;
6 import org.springframework.stereotype.Service; 6 import org.springframework.stereotype.Service;
7 import java.util.List; 7 import java.util.List;
8 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 8 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -15,13 +15,13 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -15,13 +15,13 @@ import org.springframework.beans.factory.annotation.Autowired;
15 * @Version: V1.0 15 * @Version: V1.0
16 */ 16 */
17 @Service 17 @Service
18 -public class ReceiptContaienrDetailServiceImpl extends ServiceImpl<ReceiptContaienrDetailMapper, ReceiptContaienrDetail> implements IReceiptContaienrDetailService { 18 +public class ReceiptContainerDetailServiceImpl extends ServiceImpl<ReceiptContainerDetailMapper, ReceiptContainerDetail> implements IReceiptContainerDetailService {
19 19
20 @Autowired 20 @Autowired
21 - private ReceiptContaienrDetailMapper receiptContaienrDetailMapper; 21 + private ReceiptContainerDetailMapper receiptContainerDetailMapper;
22 22
23 @Override 23 @Override
24 - public List<ReceiptContaienrDetail> selectByMainId(String mainId) {  
25 - return receiptContaienrDetailMapper.selectByMainId(mainId); 24 + public List<ReceiptContainerDetail> selectByMainId(String mainId) {
  25 + return receiptContainerDetailMapper.selectByMainId(mainId);
26 } 26 }
27 } 27 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/impl/ReceiptContainerHeaderServiceImpl.java
@@ -8,11 +8,11 @@ import org.jeecg.modules.wms.config.container.entity.Container; @@ -8,11 +8,11 @@ import org.jeecg.modules.wms.config.container.entity.Container;
8 import org.jeecg.modules.wms.config.container.service.IContainerService; 8 import org.jeecg.modules.wms.config.container.service.IContainerService;
9 import org.jeecg.modules.wms.config.location.entity.Location; 9 import org.jeecg.modules.wms.config.location.entity.Location;
10 import org.jeecg.modules.wms.config.location.service.ILocationService; 10 import org.jeecg.modules.wms.config.location.service.ILocationService;
11 -import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContaienrDetail; 11 +import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerDetail;
12 import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader; 12 import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader;
13 -import org.jeecg.modules.wms.receipt.receiptContainerHeader.mapper.ReceiptContaienrDetailMapper; 13 +import org.jeecg.modules.wms.receipt.receiptContainerHeader.mapper.ReceiptContainerDetailMapper;
14 import org.jeecg.modules.wms.receipt.receiptContainerHeader.mapper.ReceiptContainerHeaderMapper; 14 import org.jeecg.modules.wms.receipt.receiptContainerHeader.mapper.ReceiptContainerHeaderMapper;
15 -import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContaienrDetailService; 15 +import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerDetailService;
16 import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService; 16 import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService;
17 import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail; 17 import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail;
18 import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptDetailService; 18 import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptDetailService;
@@ -47,11 +47,11 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai @@ -47,11 +47,11 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
47 @Autowired 47 @Autowired
48 private ReceiptContainerHeaderMapper receiptContainerHeaderMapper; 48 private ReceiptContainerHeaderMapper receiptContainerHeaderMapper;
49 @Autowired 49 @Autowired
50 - private ReceiptContaienrDetailMapper receiptContaienrDetailMapper; 50 + private ReceiptContainerDetailMapper receiptContainerDetailMapper;
51 @Resource 51 @Resource
52 private IContainerService containerService; 52 private IContainerService containerService;
53 @Resource 53 @Resource
54 - private IReceiptContaienrDetailService receiptContaienrDetailService; 54 + private IReceiptContainerDetailService receiptContainerDetailService;
55 @Resource 55 @Resource
56 private ILocationService locationService; 56 private ILocationService locationService;
57 @Resource 57 @Resource
@@ -68,7 +68,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai @@ -68,7 +68,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
68 @Override 68 @Override
69 @Transactional 69 @Transactional
70 public void delMain(String id) { 70 public void delMain(String id) {
71 - receiptContaienrDetailMapper.deleteByMainId(id); 71 + receiptContainerDetailMapper.deleteByMainId(id);
72 receiptContainerHeaderMapper.deleteById(id); 72 receiptContainerHeaderMapper.deleteById(id);
73 } 73 }
74 74
@@ -76,7 +76,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai @@ -76,7 +76,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
76 @Transactional 76 @Transactional
77 public void delBatchMain(Collection<? extends Serializable> idList) { 77 public void delBatchMain(Collection<? extends Serializable> idList) {
78 for(Serializable id:idList) { 78 for(Serializable id:idList) {
79 - receiptContaienrDetailMapper.deleteByMainId(id.toString()); 79 + receiptContainerDetailMapper.deleteByMainId(id.toString());
80 receiptContainerHeaderMapper.deleteById(id); 80 receiptContainerHeaderMapper.deleteById(id);
81 } 81 }
82 } 82 }
@@ -107,11 +107,11 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai @@ -107,11 +107,11 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
107 if(container.getStatus().equals(QuantityConstant.STATUS_CONTAINER_LOCK)) { 107 if(container.getStatus().equals(QuantityConstant.STATUS_CONTAINER_LOCK)) {
108 return Result.error("托盘已经锁定,不能生成任务"); 108 return Result.error("托盘已经锁定,不能生成任务");
109 } 109 }
110 - LambdaQueryWrapper<ReceiptContaienrDetail> receiptContaienrDetailLambdaQueryWrapper = Wrappers.lambdaQuery();  
111 - receiptContaienrDetailLambdaQueryWrapper.eq(ReceiptContaienrDetail::getReceiptContainerId, receiptContainerHeader.getId());  
112 - List<ReceiptContaienrDetail> receiptContaienrDetailList =  
113 - receiptContaienrDetailService.list(receiptContaienrDetailLambdaQueryWrapper);  
114 - if(receiptContaienrDetailList.isEmpty()) { 110 + LambdaQueryWrapper<ReceiptContainerDetail> receiptContainerDetailLambdaQueryWrapper = Wrappers.lambdaQuery();
  111 + receiptContainerDetailLambdaQueryWrapper.eq(ReceiptContainerDetail::getReceiptContainerId, receiptContainerHeader.getId());
  112 + List<ReceiptContainerDetail> receiptContainerDetailList =
  113 + receiptContainerDetailService.list(receiptContainerDetailLambdaQueryWrapper);
  114 + if(receiptContainerDetailList.isEmpty()) {
115 return Result.error("id:" + id + "的入库组盘,没有组盘明细,请先组盘!"); 115 return Result.error("id:" + id + "的入库组盘,没有组盘明细,请先组盘!");
116 } 116 }
117 boolean result = containerService.updateStatus(containerCode, 117 boolean result = containerService.updateStatus(containerCode,
@@ -162,7 +162,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai @@ -162,7 +162,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
162 taskHeader.setToLocationCode(toLocaitonCode); 162 taskHeader.setToLocationCode(toLocaitonCode);
163 taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); 163 taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD);
164 taskHeader.setCompanyCode(receiptContainerHeader.getCompanyCode()); 164 taskHeader.setCompanyCode(receiptContainerHeader.getCompanyCode());
165 - taskHeader.setReceiptContaienrHeaderId(receiptContainerHeader.getId()); 165 + taskHeader.setReceiptContainerHeaderId(receiptContainerHeader.getId());
166 taskHeader.setWarehouseCode(warehouseCode); 166 taskHeader.setWarehouseCode(warehouseCode);
167 taskHeader.setZoneCode(zoneCode); 167 taskHeader.setZoneCode(zoneCode);
168 taskHeader.setToPort(receiptContainerHeader.getToPort()); 168 taskHeader.setToPort(receiptContainerHeader.getToPort());
@@ -172,28 +172,28 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai @@ -172,28 +172,28 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
172 } 172 }
173 List<TaskDetail> taskDetailList = new ArrayList<>(); 173 List<TaskDetail> taskDetailList = new ArrayList<>();
174 List<ReceiptDetail> receiptDetailList = new ArrayList<>(); 174 List<ReceiptDetail> receiptDetailList = new ArrayList<>();
175 - for(ReceiptContaienrDetail receiptContaienrDetail : receiptContaienrDetailList) { 175 + for(ReceiptContainerDetail receiptContainerDetail : receiptContainerDetailList) {
176 TaskDetail taskDetail = new TaskDetail(); 176 TaskDetail taskDetail = new TaskDetail();
177 taskDetail.setTaskHeaderId(taskHeader.getId()); 177 taskDetail.setTaskHeaderId(taskHeader.getId());
178 taskDetail.setTaskType(taskHeader.getTaskType()); 178 taskDetail.setTaskType(taskHeader.getTaskType());
179 - taskDetail.setWarehouseCode(receiptContaienrDetail.getWarehouseCode());  
180 - taskDetail.setReceiptId(receiptContaienrDetail.getReceiptId());  
181 - taskDetail.setReceiptDetailId(receiptContaienrDetail.getReceiptDetailId());  
182 - taskDetail.setReceiptContainerDetailId(receiptContaienrDetail.getId());  
183 - taskDetail.setCompanyCode(receiptContaienrDetail.getCompanyCode());  
184 - taskDetail.setMaterialCode(receiptContaienrDetail.getMaterialCode());  
185 - taskDetail.setMaterialName(receiptContaienrDetail.getMaterialName());  
186 - taskDetail.setMaterialSpec(receiptContaienrDetail.getMaterialSpec());  
187 - taskDetail.setMaterialUnit(receiptContaienrDetail.getMaterialUnit());  
188 - taskDetail.setInventoryStatus(receiptContaienrDetail.getInventoryStatus());  
189 - taskDetail.setQty(receiptContaienrDetail.getQty());  
190 - taskDetail.setBatch(receiptContaienrDetail.getBatch());  
191 - taskDetail.setLot(receiptContaienrDetail.getLot());  
192 - taskDetail.setProject(receiptContaienrDetail.getProject()); 179 + taskDetail.setWarehouseCode(receiptContainerDetail.getWarehouseCode());
  180 + taskDetail.setReceiptId(receiptContainerDetail.getReceiptId());
  181 + taskDetail.setReceiptDetailId(receiptContainerDetail.getReceiptDetailId());
  182 + taskDetail.setReceiptContainerDetailId(receiptContainerDetail.getId());
  183 + taskDetail.setCompanyCode(receiptContainerDetail.getCompanyCode());
  184 + taskDetail.setMaterialCode(receiptContainerDetail.getMaterialCode());
  185 + taskDetail.setMaterialName(receiptContainerDetail.getMaterialName());
  186 + taskDetail.setMaterialSpec(receiptContainerDetail.getMaterialSpec());
  187 + taskDetail.setMaterialUnit(receiptContainerDetail.getMaterialUnit());
  188 + taskDetail.setInventoryStatus(receiptContainerDetail.getInventoryStatus());
  189 + taskDetail.setQty(receiptContainerDetail.getQty());
  190 + taskDetail.setBatch(receiptContainerDetail.getBatch());
  191 + taskDetail.setLot(receiptContainerDetail.getLot());
  192 + taskDetail.setProject(receiptContainerDetail.getProject());
193 taskDetailList.add(taskDetail); 193 taskDetailList.add(taskDetail);
194 - ReceiptDetail receiptDetail = receiptDetailService.getById(receiptContaienrDetail.getReceiptDetailId()); 194 + ReceiptDetail receiptDetail = receiptDetailService.getById(receiptContainerDetail.getReceiptDetailId());
195 if(receiptDetail == null) { 195 if(receiptDetail == null) {
196 - throw new ServiceException("根据id:" + receiptContaienrDetail.getReceiptDetailId() + ",没有找到入库单详情"); 196 + throw new ServiceException("根据id:" + receiptContainerDetail.getReceiptDetailId() + ",没有找到入库单详情");
197 } 197 }
198 receiptDetail.setStatus(QuantityConstant.RECEIPT_HEADER_WAIT_SHELF); 198 receiptDetail.setStatus(QuantityConstant.RECEIPT_HEADER_WAIT_SHELF);
199 receiptDetailList.add(receiptDetail); 199 receiptDetailList.add(receiptDetail);
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/receipt/receiving/service/impl/ReceiveServiceImpl.java
@@ -12,13 +12,12 @@ import org.jeecg.modules.wms.config.containerType.entity.ContainerType; @@ -12,13 +12,12 @@ import org.jeecg.modules.wms.config.containerType.entity.ContainerType;
12 import org.jeecg.modules.wms.config.containerType.service.IContainerTypeService; 12 import org.jeecg.modules.wms.config.containerType.service.IContainerTypeService;
13 import org.jeecg.modules.wms.config.material.entity.Material; 13 import org.jeecg.modules.wms.config.material.entity.Material;
14 import org.jeecg.modules.wms.config.material.service.IMaterialService; 14 import org.jeecg.modules.wms.config.material.service.IMaterialService;
15 -import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContaienrDetail; 15 +import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerDetail;
16 import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader; 16 import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader;
17 -import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContaienrDetailService; 17 +import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerDetailService;
18 import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService; 18 import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService;
19 import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail; 19 import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail;
20 import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader; 20 import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader;
21 -import org.jeecg.modules.wms.receipt.receiptHeader.mapper.ReceiptHeaderMapper;  
22 import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptDetailService; 21 import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptDetailService;
23 import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptHeaderService; 22 import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptHeaderService;
24 import org.jeecg.modules.wms.receipt.receiving.domain.Receive; 23 import org.jeecg.modules.wms.receipt.receiving.domain.Receive;
@@ -51,7 +50,7 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; imp @@ -51,7 +50,7 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; imp
51 @Resource 50 @Resource
52 private IContainerTypeService containerTypeService; 51 private IContainerTypeService containerTypeService;
53 @Resource 52 @Resource
54 - private IReceiptContaienrDetailService receiptContaienrDetailService; 53 + private IReceiptContainerDetailService receiptContainerDetailService;
55 @Resource 54 @Resource
56 private IReceiptHeaderService receiptHeaderService; 55 private IReceiptHeaderService receiptHeaderService;
57 56
@@ -126,7 +125,7 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; imp @@ -126,7 +125,7 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; imp
126 } 125 }
127 126
128 List<ReceiptDetail> receiptDetailList = new ArrayList<>(); 127 List<ReceiptDetail> receiptDetailList = new ArrayList<>();
129 - List<ReceiptContaienrDetail> receiptContaienrDetailList = new ArrayList<>(); 128 + List<ReceiptContainerDetail> receiptContainerDetailList = new ArrayList<>();
130 for(Receive receive : receiveList) { 129 for(Receive receive : receiveList) {
131 //待收数量 130 //待收数量
132 BigDecimal qty = receive.getQty(); 131 BigDecimal qty = receive.getQty();
@@ -166,33 +165,33 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; imp @@ -166,33 +165,33 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; imp
166 receiptDetail.setTaskQty(receiptTaskQty); 165 receiptDetail.setTaskQty(receiptTaskQty);
167 receiptDetailList.add(receiptDetail); 166 receiptDetailList.add(receiptDetail);
168 167
169 - LambdaQueryWrapper<ReceiptContaienrDetail> receiptContaienrDetailLambdaQueryWrapper = Wrappers.lambdaQuery();  
170 - receiptContaienrDetailLambdaQueryWrapper.eq(ReceiptContaienrDetail::getReceiptId, receiptDetail.getReceiptId())  
171 - .eq(ReceiptContaienrDetail::getReceiptDetailId, receiptDetail.getId())  
172 - .eq(ReceiptContaienrDetail::getReceiptContainerId, receiptContainerHeader.getId());  
173 - ReceiptContaienrDetail receiptContaienrDetail = receiptContaienrDetailService.getOne(receiptContaienrDetailLambdaQueryWrapper);  
174 - if(receiptContaienrDetail != null) { 168 + LambdaQueryWrapper<ReceiptContainerDetail> receiptContainerDetailLambdaQueryWrapper = Wrappers.lambdaQuery();
  169 + receiptContainerDetailLambdaQueryWrapper.eq(ReceiptContainerDetail::getReceiptId, receiptDetail.getReceiptId())
  170 + .eq(ReceiptContainerDetail::getReceiptDetailId, receiptDetail.getId())
  171 + .eq(ReceiptContainerDetail::getReceiptContainerId, receiptContainerHeader.getId());
  172 + ReceiptContainerDetail receiptContainerDetail = receiptContainerDetailService.getOne(receiptContainerDetailLambdaQueryWrapper);
  173 + if(receiptContainerDetail != null) {
175 //如果是已经组过的详情,那么直接相加收货数量 174 //如果是已经组过的详情,那么直接相加收货数量
176 - receiptContaienrDetail.setQty(receiptContaienrDetail.getQty().add(taskQty));  
177 - receiptContaienrDetailService.updateById(receiptContaienrDetail); 175 + receiptContainerDetail.setQty(receiptContainerDetail.getQty().add(taskQty));
  176 + receiptContainerDetailService.updateById(receiptContainerDetail);
178 } else { 177 } else {
179 - receiptContaienrDetail = new ReceiptContaienrDetail();  
180 - receiptContaienrDetail.setCompanyCode(receiptDetail.getCompanyCode());  
181 - receiptContaienrDetail.setReceiptDetailId(receiptDetail.getId());  
182 - receiptContaienrDetail.setReceiptId(receiptDetail.getReceiptId());  
183 - receiptContaienrDetail.setReceiptCode(receiptDetail.getReceiptCode());  
184 - receiptContaienrDetail.setReceiptContainerId(receiptContainerHeader.getId());  
185 - receiptContaienrDetail.setWarehouseCode(receiptDetail.getWarehouseCode());  
186 - receiptContaienrDetail.setMaterialCode(receiptDetail.getMaterialCode());  
187 - receiptContaienrDetail.setMaterialName(receiptDetail.getMaterialName());  
188 - receiptContaienrDetail.setMaterialSpec(receiptDetail.getMaterialSpec());  
189 - receiptContaienrDetail.setMaterialUnit(receiptDetail.getMaterialUnit());  
190 - receiptContaienrDetail.setQty(taskQty);  
191 - receiptContaienrDetail.setBatch(receiptDetail.getBatch());  
192 - receiptContaienrDetail.setLot(receiptDetail.getLot());  
193 - receiptContaienrDetail.setProject(receiptDetail.getProject());  
194 - receiptContaienrDetail.setInventoryStatus(receiptDetail.getInventoryStatus());  
195 - receiptContaienrDetailList.add(receiptContaienrDetail); 178 + receiptContainerDetail = new ReceiptContainerDetail();
  179 + receiptContainerDetail.setCompanyCode(receiptDetail.getCompanyCode());
  180 + receiptContainerDetail.setReceiptDetailId(receiptDetail.getId());
  181 + receiptContainerDetail.setReceiptId(receiptDetail.getReceiptId());
  182 + receiptContainerDetail.setReceiptCode(receiptDetail.getReceiptCode());
  183 + receiptContainerDetail.setReceiptContainerId(receiptContainerHeader.getId());
  184 + receiptContainerDetail.setWarehouseCode(receiptDetail.getWarehouseCode());
  185 + receiptContainerDetail.setMaterialCode(receiptDetail.getMaterialCode());
  186 + receiptContainerDetail.setMaterialName(receiptDetail.getMaterialName());
  187 + receiptContainerDetail.setMaterialSpec(receiptDetail.getMaterialSpec());
  188 + receiptContainerDetail.setMaterialUnit(receiptDetail.getMaterialUnit());
  189 + receiptContainerDetail.setQty(taskQty);
  190 + receiptContainerDetail.setBatch(receiptDetail.getBatch());
  191 + receiptContainerDetail.setLot(receiptDetail.getLot());
  192 + receiptContainerDetail.setProject(receiptDetail.getProject());
  193 + receiptContainerDetail.setInventoryStatus(receiptDetail.getInventoryStatus());
  194 + receiptContainerDetailList.add(receiptContainerDetail);
196 } 195 }
197 196
198 } 197 }
@@ -201,8 +200,8 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; imp @@ -201,8 +200,8 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; imp
201 throw new ServiceException("批量更新入库单详情失败"); 200 throw new ServiceException("批量更新入库单详情失败");
202 } 201 }
203 202
204 - if(receiptContaienrDetailList.size() > 0) {  
205 - result = receiptContaienrDetailService.saveBatch(receiptContaienrDetailList); 203 + if(receiptContainerDetailList.size() > 0) {
  204 + result = receiptContainerDetailService.saveBatch(receiptContainerDetailList);
206 if (!result) { 205 if (!result) {
207 throw new ServiceException("保存入库组盘详情失败"); 206 throw new ServiceException("保存入库组盘详情失败");
208 } 207 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/entity/TaskHeader.java
@@ -37,7 +37,7 @@ public class TaskHeader implements Serializable { @@ -37,7 +37,7 @@ public class TaskHeader implements Serializable {
37 /**前置任务号*/ 37 /**前置任务号*/
38 @Excel(name = "入库组盘ID", width = 15) 38 @Excel(name = "入库组盘ID", width = 15)
39 @ApiModelProperty(value = "入库组盘ID") 39 @ApiModelProperty(value = "入库组盘ID")
40 - private Integer receiptContaienrHeaderId; 40 + private Integer receiptContainerHeaderId;
41 /**仓库*/ 41 /**仓库*/
42 @Excel(name = "仓库", width = 15) 42 @Excel(name = "仓库", width = 15)
43 @ApiModelProperty(value = "仓库") 43 @ApiModelProperty(value = "仓库")
@@ -98,6 +98,9 @@ public class TaskHeader implements Serializable { @@ -98,6 +98,9 @@ public class TaskHeader implements Serializable {
98 @Excel(name = "目标出入口", width = 15) 98 @Excel(name = "目标出入口", width = 15)
99 @ApiModelProperty(value = "目标出入口") 99 @ApiModelProperty(value = "目标出入口")
100 private String toPort; 100 private String toPort;
  101 + @Excel(name = "重量", width = 15)
  102 + @ApiModelProperty(value = "重量")
  103 + private Integer weight;
101 /**备用字段1*/ 104 /**备用字段1*/
102 @Excel(name = "备用字段1", width = 15) 105 @Excel(name = "备用字段1", width = 15)
103 @ApiModelProperty(value = "备用字段1") 106 @ApiModelProperty(value = "备用字段1")
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/ITaskHeaderService.java
1 package org.jeecg.modules.wms.task.taskHeader.service; 1 package org.jeecg.modules.wms.task.taskHeader.service;
2 2
3 import com.baomidou.mybatisplus.extension.service.IService; 3 import com.baomidou.mybatisplus.extension.service.IService;
  4 +import org.jeecg.common.api.vo.Result;
4 import org.jeecg.modules.wms.config.location.entity.Location; 5 import org.jeecg.modules.wms.config.location.entity.Location;
5 import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; 6 import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader;
6 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
@@ -19,12 +20,20 @@ public interface ITaskHeaderService extends IService&lt;TaskHeader&gt; { @@ -19,12 +20,20 @@ public interface ITaskHeaderService extends IService&lt;TaskHeader&gt; {
19 /** 20 /**
20 * 删除一对多 21 * 删除一对多
21 */ 22 */
22 - public void delMain (String id); 23 + void delMain (String id);
23 24
24 /** 25 /**
25 * 批量删除一对多 26 * 批量删除一对多
26 */ 27 */
27 - public void delBatchMain (Collection<? extends Serializable> idList); 28 + void delBatchMain (Collection<? extends Serializable> idList);
28 29
29 - public boolean haveUncompleteTaskInNear(Location location); 30 + boolean haveUncompleteTaskInNear(Location location);
  31 +
  32 + Result createTransferTask(String fromLocationCode, String toLocationCode, String warehouseCode);
  33 +
  34 + TaskHeader getUnCompleteTaskByFromLocationCode(String fromLocationCode, String warehouseCode);
  35 +
  36 + TaskHeader getUnCompleteTaskByToLocationCode(String toLocationCode, String warehouseCode);
  37 +
  38 + TaskHeader getTaskHeaderByLocationCode(String locationCode);
30 } 39 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
1 package org.jeecg.modules.wms.task.taskHeader.service.impl; 1 package org.jeecg.modules.wms.task.taskHeader.service.impl;
2 2
  3 +import com.aliyun.oss.ServiceException;
  4 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  5 +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
  6 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  7 +import org.jeecg.common.api.vo.Result;
  8 +import org.jeecg.modules.wms.config.container.entity.Container;
  9 +import org.jeecg.modules.wms.config.container.service.IContainerService;
3 import org.jeecg.modules.wms.config.location.entity.Location; 10 import org.jeecg.modules.wms.config.location.entity.Location;
4 import org.jeecg.modules.wms.config.location.service.ILocationService; 11 import org.jeecg.modules.wms.config.location.service.ILocationService;
5 import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; 12 import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader;
6 import org.jeecg.modules.wms.task.taskHeader.mapper.TaskDetailMapper; 13 import org.jeecg.modules.wms.task.taskHeader.mapper.TaskDetailMapper;
7 import org.jeecg.modules.wms.task.taskHeader.mapper.TaskHeaderMapper; 14 import org.jeecg.modules.wms.task.taskHeader.mapper.TaskHeaderMapper;
8 import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService; 15 import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService;
  16 +import org.jeecg.utils.StringUtils;
9 import org.jeecg.utils.constant.QuantityConstant; 17 import org.jeecg.utils.constant.QuantityConstant;
10 import org.springframework.stereotype.Service; 18 import org.springframework.stereotype.Service;
11 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 19 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -32,6 +40,10 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -32,6 +40,10 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
32 private TaskDetailMapper taskDetailMapper; 40 private TaskDetailMapper taskDetailMapper;
33 @Resource 41 @Resource
34 private ILocationService locationService; 42 private ILocationService locationService;
  43 + @Resource
  44 + private ITaskHeaderService taskHeaderService;
  45 + @Resource
  46 + private IContainerService containerService;
35 47
36 @Override 48 @Override
37 @Transactional 49 @Transactional
@@ -67,4 +79,175 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -67,4 +79,175 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
67 return false; 79 return false;
68 } 80 }
69 81
  82 + @Override
  83 + @Transactional(rollbackFor = Exception.class)
  84 + public Result createTransferTask(String fromLocationCode, String toLocationCode, String warehouseCode) {
  85 + Location fromLocation = locationService.getLocationByCode(fromLocationCode, warehouseCode);
  86 + Location toLocation = locationService.getLocationByCode(toLocationCode, warehouseCode);
  87 + Integer preTaskNo = 0;
  88 + // 1. 判断起点库位和终点库位是否满足移库条件
  89 + if(fromLocation == null) {
  90 + return Result.error("源库位:" + fromLocationCode + "未找到");
  91 + }
  92 + if (!QuantityConstant.STATUS_LOCATION_EMPTY.equals(fromLocation.getStatus())) {
  93 + return Result.error("源库位:" + fromLocationCode + "状态非空闲");
  94 + }
  95 + if (StringUtils.isEmpty(fromLocation.getContainerCode())) {
  96 + return Result.error("源库位:" + fromLocationCode + "不存在托盘");
  97 + }
  98 + //这里增加组盘校验,如果此托盘存在未完成的组盘数据,则不能移库
  99 + //校验入库组盘
  100 +// if (inventoryHeaderService.getUncompleteReceiptContainer(fromLocationCode, warehouseCode) > 0) {
  101 +// return Result.error("源库位:" + fromLocationCode + "存在入库组盘,不能移库");
  102 +// }
  103 +// if (inventoryHeaderService.getUncompleteShipmentContainer(toLocationCode, warehouseCode) > 0) {
  104 +// return Result.error("源库位:" + toLocationCode + "存在出库组盘,不能移库");
  105 +// }
  106 + if (toLocation == null) {
  107 + return Result.error("目标库位:" + toLocationCode + "未找到");
  108 + }
  109 + if (!QuantityConstant.STATUS_LOCATION_EMPTY.equals(toLocation.getStatus())) {
  110 + return Result.error("目标库位:" + toLocationCode + "状态非空闲");
  111 + }
  112 + if (StringUtils.isNotEmpty(toLocation.getContainerCode())) {
  113 + return Result.error("目标库位:" + toLocationCode + "存在托盘");
  114 + }
  115 + if (taskHeaderService.haveUncompleteTaskInNear(toLocation)) {
  116 + return Result.error("目标库位:" + toLocationCode + "旁边存在任务,请完成任务以后再分配");
  117 + }
  118 + if(!fromLocation.getRoadWay().equals(toLocation.getRoadWay())) {
  119 + return Result.error("目标库位和源库位不在同一个巷道");
  120 + }
  121 + if(!fromLocation.getHigh().equals(toLocation.getHigh())) {
  122 + return Result.error("目标库位和源库位高度不一样");
  123 + }
  124 + if(!fromLocation.getLocationTypeCode().equals(toLocation.getLocationTypeCode())) {
  125 + return Result.error("目标库位和源库位库位类型不一样");
  126 + }
  127 + if(!fromLocation.getZoneCode().equals(toLocation.getZoneCode())) {
  128 + return Result.error("目标库位和源库位不在同一个区域");
  129 + }
  130 + // 2. 记住移库前的容器类型,因为空托盘组无法区分
  131 + Container container = containerService.getContainerByCode(fromLocation.getContainerCode(), warehouseCode);
  132 + container.setLastStatus(container.getStatus());
  133 + containerService.updateById(container);
  134 +
  135 + // 3. 判断源库位旁边有托盘但是没有任务,那么不允许移库
  136 + if(fromLocation.getRowFlag() == QuantityConstant.ROW_OUT) {
  137 + //内侧库位
  138 + Location location1 = locationService.getNear(fromLocation);
  139 + String locationCode = location1.getCode();
  140 + if(StringUtils.isNotEmpty(location1.getContainerCode())) {
  141 + TaskHeader taskHeader = getUnCompleteTaskByFromLocationCode(fromLocationCode, warehouseCode);
  142 + if(taskHeader != null) {
  143 + preTaskNo = taskHeader.getId();
  144 + } else {
  145 + return Result.error("源库位:" + fromLocationCode + "旁边库位有托盘无法移库");
  146 + }
  147 + } else {
  148 + TaskHeader taskHeader = getUnCompleteTaskByToLocationCode(locationCode, warehouseCode);
  149 + if(taskHeader != null) {
  150 + return Result.error("源库位:" + fromLocationCode + "旁边库位有任务无法移库");
  151 + }
  152 + }
  153 + }
  154 +
  155 + // 4. 判断源库位旁边有托盘但是没有任务,那么不允许移库
  156 + TaskHeader taskHeader = new TaskHeader();
  157 + taskHeader.setWarehouseCode(warehouseCode);
  158 + taskHeader.setTaskType(QuantityConstant.TASK_TYPE_TRANSFER);
  159 + taskHeader.setInnernalTaskType(QuantityConstant.TASK_INTENERTYPE_WORK);
  160 + taskHeader.setZoneCode(fromLocation.getZoneCode());
  161 + taskHeader.setContainerCode(fromLocation.getContainerCode());
  162 + taskHeader.setFromLocationCode(fromLocationCode);
  163 + taskHeader.setToLocationCode(toLocationCode);
  164 + taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD);
  165 + taskHeader.setPreTaskNo(preTaskNo);
  166 + boolean result = taskHeaderService.save(taskHeader);
  167 + if(!result) {
  168 + throw new ServiceException("创建任务失败");
  169 + }
  170 +
  171 + result = locationService.updateStatus(fromLocationCode,
  172 + QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode);
  173 + if(!result) {
  174 + throw new ServiceException("库位“ + fromLocationCode + “更新失败");
  175 + }
  176 + result = locationService.updateStatus(toLocationCode,
  177 + QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode);
  178 + if(!result) {
  179 + throw new ServiceException("库位“ + toLocationCode + “更新失败");
  180 + }
  181 + result = containerService.updateLocationCodeAndStatus(fromLocation.getContainerCode(),
  182 + fromLocationCode, QuantityConstant.STATUS_CONTAINER_LOCK, warehouseCode);
  183 + if(!result) {
  184 + throw new ServiceException("容器“ + fromLocation.getContainerCode() + “更新失败");
  185 + }
  186 +
  187 +// LambdaUpdateWrapper<InventoryDetail> detailLambdaUpdateWrapper = Wrappers.lambdaUpdate();
  188 +// detailLambdaUpdateWrapper.eq(InventoryDetail::getWarehouseCode, warehouseCode);
  189 +// detailLambdaUpdateWrapper.eq(InventoryDetail::getLocationCode, sourceLocationCode);
  190 +// List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(detailLambdaUpdateWrapper);
  191 +// for (InventoryDetail inventoryDetail : inventoryDetailList) {
  192 +// TaskDetail taskDetail = new TaskDetail();
  193 +// taskDetail.setTaskId(taskHeader.getId());
  194 +// taskDetail.setTaskType(taskHeader.getTaskType());
  195 +// taskDetail.setInternalTaskType(taskHeader.getInternalTaskType());
  196 +// taskDetail.setWarehouseCode(taskHeader.getWarehouseCode());;
  197 +// taskDetail.setCompanyCode(inventoryDetail.getCompanyCode());
  198 +// taskDetail.setMaterialCode(inventoryDetail.getMaterialCode());
  199 +// taskDetail.setMaterialName(inventoryDetail.getMaterialName());
  200 +// taskDetail.setMaterialSpec(inventoryDetail.getMaterialSpec());
  201 +// taskDetail.setMaterialUnit(inventoryDetail.getMaterialUnit());
  202 +// taskDetail.setQty(inventoryDetail.getQty());
  203 +// taskDetail.setFromLocation(inventoryDetail.getLocationCode());
  204 +// taskDetail.setToLocation(desLocationCode);
  205 +// taskDetail.setContainerCode(inventoryDetail.getContainerCode());
  206 +// taskDetail.setStatus(QuantityConstant.TASK_STATUS_BUILD);
  207 +// taskDetail.setReferenceCode(inventoryDetail.getReferCode());
  208 +// taskDetail.setAttribute1(inventoryDetail.getAttribute1());
  209 +// taskDetail.setAttribute2(inventoryDetail.getAttribute2());
  210 +// taskDetail.setAttribute3(inventoryDetail.getAttribute3());
  211 +// taskDetail.setBatch(inventoryDetail.getBatch());
  212 +// taskDetail.setLot(inventoryDetail.getLot());
  213 +// taskDetail.setProjectNo(inventoryDetail.getProjectNo());
  214 +// taskDetail.setManufactureDate(inventoryDetail.getManufactureDate());
  215 +// taskDetail.setExpirationDate(inventoryDetail.getExpirationDate());
  216 +// taskDetail.setAgingDate(inventoryDetail.getAgingDate());
  217 +// taskDetail.setInventorySts(inventoryDetail.getInventorySts());
  218 +// taskDetail.setFromInventoryId(inventoryDetail.getId());
  219 +// taskDetail.setToInventoryId(inventoryDetail.getId());
  220 +// if (!taskDetailService.save(taskDetail) || !inventoryDetailService.updateById(inventoryDetail)) {
  221 +// throw new ServiceException("创建任务失败");
  222 +// }
  223 +// }
  224 +
  225 + return Result.OK(taskHeader.getId());
  226 + }
  227 +
  228 + @Override
  229 + public TaskHeader getUnCompleteTaskByFromLocationCode(String fromLocationCode, String warehouseCode) {
  230 + LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
  231 + taskHeaderLambdaQueryWrapper.eq(TaskHeader::getFromLocationCode, fromLocationCode)
  232 + .eq(TaskHeader::getWarehouseCode, warehouseCode)
  233 + .lt(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_COMPLETED);
  234 + TaskHeader taskHeader = taskHeaderService.getOne(taskHeaderLambdaQueryWrapper);
  235 + return taskHeader;
  236 + }
  237 +
  238 + @Override
  239 + public TaskHeader getUnCompleteTaskByToLocationCode(String toLocationCode, String warehouseCode) {
  240 + LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
  241 + taskHeaderLambdaQueryWrapper.eq(TaskHeader::getToLocationCode, toLocationCode)
  242 + .eq(TaskHeader::getWarehouseCode, warehouseCode)
  243 + .lt(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_COMPLETED);
  244 + TaskHeader taskHeader = taskHeaderService.getOne(taskHeaderLambdaQueryWrapper);
  245 + return taskHeader;
  246 + }
  247 +
  248 + @Override
  249 + public TaskHeader getTaskHeaderByLocationCode(String locationCode) {
  250 + return null;
  251 + }
  252 +
70 } 253 }
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/utils/constant/QuantityConstant.java
@@ -398,7 +398,9 @@ public class QuantityConstant { @@ -398,7 +398,9 @@ public class QuantityConstant {
398 /** AGV任务完成 */ 398 /** AGV任务完成 */
399 public static final int AGV_TASK_STATUS_COMPLETED = 100; 399 public static final int AGV_TASK_STATUS_COMPLETED = 100;
400 400
  401 + /** 深库位 */
401 public static final int ROW_OUT = 1; 402 public static final int ROW_OUT = 1;
  403 + /** 浅库位 */
402 public static final int ROW_IN = 0; 404 public static final int ROW_IN = 0;
403 405
404 //16、请求类型 406 //16、请求类型
@@ -446,6 +448,8 @@ public class QuantityConstant { @@ -446,6 +448,8 @@ public class QuantityConstant {
446 public static final int STATION_PICK = 3; 448 public static final int STATION_PICK = 3;
447 public static final int STATION_PICK_AND_OUT = 4; 449 public static final int STATION_PICK_AND_OUT = 4;
448 450
  451 + public static final String EMPTY_STRING = "";
  452 +
449 public static final String STATUS_CONTAINER_EMPTY = "empty"; 453 public static final String STATUS_CONTAINER_EMPTY = "empty";
450 public static final String STATUS_CONTAINER_LOCK = "lock"; 454 public static final String STATUS_CONTAINER_LOCK = "lock";
451 public static final String STATUS_CONTAINER_SOME = "some"; 455 public static final String STATUS_CONTAINER_SOME = "some";
@@ -460,6 +464,7 @@ public class QuantityConstant { @@ -460,6 +464,7 @@ public class QuantityConstant {
460 public static final String RULE_CONNECT_WCS = "connectWcs"; 464 public static final String RULE_CONNECT_WCS = "connectWcs";
461 public static final String RULE_ALLOCATION = "allocationRule"; 465 public static final String RULE_ALLOCATION = "allocationRule";
462 public static final String DOUBLE_FORK_RESERVE_LOCATION = "doubleForkReserveLocation"; 466 public static final String DOUBLE_FORK_RESERVE_LOCATION = "doubleForkReserveLocation";
  467 + public static final String DOUBLE_FORK_SEARCH_LOCATION = "doubleForkSearchLocation";
463 public static final String EMPTY_CONTAINER_WEIGHT = "emptyWeight"; 468 public static final String EMPTY_CONTAINER_WEIGHT = "emptyWeight";
464 public static final String WAREHOUSING_WEIGHING = "warehousingWeighing"; 469 public static final String WAREHOUSING_WEIGHING = "warehousingWeighing";
465 public static final String EXCEPTION_TO_CACHE = "exceptionToCache"; 470 public static final String EXCEPTION_TO_CACHE = "exceptionToCache";
@@ -544,6 +549,9 @@ public class QuantityConstant { @@ -544,6 +549,9 @@ public class QuantityConstant {
544 public static final String BILL_TYPE_NAME_RN = "退货通知单"; 549 public static final String BILL_TYPE_NAME_RN = "退货通知单";
545 public static final String BILL_TYPE_NAME_SO = "出库申请单"; 550 public static final String BILL_TYPE_NAME_SO = "出库申请单";
546 551
  552 + public static final int STATUS_ENABLE = 1;
  553 + public static final int STATUS_DISABLE = 0;
  554 +
547 555
548 public static final String EER_TABLE_OTHERSHIPMENT = "STK_MisDelivery"; 556 public static final String EER_TABLE_OTHERSHIPMENT = "STK_MisDelivery";
549 /*直接调拨单回传*/ 557 /*直接调拨单回传*/
@@ -637,8 +645,6 @@ public class QuantityConstant { @@ -637,8 +645,6 @@ public class QuantityConstant {
637 public static final int AGV_TASK_NOT_CREATE = 0; //没有创建过AGV任务 645 public static final int AGV_TASK_NOT_CREATE = 0; //没有创建过AGV任务
638 public static final int AGV_TASK_ALREADY_CREATE = 1; //创建过AGV任务 646 public static final int AGV_TASK_ALREADY_CREATE = 1; //创建过AGV任务
639 647
640 - public static final String EMPTY_STRING = "";  
641 -  
642 // 第三方打印工具 648 // 第三方打印工具
643 public static final String PRINT_SERVICE = "PRINT_SERVICE"; 649 public static final String PRINT_SERVICE = "PRINT_SERVICE";
644 650