add:生产入库增加直接入库功能
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
package org.nl.b_lms.pdm.info.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 子卷下线记录表
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-07-19
|
||||
*/
|
||||
@Data
|
||||
@TableName("pdm_bi_containerinbound")
|
||||
public class PdmBiContainerinbound implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 标识
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 子卷号
|
||||
*/
|
||||
private String container_name;
|
||||
/**
|
||||
* 木箱
|
||||
*/
|
||||
private String box;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 直接入库
|
||||
*/
|
||||
private Boolean inbound;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.nl.b_lms.pdm.info.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.b_lms.pdm.info.dao.PdmBiContainerinbound;
|
||||
import org.nl.b_lms.pdm.info.dao.PdmBiContainerinfo;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 子卷下线记录表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-07-19
|
||||
*/
|
||||
public interface PdmBiContainerinboundMapper extends BaseMapper<PdmBiContainerinbound> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.nl.b_lms.pdm.info.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.b_lms.pdm.info.dao.PdmBiContainerinbound;
|
||||
import org.nl.b_lms.pdm.info.dao.PdmBiContainerinfo;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 子卷下线记录表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-07-19
|
||||
*/
|
||||
public interface IPdmBiContainerinboundService extends IService<PdmBiContainerinbound> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.nl.b_lms.pdm.info.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.b_lms.pdm.info.dao.PdmBiContainerinbound;
|
||||
import org.nl.b_lms.pdm.info.mapper.PdmBiContainerinboundMapper;
|
||||
import org.nl.b_lms.pdm.info.service.IPdmBiContainerinboundService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 子卷下线记录表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-07-19
|
||||
*/
|
||||
@Service
|
||||
public class PdmBiContainerinbooundServiceImpl extends ServiceImpl<PdmBiContainerinboundMapper, PdmBiContainerinbound> implements IPdmBiContainerinboundService {
|
||||
|
||||
|
||||
}
|
||||
@@ -21,7 +21,9 @@ import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.IPdmBiSlittingproductionplanService;
|
||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
|
||||
import org.nl.b_lms.pdm.info.dao.PdmBiContainerinbound;
|
||||
import org.nl.b_lms.pdm.info.dao.PdmBiOrderbominfo;
|
||||
import org.nl.b_lms.pdm.info.service.IPdmBiContainerinboundService;
|
||||
import org.nl.b_lms.pdm.info.service.IPdmBiOrderbominfoService;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.mapper.PdmBiSubpackagerelationMapper;
|
||||
@@ -101,6 +103,9 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
@Autowired
|
||||
private IPdmBiOrderbominfoService iPdmBiOrderbominfoService;
|
||||
|
||||
@Autowired
|
||||
private IPdmBiContainerinboundService iPdmBiContainerinboundService;
|
||||
|
||||
@Autowired
|
||||
private OutBoxManageService outBoxManageService;
|
||||
|
||||
@@ -115,10 +120,12 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
@Resource
|
||||
private BstIvtBoxinfoMapper bstIvtBoxinfoMapper;
|
||||
|
||||
@Autowired
|
||||
private TwoOutBoxTask twoOutBoxTask;
|
||||
|
||||
@Autowired
|
||||
private ISysParamService iSysParamService;
|
||||
@Resource
|
||||
private TaskQueue taskQueue;
|
||||
|
||||
@Resource
|
||||
@Qualifier("threadPoolExecutor")
|
||||
private ThreadPoolExecutor pool;
|
||||
@@ -428,7 +435,15 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PdmBiContainerinbound pdmBiContainerinbound = new PdmBiContainerinbound();
|
||||
pdmBiContainerinbound.setId(org.nl.common.utils.IdUtil.getStringId());
|
||||
pdmBiContainerinbound.setContainer_name(containerName);
|
||||
pdmBiContainerinbound.setBox(boxSn);
|
||||
Boolean inbound = param.getBoolean("inbound");
|
||||
if (inbound!=null){
|
||||
pdmBiContainerinbound.setInbound(inbound);
|
||||
}
|
||||
iPdmBiContainerinboundService.save(pdmBiContainerinbound);
|
||||
// 生成任务
|
||||
JSONObject jsonTaskParam = new JSONObject();
|
||||
jsonTaskParam.put("task_type", "010704");
|
||||
@@ -440,9 +455,8 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
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);
|
||||
taskBean.immediateNotifyAcs(null);
|
||||
twoOutBoxTask.createTask(jsonTaskParam);
|
||||
twoOutBoxTask.immediateNotifyAcs(null);
|
||||
|
||||
String is_labeling = iSysParamService.findByCode("is_checkbox").getValue();
|
||||
if (is_labeling.equals("1")) {
|
||||
|
||||
@@ -35,6 +35,7 @@ import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.nl.common.enums.PackageInfoIvtEnum.IVT_STATUS;
|
||||
import static org.nl.wms.util.TaskUtil.getRoutePlanCode;
|
||||
@@ -82,15 +83,13 @@ public class TwoOutBoxTask extends AbstractAcsTask {
|
||||
if (ObjectUtil.isNotEmpty(jsonPack.getString("container_name"))) {
|
||||
num += 1;
|
||||
}
|
||||
|
||||
ArrayList<AcsTaskDto> resultList = new ArrayList<>();
|
||||
// 如果缓存了4个箱子则不下发任务
|
||||
if (num >= 4) {
|
||||
if (num >= 3) {
|
||||
return resultList;
|
||||
}
|
||||
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
if (num >= 4) {
|
||||
if (num >= 3) {
|
||||
break;
|
||||
}
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
@@ -101,9 +100,6 @@ public class TwoOutBoxTask extends AbstractAcsTask {
|
||||
JSONObject 浅Attr = attrTab
|
||||
.query("zdepth = '1' and row_num = '"+attr.getString("row_num")+"' and col_num = '" + attr.getString("col_num") + "' and layer_num = '"+attr.getString("layer_num")+"'")
|
||||
.uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(浅Attr)){
|
||||
continue;
|
||||
}
|
||||
if (ObjectUtil.isEmpty(浅Attr.getString("storagevehicle_code"))){
|
||||
if (!浅Attr.getString("lock_type").equals(IOSEnum.LOCK_TYPE.code("未锁定"))) {
|
||||
continue;
|
||||
@@ -117,10 +113,7 @@ public class TwoOutBoxTask extends AbstractAcsTask {
|
||||
.eq("is_delete", "0")
|
||||
.eq("point_code1", 浅Attr.getString("struct_code"))
|
||||
.lt("task_status", TaskStatusEnum.FINISHED.getCode()));
|
||||
Optional<SchBaseTask> any = list.stream().filter(a -> !a.getPoint_code2().equals("ZXQ_1_1")).findAny();
|
||||
if (any.isPresent()){
|
||||
SchBaseTask errortask = any.get();
|
||||
log.error("twoOutTask has error task"+errortask.getTask_code());
|
||||
if (!CollectionUtils.isEmpty(list)){
|
||||
continue;
|
||||
}else {
|
||||
outBoxManageService.createBoxMove(浅Attr);
|
||||
|
||||
@@ -46,6 +46,9 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
public class OutBoxManageServiceImpl implements OutBoxManageService {
|
||||
|
||||
@Autowired
|
||||
private TwoOutBoxTask twoOutBoxTask;
|
||||
|
||||
/**
|
||||
* 出库不需要查询的排集合
|
||||
*/
|
||||
@@ -123,9 +126,8 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
|
||||
JSONObject request_param = new JSONObject();
|
||||
request_param.put("containerType", jsonAttr.getString("storagevehicle_type"));
|
||||
jsonTaskParam.put("request_param", request_param.toString());
|
||||
TwoOutBoxTask taskBean = new TwoOutBoxTask();
|
||||
taskBean.createTask(jsonTaskParam);
|
||||
taskBean.immediateNotifyAcs(null);
|
||||
twoOutBoxTask.createTask(jsonTaskParam);
|
||||
twoOutBoxTask.immediateNotifyAcs(null);
|
||||
// 锁定起点
|
||||
jsonAttr.put("lock_type", IOSEnum.LOCK_TYPE.code("验箱出库锁"));
|
||||
attrTab.update(jsonAttr);
|
||||
|
||||
@@ -24,6 +24,8 @@ import org.nl.b_lms.bst.ivt.shafttubeivt.service.dao.BstIvtShafttubeivt;
|
||||
import org.nl.b_lms.pda.service.ProductOutTwoService;
|
||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.IPdmBiSlittingproductionplanService;
|
||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
|
||||
import org.nl.b_lms.pdm.info.dao.PdmBiContainerinbound;
|
||||
import org.nl.b_lms.pdm.info.service.IPdmBiContainerinboundService;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
@@ -103,6 +105,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
|
||||
private final ISysNoticeService noticeService;
|
||||
|
||||
@Autowired
|
||||
private IPdmBiContainerinboundService iPdmBiContainerinboundService;
|
||||
|
||||
/**
|
||||
* 入库处理类服务
|
||||
*/
|
||||
@@ -2026,7 +2031,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
throw new BadRequestException("上报的重量不能为0!");
|
||||
}
|
||||
JSONObject jsonObject = ComPareUtil.CompareWhight(whereJson);
|
||||
if (jsonObject.getBoolean("compaer_result")) {
|
||||
Boolean inbound = jsonObject.getBoolean("inbound");
|
||||
Boolean compaerResult = jsonObject.getBoolean("compaer_result");
|
||||
String box_no = jsonObject.getString("box_no");
|
||||
Integer box_weight = jsonObject.getIntValue("box_weight");
|
||||
if (compaerResult && inbound) {
|
||||
whereJson.put("bill_type", IOSEnum.IN_TYPE.code("生产入库"));
|
||||
//"material_barcode":"C1101,","device_code":"RK1018","weight":500.95,"vehicle_code":"B01401","type":"1"
|
||||
int count = taskService.count(new QueryWrapper<SchBaseTask>()
|
||||
@@ -2043,6 +2052,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
}
|
||||
inBussManageService.inTask(whereJson);
|
||||
} else {
|
||||
if (!compaerResult){
|
||||
iPdmBiContainerinboundService
|
||||
.update(new UpdateWrapper<PdmBiContainerinbound>()
|
||||
.set("remark","称重"+whereJson.getIntValue("weight")+"与木箱重量"+box_weight+"不匹配")
|
||||
.eq("box",box_no));
|
||||
}
|
||||
//更新子卷入库备注信息
|
||||
JSONObject jsonTaskParam = new JSONObject();
|
||||
//创建异常任务去异常入库口
|
||||
//入库口
|
||||
|
||||
@@ -6,6 +6,8 @@ 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.info.dao.PdmBiContainerinbound;
|
||||
import org.nl.b_lms.pdm.info.service.IPdmBiContainerinboundService;
|
||||
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;
|
||||
@@ -67,10 +69,15 @@ public class ComPareUtil {
|
||||
if (!(NumberUtil.sub(box_weight, weight_sys) <= current_weight && NumberUtil.add(box_weight, weight_sys) >= current_weight)) {
|
||||
compaer_result = false;
|
||||
}
|
||||
|
||||
//查询子卷入库配置
|
||||
IPdmBiContainerinboundService iPdmBiContainerinboundService = SpringContextHolder.getBean(IPdmBiContainerinboundService.class);
|
||||
PdmBiContainerinbound pdmBiContainerinbound = iPdmBiContainerinboundService.getOne(new QueryWrapper<PdmBiContainerinbound>()
|
||||
.eq("box", sub.getPackage_box_sn()));
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("compaer_result", compaer_result);
|
||||
json.put("box_no", sub.getPackage_box_sn());
|
||||
json.put("box_weight", sub.getBox_weight().intValue());
|
||||
json.put("inbound", (pdmBiContainerinbound != null ? pdmBiContainerinbound.getInbound():false));
|
||||
return json;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ spring:
|
||||
freemarker:
|
||||
check-template-location: false
|
||||
profiles:
|
||||
active: dev
|
||||
active: prod
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
data:
|
||||
|
||||
Reference in New Issue
Block a user