add:验箱流程
This commit is contained in:
@@ -155,21 +155,29 @@ public class PdmBiSubpackagerelationController {
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/zjInBound")
|
||||
@SaIgnore
|
||||
@Log("子卷装箱查询")
|
||||
//@SaCheckPermission("@el.check(updateEntityList)")
|
||||
public ResponseEntity<Object> zjInBound(@RequestBody JSONObject whereJson) {
|
||||
List list = pdmBiSubpackagerelationService.zjInBound(whereJson);
|
||||
return new ResponseEntity<>(TableDataInfo.build(list),HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/zjInBoundConfirm")
|
||||
@SaIgnore
|
||||
@Log("子卷装箱入库")
|
||||
//@SaCheckPermission("@el.check(updateEntityList)")
|
||||
public ResponseEntity<Object> zjInBound(@RequestBody JSONObject whereJson) {
|
||||
RLock lock = redissonClient.getLock("updateEntityList");
|
||||
public ResponseEntity<Object> zjInBoundConfirm(@RequestBody JSONObject whereJson) {
|
||||
RLock lock = redissonClient.getLock("zjInBound");
|
||||
boolean tryLock = false;
|
||||
try {
|
||||
tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||
if (tryLock) {
|
||||
pdmBiSubpackagerelationService.updateEntityList(whereJson);
|
||||
pdmBiSubpackagerelationService.zjInBoundConfirm(whereJson);
|
||||
} else {
|
||||
log.info("子卷装箱操作正在执行被锁住。");
|
||||
log.info("子卷装箱入库操作正在执行被锁住。");
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
@@ -178,7 +186,7 @@ public class PdmBiSubpackagerelationController {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -71,6 +71,13 @@ public interface IpdmBiSubpackagerelationService extends IService<PdmBiSubpackag
|
||||
*/
|
||||
void zjInBoundConfirm(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 子卷装箱
|
||||
* @param whereJson
|
||||
* @return
|
||||
*/
|
||||
List zjInBound(JSONObject whereJson);
|
||||
|
||||
|
||||
/**
|
||||
* 传输子卷包装关系至LMS
|
||||
|
||||
@@ -33,24 +33,29 @@ import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.dto.SchBaseTaskDto;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
import org.nl.b_lms.sch.tasks.TwoOutBoxTask;
|
||||
import org.nl.b_lms.sch.tasks.first_floor_area.ZxqTask;
|
||||
import org.nl.b_lms.sch.tasks.first_floor_area.auto.TaskQueue;
|
||||
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService;
|
||||
import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo;
|
||||
import org.nl.b_lms.storage_manage.database.service.dao.mapper.BstIvtBoxinfoMapper;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.impl.OutBoxManageServiceImpl;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.OutBoxManageService;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
|
||||
import org.nl.wms.pda.mps.eum.RegionTypeEnum;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.redisson.api.RLock;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -76,29 +81,26 @@ import java.util.stream.Collectors;
|
||||
@Log4j
|
||||
public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpackagerelationMapper, PdmBiSubpackagerelation> implements IpdmBiSubpackagerelationService {
|
||||
|
||||
|
||||
@Resource
|
||||
private RedissonClient redissonClient;
|
||||
@Resource
|
||||
@Autowired
|
||||
private IschBaseTaskService taskService;
|
||||
@Resource
|
||||
@Autowired
|
||||
private ZxqTask zxqTask;
|
||||
|
||||
@Resource
|
||||
@Autowired
|
||||
private IBstIvtBoxinfoService iBstIvtBoxinfoService;
|
||||
|
||||
@Resource
|
||||
@Autowired
|
||||
private LmsToMesServiceImpl lmsToMesServiceImpl;
|
||||
@Resource
|
||||
@Autowired
|
||||
private IPdmBiSlittingproductionplanService iPdmBiSlittingproductionplanService;
|
||||
|
||||
@Resource
|
||||
@Autowired
|
||||
private IPdmBiOrderbominfoService iPdmBiOrderbominfoService;
|
||||
|
||||
@Resource
|
||||
@Autowired
|
||||
private OutBoxManageService outBoxManageService;
|
||||
|
||||
@Resource
|
||||
@Autowired
|
||||
private IbstIvtPackageinfoivtService packageinfoivtService;
|
||||
|
||||
@Resource
|
||||
@@ -241,22 +243,12 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateEntityList(JSONObject whereJson) {
|
||||
String deviceCode = "ZXQ_1_1";
|
||||
List<PdmBiSubpackagerelation> packagerelationList = JSONObject.parseArray(whereJson.getJSONArray("tableMater").toJSONString(), PdmBiSubpackagerelation.class);
|
||||
//子卷信息校验
|
||||
checkEntityList(whereJson, packagerelationList);
|
||||
//均衡获取木箱出库装箱区对接位
|
||||
//= getPointCode(packagerelationList.size());
|
||||
String deviceCode = "ZXQ_1_1";
|
||||
int count = taskService.count(new QueryWrapper<SchBaseTask>()
|
||||
.eq("task_type", "010908")
|
||||
.eq("is_delete", "0")
|
||||
.lt("task_status", TaskStatusEnum.FINISHED.getCode()));
|
||||
int count2 = packageinfoivtService.count(new QueryWrapper<BstIvtPackageinfoivt>()
|
||||
.eq("point_status",PackageInfoIvtEnum.POINT_STATUS.code("装箱区"))
|
||||
.eq("ivt_status",PackageInfoIvtEnum.IVT_STATUS.code("合格品")));
|
||||
if (count+count2>8){
|
||||
throw new BadRequestException("当前装箱区木箱任务已满,稍后再试");
|
||||
}
|
||||
List<String> workIdList = JSONObject.parseArray(whereJson.getJSONArray("tableMater").toJSONString(), PdmBiSubpackagerelation.class).stream()
|
||||
.map(PdmBiSubpackagerelation::getWorkorder_id)
|
||||
.map(String::valueOf)
|
||||
@@ -296,100 +288,132 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
}
|
||||
|
||||
@Override
|
||||
public List zjInBound(JSONObject whereJson) {
|
||||
String containerName = whereJson.getString("container_name");
|
||||
if (StringUtils.isEmpty(containerName)){
|
||||
throw new BadRequestException("子卷编码不能为空");
|
||||
}
|
||||
String[] split = containerName.split(",");
|
||||
List<PdmBiSubpackagerelation> subList = this.list(new QueryWrapper<PdmBiSubpackagerelation>()
|
||||
.eq("status", "0")
|
||||
.in("container_name", split));
|
||||
if (CollectionUtils.isEmpty(subList)){
|
||||
throw new BadRequestException("当前子卷还为组盘");
|
||||
}
|
||||
if (subList.size() != split.length){
|
||||
throw new BadRequestException("子卷包装信息与子卷不相符合");
|
||||
}
|
||||
return subList;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void zjInBoundConfirm(JSONObject param) {
|
||||
// String containerName = param.getString("container_name");
|
||||
// if (StringUtils.isEmpty(containerName)){
|
||||
// throw new BadRequestException("子卷编码不能为空");
|
||||
// }
|
||||
// String[] split = containerName.split(",");
|
||||
// //理论毛重
|
||||
// List<PdmBiSubpackagerelation> subList = this.list(new QueryWrapper<PdmBiSubpackagerelation>()
|
||||
// .eq("status", "0")
|
||||
// .in("container_name", split));
|
||||
// if (subList.size() != containerName.length()){
|
||||
// throw new BadRequestException("子卷包装信息与子卷不相符合");
|
||||
// }
|
||||
// Set<String> collect = subList.stream().map(PdmBiSubpackagerelation::getPackage_box_sn).collect(Collectors.toSet());
|
||||
// if (collect.size()>1){
|
||||
// throw new BadRequestException("当前子卷不属于同一组"+ collect);
|
||||
// }
|
||||
// if (subList.get(0).getQuanlity_in_box().intValue()!= split.length){
|
||||
// throw new BadRequestException("当前木箱"+subList.get(0).getQuanlity_in_box()+"要装箱的子卷"+split.length+"未装完");
|
||||
// }
|
||||
// String boxSn = subList.get(0).getPackage_box_sn();
|
||||
// updateWrapper.set("box_weight", NumberUtil.round(totalWeight, 2).toString());
|
||||
// updateWrapper.set("package_box_sn", boxDao.getBox_no());
|
||||
// updateWrapper.set("quanlity_in_box", workIdList.size());
|
||||
// updateWrapper.set("box_type", boxDao.getMaterial_code());
|
||||
// updateWrapper.set("box_length", boxDao.getBox_length());
|
||||
// updateWrapper.set("box_width", boxDao.getBox_width());
|
||||
// updateWrapper.set("box_high", boxDao.getBox_high());
|
||||
// updateWrapper.set("box_group", maxBoxGroup);
|
||||
// updateWrapper.set("status", "0");
|
||||
// updateWrapper.in("workorder_id", workIdList);
|
||||
// pdmBiSubpackagerelationMapper.update(null, updateWrapper);
|
||||
// List<PdmBiSubpackagerelation> packagerelationList = JSONObject.parseArray(whereJson.getJSONArray("tableMater").toJSONString(), PdmBiSubpackagerelation.class);
|
||||
// //子卷信息校验
|
||||
// checkEntityList(whereJson, packagerelationList);
|
||||
// //均衡获取木箱出库装箱区对接位
|
||||
// //= getPointCode(packagerelationList.size());
|
||||
// String deviceCode = "ZXQ_1_1";
|
||||
// int count = taskService.count(new QueryWrapper<SchBaseTask>()
|
||||
// .eq("task_type", "010908")
|
||||
// .eq("is_delete", "0")
|
||||
// .lt("task_status", TaskStatusEnum.FINISHED.getCode()));
|
||||
// int count2 = packageinfoivtService.count(new QueryWrapper<BstIvtPackageinfoivt>()
|
||||
// .eq("point_status",PackageInfoIvtEnum.POINT_STATUS.code("装箱区"))
|
||||
// .eq("ivt_status",PackageInfoIvtEnum.IVT_STATUS.code("合格品")));
|
||||
// if (count+count2>8){
|
||||
// throw new BadRequestException("当前装箱区木箱任务已满,稍后再试");
|
||||
// }
|
||||
// List<String> workIdList = JSONObject.parseArray(whereJson.getJSONArray("tableMater").toJSONString(), PdmBiSubpackagerelation.class).stream()
|
||||
// .map(PdmBiSubpackagerelation::getWorkorder_id)
|
||||
// .map(String::valueOf)
|
||||
// .collect(Collectors.toList());
|
||||
// //根据分切计划获取子卷重量计算理论毛重
|
||||
// Set<String> containerNameList = packagerelationList.stream()
|
||||
// .map(PdmBiSubpackagerelation::getContainer_name)
|
||||
// .collect(Collectors.toSet());
|
||||
// List<PdmBiSlittingproductionplan> planList = iPdmBiSlittingproductionplanService.list(new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
// .in(PdmBiSlittingproductionplan::getContainer_name, containerNameList)
|
||||
// .eq(PdmBiSlittingproductionplan::getIs_delete,IOSEnum.IS_NOTANDYES.code("否"))
|
||||
// );
|
||||
//
|
||||
// if (ObjectUtils.isEmpty(planList)) {
|
||||
// throw new BadRequestException("子卷查询不到分切计划,请检查!");
|
||||
// }
|
||||
// BigDecimal totalWeight;
|
||||
// totalWeight = planList.stream()
|
||||
// .map(PdmBiSlittingproductionplan::getWeight)
|
||||
// .filter(p -> p != null && !p.trim().isEmpty())
|
||||
// .filter(r -> !r.isEmpty())
|
||||
// .map(BigDecimal::new)
|
||||
// .reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
// if (totalWeight.compareTo(new BigDecimal(0)) == 0) {
|
||||
// throw new BadRequestException("分切计划的子卷重量不能为0");
|
||||
// }
|
||||
// //获取子卷组号
|
||||
// List<PdmBiSubpackagerelation> pdmBiSubpackagerelationList = pdmBiSubpackagerelationMapper
|
||||
// .selectList(new LambdaQueryWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getSale_order_name, packagerelationList.get(0).getSale_order_name()));
|
||||
// Integer maxBoxGroup = pdmBiSubpackagerelationList.stream()
|
||||
// .map(PdmBiSubpackagerelation::getBox_group)
|
||||
// .filter(r -> r != null && !r.trim().isEmpty())
|
||||
// .map(Integer::parseInt)
|
||||
// .max(Integer::compareTo)
|
||||
// .orElse(0) + 1;
|
||||
// outBox(workIdList, containerNameList, deviceCode, maxBoxGroup, whereJson, totalWeight);
|
||||
String containerName = param.getString("search");
|
||||
if (StringUtils.isEmpty(containerName)){
|
||||
throw new BadRequestException("子卷编码不能为空");
|
||||
}
|
||||
String deviceCode = "ZXQ_1_1";
|
||||
int count = taskService.count(new QueryWrapper<SchBaseTask>()
|
||||
.eq("task_type", "010908")
|
||||
.eq("is_delete", "0")
|
||||
.lt("task_status", TaskStatusEnum.FINISHED.getCode()));
|
||||
int count2 = packageinfoivtService.count(new QueryWrapper<BstIvtPackageinfoivt>()
|
||||
.eq("point_status",PackageInfoIvtEnum.POINT_STATUS.code("装箱区"))
|
||||
.eq("ivt_status",PackageInfoIvtEnum.IVT_STATUS.code("合格品")));
|
||||
if (count+count2>8){
|
||||
throw new BadRequestException("当前装箱区木箱任务已满,稍后再试");
|
||||
}
|
||||
|
||||
String[] split = containerName.split(",");
|
||||
//理论毛重
|
||||
List<PdmBiSubpackagerelation> subList = this.list(new QueryWrapper<PdmBiSubpackagerelation>()
|
||||
.eq("status", "0")
|
||||
.in("container_name", split));
|
||||
if (subList.size() != split.length){
|
||||
throw new BadRequestException("子卷包装信息与子卷不相符合");
|
||||
}
|
||||
Set<String> collect = subList.stream().map(PdmBiSubpackagerelation::getPackage_box_sn).collect(Collectors.toSet());
|
||||
Set<String> containers = subList.stream().map(PdmBiSubpackagerelation::getContainer_name).collect(Collectors.toSet());
|
||||
if (collect.size() == 0){
|
||||
throw new BadRequestException("当前子卷还未进行装箱组盘操作");
|
||||
}
|
||||
if (collect.size()>1){
|
||||
throw new BadRequestException("当前子卷不属于同一组"+ collect);
|
||||
}
|
||||
if (subList.get(0).getQuanlity_in_box().intValue()!= split.length){
|
||||
throw new BadRequestException("当前木箱"+subList.get(0).getQuanlity_in_box()+"要装箱的子卷"+split.length+"未装完");
|
||||
}
|
||||
String boxSn = subList.get(0).getPackage_box_sn();
|
||||
// 查询木箱对应的托盘号
|
||||
JSONObject jsonVeExt = WQLObject.getWQLObject("md_pb_storagevehicleext").query("pcsn = '" + boxSn + "'")
|
||||
.uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonVeExt)) {
|
||||
throw new BadRequestException("此木箱没有绑定托盘号!"+boxSn);
|
||||
}
|
||||
//查询木箱所在货位
|
||||
WQLObject attrTab = WQLObject.getWQLObject("st_ivt_structattr");
|
||||
JSONArray boxAttrs = attrTab.query("storagevehicle_code = '" + boxSn + "' and sect_id = '1748219897940414464'").getResultJSONArray(0);
|
||||
if (boxAttrs.size() == 0){
|
||||
throw new BadRequestException("当前木箱"+boxSn+"库存信息查询不到,请确认");
|
||||
}
|
||||
JSONObject boxAttr = boxAttrs.getJSONObject(0);
|
||||
String task_group_id = null;
|
||||
if (boxAttr.getString("zdepth").equals(IOSEnum.ZDEPTH_STRUCT.code("深"))) {
|
||||
JSONObject 浅Attr = attrTab
|
||||
.query("zdepth = '1' and row_num = '"+boxAttr.getString("row_num")+"' and col_num = '" + boxAttr.getString("col_num") + "' and layer_num = '"+boxAttr.getString("layer_num")+"'")
|
||||
.uniqueResult(0);
|
||||
// 判断浅货位是否有木箱
|
||||
if (!ObjectUtil.isEmpty(浅Attr.getString("storagevehicle_code"))) {
|
||||
// 判断是否被锁定
|
||||
if (浅Attr.getString("lock_type").equals(IOSEnum.LOCK_TYPE.code("未锁定"))) {
|
||||
// 判断浅货位木箱和深货位木箱是否相同规格
|
||||
task_group_id = outBoxManageService.createBoxMove(浅Attr);
|
||||
} else {
|
||||
// 判断是否是空木箱出库锁
|
||||
throw new BadRequestException("当前木箱所在货位"+boxAttr.getString("struct_code")+"对应浅货位存在任务"+浅Attr.getString("task_code"));
|
||||
}
|
||||
}
|
||||
}
|
||||
int moveTask = taskService.count(new QueryWrapper<SchBaseTask>()
|
||||
.eq("task_type", "010704")
|
||||
.eq("is_delete", "0")
|
||||
.eq("point_code1", boxAttr.getString("struct_code"))
|
||||
.lt("task_status", TaskStatusEnum.FINISHED.getCode()));
|
||||
if (moveTask>0){
|
||||
throw new BadRequestException("当前子卷已经装箱入库");
|
||||
}
|
||||
// 生成任务
|
||||
JSONObject jsonTaskParam = new JSONObject();
|
||||
jsonTaskParam.put("task_type", "010704");
|
||||
jsonTaskParam.put("start_device_code", boxAttr.getString("struct_code"));
|
||||
jsonTaskParam.put("next_device_code", deviceCode);
|
||||
jsonTaskParam.put("vehicle_code", boxAttr.getString("storagevehicle_code"));
|
||||
jsonTaskParam.put("vehicle_code2", jsonVeExt.getString("storagevehicle_code"));
|
||||
jsonTaskParam.put("task_group_id", task_group_id);
|
||||
JSONObject request_param = new JSONObject();
|
||||
request_param.put("containerType", boxAttr.getString("storagevehicle_type"));
|
||||
jsonTaskParam.put("request_param", request_param.toString());
|
||||
TwoOutBoxTask taskBean = new TwoOutBoxTask();
|
||||
taskBean.createTask(jsonTaskParam);
|
||||
//子卷到装箱区
|
||||
agvTransfer(containers, deviceCode, boxSn);
|
||||
taskBean.immediateNotifyAcs(null);
|
||||
}
|
||||
|
||||
private void checkEntityList(JSONObject whereJson, List<PdmBiSubpackagerelation> packagerelationList) {
|
||||
JSONArray jsonArray = whereJson.getJSONArray("tableMater");
|
||||
if (jsonArray == null || jsonArray.size() == 0) {
|
||||
throw new BadRequestException("无选中子卷信息");
|
||||
} if (jsonArray == null || jsonArray.size() == 0) {
|
||||
throw new BadRequestException("无选中子卷信息");
|
||||
}
|
||||
if (ObjectUtils.isEmpty(packagerelationList)) {
|
||||
throw new BadRequestException("无选中子卷信息");
|
||||
}
|
||||
if (!packagerelationList.get(0).getBox_type().equals(whereJson.getString("checked"))){
|
||||
throw new BadRequestException("子卷订单bom的木箱规格与所选木箱规格不一致,请重新操作");
|
||||
}
|
||||
//检查是否存在已分配规格的子卷号
|
||||
if (packagerelationList.stream()
|
||||
.anyMatch(r -> !r.getStatus().equals("99"))) {
|
||||
@@ -448,10 +472,10 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
updateWrapper.set("status", "0");
|
||||
updateWrapper.in("workorder_id", workIdList);
|
||||
pdmBiSubpackagerelationMapper.update(null, updateWrapper);
|
||||
// agvTransfer(containerNameList, deviceCode, boxSn);
|
||||
//给MES传输子卷包装关系
|
||||
CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
log.error("----回传子卷包装关系----");
|
||||
String isConnect2 = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("IS_CONNECT_MES2").getValue();
|
||||
if ("1".equals(isConnect2)) {
|
||||
transferBoxPackageToMes(false, whereJson, containerNameList, boxSn, weightTotal);
|
||||
@@ -462,8 +486,6 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
}, pool);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 传输子卷包装关系至LMS
|
||||
*/
|
||||
|
||||
@@ -54,6 +54,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -1607,6 +1608,10 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
String paperWeight = param.getString("paper_weight");
|
||||
PdmBiSlittingproductionplan plan = slittingproductionplanService.getByContainerName(containerName);
|
||||
if (ObjectUtil.isNotEmpty(rollWeight)) {
|
||||
BigDecimal bigDecimal = new BigDecimal(rollWeight);
|
||||
if (bigDecimal.intValue()<50){
|
||||
throw new BadRequestException("子卷重量异常,不能小于50");
|
||||
}
|
||||
plan.setWeight(rollWeight);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(paperWeight)) {
|
||||
|
||||
@@ -268,6 +268,9 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
||||
apply_jo.put("container_type", vehicle_type);
|
||||
acsToWmsService.applyTwo(apply_jo);
|
||||
} else {
|
||||
if (split.length>data.getIntValue("qty")){
|
||||
throw new BadRequestException("当前拆叠盘托盘不足"+split.length+"个");
|
||||
}
|
||||
if (!data.getString("container_type").equals(vehicle_type)) {
|
||||
if (data.getString("container_type").equals("0")) {
|
||||
throw new BadRequestException("当前电气反馈的托盘类型为0,请检查!");
|
||||
|
||||
@@ -139,15 +139,70 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
|
||||
WQLObject veExtTab = WQLObject.getWQLObject("md_pb_storagevehicleext");
|
||||
whereJson.put("stor_id", IOSEnum.STOR_ID.code("二期"));
|
||||
whereJson.put("sect_id", RegionTypeEnum.TWO_BZC01.getId());
|
||||
/*
|
||||
* 判断是否有相同规格的木箱
|
||||
* 判断条件:库区、仓库、是否启用、是否删除、未锁定、有载具、相同规格的木箱
|
||||
*/
|
||||
String block_num = whereJson.getString("move_block_num");
|
||||
if (ObjectUtil.isEmpty(block_num)) {
|
||||
whereJson.put("flag", "6");
|
||||
} else {
|
||||
whereJson.put("flag", "7");
|
||||
}
|
||||
JSONArray structArray = WQL.getWO("BST_OUTBOX").addParamMap(whereJson).process().getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(structArray)) {
|
||||
notOutRowList.clear();
|
||||
notOutBlockList.clear();
|
||||
if (ObjectUtil.isNotEmpty(block_num)) {
|
||||
throw new BadRequestException(block_num+"号巷道没有相同规格的木箱!木箱料号:"+whereJson.getString("material_code"));
|
||||
} else {
|
||||
throw new BadRequestException("没有相同规格的木箱!");
|
||||
}
|
||||
|
||||
JSONObject jsonAttr = getStruct(whereJson);
|
||||
|
||||
}
|
||||
// 确定巷道:找相同规格木箱的最多的巷道
|
||||
if (ObjectUtil.isEmpty(block_num)) {
|
||||
block_num = getMaxBlock(whereJson);
|
||||
}
|
||||
// 确定排:找某一巷道规格木箱的最多排
|
||||
whereJson.put("block_num", block_num);
|
||||
String row_num = getMaxRow(whereJson);
|
||||
// 确定仓位
|
||||
whereJson.put("row_num", row_num);
|
||||
whereJson.put("notMove",true);
|
||||
JSONObject jsonAttr = getBox(whereJson);
|
||||
// 为空则新找巷道
|
||||
if (ObjectUtil.isEmpty(jsonAttr)) {
|
||||
whereJson.put("flag", "1");
|
||||
notOutBlockList.add(whereJson.getString("block_num"));
|
||||
String join = "('" + String.join("','", notOutBlockList) + "')";
|
||||
whereJson.put("not_block_id", join);
|
||||
List<JSONObject> blockList = WQL.getWO("BST_OUTBOX").addParamMap(whereJson)
|
||||
.process().getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
for (int i = 0; i < blockList.size(); i++) {
|
||||
JSONObject json = blockList.get(i);
|
||||
json.put("stor_id", whereJson.getString("stor_id"));
|
||||
json.put("sect_id", whereJson.getString("sect_id"));
|
||||
json.put("box_length", whereJson.getString("box_length"));
|
||||
json.put("box_width", whereJson.getString("box_width"));
|
||||
json.put("box_high", whereJson.getString("box_high"));
|
||||
json.put("num", whereJson.getString("num"));
|
||||
String row_num_2 = getMaxRow(json);
|
||||
json.put("row_num", row_num_2);
|
||||
JSONObject jsonAttr_2 = getBox(json);
|
||||
if (ObjectUtil.isNotEmpty(jsonAttr_2)) {
|
||||
jsonAttr = jsonAttr_2;
|
||||
break;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isEmpty(jsonAttr)) {
|
||||
notOutRowList.clear();
|
||||
notOutBlockList.clear();
|
||||
throw new BadRequestException("没有符合规格的木箱!");
|
||||
}
|
||||
|
||||
// 查询木箱对应的托盘号
|
||||
JSONObject jsonVeExt = veExtTab.query("pcsn = '" + jsonAttr.getString("storagevehicle_code") + "'")
|
||||
.uniqueResult(0);
|
||||
@@ -571,9 +626,10 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
|
||||
break;
|
||||
} else {
|
||||
// 创建木箱移库单
|
||||
String task_group_id = createBoxMove(lowAttr.get(0));
|
||||
|
||||
json.put("task_group_id", task_group_id);
|
||||
if (whereJson.getBoolean("notMove") ==null){
|
||||
String task_group_id = createBoxMove(lowAttr.get(0));
|
||||
json.put("task_group_id", task_group_id);
|
||||
}
|
||||
jsonAttr = json;
|
||||
break;
|
||||
}
|
||||
@@ -630,7 +686,7 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
|
||||
* @param jsonObject : 需要移库的仓位对象
|
||||
* @return String: 任务组标识
|
||||
*/
|
||||
private String createBoxMove(JSONObject jsonObject) {
|
||||
public String createBoxMove(JSONObject jsonObject) {
|
||||
WQLObject attrTab = WQLObject.getWQLObject("st_ivt_structattr");
|
||||
// 载具扩展属性表
|
||||
WQLObject extTab = WQLObject.getWQLObject("md_pb_storagevehicleext");
|
||||
|
||||
@@ -45,4 +45,11 @@ public interface OutBoxManageService {
|
||||
*/
|
||||
String taskExceptionalOut(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* 木箱移库
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
public String createBoxMove(JSONObject jsonObject);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user