opt:托盘库逻辑优化;
This commit is contained in:
@@ -87,6 +87,7 @@
|
|||||||
<where>
|
<where>
|
||||||
1 = 1
|
1 = 1
|
||||||
AND ext.status = '02'
|
AND ext.status = '02'
|
||||||
|
AND ext.qty > 0
|
||||||
<if test="param.stor_id != null and param.stor_id != ''">
|
<if test="param.stor_id != null and param.stor_id != ''">
|
||||||
AND
|
AND
|
||||||
attr.stor_id = #{param.stor_id}
|
attr.stor_id = #{param.stor_id}
|
||||||
@@ -257,6 +258,7 @@
|
|||||||
INNER JOIN md_me_materialbase mater ON mater.material_id = ext.material_id
|
INNER JOIN md_me_materialbase mater ON mater.material_id = ext.material_id
|
||||||
<where>
|
<where>
|
||||||
1 = 1
|
1 = 1
|
||||||
|
AND ext.`status` < '03'
|
||||||
<if test="params.stor_id != null and params.stor_id != ''">
|
<if test="params.stor_id != null and params.stor_id != ''">
|
||||||
AND
|
AND
|
||||||
attr.stor_id = #{params.stor_id}
|
attr.stor_id = #{params.stor_id}
|
||||||
|
|||||||
@@ -394,6 +394,7 @@ public class MdMeMaterialbaseServiceImpl extends ServiceImpl<MdMeMaterialbaseMap
|
|||||||
.set(Structattr::getUpdate_optname, nickName)
|
.set(Structattr::getUpdate_optname, nickName)
|
||||||
.set(Structattr::getUpdate_time, now)
|
.set(Structattr::getUpdate_time, now)
|
||||||
.eq(Structattr::getStruct_id, struct.getStruct_id()));
|
.eq(Structattr::getStruct_id, struct.getStruct_id()));
|
||||||
|
}
|
||||||
//锁定新库存
|
//锁定新库存
|
||||||
iStructattrService.update(new LambdaUpdateWrapper<>(Structattr.class)
|
iStructattrService.update(new LambdaUpdateWrapper<>(Structattr.class)
|
||||||
.set(Structattr::getStoragevehicle_code, m3)
|
.set(Structattr::getStoragevehicle_code, m3)
|
||||||
@@ -405,9 +406,8 @@ public class MdMeMaterialbaseServiceImpl extends ServiceImpl<MdMeMaterialbaseMap
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
throw new BadRequestException("导入失败" + ex.getMessage() + ":" + in);
|
throw new BadRequestException("导入失败" + ex.getMessage() + ",在表格第" + in+"行,请检查一下。");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -512,7 +512,7 @@ public class MdMeMaterialbaseServiceImpl extends ServiceImpl<MdMeMaterialbaseMap
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
throw new BadRequestException("导入失败" + ex.getMessage() + ":" + in);
|
throw new BadRequestException("导入失败" + ex.getMessage() + ",在表格第" + in+"行,请检查一下。");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -259,7 +259,6 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
|
|||||||
.eq(Structattr::getStruct_code,jsonObject.getString("struct_code"))
|
.eq(Structattr::getStruct_code,jsonObject.getString("struct_code"))
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "2":
|
case "2":
|
||||||
//解锁仓位
|
//解锁仓位
|
||||||
this.update(new LambdaUpdateWrapper<>(Structattr.class)
|
this.update(new LambdaUpdateWrapper<>(Structattr.class)
|
||||||
@@ -421,7 +420,7 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
|
|||||||
.set("lock_type", IOSEnum.LOCK_TYPE.code("未锁定"))
|
.set("lock_type", IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||||
.set("storagevehicle_code", changeDto.getStoragevehicleCode())
|
.set("storagevehicle_code", changeDto.getStoragevehicleCode())
|
||||||
.eq("struct_code", changeDto.getStructCode());
|
.eq("struct_code", changeDto.getStructCode());
|
||||||
//如果是整出
|
//自动确认出库
|
||||||
if (!changeDto.getInBound()) {
|
if (!changeDto.getInBound()) {
|
||||||
wrapper.set("storagevehicle_code", null);
|
wrapper.set("storagevehicle_code", null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,10 +8,13 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.common.base.TableDataInfo;
|
import org.nl.common.base.TableDataInfo;
|
||||||
import org.nl.common.domain.vo.SelectItemVo;
|
import org.nl.common.domain.vo.SelectItemVo;
|
||||||
|
import org.nl.common.enums.NoticeTypeEnum;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.common.logging.annotation.Log;
|
import org.nl.common.logging.annotation.Log;
|
||||||
import org.nl.common.utils.MapOf;
|
import org.nl.common.utils.MapOf;
|
||||||
import org.nl.common.utils.RedissonUtils;
|
import org.nl.common.utils.RedissonUtils;
|
||||||
|
import org.nl.config.SpringContextHolder;
|
||||||
|
import org.nl.system.service.notice.impl.SysNoticeServiceImpl;
|
||||||
import org.nl.system.service.param.ISysParamService;
|
import org.nl.system.service.param.ISysParamService;
|
||||||
import org.nl.system.service.param.dao.Param;
|
import org.nl.system.service.param.dao.Param;
|
||||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||||
@@ -107,10 +110,10 @@ public class PdaIosOutController {
|
|||||||
public ResponseEntity<Object> bindOrUnbind(@RequestBody JSONObject whereJson) {
|
public ResponseEntity<Object> bindOrUnbind(@RequestBody JSONObject whereJson) {
|
||||||
assertNotBlankJson(whereJson, "请求参数不能为空", "mode");
|
assertNotBlankJson(whereJson, "请求参数不能为空", "mode");
|
||||||
RedissonUtils.lock(() -> {
|
RedissonUtils.lock(() -> {
|
||||||
if (StringUtils.isBlank(whereJson.getString("siteCode"))&&StringUtils.isBlank( whereJson.getString("shelfCode"))) {
|
if (StringUtils.isBlank(whereJson.getString("siteCode")) && StringUtils.isBlank(whereJson.getString("shelfCode"))) {
|
||||||
throw new BadRequestException("点位编号和载具编号需要扫其中一个,不能同时为空");
|
throw new BadRequestException("点位编号和载具编号需要扫其中一个,不能同时为空");
|
||||||
}
|
}
|
||||||
pdaIosOutService.bindOrUnbind(whereJson.getString("siteCode"), whereJson.getString("shelfCode"), whereJson.getString("mode"),true);
|
pdaIosOutService.bindOrUnbind(whereJson.getString("siteCode"), whereJson.getString("shelfCode"), whereJson.getString("mode"), true);
|
||||||
}, "bindOrUnbind" , null);
|
}, "bindOrUnbind" , null);
|
||||||
return new ResponseEntity<>(PdaResponse.requestParamOk(whereJson), HttpStatus.OK);
|
return new ResponseEntity<>(PdaResponse.requestParamOk(whereJson), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,10 +33,13 @@ import org.nl.wms.pda.ios_manage.service.PdaIosInService;
|
|||||||
import org.nl.wms.pda.ios_manage.service.PdaIosOutService;
|
import org.nl.wms.pda.ios_manage.service.PdaIosOutService;
|
||||||
import org.nl.wms.pda.util.PdaResponse;
|
import org.nl.wms.pda.util.PdaResponse;
|
||||||
import org.nl.wms.sch_manage.enums.StatusEnum;
|
import org.nl.wms.sch_manage.enums.StatusEnum;
|
||||||
|
import org.nl.wms.sch_manage.enums.TaskStatus;
|
||||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||||
import org.nl.wms.sch_manage.service.ISchBaseRegionService;
|
import org.nl.wms.sch_manage.service.ISchBaseRegionService;
|
||||||
|
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
|
||||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||||
import org.nl.wms.sch_manage.service.dao.SchBaseRegion;
|
import org.nl.wms.sch_manage.service.dao.SchBaseRegion;
|
||||||
|
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||||
import org.nl.wms.sch_manage.service.util.AbstractTask;
|
import org.nl.wms.sch_manage.service.util.AbstractTask;
|
||||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||||
@@ -70,7 +73,8 @@ import static org.nl.wms.warehouse_management.enums.IOSEnum.GROUP_PLATE_STATUS;
|
|||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class PdaIosInServiceImpl implements PdaIosInService {
|
public class PdaIosInServiceImpl implements PdaIosInService {
|
||||||
|
@Autowired
|
||||||
|
private ISchBaseTaskService iSchBaseTaskService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private Map<String, AbstractTask> applyTaskMap;
|
private Map<String, AbstractTask> applyTaskMap;
|
||||||
/**
|
/**
|
||||||
@@ -294,7 +298,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
|||||||
throw new BadRequestException("物料信息错误:" + dataArray.getJSONObject(0).getString("material_id"));
|
throw new BadRequestException("物料信息错误:" + dataArray.getJSONObject(0).getString("material_id"));
|
||||||
}
|
}
|
||||||
if (StringUtils.isBlank(materInfo.getPlacement_type())) {
|
if (StringUtils.isBlank(materInfo.getPlacement_type())) {
|
||||||
throw new BadRequestException("该物料:" + materInfo.getMaterial_name() + ",未绑定货架,请在物料维护界面进行绑定操作");
|
throw new BadRequestException("该物料:" + materInfo.getMaterial_name() + ",物料编码为:" + materInfo.getMaterial_code() + ",未绑定货架,请在物料维护界面进行绑定操作");
|
||||||
}
|
}
|
||||||
//货架人员管理校验,admin不校验
|
//货架人员管理校验,admin不校验
|
||||||
if (!"admin".equals(userName)) {
|
if (!"admin".equals(userName)) {
|
||||||
@@ -312,7 +316,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
|||||||
List<String> rowList = list.stream().map(Structattr::getPlacement_type).map(String::valueOf).collect(Collectors.toList());
|
List<String> rowList = list.stream().map(Structattr::getPlacement_type).map(String::valueOf).collect(Collectors.toList());
|
||||||
//检查物料的用户ID是否在用户绑定的货架行号中
|
//检查物料的用户ID是否在用户绑定的货架行号中
|
||||||
if (!rowList.contains(materInfo.getPlacement_type())) {
|
if (!rowList.contains(materInfo.getPlacement_type())) {
|
||||||
throw new BadRequestException("该物料:" + materInfo.getMaterial_name() + ",归属的货架:" + materInfo.getPlacement_type() + ",不属于用户:" + userName + " 的管理范畴或货架库位已满,请检查或修改用户的货架或物料权限!");
|
throw new BadRequestException("该物料:" + materInfo.getMaterial_name() + ",物料编码为:" + materInfo.getMaterial_code() + ",归属的货架:" + materInfo.getPlacement_type() + ",不属于用户:" + userName + " 的管理范畴或货架库位已满,请检查或修改用户的货架或物料权限!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -332,7 +336,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
|||||||
.set(GroupPlate::getUpdate_time, DateUtil.now())
|
.set(GroupPlate::getUpdate_time, DateUtil.now())
|
||||||
.set(GroupPlate::getUpdate_optid, userId)
|
.set(GroupPlate::getUpdate_optid, userId)
|
||||||
.set(GroupPlate::getUpdate_optname, userName)
|
.set(GroupPlate::getUpdate_optname, userName)
|
||||||
.set(GroupPlate::getRemark, "载具:" + vehicleDao.getStoragevehicle_code() + "存在物料,于" + DateUtil.now() + "重新组盘,该物料强制清空出库。")
|
.set(GroupPlate::getRemark, "载具:" + vehicleDao.getStoragevehicle_code() + "于" + DateUtil.now() + "重置,重新入库。")
|
||||||
.in(GroupPlate::getGroup_id, groupPlateList.stream().map(GroupPlate::getGroup_id).collect(Collectors.toSet()))
|
.in(GroupPlate::getGroup_id, groupPlateList.stream().map(GroupPlate::getGroup_id).collect(Collectors.toSet()))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -433,8 +437,8 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
|||||||
LambdaQueryWrapper<MdMeMaterialbase> queryWrapper = new QueryWrapper<MdMeMaterialbase>().lambda();
|
LambdaQueryWrapper<MdMeMaterialbase> queryWrapper = new QueryWrapper<MdMeMaterialbase>().lambda();
|
||||||
String search = MapUtil.getStr(whereJson, "search");
|
String search = MapUtil.getStr(whereJson, "search");
|
||||||
if (ObjectUtil.isNotEmpty(search)) {
|
if (ObjectUtil.isNotEmpty(search)) {
|
||||||
queryWrapper.likeRight(MdMeMaterialbase::getMaterial_code, search)
|
queryWrapper.like(MdMeMaterialbase::getMaterial_code, search)
|
||||||
.or(item -> item.likeRight(MdMeMaterialbase::getMaterial_name, search));
|
.or(item -> item.like(MdMeMaterialbase::getMaterial_name, search));
|
||||||
}
|
}
|
||||||
String regionCode = MapUtil.getStr(whereJson, "region");
|
String regionCode = MapUtil.getStr(whereJson, "region");
|
||||||
if (ObjectUtil.isNotEmpty(regionCode)) {
|
if (ObjectUtil.isNotEmpty(regionCode)) {
|
||||||
@@ -463,9 +467,55 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
|||||||
PageQuery pageQuery = new PageQuery();
|
PageQuery pageQuery = new PageQuery();
|
||||||
IPage<SchBaseRegion> regionList = iSchBaseRegionService.queryAll(whereJson, pageQuery);
|
IPage<SchBaseRegion> regionList = iSchBaseRegionService.queryAll(whereJson, pageQuery);
|
||||||
List<SelectItemVo> selectList = new ArrayList<>();
|
List<SelectItemVo> selectList = new ArrayList<>();
|
||||||
|
String regionCode = "YZHJ01";
|
||||||
|
String regionName = "预装线货架区";
|
||||||
|
if (ObjectUtil.isNotEmpty(whereJson.getString("storagevehicle_code"))) {
|
||||||
|
List<SchBaseTask> taskList = iSchBaseTaskService.list(new LambdaQueryWrapper<SchBaseTask>().eq(SchBaseTask::getVehicle_code, whereJson.getString("storagevehicle_code")).lt(SchBaseTask::getTask_status, TaskStatus.UNFINISHED.getCode()).orderByDesc(SchBaseTask::getCreate_time).last("LIMIT 50"));
|
||||||
|
if (ObjectUtil.isNotEmpty(taskList)) {
|
||||||
|
//去除相同区域转运
|
||||||
|
taskList = taskList.stream()
|
||||||
|
.filter(task -> {
|
||||||
|
String pointCodeStart = task.getPoint_code1();
|
||||||
|
String pointCodeEnd = task.getPoint_code2();
|
||||||
|
return StringUtils.isNotBlank(pointCodeStart) &&
|
||||||
|
StringUtils.isNotBlank(pointCodeEnd) &&
|
||||||
|
pointCodeStart.charAt(0) != pointCodeEnd.charAt(0);
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (ObjectUtil.isNotEmpty(whereJson.getString("pointCode"))) {
|
||||||
|
//提取与起点相同的终点任务的区域
|
||||||
|
taskList = taskList.stream()
|
||||||
|
.filter(task -> {
|
||||||
|
String pointCodeStart = whereJson.getString("pointCode");
|
||||||
|
String pointCodeEnd = task.getPoint_code2();
|
||||||
|
return StringUtils.isNotBlank(pointCodeStart) &&
|
||||||
|
StringUtils.isNotBlank(pointCodeEnd) &&
|
||||||
|
pointCodeStart.charAt(0) == pointCodeEnd.charAt(0);
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
//获取区域
|
||||||
|
if (ObjectUtil.isNotEmpty(taskList)) {
|
||||||
|
List<SchBasePoint> schBasePointList = iSchBasePointService.list(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getPoint_code, taskList.get(0).getPoint_code1()).eq(SchBasePoint::getIs_used, true));
|
||||||
|
regionCode = schBasePointList.get(0).getRegion_code();
|
||||||
|
regionName = schBasePointList.get(0).getRegion_name();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
selectList.add(SelectItemVo.builder().text(regionName).value(regionCode).build());
|
||||||
|
List<SelectItemVo> finalSelectList = selectList;
|
||||||
regionList.getRecords().forEach(r ->
|
regionList.getRecords().forEach(r ->
|
||||||
selectList.add(SelectItemVo.builder().text(r.getRegion_name()).value(r.getRegion_code()).build())
|
finalSelectList.add(SelectItemVo.builder().text(r.getRegion_name()).value(r.getRegion_code()).build())
|
||||||
);
|
);
|
||||||
|
Set<String> seenValues = new HashSet<>();
|
||||||
|
selectList = selectList.stream()
|
||||||
|
.filter(item -> {
|
||||||
|
if ("YZHJ01".equals(item.getValue())) {
|
||||||
|
return seenValues.add(item.getValue());
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
return selectList;
|
return selectList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,12 +16,14 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.nl.common.base.TableDataInfo;
|
import org.nl.common.base.TableDataInfo;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.domain.vo.SelectItemVo;
|
import org.nl.common.domain.vo.SelectItemVo;
|
||||||
|
import org.nl.common.enums.NoticeTypeEnum;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.common.utils.CodeUtil;
|
import org.nl.common.utils.CodeUtil;
|
||||||
import org.nl.common.utils.IdUtil;
|
import org.nl.common.utils.IdUtil;
|
||||||
import org.nl.common.utils.MapOf;
|
import org.nl.common.utils.MapOf;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.config.SpringContextHolder;
|
import org.nl.config.SpringContextHolder;
|
||||||
|
import org.nl.system.service.notice.impl.SysNoticeServiceImpl;
|
||||||
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
||||||
import org.nl.wms.basedata_manage.service.*;
|
import org.nl.wms.basedata_manage.service.*;
|
||||||
import org.nl.wms.basedata_manage.service.dao.*;
|
import org.nl.wms.basedata_manage.service.dao.*;
|
||||||
@@ -492,13 +494,12 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
|||||||
PageQuery pageQuery = new PageQuery();
|
PageQuery pageQuery = new PageQuery();
|
||||||
pageQuery.setPage(whereJson.getInteger("page") - 1);
|
pageQuery.setPage(whereJson.getInteger("page") - 1);
|
||||||
pageQuery.setSize(100);
|
pageQuery.setSize(100);
|
||||||
whereJson.put("region", "YZHJ");
|
|
||||||
// 查询条件
|
// 查询条件
|
||||||
LambdaQueryWrapper<MdMeMaterialbase> queryWrapper = new QueryWrapper<MdMeMaterialbase>().lambda();
|
LambdaQueryWrapper<MdMeMaterialbase> queryWrapper = new QueryWrapper<MdMeMaterialbase>().lambda();
|
||||||
String search = MapUtil.getStr(whereJson, "search");
|
String search = MapUtil.getStr(whereJson, "search");
|
||||||
if (ObjectUtil.isNotEmpty(search)) {
|
if (ObjectUtil.isNotEmpty(search)) {
|
||||||
queryWrapper.likeRight(MdMeMaterialbase::getMaterial_code, search)
|
queryWrapper.like(MdMeMaterialbase::getMaterial_code, search)
|
||||||
.or(item -> item.likeRight(MdMeMaterialbase::getMaterial_name, search));
|
.or(item -> item.like(MdMeMaterialbase::getMaterial_name, search));
|
||||||
}
|
}
|
||||||
String regionCode = MapUtil.getStr(whereJson, "region");
|
String regionCode = MapUtil.getStr(whereJson, "region");
|
||||||
if (ObjectUtil.isNotEmpty(regionCode)) {
|
if (ObjectUtil.isNotEmpty(regionCode)) {
|
||||||
@@ -516,6 +517,8 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public PdaResponse bindOrUnbind(String siteCode, String shelfCode, String mode, boolean dealGroupPlate) {
|
public PdaResponse bindOrUnbind(String siteCode, String shelfCode, String mode, boolean dealGroupPlate) {
|
||||||
SchBasePoint sitePoint = new SchBasePoint();
|
SchBasePoint sitePoint = new SchBasePoint();
|
||||||
|
String siteCode1 = "";
|
||||||
|
String shelfCode1 = "";
|
||||||
// 校验站点是否存在、是否可用
|
// 校验站点是否存在、是否可用
|
||||||
if (StringUtils.isNotBlank(siteCode)) {
|
if (StringUtils.isNotBlank(siteCode)) {
|
||||||
sitePoint = iSchBasePointService.getOne(
|
sitePoint = iSchBasePointService.getOne(
|
||||||
@@ -526,6 +529,8 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
|||||||
if (sitePoint == null) {
|
if (sitePoint == null) {
|
||||||
throw new BadRequestException("输入的站点编号有误或被禁用,请检查!");
|
throw new BadRequestException("输入的站点编号有误或被禁用,请检查!");
|
||||||
}
|
}
|
||||||
|
siteCode1 = siteCode;
|
||||||
|
shelfCode1 = sitePoint.getVehicle_code() == null ? ",并清空了该站点货物" : sitePoint.getVehicle_code();
|
||||||
}
|
}
|
||||||
//绑定
|
//绑定
|
||||||
if (IOSEnum.BIND_OR_UNBIND.code("绑定").equals(mode)) {
|
if (IOSEnum.BIND_OR_UNBIND.code("绑定").equals(mode)) {
|
||||||
@@ -562,9 +567,13 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
|||||||
dealGroupPlateStatus(shelfCode, sitePoint.getRegion_code());
|
dealGroupPlateStatus(shelfCode, sitePoint.getRegion_code());
|
||||||
}
|
}
|
||||||
doBind(siteCode, shelfCode);
|
doBind(siteCode, shelfCode);
|
||||||
|
shelfCode1 = shelfCode;
|
||||||
} else {
|
} else {
|
||||||
doUnbind(siteCode, sitePoint.getParent_point_code());
|
doUnbind(siteCode, sitePoint.getParent_point_code());
|
||||||
|
siteCode1 =siteCode;
|
||||||
}
|
}
|
||||||
|
String operation = "0".equals(mode) ? "解绑" : "绑定";
|
||||||
|
SpringContextHolder.getBean(SysNoticeServiceImpl.class).createNotice(DateUtil.now() + ",手持端操作通知:站点" + siteCode1 + operation + shelfCode1, "操作信息", NoticeTypeEnum.NOTIFICATION.getCode());
|
||||||
return PdaResponse.requestOk();
|
return PdaResponse.requestOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -586,6 +595,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
|||||||
.set(SchBasePoint::getUpdate_name, SecurityUtils.getCurrentNickName());
|
.set(SchBasePoint::getUpdate_name, SecurityUtils.getCurrentNickName());
|
||||||
;
|
;
|
||||||
iSchBasePointService.update(wrapper1);
|
iSchBasePointService.update(wrapper1);
|
||||||
|
SpringContextHolder.getBean(SysNoticeServiceImpl.class).createNotice(DateUtil.now() + ",手持端操作通知:载具:" + shelfCode + "在新位置:" + siteCode + "重新组盘,旧站点:" + boundPoint.getPoint_code() + "被解绑释放。", "操作信息", NoticeTypeEnum.NOTIFICATION.getCode());
|
||||||
//throw new BadRequestException("当前货架:" + shelfCode + "已绑定在站点:" + boundPoint.getPoint_code() + ",请扫描站点:" + boundPoint.getPoint_code() + "进行解绑,再绑定。");
|
//throw new BadRequestException("当前货架:" + shelfCode + "已绑定在站点:" + boundPoint.getPoint_code() + ",请扫描站点:" + boundPoint.getPoint_code() + "进行解绑,再绑定。");
|
||||||
}
|
}
|
||||||
wrapper.eq(SchBasePoint::getPoint_code, siteCode)
|
wrapper.eq(SchBasePoint::getPoint_code, siteCode)
|
||||||
@@ -884,9 +894,20 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
|||||||
.set(SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("有货"))
|
.set(SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("有货"))
|
||||||
.eq(SchBasePoint::getPoint_code, startPointCode)
|
.eq(SchBasePoint::getPoint_code, startPointCode)
|
||||||
);
|
);
|
||||||
|
SpringContextHolder.getBean(SysNoticeServiceImpl.class).createNotice(DateUtil.now() + ",手持端操作通知:生成点对点任务,站点:" + vehiclePoint.getPoint_code() + "强制解绑载具:" + vehicleCode+",重新绑定到站点:"+startPointCode, "操作信息", NoticeTypeEnum.NOTIFICATION.getCode());
|
||||||
|
}
|
||||||
|
//只有空载具才会自动回原来区域
|
||||||
|
int has = iMdPbGroupplateService.count(new LambdaUpdateWrapper<GroupPlate>()
|
||||||
|
.eq(GroupPlate::getStoragevehicle_code, vehicleCode)
|
||||||
|
.lt(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库")));
|
||||||
|
if (has > 0) {
|
||||||
|
isCheckIvt = "0";
|
||||||
}
|
}
|
||||||
//终点为站点
|
//终点为站点
|
||||||
if (StringUtils.isNotBlank(pointCode2)) {
|
if (StringUtils.isNotBlank(pointCode2)) {
|
||||||
|
if (startPointCode.equals(pointCode2)) {
|
||||||
|
throw new BadRequestException("起点和终点不能相同,请检查!");
|
||||||
|
}
|
||||||
SchBasePoint schBasePoint = iSchBasePointService.getOne(
|
SchBasePoint schBasePoint = iSchBasePointService.getOne(
|
||||||
new LambdaQueryWrapper<SchBasePoint>()
|
new LambdaQueryWrapper<SchBasePoint>()
|
||||||
.eq(SchBasePoint::getPoint_code, pointCode2).eq(SchBasePoint::getIs_used, true)
|
.eq(SchBasePoint::getPoint_code, pointCode2).eq(SchBasePoint::getIs_used, true)
|
||||||
@@ -898,16 +919,35 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
|||||||
} else {
|
} else {
|
||||||
if ("1".equals(isCheckIvt)) {
|
if ("1".equals(isCheckIvt)) {
|
||||||
//终点为区域
|
//终点为区域
|
||||||
List<SchBaseTask> taskList = iSchBaseTaskService.list(new LambdaQueryWrapper<SchBaseTask>().eq(SchBaseTask::getVehicle_code, vehicleCode).eq(SchBaseTask::getTask_status, TaskStatus.FINISHED.getCode()).orderByDesc(SchBaseTask::getCreate_time).last("LIMIT 50"));
|
List<SchBaseTask> taskList = iSchBaseTaskService.list(new LambdaQueryWrapper<SchBaseTask>().eq(SchBaseTask::getVehicle_code, vehicleCode).lt(SchBaseTask::getTask_status, TaskStatus.UNFINISHED.getCode()).orderByDesc(SchBaseTask::getCreate_time).last("LIMIT 50"));
|
||||||
|
if (ObjectUtil.isNotEmpty(taskList)) {
|
||||||
|
//去除相同区域转运
|
||||||
|
taskList = taskList.stream()
|
||||||
|
.filter(task -> {
|
||||||
|
String pointCodeStart = task.getPoint_code1();
|
||||||
|
String pointCodeEnd = task.getPoint_code2();
|
||||||
|
return StringUtils.isNotBlank(pointCodeStart) &&
|
||||||
|
StringUtils.isNotBlank(pointCodeEnd) &&
|
||||||
|
pointCodeStart.charAt(0) != pointCodeEnd.charAt(0);
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
//提取与起点相同的终点任务的区域
|
||||||
|
taskList = taskList.stream()
|
||||||
|
.filter(task -> {
|
||||||
|
String pointCodeStart = point.getPoint_code();
|
||||||
|
String pointCodeEnd = task.getPoint_code2();
|
||||||
|
return StringUtils.isNotBlank(pointCodeStart) &&
|
||||||
|
StringUtils.isNotBlank(pointCodeEnd) &&
|
||||||
|
pointCodeStart.charAt(0) == pointCodeEnd.charAt(0);
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
//获取区域
|
||||||
if (ObjectUtil.isNotEmpty(taskList)) {
|
if (ObjectUtil.isNotEmpty(taskList)) {
|
||||||
List<SchBasePoint> schBasePointList = iSchBasePointService.list(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getPoint_code, taskList.get(0).getPoint_code1()).eq(SchBasePoint::getIs_used, true));
|
List<SchBasePoint> schBasePointList = iSchBasePointService.list(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getPoint_code, taskList.get(0).getPoint_code1()).eq(SchBasePoint::getIs_used, true));
|
||||||
if (ObjectUtil.isNotEmpty(schBasePointList)) {
|
|
||||||
if (!point.getRegion_code().equals(schBasePointList.get(0).getRegion_code())) {
|
|
||||||
regionCode = schBasePointList.get(0).getRegion_code();
|
regionCode = schBasePointList.get(0).getRegion_code();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
//获取终点
|
//获取终点
|
||||||
endPointCode = iSchBasePointService.getPointCode(regionCode);
|
endPointCode = iSchBasePointService.getPointCode(regionCode);
|
||||||
if (StringUtils.isBlank(endPointCode)) {
|
if (StringUtils.isBlank(endPointCode)) {
|
||||||
@@ -933,7 +973,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
|||||||
//入库分配
|
//入库分配
|
||||||
SpringContextHolder.getBean(PdaIosInServiceImpl.class).divStructNoBills(whereJson);
|
SpringContextHolder.getBean(PdaIosInServiceImpl.class).divStructNoBills(whereJson);
|
||||||
return PdaResponse.requestOk();
|
return PdaResponse.requestOk();
|
||||||
}else{
|
} else {
|
||||||
throw new BadRequestException("该区域暂无空闲货位,请及时取走该区域的物料!");
|
throw new BadRequestException("该区域暂无空闲货位,请及时取走该区域的物料!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -942,6 +982,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
|||||||
JSONObject task = new JSONObject();
|
JSONObject task = new JSONObject();
|
||||||
task.put("task_type", IOSConstant.PDA_POINT_TASK);
|
task.put("task_type", IOSConstant.PDA_POINT_TASK);
|
||||||
task.put("config_code", IOSConstant.PDA_POINT_TASK);
|
task.put("config_code", IOSConstant.PDA_POINT_TASK);
|
||||||
|
task.put("vehicle_type", vehicleDao.getStoragevehicle_type());
|
||||||
task.put("point_code1", startPointCode);
|
task.put("point_code1", startPointCode);
|
||||||
task.put("point_code2", endPointCode);
|
task.put("point_code2", endPointCode);
|
||||||
task.put("vehicle_code", vehicleCode);
|
task.put("vehicle_code", vehicleCode);
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ public enum StatusEnum {
|
|||||||
TASK_TYPE(ForkMap.pushAll(IOBILL_TYPE_IN.code, IOBILL_TYPE_OUT.code, IOBILL_TYPE_MOVE.code, EXT_TASK_TYPE.code, OTHER_TASK_TYPE.code)),
|
TASK_TYPE(ForkMap.pushAll(IOBILL_TYPE_IN.code, IOBILL_TYPE_OUT.code, IOBILL_TYPE_MOVE.code, EXT_TASK_TYPE.code, OTHER_TASK_TYPE.code)),
|
||||||
|
|
||||||
ACS_TASK_TYPE(ForkMap.of(
|
ACS_TASK_TYPE(ForkMap.of(
|
||||||
"叉车", "1", "ccbyrw01", "CTU入库", "2", "ctubyru01", "潜伏车", "3", "qfbyrw01", "CTU出库", "4", "ctubyru02"
|
"叉车", "1", "ccbyrw01", "CTU入库", "2", "ctubyru01", "潜伏车", "3", "qfbyrw01", "CTU出库", "4", "ctubyru02", "普通托盘转运", "5", "DNBJBY", "钣金托盘转运", "6", "DNZBBYRW", "高位库普通托盘", "7", "ccbyrw02"
|
||||||
)),
|
)),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -95,7 +95,7 @@ public enum StatusEnum {
|
|||||||
PRODUCT_AREA(ForkMap.of("一层车间", "A1", null, "二层车间", "A2", null, "三层车间", "A3", null)),
|
PRODUCT_AREA(ForkMap.of("一层车间", "A1", null, "二层车间", "A2", null, "三层车间", "A3", null)),
|
||||||
|
|
||||||
|
|
||||||
REGION_INFO(ForkMap.of("商用线5号线", "SYCX01", null, "预装暂存区", "YZZC01", null, "预装线货架区", "YZHJ01", null, "铜管仓", "TGCK01", null,
|
REGION_INFO(ForkMap.of("商用线5号线", "SYCX01", null, "预装托盘暂存区", "YZZC01", null, "预装线货架区", "YZHJ01", null, "铜管仓", "TGCK01", null,
|
||||||
"铜管-烧焊车间", "SHCJ01", null,"两器-烧焊车间", "SHCJ02", null, "来料检验区", "LLJY01", null, "空托存放区", "KTCF01", null, "两器仓", "LQHJ01", null, "满托存放区", "MTCF01", null, "焊接货架区", "LQSH01", null, "原料入库区", "RKQ01", null,"CTU入库点", "CTU01", null,"CTU出库点", "CTU02", null)),
|
"铜管-烧焊车间", "SHCJ01", null,"两器-烧焊车间", "SHCJ02", null, "来料检验区", "LLJY01", null, "空托存放区", "KTCF01", null, "两器仓", "LQHJ01", null, "满托存放区", "MTCF01", null, "焊接货架区", "LQSH01", null, "原料入库区", "RKQ01", null,"CTU入库点", "CTU01", null,"CTU出库点", "CTU02", null)),
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,11 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.common.enums.NoticeTypeEnum;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
|
import org.nl.config.SpringContextHolder;
|
||||||
|
import org.nl.system.service.notice.impl.SysNoticeServiceImpl;
|
||||||
import org.nl.wms.sch_manage.enums.StatusEnum;
|
import org.nl.wms.sch_manage.enums.StatusEnum;
|
||||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||||
@@ -32,7 +35,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
@@ -135,6 +141,8 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
|||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void update(SchBasePoint entity) {
|
public void update(SchBasePoint entity) {
|
||||||
|
String status = "";
|
||||||
|
String vehicleCode;
|
||||||
LambdaUpdateWrapper<SchBasePoint> updateWrapper = new LambdaUpdateWrapper<SchBasePoint>();
|
LambdaUpdateWrapper<SchBasePoint> updateWrapper = new LambdaUpdateWrapper<SchBasePoint>();
|
||||||
updateWrapper.eq(SchBasePoint::getPoint_code, entity.getPoint_code());
|
updateWrapper.eq(SchBasePoint::getPoint_code, entity.getPoint_code());
|
||||||
// 获取region_name
|
// 获取region_name
|
||||||
@@ -155,8 +163,12 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
|||||||
if (pointStatus.equals(IOSEnum.POINT_STATUS.code("无货"))) {
|
if (pointStatus.equals(IOSEnum.POINT_STATUS.code("无货"))) {
|
||||||
updateWrapper.set(SchBasePoint::getVehicle_type, null);
|
updateWrapper.set(SchBasePoint::getVehicle_type, null);
|
||||||
updateWrapper.set(SchBasePoint::getPoint_status, pointStatus);
|
updateWrapper.set(SchBasePoint::getPoint_status, pointStatus);
|
||||||
|
status = "无货";
|
||||||
}
|
}
|
||||||
|
status = StringUtils.isBlank(status) ? pointStatus.equals(IOSEnum.POINT_STATUS.code("有货")) ? "有货" : "空载具" : "无货";
|
||||||
|
vehicleCode = StringUtils.isBlank(entity.getVehicle_code()) ? "清空载具" : entity.getVehicle_code();
|
||||||
pointMapper.update(null, updateWrapper);
|
pointMapper.update(null, updateWrapper);
|
||||||
|
SpringContextHolder.getBean(SysNoticeServiceImpl.class).createNotice(DateUtil.now() + ",PC端操作通知:站点" + entity.getPoint_code() + "被修改,载具信息被修改为:" + vehicleCode + ",点位信息被修改为:" + status, "操作信息", NoticeTypeEnum.NOTIFICATION.getCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -246,35 +258,36 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
|||||||
.findFirst()
|
.findFirst()
|
||||||
.orElseThrow(() -> new BadRequestException("该区域暂无空闲货位,请及时取走该区域的物料!"))
|
.orElseThrow(() -> new BadRequestException("该区域暂无空闲货位,请及时取走该区域的物料!"))
|
||||||
.getPoint_code();
|
.getPoint_code();
|
||||||
} else if ((regionCode.equals(StatusEnum.REGION_INFO.code("预装暂存区")))) {
|
|
||||||
Map<String, List<SchBasePoint>> pointMap = pointList.stream().collect(Collectors.groupingBy(SchBasePoint::getParent_point_code));
|
|
||||||
if (ObjectUtils.isEmpty(pointMap)) {
|
|
||||||
throw new RuntimeException("该暂存区已分配或放满了,请及时取走暂存区的物料!");
|
|
||||||
}
|
}
|
||||||
for (Map.Entry<String, List<SchBasePoint>> entry : pointMap.entrySet()) {
|
// else if ((regionCode.equals(StatusEnum.REGION_INFO.code("预装托盘暂存区")))) {
|
||||||
List<SchBasePoint> filteredSortedList = entry.getValue();
|
// Map<String, List<SchBasePoint>> pointMap = pointList.stream().collect(Collectors.groupingBy(SchBasePoint::getParent_point_code));
|
||||||
filteredSortedList.sort(Comparator.comparingInt(SchBasePoint::getCol_num).reversed());
|
// if (ObjectUtils.isEmpty(pointMap)) {
|
||||||
boolean hasEmptyVehicle = true;
|
// throw new RuntimeException("该暂存区已分配或放满了,请及时取走暂存区的物料!");
|
||||||
Optional<SchBasePoint> emptyList = filteredSortedList.stream()
|
// }
|
||||||
.filter(n -> n.getPoint_status().equals(IOSEnum.POINT_STATUS.code("无货")))
|
// for (Map.Entry<String, List<SchBasePoint>> entry : pointMap.entrySet()) {
|
||||||
.findFirst();
|
// List<SchBasePoint> filteredSortedList = entry.getValue();
|
||||||
//判断点位外层是否有空载具
|
// filteredSortedList.sort(Comparator.comparingInt(SchBasePoint::getCol_num).reversed());
|
||||||
if (emptyList.isPresent()) {
|
// boolean hasEmptyVehicle = true;
|
||||||
Integer sortSeq = emptyList.get().getCol_num();
|
// Optional<SchBasePoint> emptyList = filteredSortedList.stream()
|
||||||
//外层存在有货的阻挡,那么这一列都不能用了
|
// .filter(n -> n.getPoint_status().equals(IOSEnum.POINT_STATUS.code("无货")))
|
||||||
hasEmptyVehicle = filteredSortedList.stream()
|
// .findFirst();
|
||||||
.anyMatch(r -> r.getCol_num() < sortSeq &&
|
// //判断点位外层是否有空载具
|
||||||
r.getPoint_status().equals(IOSEnum.POINT_STATUS.code("有货")));
|
// if (emptyList.isPresent()) {
|
||||||
}
|
// Integer sortSeq = emptyList.get().getCol_num();
|
||||||
if (!hasEmptyVehicle) {
|
// //外层存在有货的阻挡,那么这一列都不能用了
|
||||||
pointCode = emptyList.get().getPoint_code();
|
// hasEmptyVehicle = filteredSortedList.stream()
|
||||||
break;
|
// .anyMatch(r -> r.getCol_num() < sortSeq &&
|
||||||
}
|
// r.getPoint_status().equals(IOSEnum.POINT_STATUS.code("有货")));
|
||||||
}
|
// }
|
||||||
if (StringUtils.isBlank(pointCode)) {
|
// if (!hasEmptyVehicle) {
|
||||||
throw new BadRequestException("该暂存区暂无空闲货位,请检查暂存区是否存在同一列有物料阻挡未取走!");
|
// pointCode = emptyList.get().getPoint_code();
|
||||||
}
|
// break;
|
||||||
} else {
|
// }
|
||||||
|
// }
|
||||||
|
// if (StringUtils.isBlank(pointCode)) {
|
||||||
|
// throw new BadRequestException("该暂存区暂无空闲货位,请检查暂存区是否存在同一列有物料阻挡未取走!");
|
||||||
|
// }}
|
||||||
|
else {
|
||||||
//默认升序
|
//默认升序
|
||||||
pointCode = pointList.stream()
|
pointCode = pointList.stream()
|
||||||
.findFirst()
|
.findFirst()
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import org.nl.wms.sch_manage.service.dao.mapper.SchBaseRegionMapper;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -95,7 +96,7 @@ public class SchBaseRegionServiceImpl extends ServiceImpl<SchBaseRegionMapper, S
|
|||||||
public List<SchBaseRegion> getRegionList(SchBaseRegion region) {
|
public List<SchBaseRegion> getRegionList(SchBaseRegion region) {
|
||||||
LambdaQueryWrapper<SchBaseRegion> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SchBaseRegion> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
if (region != null) {
|
if (region != null) {
|
||||||
lambdaQueryWrapper.eq(SchBaseRegion::getStor_code, region.getStor_code());
|
lambdaQueryWrapper.like(SchBaseRegion::getStor_code, region.getStor_code());
|
||||||
}
|
}
|
||||||
lambdaQueryWrapper.orderByAsc(SchBaseRegion::getOrder_seq);
|
lambdaQueryWrapper.orderByAsc(SchBaseRegion::getOrder_seq);
|
||||||
return schBaseRegionMapper.selectList(lambdaQueryWrapper);
|
return schBaseRegionMapper.selectList(lambdaQueryWrapper);
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
||||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||||
import org.nl.wms.ext.service.WmsToAcsService;
|
import org.nl.wms.ext.service.WmsToAcsService;
|
||||||
@@ -24,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -86,17 +88,40 @@ public abstract class AbstractTask {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取任务扩展信息
|
* 设置任务扩展信息(物料编码、名称、入库数量、出库数量、批次信息)
|
||||||
*/
|
*/
|
||||||
public void getExtInfo(SchBaseTask task) {
|
public void getExtInfo(SchBaseTask task) {
|
||||||
List<GroupPlate> groupPlateList = iMdPbGroupplateService.list(
|
List<GroupPlate> groupPlateList = iMdPbGroupplateService.list(
|
||||||
new LambdaQueryWrapper<GroupPlate>()
|
new LambdaQueryWrapper<GroupPlate>()
|
||||||
.eq(GroupPlate::getStoragevehicle_code, task.getVehicle_code())
|
.eq(GroupPlate::getStoragevehicle_code, task.getVehicle_code())
|
||||||
.lt(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库")));
|
.lt(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库")));
|
||||||
if (ObjectUtil.isNotEmpty(groupPlateList)) {
|
if (CollectionUtils.isEmpty(groupPlateList)) {
|
||||||
MdMeMaterialbase mdMeMaterialbase = iMdMeMaterialbaseService.getById(groupPlateList.get(0).getMaterial_id());
|
return;
|
||||||
task.setExt_group_data("物料编码:"+mdMeMaterialbase.getMaterial_code() + "-" + "物料名称:"+mdMeMaterialbase.getMaterial_name() + "-" +"入库数量:"+ groupPlateList.get(0).getQty() + "-" +"出库数量:"+ groupPlateList.get(0).getFrozen_qty() + "-" +"批次信息:"+ groupPlateList.get(0).getPcsn());
|
|
||||||
}
|
}
|
||||||
|
// 确定用于构建扩展信息的 GroupPlate 记录
|
||||||
|
GroupPlate targetPlate;
|
||||||
|
if (groupPlateList.size() > 1) {
|
||||||
|
targetPlate = groupPlateList.stream()
|
||||||
|
.filter(r -> r.getFrozen_qty().compareTo(BigDecimal.ZERO) > 0)
|
||||||
|
.findFirst()
|
||||||
|
.orElse(groupPlateList.get(0));
|
||||||
|
} else {
|
||||||
|
targetPlate = groupPlateList.get(0);
|
||||||
|
}
|
||||||
|
MdMeMaterialbase material = iMdMeMaterialbaseService.getById(targetPlate.getMaterial_id());
|
||||||
|
if (material == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 获取数量
|
||||||
|
BigDecimal outQty = targetPlate.getFrozen_qty();
|
||||||
|
BigDecimal inQty = targetPlate.getFrozen_qty().compareTo(BigDecimal.ZERO) > 0 ? BigDecimal.ZERO : targetPlate.getQty();
|
||||||
|
String extInfo = String.format("物料编码:%s-物料名称:%s-入库数量:%s-出库数量:%s-批次信息:%s",
|
||||||
|
material.getMaterial_code(),
|
||||||
|
material.getMaterial_name(),
|
||||||
|
inQty,
|
||||||
|
outQty,
|
||||||
|
targetPlate.getPcsn());
|
||||||
|
task.setExt_group_data(extInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package org.nl.wms.sch_manage.service.util;
|
package org.nl.wms.sch_manage.service.util;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import org.nl.wms.sch_manage.enums.StatusEnum;
|
|
||||||
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -32,7 +31,19 @@ public class PointUtils {
|
|||||||
|
|
||||||
public static String getRcsTraceId(SchBaseTask task) {
|
public static String getRcsTraceId(SchBaseTask task) {
|
||||||
if (task.getVehicle_code().contains("T")) {
|
if (task.getVehicle_code().contains("T")) {
|
||||||
return "ccbyrw01";
|
if (task.getPoint_code1().contains("A") || task.getPoint_code2().contains("A")) {
|
||||||
|
//普通托盘
|
||||||
|
return "ccbyrw02";
|
||||||
|
} else {
|
||||||
|
//tofix 产线转运 叉车钣金铁托盘 ccbyrw01
|
||||||
|
//普通托盘
|
||||||
|
if ("1".equals(task.getVehicle_type())) {
|
||||||
|
return "DNZBBYRW";
|
||||||
|
} else {
|
||||||
|
//钣金托盘
|
||||||
|
return "DNBJBY";
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (task.getVehicle_code().contains("LX")) {
|
} else if (task.getVehicle_code().contains("LX")) {
|
||||||
return task.getConfig_code().contains("In") ?"ctubyru01":"ctubyru02";
|
return task.getConfig_code().contains("In") ?"ctubyru01":"ctubyru02";
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -825,7 +825,6 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
|||||||
ioStorInvDis.setQty_unit_id(dtl.getQty_unit_id());
|
ioStorInvDis.setQty_unit_id(dtl.getQty_unit_id());
|
||||||
ioStorInvDis.setQty_unit_name(dtl.getQty_unit_name());
|
ioStorInvDis.setQty_unit_name(dtl.getQty_unit_name());
|
||||||
ioStorInvDis.setWork_status(IOSEnum.INBILL_DIS_STATUS.code("未生成"));
|
ioStorInvDis.setWork_status(IOSEnum.INBILL_DIS_STATUS.code("未生成"));
|
||||||
|
|
||||||
// 未分配数量 - 该库位上的可用数量 < 0 目前做整出
|
// 未分配数量 - 该库位上的可用数量 < 0 目前做整出
|
||||||
// double canuse_qty = outAllocation.getCanuse_qty().doubleValue();
|
// double canuse_qty = outAllocation.getCanuse_qty().doubleValue();
|
||||||
// if (unassign_qty-canuse_qty>=0){
|
// if (unassign_qty-canuse_qty>=0){
|
||||||
@@ -838,7 +837,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
|||||||
// unassign_qty=0;
|
// unassign_qty=0;
|
||||||
// }
|
// }
|
||||||
if (unassign_qty <= 0){
|
if (unassign_qty <= 0){
|
||||||
throw new BadRequestException("已全部分配完,未分配数量为0");
|
continue;
|
||||||
}
|
}
|
||||||
unassign_qty = unassign_qty-canuse_qty;
|
unassign_qty = unassign_qty-canuse_qty;
|
||||||
if (unassign_qty<0){
|
if (unassign_qty<0){
|
||||||
@@ -1199,6 +1198,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
|||||||
finish_map.put("inv_type", null);
|
finish_map.put("inv_type", null);
|
||||||
finish_map.put("inv_id", null);
|
finish_map.put("inv_id", null);
|
||||||
finish_map.put("inv_code", null);
|
finish_map.put("inv_code", null);
|
||||||
|
String now = DateUtil.now();
|
||||||
iStructattrService.updateStatusByCode("1", finish_map);
|
iStructattrService.updateStatusByCode("1", finish_map);
|
||||||
//更新终点
|
//更新终点
|
||||||
LambdaUpdateWrapper<SchBasePoint> wrapper = new LambdaUpdateWrapper<>();
|
LambdaUpdateWrapper<SchBasePoint> wrapper = new LambdaUpdateWrapper<>();
|
||||||
@@ -1231,13 +1231,12 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
|||||||
.set(SchBasePoint::getUpdate_id, SecurityUtils.getCurrentUserId())
|
.set(SchBasePoint::getUpdate_id, SecurityUtils.getCurrentUserId())
|
||||||
.set(SchBasePoint::getUpdate_name, SecurityUtils.getCurrentNickName());
|
.set(SchBasePoint::getUpdate_name, SecurityUtils.getCurrentNickName());
|
||||||
iSchBasePointService.update(wrapper);
|
iSchBasePointService.update(wrapper);
|
||||||
//绑定载具
|
//绑定目标点位载具
|
||||||
pdaIosOutService.bindOrUnbind(task.getPoint_code2(), task.getVehicle_code(), IOSEnum.BIND_OR_UNBIND.code("绑定"),false);
|
pdaIosOutService.bindOrUnbind(task.getPoint_code2(), task.getVehicle_code(), IOSEnum.BIND_OR_UNBIND.code("绑定"), false);
|
||||||
//是否处理单据及分配信息
|
//是否处理单据及分配信息
|
||||||
if (BaseDataEnum.IS_YES_NOT.code("是").equals(task.getHandle_status())) {
|
if (BaseDataEnum.IS_YES_NOT.code("是").equals(task.getHandle_status())) {
|
||||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
String now = DateUtil.now();
|
|
||||||
List<IOStorInvDis> ioStorInvDisList = ioStorInvDisMapper.selectList(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
List<IOStorInvDis> ioStorInvDisList = ioStorInvDisMapper.selectList(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||||
.eq(IOStorInvDis::getTask_id, task.getTask_id())
|
.eq(IOStorInvDis::getTask_id, task.getTask_id())
|
||||||
);
|
);
|
||||||
@@ -1248,15 +1247,20 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
|||||||
ioStorInvDisMapper.update(null, new LambdaUpdateWrapper<>(IOStorInvDis.class)
|
ioStorInvDisMapper.update(null, new LambdaUpdateWrapper<>(IOStorInvDis.class)
|
||||||
.set(IOStorInvDis::getWork_status, IOSEnum.INBILL_DIS_STATUS.code("完成"))
|
.set(IOStorInvDis::getWork_status, IOSEnum.INBILL_DIS_STATUS.code("完成"))
|
||||||
.in(IOStorInvDis::getIostorinvdis_id, ioStorInvDisList.stream().map(IOStorInvDis::getIostorinvdis_id).collect(Collectors.toList())));
|
.in(IOStorInvDis::getIostorinvdis_id, ioStorInvDisList.stream().map(IOStorInvDis::getIostorinvdis_id).collect(Collectors.toList())));
|
||||||
|
|
||||||
ioStorInvDisList.forEach(r -> {
|
ioStorInvDisList.forEach(r -> {
|
||||||
//库存变动:根据冻结数更新物料库存
|
//库存变动:根据冻结数更新物料库存,潜伏车和叉车都是自动确认
|
||||||
|
boolean inBound = true;
|
||||||
|
if (!"qfbyrw01".equals(task.getAcs_trace_id())) {
|
||||||
|
inBound = false;
|
||||||
|
} else if (!task.getVehicle_code().contains("T")) {
|
||||||
|
inBound = false;
|
||||||
|
}
|
||||||
StructattrChangeDto changeDto = StructattrChangeDto.builder()
|
StructattrChangeDto changeDto = StructattrChangeDto.builder()
|
||||||
.inv(r.getIostorinv_id())
|
.inv(r.getIostorinv_id())
|
||||||
.storagevehicleCode(r.getStoragevehicle_code())
|
.storagevehicleCode(r.getStoragevehicle_code())
|
||||||
.structCode(r.getStruct_code())
|
.structCode(r.getStruct_code())
|
||||||
.taskType(task.getConfig_code())
|
.taskType(task.getConfig_code())
|
||||||
.inBound(!"qfbyrw01".equals(task.getAcs_trace_id())).build();
|
.inBound(inBound).build();
|
||||||
iStructattrService.changeStruct(changeDto);
|
iStructattrService.changeStruct(changeDto);
|
||||||
int countDis = ioStorInvDisMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
int countDis = ioStorInvDisMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||||
.eq(IOStorInvDis::getIostorinvdtl_id, r.getIostorinvdtl_id())
|
.eq(IOStorInvDis::getIostorinvdtl_id, r.getIostorinvdtl_id())
|
||||||
|
|||||||
@@ -82,8 +82,7 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
|||||||
@Resource
|
@Resource
|
||||||
private MdPbStoragevehicleinfoMapper mdPbStoragevehicleinfoMapper;
|
private MdPbStoragevehicleinfoMapper mdPbStoragevehicleinfoMapper;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private IMdPbGroupplateService iMdPbGroupPlateService;
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private MdPbGroupplateServiceImpl mdPbGroupplateService;
|
private MdPbGroupplateServiceImpl mdPbGroupplateService;
|
||||||
|
|||||||
@@ -373,7 +373,11 @@ public class UpdateIvtUtils {
|
|||||||
acsTaskDto.setPriority(taskDao.getPriority());
|
acsTaskDto.setPriority(taskDao.getPriority());
|
||||||
TaskOrderDetail detail = new TaskOrderDetail();
|
TaskOrderDetail detail = new TaskOrderDetail();
|
||||||
detail.setTaskPath(taskDao.getPoint_code1() + "," + taskDao.getPoint_code2());
|
detail.setTaskPath(taskDao.getPoint_code1() + "," + taskDao.getPoint_code2());
|
||||||
|
if (taskDao.getVehicle_code().contains("T")) {
|
||||||
|
detail.setShelfNumber(null);
|
||||||
|
} else {
|
||||||
detail.setShelfNumber(taskDao.getVehicle_code());
|
detail.setShelfNumber(taskDao.getVehicle_code());
|
||||||
|
}
|
||||||
// Map<String, String> extraInfo = new HashMap<>();
|
// Map<String, String> extraInfo = new HashMap<>();
|
||||||
// extraInfo.put("s", "1");
|
// extraInfo.put("s", "1");
|
||||||
// extraInfo.put("d", "2");
|
// extraInfo.put("d", "2");
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ spring:
|
|||||||
freemarker:
|
freemarker:
|
||||||
check-template-location: false
|
check-template-location: false
|
||||||
profiles:
|
profiles:
|
||||||
active: prod
|
active: dev
|
||||||
jackson:
|
jackson:
|
||||||
time-zone: GMT+8730 885 969
|
time-zone: GMT+8730 885 969
|
||||||
data:
|
data:
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vue-cli-service serve",
|
"dev": "vue-cli-service serve",
|
||||||
|
"dev1": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
|
||||||
"dev_mac": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
|
"dev_mac": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
|
||||||
"build:prod": "vue-cli-service build",
|
"build:prod": "vue-cli-service build",
|
||||||
"build:stage": "vue-cli-service build --mode staging",
|
"build:stage": "vue-cli-service build --mode staging",
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
回首页
|
回首页
|
||||||
</router-link>
|
</router-link>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
|||||||
Reference in New Issue
Block a user