Commit 07cd7e15a5ffa61075dc21a88ac13a6a0828eff9

Authored by 肖超群
1 parent de85b932

增加配置选项,判断是否允许呼叫料盒后,没有任务详情

ant-design-vue-jeecg/src/views/system/config/ParameterConfigurationList.vue
... ... @@ -38,9 +38,9 @@
38 38  
39 39 <!-- 操作按钮区域 -->
40 40 <div class="table-operator">
41   - <a-button @click="handleAdd" v-has="'ParameterConfiguration:add'" type="primary" icon="plus">新增</a-button>
42   - <a-button v-has="'ParameterConfiguration:export'" type="primary" icon="download" @click="handleExportXls('参数配置')">导出</a-button>
43   - <a-upload v-has="'ParameterConfiguration:import'" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
  41 + <a-button @click="handleAdd" v-has="'parameterConfiguration:add'" type="primary" icon="plus">新增</a-button>
  42 + <a-button v-has="'parameterConfiguration:export'" type="primary" icon="download" @click="handleExportXls('参数配置')">导出</a-button>
  43 + <a-upload v-has="'parameterConfiguration:import'" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
44 44 @change="handleImportExcel">
45 45 <a-button type="primary" icon="import">导入</a-button>
46 46 </a-upload>
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/parameterConfiguration/service/IParameterConfigurationService.java
1 1 package org.jeecg.modules.wms.config.parameterConfiguration.service;
2 2  
3   -import com.baomidou.mybatisplus.extension.service.IService;
4 3 import org.jeecg.modules.wms.config.parameterConfiguration.entity.ParameterConfiguration;
5 4  
  5 +import com.baomidou.mybatisplus.extension.service.IService;
  6 +
6 7 /**
7 8 * @Description: 参数配置
8 9 * @Author: jeecg-boot
... ... @@ -11,5 +12,7 @@ import org.jeecg.modules.wms.config.parameterConfiguration.entity.ParameterConfi
11 12 */
12 13 public interface IParameterConfigurationService extends IService<ParameterConfiguration> {
13 14  
14   - public String getValueByCode(String code);
  15 + String getValueByCode(String code);
  16 +
  17 + int getValueIntByCode(String code);
15 18 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/parameterConfiguration/service/impl/ParameterConfigurationServiceImpl.java
1 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;
6 3 import org.jeecg.modules.wms.config.parameterConfiguration.entity.ParameterConfiguration;
7 4 import org.jeecg.modules.wms.config.parameterConfiguration.mapper.ParameterConfigurationMapper;
8 5 import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService;
9 6 import org.springframework.stereotype.Service;
10 7  
  8 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  9 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
11 10 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
12 11  
13 12 /**
... ... @@ -30,4 +29,17 @@ public class ParameterConfigurationServiceImpl extends ServiceImpl&lt;ParameterConf
30 29 String value = parameterConfiguration.getValue();
31 30 return value;
32 31 }
  32 +
  33 + @Override
  34 + public int getValueIntByCode(String code) {
  35 + LambdaQueryWrapper<ParameterConfiguration> parameterConfigurationLambdaQueryWrapper = Wrappers.lambdaQuery();
  36 + parameterConfigurationLambdaQueryWrapper.eq(ParameterConfiguration::getCode, code);
  37 + ParameterConfiguration parameterConfiguration = getOne(parameterConfigurationLambdaQueryWrapper);
  38 + if (parameterConfiguration == null) {
  39 + return 0;
  40 + }
  41 + String value = parameterConfiguration.getValue();
  42 + int valueInt = Integer.parseInt(value);
  43 + return valueInt;
  44 + }
33 45 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... ... @@ -1011,17 +1011,21 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
1011 1011 return Result.ok("入库任务(" + taskHeader.getId() + ")已经是完成的!");
1012 1012 }
1013 1013 if (taskDetailList.isEmpty()) {
1014   -// return Result.error("完成入库任务时, 入库任务明细为空");
1015   - Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), taskType, containerCode, fromLocationCode,
1016   - toLocationCode, warehouseCode);
1017   - if (!result.isSuccess()) {
1018   - throw new JeecgBootException(result.getMessage());
1019   - }
1020   - success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId());
1021   - if (!success) {
1022   - throw new JeecgBootException("完成入库任务时,保存任务头失败");
  1014 + int allow = parameterConfigurationService.getValueIntByCode(QuantityConstant.RULE_CALL_BOX_ALLOW_EMPTY);
  1015 + if (allow == QuantityConstant.RULE_ALLOW_EMPTY) {
  1016 + Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), taskType, containerCode,
  1017 + fromLocationCode, toLocationCode, warehouseCode);
  1018 + if (!result.isSuccess()) {
  1019 + throw new JeecgBootException(result.getMessage());
  1020 + }
  1021 + success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId());
  1022 + if (!success) {
  1023 + throw new JeecgBootException("完成入库任务时,保存任务头失败");
  1024 + }
  1025 + return Result.ok("完成入库任务");
  1026 + } else {
  1027 + return Result.error("完成入库任务时, 入库任务明细为空");
1023 1028 }
1024   - return Result.ok("完成入库任务");
1025 1029 }
1026 1030 Location toLocation = locationService.getLocationByCode(toLocationCode, warehouseCode);
1027 1031 if (toLocation == null) {
... ... @@ -1210,17 +1214,21 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
1210 1214 }
1211 1215 // 如果任务详情为空,那么就是呼叫料盒,但是又没入库进去。
1212 1216 if (taskDetailList.isEmpty()) {
1213   -// return Result.error("完成出库任务,任务明细为空");
1214   - Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), taskType, containerCode, fromLocationCode,
1215   - toLocationCode, warehouseCode);
1216   - if (!result.isSuccess()) {
1217   - throw new JeecgBootException(result.getMessage());
1218   - }
1219   - success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId());
1220   - if (!success) {
1221   - throw new JeecgBootException("完成出库任务,保存任务头失败");
  1217 + int allow = parameterConfigurationService.getValueIntByCode(QuantityConstant.RULE_CALL_BOX_ALLOW_EMPTY);
  1218 + if (allow == QuantityConstant.RULE_ALLOW_EMPTY) {
  1219 + Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), taskType, containerCode,
  1220 + fromLocationCode, toLocationCode, warehouseCode);
  1221 + if (!result.isSuccess()) {
  1222 + throw new JeecgBootException(result.getMessage());
  1223 + }
  1224 + success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId());
  1225 + if (!success) {
  1226 + throw new JeecgBootException("完成出库任务,保存任务头失败");
  1227 + }
  1228 + return Result.ok("完成出库任务");
  1229 + } else {
  1230 + return Result.error("完成出库任务,任务明细为空");
1222 1231 }
1223   - return Result.ok("完成出库任务");
1224 1232 }
1225 1233 if (StringUtils.isEmpty(fromLocationCode)) {
1226 1234 return Result.error("完成出库任务" + taskHeader.getId() + "没有起始库位,执行中止");
... ...
huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java
... ... @@ -448,6 +448,7 @@ public class QuantityConstant {
448 448 public static final String RULE_TASK_LOCATION = "taskLocationRule";
449 449 public static final String RULE_CONNECT_WCS = "connectWcs";
450 450 public static final String RULE_ALLOCATION = "allocationRule";
  451 + public static final String RULE_CALL_BOX_ALLOW_EMPTY = "callBoxAllowEmpty";
451 452 public static final String DOUBLE_FORK_RESERVE_LOCATION = "doubleForkReserveLocation";
452 453 public static final String DOUBLE_FORK_SEARCH_LOCATION = "doubleForkSearchLocation";
453 454 public static final String WAREHOUSING_WEIGHING = "warehousingWeighing";
... ... @@ -472,6 +473,9 @@ public class QuantityConstant {
472 473 public static final int RULE_TASK_PICK_SHIPMENT = 1;
473 474 public static final int RULE_TASK_WHOLE_SHIPMENT = 0;
474 475  
  476 + public static final int RULE_ALLOW_EMPTY = 1;
  477 + public static final int RULE_NOT_ALLOW_EMPTY = 0;
  478 +
475 479 public static final int RULE_WCS_CONNECT = 1;
476 480 public static final int RULE_WCS_DISCONNECT = 0;
477 481  
... ...