fix:重量校验
This commit is contained in:
@@ -231,6 +231,7 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
|
||||
JSONObject jo = new JSONObject();
|
||||
SlitterTaskUtil.doSavePaperInfos(list, jo);
|
||||
jo.put("product_area", bstIvtStockingivt.getProduct_area());
|
||||
jo.put("deivce_code", bstIvtStockingivt.getPoint_code());
|
||||
wmsToAcsService.getTubeMsg(jo);
|
||||
}
|
||||
|
||||
|
||||
@@ -153,6 +153,9 @@ public class PdmBiSlittingproductionplan implements Serializable {
|
||||
/** 气涨轴规格 */
|
||||
private String qzz_size;
|
||||
|
||||
/** 气涨轴代数 */
|
||||
private String qzz_generation;
|
||||
|
||||
/** 子卷等级*/
|
||||
private String level;
|
||||
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
package org.nl.b_lms.sch.tasks;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.impl.LashManageServiceImpl;
|
||||
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.wms.sch.AcsTaskDto;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 堆垛机点位至行架点位任务(出库)
|
||||
* Created by Lxy on 2021/12/22.
|
||||
*/
|
||||
@Service
|
||||
public class TwoExceptionInTask extends AbstractAcsTask {
|
||||
private final String THIS_CLASS = TwoExceptionInTask.class.getName();
|
||||
|
||||
@Override
|
||||
public List<AcsTaskDto> addTask() {
|
||||
/*
|
||||
* 下发给ACS时需要特殊处理
|
||||
*/
|
||||
//任务表
|
||||
WQLObject wo_Task = WQLObject.getWQLObject("sch_base_task");
|
||||
|
||||
JSONArray taskArr = WQLObject.getWQLObject("SCH_BASE_Task").query("handle_class = '" + THIS_CLASS + "' and task_status = '" + TaskStatusEnum.START_AND_POINT.getCode() + "' and is_delete ='0'").getResultJSONArray(0);
|
||||
|
||||
ArrayList<AcsTaskDto> resultList = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < taskArr.size(); i++) {
|
||||
JSONObject json = taskArr.getJSONObject(i);
|
||||
|
||||
char dtl_type = json.getString("task_type").charAt(json.getString("task_type").length() - 1);
|
||||
AcsTaskDto dto = AcsTaskDto.builder()
|
||||
.ext_task_id(json.getString("task_id"))
|
||||
.task_code(json.getString("task_code"))
|
||||
.task_type(json.getString("acs_task_type"))
|
||||
.start_device_code(json.getString("point_code1"))
|
||||
.next_device_code(json.getString("point_code2"))
|
||||
.vehicle_code(json.getString("vehicle_code"))
|
||||
.interaction_json(json.getJSONObject("request_param"))
|
||||
.priority(json.getString("priority"))
|
||||
.class_type(json.getString("task_type"))
|
||||
.dtl_type(String.valueOf(dtl_type))
|
||||
.remark(json.getString("remark"))
|
||||
.build();
|
||||
resultList.add(dto);
|
||||
|
||||
// 更新任务为下发
|
||||
JSONObject paramMap = new JSONObject();
|
||||
paramMap.put("task_status", TaskStatusEnum.ISSUE.getCode());
|
||||
wo_Task.update(paramMap, "task_id ='" + json.getString("task_id") + "'");
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateTaskStatus(JSONObject taskObj, String status) {
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表
|
||||
|
||||
String task_id = taskObj.getString("task_id");
|
||||
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "' and task_status < '07'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonTask)) {
|
||||
if (status.equals(IOSEnum.IS_NOTANDYES.code("否"))) {
|
||||
// 任务为执行之后就不允许取消
|
||||
if (jsonTask.getIntValue("task_status") > Integer.parseInt(TaskStatusEnum.ISSUE.getCode())) {
|
||||
throw new BadRequestException("任务:" + jsonTask.getString("task_code") + "已执行,不可取消");
|
||||
}
|
||||
|
||||
// 更新删除字段
|
||||
jsonTask.put("is_delete", "1");
|
||||
jsonTask.put("update_time", DateUtil.now());
|
||||
taskTab.update(jsonTask);
|
||||
}
|
||||
|
||||
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
|
||||
// 更新任务状态为执行中
|
||||
jsonTask.put("task_status", TaskStatusEnum.EXECUTING.getCode());
|
||||
jsonTask.put("update_time", DateUtil.now());
|
||||
taskTab.update(jsonTask);
|
||||
|
||||
}
|
||||
|
||||
if (StrUtil.equals(status, TaskStatusEnum.FINISHED.getCode())) {
|
||||
// 更新任务完成
|
||||
jsonTask.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
||||
jsonTask.put("update_time", DateUtil.now());
|
||||
taskTab.update(jsonTask);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findStartPoint() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findNextPoint() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createTask(JSONObject form) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
json.put("task_code", IdUtil.getSnowflake(1, 1).nextId());
|
||||
|
||||
json.put("task_type", form.getString("task_type"));
|
||||
json.put("vehicle_code", form.getString("vehicle_code"));
|
||||
json.put("point_code1", form.getString("point_code1"));
|
||||
json.put("point_code2", form.getString("point_code2"));
|
||||
json.put("request_param", form.getString("request_param"));
|
||||
|
||||
json.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
json.put("handle_class", THIS_CLASS);
|
||||
json.put("create_id", currentUserId);
|
||||
json.put("create_name", currentUsername);
|
||||
json.put("create_time", DateUtil.now());
|
||||
json.put("acs_task_type", "7");
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").insert(json);
|
||||
|
||||
return json.getString("task_id");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void forceFinish(String task_id) {
|
||||
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
this.updateTaskStatus(taskObj, TaskStatusEnum.FINISHED.getCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel(String task_id) {
|
||||
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
this.updateTaskStatus(taskObj, IOSEnum.IS_NOTANDYES.code("否"));
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,21 @@
|
||||
package org.nl.b_lms.storage_manage.database.controller;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
||||
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
@@ -37,5 +35,18 @@ public class BstIvtBoxinfoController {
|
||||
return new ResponseEntity<>(iBstIvtBoxinfoService.queryAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/saveBoxInfo")
|
||||
@Log("保存木箱信息")
|
||||
public ResponseEntity<Object> saveBoxInfo(@RequestBody JSONObject jsonObject) {
|
||||
iBstIvtBoxinfoService.saveBoxInfo(jsonObject);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getBoxInfo")
|
||||
@Log("查询木箱信息")
|
||||
public ResponseEntity<Object> query(@RequestBody JSONObject jsonObject) {
|
||||
return new ResponseEntity<>(iBstIvtBoxinfoService.getBoxInfo(jsonObject), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
@@ -18,7 +18,6 @@ import java.util.Map;
|
||||
public interface IBstIvtBoxinfoService extends IService<BstIvtBoxinfo> {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
@@ -29,22 +28,22 @@ public interface IBstIvtBoxinfoService extends IService<BstIvtBoxinfo> {
|
||||
Map<String, Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据mes信息插入木箱信息
|
||||
* @param whereJson:{
|
||||
* Length:长
|
||||
* Width:宽
|
||||
* Height:高
|
||||
* ProductName:物料编码
|
||||
* Description:物料名称(根据"|"截取第三个和第四个之间的数值 = 子卷数)
|
||||
* ContainerName:木箱号
|
||||
* }
|
||||
*
|
||||
* @param whereJson:{ Length:长
|
||||
* Width:宽
|
||||
* Height:高
|
||||
* ProductName:物料编码
|
||||
* Description:物料名称(根据"|"截取第三个和第四个之间的数值 = 子卷数)
|
||||
* ContainerName:木箱号
|
||||
* }
|
||||
* @return BstIvtBoxinfo: 木箱信息实体类
|
||||
*/
|
||||
BstIvtBoxinfo mesInsert(JSONObject whereJson);
|
||||
|
||||
void saveBoxInfo(JSONObject jsonObject);
|
||||
|
||||
BstIvtBoxinfo getBoxInfo(JSONObject jsonObject);
|
||||
|
||||
}
|
||||
|
||||
@@ -87,5 +87,7 @@ public class BstIvtBoxinfo implements Serializable {
|
||||
*/
|
||||
private String insert_time;
|
||||
|
||||
private String box_weight;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package org.nl.b_lms.storage_manage.database.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -9,10 +10,12 @@ 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.common.utils.IdUtil;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -41,7 +44,7 @@ public class BstIvtBoxinfoServiceImpl extends ServiceImpl<BstIvtBoxinfoMapper, B
|
||||
if (whereJson.containsKey("search")) {
|
||||
queryWrapper.like(BstIvtBoxinfo::getBox_no, whereJson.get("search")).or().like(BstIvtBoxinfo::getMaterial_code, whereJson.get("search")).or().like(BstIvtBoxinfo::getMaterial_name, whereJson.get("search"));
|
||||
}
|
||||
IPage<BstIvtBoxinfo> result = bstIvtBoxinfoMapper.selectPage(new Page<>(page.getPageNumber() + 1, page.getPageSize()),queryWrapper);
|
||||
IPage<BstIvtBoxinfo> result = bstIvtBoxinfoMapper.selectPage(new Page<>(page.getPageNumber() + 1, page.getPageSize()), queryWrapper);
|
||||
mapReslt.put("content", result.getRecords());
|
||||
mapReslt.put("totalElements", result.getTotal());
|
||||
return mapReslt;
|
||||
@@ -56,7 +59,7 @@ public class BstIvtBoxinfoServiceImpl extends ServiceImpl<BstIvtBoxinfoMapper, B
|
||||
String vehicle_type = "";
|
||||
if (length <= Integer.parseInt(boxLength)) {
|
||||
vehicle_type = "1";
|
||||
}else {
|
||||
} else {
|
||||
vehicle_type = "2";
|
||||
}
|
||||
|
||||
@@ -90,4 +93,26 @@ public class BstIvtBoxinfoServiceImpl extends ServiceImpl<BstIvtBoxinfoMapper, B
|
||||
|
||||
return boxDao;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveBoxInfo(JSONObject jsonObject) {
|
||||
String boxNo = jsonObject.getString("box_no");
|
||||
String box_weight = jsonObject.getString("box_weight");
|
||||
BstIvtBoxinfo boxinfo = bstIvtBoxinfoMapper.selectOne(new LambdaQueryWrapper<BstIvtBoxinfo>().eq(BstIvtBoxinfo::getBox_no, boxNo));
|
||||
if (boxinfo == null) {
|
||||
throw new BadRequestException("未查询到该木箱对应的木箱信息");
|
||||
}
|
||||
boxinfo.setBox_weight(box_weight);
|
||||
bstIvtBoxinfoMapper.updateById(boxinfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BstIvtBoxinfo getBoxInfo(JSONObject jsonObject) {
|
||||
String boxNo = jsonObject.getString("box_no");
|
||||
BstIvtBoxinfo boxinfo = bstIvtBoxinfoMapper.selectOne(new LambdaQueryWrapper<BstIvtBoxinfo>().eq(BstIvtBoxinfo::getBox_no, boxNo));
|
||||
if (boxinfo == null) {
|
||||
throw new BadRequestException("未查询到该木箱对应的木箱信息");
|
||||
}
|
||||
return boxinfo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ 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.service.IschBaseTaskService;
|
||||
import org.nl.b_lms.sch.tasks.TwoBoxExcepTask;
|
||||
import org.nl.b_lms.sch.tasks.TwoExceptionInTask;
|
||||
import org.nl.b_lms.sch.tasks.TwoOutHeapTask;
|
||||
import org.nl.b_lms.sch.tasks.first_floor_area.MzhcwTask;
|
||||
import org.nl.b_lms.sch.tasks.first_floor_area.SsxDjwTask;
|
||||
import org.nl.b_lms.sch.tasks.slitter.service.SlitterService;
|
||||
@@ -50,6 +52,7 @@ import org.nl.wms.pda.mps.service.CasingService;
|
||||
import org.nl.wms.pda.mps.service.ShippingService;
|
||||
import org.nl.wms.pda.mps.service.impl.BakingServiceImpl;
|
||||
import org.nl.wms.pda.st.service.impl.PrintServiceImpl;
|
||||
import org.nl.wms.sch.ComPareUtil;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.sch.tasks.CutConveyorTask;
|
||||
import org.nl.wms.sch.tasks.EmptyVehicleTask;
|
||||
@@ -295,7 +298,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
String type = whereJson.getString("type");
|
||||
JSONObject result = new JSONObject();
|
||||
RLock lock = redissonClient.getLock("acs_to_wms:" + type);
|
||||
boolean tryLock = lock.tryLock(5,20, TimeUnit.SECONDS);
|
||||
boolean tryLock = lock.tryLock(5, 20, TimeUnit.SECONDS);
|
||||
try {
|
||||
if (tryLock) {
|
||||
String device_code = whereJson.getString("device_code");
|
||||
@@ -554,8 +557,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
//判断是否开启了系统参数生成AGV搬运任务
|
||||
String agv_transport = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("agv_transport").getValue();
|
||||
//如果未开启AGV搬运则不创建从1016到发货区的任务
|
||||
if (agv_transport.equals("0")){
|
||||
log.info("未开启AGV搬运系统参数,不生成AGV搬运["+vehicle_code+"]任务!");
|
||||
if (agv_transport.equals("0")) {
|
||||
log.info("未开启AGV搬运系统参数,不生成AGV搬运[" + vehicle_code + "]任务!");
|
||||
JSONArray sub_rows2 = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_sn = '" + vehicle_code + "'").getResultJSONArray(0);
|
||||
for (int i = 0; i < sub_rows2.size(); i++) {
|
||||
JSONObject sub_row = sub_rows2.getJSONObject(i);
|
||||
@@ -735,7 +738,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
if (lock.isLocked() && lock.isHeldByCurrentThread()) {
|
||||
try {
|
||||
lock.unlock();
|
||||
}catch (Exception ex){}
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
}
|
||||
}
|
||||
result.put("status", HttpStatus.BAD_REQUEST.value());
|
||||
@@ -1438,9 +1442,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
ivt_shaftivt.update(point1_jo);
|
||||
} else if ("010607".equals(point_type) || "010603".equals(point_type) || "010606".equals(point_type)) {
|
||||
JSONObject point1_jo = ivt_shaftivt.query("point_code = '" + task_jo.getString("point_code1") + "'").uniqueResult(0);
|
||||
if(point1_jo.getString("point_type").equals("1")){
|
||||
if (point1_jo.getString("point_type").equals("1")) {
|
||||
point1_jo.put("have_qzz", "0");
|
||||
}else {
|
||||
} else {
|
||||
point1_jo.put("qzz_size", "");
|
||||
point1_jo.put("qzz_generation", "");
|
||||
point1_jo.put("have_qzz", "0");
|
||||
@@ -1838,7 +1842,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
}
|
||||
} else {
|
||||
//如果满轴位没有可用的空点位,先创建一个桁架任务但是不下发,等这边空出来点位,判断是否有这种桁架任务然后补发;
|
||||
List<SchBaseTask> existTaskList = getExistTasks(PackageInfoIvtEnum.TASK_TYPE.code("输送线->满轴缓存位"),containerName);
|
||||
List<SchBaseTask> existTaskList = getExistTasks(PackageInfoIvtEnum.TASK_TYPE.code("输送线->满轴缓存位"), containerName);
|
||||
//如果有就不创建,没有就创建
|
||||
if (CollectionUtils.isEmpty(existTaskList)) {
|
||||
//只确定起点NBJ1002
|
||||
@@ -1978,8 +1982,33 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
if (whereJson.getIntValue("weight") <= 0) {
|
||||
throw new BadRequestException("上报的重量不能为0!");
|
||||
}
|
||||
whereJson.put("bill_type", IOSEnum.IN_TYPE.code("生产入库"));
|
||||
inBussManageService.inTask(whereJson);
|
||||
JSONObject jsonObject = ComPareUtil.CompareWhight(whereJson);
|
||||
if (jsonObject.getBoolean("compaer_result")) {
|
||||
whereJson.put("bill_type", IOSEnum.IN_TYPE.code("生产入库"));
|
||||
inBussManageService.inTask(whereJson);
|
||||
} else {
|
||||
JSONObject jsonTaskParam = new JSONObject();
|
||||
//创建异常任务去异常入库口
|
||||
//入库口
|
||||
jsonTaskParam.put("point_code1", "RK1018");
|
||||
//异常位
|
||||
jsonTaskParam.put("point_code2", "RK1003");
|
||||
jsonTaskParam.put("vehicle_code", jsonObject.getString("box_no"));
|
||||
jsonTaskParam.put("vehicle_code2", whereJson.getString("vehicle_code"));
|
||||
JSONObject request_param = new JSONObject();
|
||||
if (whereJson.getString("vehicle_code").startsWith("A")) {
|
||||
request_param.put("containerType", "2");
|
||||
} else if (whereJson.getString("vehicle_code").startsWith("B")) {
|
||||
request_param.put("containerType", "1");
|
||||
} else {
|
||||
throw new BadRequestException("托盘号有误,无法找到对应的托盘类型!");
|
||||
}
|
||||
jsonTaskParam.put("request_param", request_param);
|
||||
TwoExceptionInTask bean = SpringContextHolder.getBean(TwoExceptionInTask.class);
|
||||
bean.createTask(jsonTaskParam);
|
||||
bean.immediateNotifyAcs(null);
|
||||
}
|
||||
|
||||
} else if (type.equals(IOSEnum.ACSTOLMS_TYPE.code("空盘入库"))) {
|
||||
// 2-空盘入库
|
||||
whereJson.put("vehicle_type", whereJson.getString("container_type"));
|
||||
@@ -2452,7 +2481,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.info("1层空托盘区扩容失败:"+e.getMessage());
|
||||
log.info("1层空托盘区扩容失败:" + e.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2461,15 +2490,16 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
jsonParam.put("sect_id", RegionTypeEnum.KTP01.getId());
|
||||
jsonParam.put("sect_code", "KTP01");
|
||||
jsonParam.put("sect_name", RegionTypeEnum.KTP01.getName());
|
||||
attr.update(jsonParam,"sect_code = 'ZC01' AND block_num = '"+block_num+"' AND row_num = '"+row_num+"' AND layer_num = '1'");
|
||||
attr.update(jsonParam, "sect_code = 'ZC01' AND block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND layer_num = '1'");
|
||||
|
||||
// 更新点位为主存区域
|
||||
jsonParam.put("region_id", RegionTypeEnum.KTP01.getId());
|
||||
jsonParam.put("region_code", "KTP01");
|
||||
jsonParam.put("region_name", RegionTypeEnum.KTP01.getName());
|
||||
point.update(jsonParam,"region_code = 'ZC01' AND block_num = '"+block_num+"' AND row_num = '"+row_num+"' AND layer_num = '1'");
|
||||
point.update(jsonParam, "region_code = 'ZC01' AND block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND layer_num = '1'");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject actionFinishRequest2(JSONObject param) {
|
||||
return slitterService.acsActionFinishRequestToRelease(param);
|
||||
|
||||
@@ -527,7 +527,9 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
String SplitBreadth = param.getString("SplitBreadth"); // 子卷幅宽
|
||||
String SplitHeight = param.getString("SplitHeight"); // 子卷理论长度
|
||||
String SplitWeight = param.getString("SplitWeight"); // 子卷理论重量
|
||||
String Attribute2 = param.getString("Attribute2"); // 销售订单及行号
|
||||
// String Attribute2 = param.getString("Attribute2"); // 销售订单及行号
|
||||
String Attribute2 = param.getString("Attribute2"); // 上下轴
|
||||
String Attribute3 = param.getString("Attribute3"); // 位置左右
|
||||
|
||||
WQLObject tab = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan");
|
||||
|
||||
@@ -597,6 +599,8 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
* 1.当管件类型为1(纸筒)时 PaperTubeMaterial 纸筒物料编码、PaperTubeDescription 纸筒物料描述、PaperTubeModel 纸筒规格 不能为空
|
||||
* 2.当管件类型为2(FRP管)时 FRPMaterial FRP管物料编码、FRPDescription FRP管物料描述、FRPModel FRP管规格 不能为空
|
||||
*/
|
||||
String qzz_generation = "0";
|
||||
String qzz_size = "0";
|
||||
if (StrUtil.equals(PaperTubeOrFRP, "1")) {
|
||||
if (ObjectUtil.isEmpty(param.getString("PaperTubeMaterial"))) {
|
||||
throw new BadRequestException("纸筒物料编码不能为空");
|
||||
@@ -607,6 +611,16 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
if (ObjectUtil.isEmpty(param.getString("PaperTubeModel"))) {
|
||||
throw new BadRequestException("纸筒规格不能为空");
|
||||
}
|
||||
if (param.getString("PaperTubeDescription").contains("3.12")) {
|
||||
qzz_generation = "4";
|
||||
}
|
||||
if (param.getString("PaperTubeDescription").contains("3.15")) {
|
||||
qzz_generation = "5";
|
||||
}
|
||||
// 解析描述数组
|
||||
String[] tubeArray = param.getString("PaperTubeDescription").split("\\|");
|
||||
// 定义尺寸与长度
|
||||
qzz_size = Character.toString(tubeArray[2].charAt(0));
|
||||
} else {
|
||||
if (ObjectUtil.isEmpty(param.getString("FRPMaterial"))) {
|
||||
throw new BadRequestException("FRP管物料编码不能为空");
|
||||
@@ -617,6 +631,16 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
if (ObjectUtil.isEmpty(param.getString("FRPModel"))) {
|
||||
throw new BadRequestException("FRP管规格不能为空");
|
||||
}
|
||||
if (param.getString("FRPDescription").contains("3.12")) {
|
||||
qzz_generation = "4";
|
||||
}
|
||||
if (param.getString("FRPDescription").contains("3.15")) {
|
||||
qzz_generation = "5";
|
||||
}
|
||||
// 解析描述数组
|
||||
String[] tubeArray = param.getString("FRPDescription").split("\\|");
|
||||
// 定义尺寸与长度
|
||||
qzz_size = Character.toString(tubeArray[2].charAt(0));
|
||||
}
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
@@ -644,9 +668,17 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
json.put("split_breadth", SplitBreadth);
|
||||
json.put("split_height", SplitHeight);
|
||||
json.put("split_weight", SplitWeight);
|
||||
json.put("sale_order_name", Attribute2);
|
||||
json.put("up_or_down", Attribute2);
|
||||
json.put("left_or_right", Attribute3);
|
||||
json.put("qzz_size", qzz_size);
|
||||
if (ResourceName.startsWith("B5") || ResourceName.startsWith("B6")) {
|
||||
json.put("is_paper_ok", "1");
|
||||
}
|
||||
// json.put("sale_order_name", Attribute2);
|
||||
|
||||
json.put("start_time", DateUtil.now());
|
||||
json.put("status", "01");
|
||||
json.put("qzz_generation", qzz_generation);
|
||||
json.put("is_parent_ok", "0");
|
||||
json.put("is_child_tz_ok", "0");
|
||||
json.put("is_child_ps_ok", "0");
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
package org.nl.wms.sch;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
||||
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService;
|
||||
import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo;
|
||||
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.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class ComPareUtil {
|
||||
|
||||
public static JSONObject CompareWhight(JSONObject jsonObject) {
|
||||
|
||||
WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelation");
|
||||
|
||||
String vehicle_code = jsonObject.getString("vehicle_code");
|
||||
|
||||
// 处理子卷号
|
||||
String material_barcode = jsonObject.getString("material_barcode");
|
||||
if (ObjectUtil.isEmpty(material_barcode)) {
|
||||
throw new BadRequestException("子卷号不能为空!");
|
||||
}
|
||||
|
||||
List<String> pcsnList = Arrays.asList(material_barcode.split(","));
|
||||
// 查询子卷包装关系
|
||||
List<JSONObject> subList = subTab.query("container_name in ('" + String.join("','", pcsnList) + "') and status in ('0','1','99')")
|
||||
.getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
if (ObjectUtil.isEmpty(subList)) {
|
||||
throw new BadRequestException("未查询到子卷包装信息!");
|
||||
}
|
||||
if (StringUtils.isBlank(subList.get(0).getString("package_box_sn"))) {
|
||||
throw new BadRequestException("木箱号不能为空!");
|
||||
}
|
||||
//查询托盘重量
|
||||
JSONObject vehicle_ext = WQLObject.getWQLObject("").query("storagevehicle_code = '" + vehicle_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(vehicle_ext)) {
|
||||
throw new BadRequestException("未查询到托盘的扩展信息");
|
||||
}
|
||||
IpdmBiSubpackagerelationService ipdmBiSubpackagerelationService = SpringContextHolder.getBean(IpdmBiSubpackagerelationService.class);
|
||||
List<PdmBiSubpackagerelation> list = ipdmBiSubpackagerelationService.list(new LambdaQueryWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getPackage_box_sn, vehicle_ext.getString("pcsn")));
|
||||
if (ObjectUtil.isEmpty(list)) {
|
||||
throw new BadRequestException("未查询到对应的木箱包装关系!");
|
||||
}
|
||||
PdmBiSubpackagerelation sub = list.get(0);
|
||||
|
||||
|
||||
double vehicle_weight = vehicle_ext.getDoubleValue("qty");
|
||||
double current_weight = NumberUtil.sub(jsonObject.getDoubleValue("weight"), vehicle_weight);
|
||||
double box_weight = sub.getBox_weight().doubleValue();
|
||||
|
||||
double weight_sys = Double.parseDouble(SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("weight_sys").getValue());
|
||||
|
||||
boolean compaer_result = true;
|
||||
if (!(NumberUtil.sub(box_weight, weight_sys) <= current_weight && NumberUtil.add(box_weight, weight_sys) >= current_weight)) {
|
||||
compaer_result = false;
|
||||
}
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("compaer_result", compaer_result);
|
||||
json.put("box_no", sub.getPackage_box_sn());
|
||||
return json;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user