add:增加任务校验;
This commit is contained in:
@@ -169,7 +169,7 @@ public class BsrealStorattrServiceImpl extends ServiceImpl<BsrealStorattrMapper,
|
||||
LambdaQueryWrapper<BsrealStorattr> queryWrapper = new LambdaQueryWrapper<>(BsrealStorattr.class)
|
||||
.select(BsrealStorattr::getStor_id, BsrealStorattr::getStor_code, BsrealStorattr::getStor_name)
|
||||
.eq(StrUtil.isNotEmpty(is_materialstore),BsrealStorattr::getIs_materialstore,is_materialstore)
|
||||
.eq(StrUtil.isNotEmpty(is_virtualstore),BsrealStorattr::getIs_virtualstore,is_virtualstore)
|
||||
.ne(BsrealStorattr::getIs_virtualstore,"1")
|
||||
.eq(StrUtil.isNotEmpty(is_semi_finished),BsrealStorattr::getIs_materialstore,is_semi_finished)
|
||||
.eq(StrUtil.isNotEmpty(is_productstore),BsrealStorattr::getIs_materialstore,is_productstore)
|
||||
.eq(StrUtil.isNotEmpty(is_attachment),BsrealStorattr::getIs_materialstore,is_attachment)
|
||||
|
||||
@@ -29,7 +29,7 @@ public enum StatusEnum {
|
||||
*/
|
||||
IOBILL_TYPE_IN(ForkMap.of("生产入库", "0001", "inStorageTask", "调拨入库", "0004", "inStorageTask", "退货入库", "0002", "inStorageTask", "拣选回库",
|
||||
"13", "inStorageTask", "盘点入库", "14", "inStorageTask", "托盘入库", "30", "inStorageTask", "返检入库", "0005", "inStorageTask", "报废入库", "0003", "inStorageTask", "inStorageTask", "手工入库", "0009", "inStorageTask")),
|
||||
IOBILL_TYPE_OUT(ForkMap.of("销售出库", "20", "outStorageTask","发货出库", "1001", "outStorageTask", "生产出库", "21", "outStorageTask", "调拨出库", "1004", "outStorageTask",
|
||||
IOBILL_TYPE_OUT(ForkMap.of("销售出库", "20", "outStorageTask","发货出库", "1001", "outStorageTask", "生产出库", "1003", "outStorageTask", "手工出库", "1009", "outStorageTask", "领料出库", "23", "outStorageTask", "调拨出库", "1004", "outStorageTask",
|
||||
"拣选出库", "23", "conveyorOutStorageTask", "盘点出库", "24", "outStorageTask", "出库拣选", "25", "toPickPlatformTask",
|
||||
"退货出库", "26", "outStorageTask", "托盘出库", "40", "outStorageTask", "二楼CTU出库", "81", "outStorageTask", "返检出库",
|
||||
"1006", "outStorageTask", "报废出库", "1002", "outStorageTask")),
|
||||
|
||||
@@ -71,6 +71,9 @@ public interface ISchBaseTaskService extends IService<SchBaseTask> {
|
||||
*/
|
||||
SchBaseTask getByCode(String taskCode);
|
||||
|
||||
|
||||
/**
|
||||
* 获取点位任务数量
|
||||
*/
|
||||
List<SchBaseTask> getTaskList(Set<String> pointCodes1, Set<String> pointCodes2, Set<String> pointCodes3, Set<String> pointCodes4);
|
||||
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
<foreach item="code" collection="pointCodes4" open="(" separator="," close=")"> #{code} </foreach>
|
||||
</if>
|
||||
</trim>
|
||||
AND (status <![CDATA[ < ]]> '80')
|
||||
AND (task_status <![CDATA[ < ]]> '5')
|
||||
AND (is_delete = '0')
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -167,7 +167,13 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
return this.getOne(lam);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取点位任务数量
|
||||
*/
|
||||
@Override
|
||||
public List<SchBaseTask> getTaskList(Set<String> pointCodes1, Set<String> pointCodes2, Set<String> pointCodes3, Set<String> pointCodes4) {
|
||||
return baseMapper.getTaskList(pointCodes1, pointCodes2, pointCodes3, pointCodes4);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,17 +3,20 @@ package org.nl.wms.sch_manage.service.util;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.http.HttpStatus;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.nl.config.SpringContextHolder;
|
||||
import org.nl.wms.gateway.dto.RcsResponse;
|
||||
import org.nl.wms.gateway.service.IGateWayService;
|
||||
import org.nl.wms.sch_manage.enums.TaskStatus;
|
||||
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.util.tasks.StOutTask;
|
||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_management.service.util.UpdateIvtUtils;
|
||||
import org.redisson.api.RLock;
|
||||
|
||||
@@ -25,6 +25,6 @@ public interface IOStorInvMapper extends BaseMapper<IOStorInv> {
|
||||
|
||||
List<IOStorInvDtlDto> getIODtl (@Param("params") Map whereJson);
|
||||
|
||||
IPage<IOStorInv> queryOutBillPage (IPage<IOStorInv> page,@Param("params") Map whereJson);
|
||||
IPage<IOStorInv> queryOutBillPage (IPage<IOStorInv> page,@Param("params") Map whereJson,@Param("billTypeCollect") List<String> billTypeCollect);
|
||||
|
||||
}
|
||||
|
||||
@@ -146,12 +146,12 @@
|
||||
AND
|
||||
ios.bill_status IN #{params.billStatuses}
|
||||
</if>
|
||||
|
||||
<if test="params.billTypes != null">
|
||||
AND
|
||||
ios.bill_type IN #{params.billTypes}
|
||||
<if test="billTypeCollect != null and billTypeCollect != ''">
|
||||
AND ios.bill_type IN
|
||||
<foreach collection="billTypeCollect" item="code" separator="," open="(" close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="params.pcsn != null">
|
||||
AND
|
||||
dis.pcsn LIKE #{params.pcsn}
|
||||
|
||||
@@ -157,20 +157,9 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
}
|
||||
map.put("billStatuses", billStatuses);
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotEmpty(bill_type)) {
|
||||
String billTypes = "(";
|
||||
for (int i = 0; i < bill_type.length; i++) {
|
||||
if (i != bill_type.length - 1) {
|
||||
billTypes += "'" + bill_type[i] + "',";
|
||||
} else {
|
||||
billTypes += "'" + bill_type[i] + "')";
|
||||
}
|
||||
}
|
||||
map.put("billTypes", billTypes);
|
||||
}
|
||||
|
||||
return ioStorInvMapper.queryOutBillPage(new Page<>(page.getPage()+1,page.getSize()),map);
|
||||
List<String> billTypeCollect = ObjectUtil.isNotEmpty(bill_type)
|
||||
? Arrays.stream(bill_type).collect(Collectors.toList()) : null;
|
||||
return ioStorInvMapper.queryOutBillPage(new Page<>(page.getPage()+1,page.getSize()),map,billTypeCollect);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleextService;
|
||||
@@ -20,12 +21,13 @@ import org.nl.wms.warehouse_management.service.IMdPbGroupplateService;
|
||||
import org.nl.wms.warehouse_management.service.dao.GroupPlate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@@ -104,15 +106,23 @@ public class UpdateIvtUtils {
|
||||
|
||||
|
||||
/**
|
||||
* 任务校验
|
||||
* 任务起点或终点或载具编号有任务未完成校验
|
||||
*
|
||||
* @param where 输入参数
|
||||
*/
|
||||
public void checkTask(JSONObject where) {
|
||||
List<SchBaseTask> list = iSchBaseTaskService.list(new QueryWrapper<SchBaseTask>().eq("vehicle_code", where.getString("vehicle_code"))
|
||||
List<SchBaseTask> list;
|
||||
Set<String> pointIds = new HashSet<>();
|
||||
pointIds.add(where.getString("point_code1"));
|
||||
pointIds.add(where.getString("point_code2"));
|
||||
list = iSchBaseTaskService.getTaskList(pointIds, pointIds, null, null);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
throw new BadRequestException("当前起点或终点存在任务,起点:" + where.getString("point_code1") + ",终点:" + where.getString("point_code2") + ",请在WMS任务列表中检查!");
|
||||
}
|
||||
list = iSchBaseTaskService.list(new QueryWrapper<SchBaseTask>().eq("vehicle_code", where.getString("vehicle_code"))
|
||||
.lt("task_status", TaskStatus.FINISHED.getCode()));
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
throw new BadRequestException("当前载具存在任务:" + list.stream().map(SchBaseTask::getTask_code).collect(Collectors.joining(","))+",请在WMS任务列表中检查!");
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
throw new BadRequestException("当前载具存在任务:" + list.stream().map(SchBaseTask::getTask_code).collect(Collectors.joining(",")) + ",请在WMS任务列表中检查!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user