add:子卷步序
This commit is contained in:
@@ -0,0 +1,64 @@
|
|||||||
|
package org.nl.b_lms.pdm.productSpec.controller;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.nl.b_lms.pdm.productSpec.dao.PdmProductSpec;
|
||||||
|
import org.nl.b_lms.pdm.productSpec.service.IpdmProductSpecService;
|
||||||
|
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||||
|
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
||||||
|
import org.nl.b_lms.sch.tasks.TwoOutBoxTask;
|
||||||
|
import org.nl.b_lms.sch.tasks.first_floor_area.auto.AutoSendVehicleToDjq;
|
||||||
|
import org.nl.b_lms.sch.tasks.first_floor_area.auto.Prun;
|
||||||
|
import org.nl.common.TableDataInfo;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||||
|
import org.nl.common.utils.RedissonUtils;
|
||||||
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
|
import org.nl.modules.logging.annotation.Log;
|
||||||
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
|
import org.redisson.api.RLock;
|
||||||
|
import org.redisson.api.RedissonClient;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@code @Description:} 子卷包装关系表(PdmBiSubpackagerelation)控制层
|
||||||
|
* {@code @Author:} gbx
|
||||||
|
*
|
||||||
|
* @since 2024-02-01
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RequestMapping("/api/pdmProductSpec")
|
||||||
|
@Slf4j
|
||||||
|
public class PdmProductSpecController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IpdmProductSpecService ipdmProductSpecService;
|
||||||
|
|
||||||
|
@GetMapping("/subSpec/{code}")
|
||||||
|
public ResponseEntity<Object> subSpec(@PathVariable String code) {
|
||||||
|
List result = new ArrayList<>();
|
||||||
|
if (!StringUtils.isEmpty(code)){
|
||||||
|
result = ipdmProductSpecService.list(new QueryWrapper<PdmProductSpec>()
|
||||||
|
.eq("container_name", code).orderByAsc("id"));
|
||||||
|
}
|
||||||
|
return new ResponseEntity<>(result, HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package org.nl.b_lms.pdm.productSpec.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 子卷生产步序表
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("pdm_product_spec")
|
||||||
|
public class PdmProductSpec extends Model<PdmProductSpec> {
|
||||||
|
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
private String container_name;
|
||||||
|
private Integer spec;
|
||||||
|
private String param;
|
||||||
|
private Boolean result;
|
||||||
|
private String msg;
|
||||||
|
private Date create_time;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package org.nl.b_lms.pdm.productSpec.dao.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.nl.b_lms.pdm.productSpec.dao.PdmProductSpec;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@code @Description:} 子卷包装关系表(PdmBiSubpackagerelation)数据持久层
|
||||||
|
* {@code @Author:} gbx
|
||||||
|
*
|
||||||
|
* @since 2024-02-01
|
||||||
|
*/
|
||||||
|
public interface PdmProductSpecMapper extends BaseMapper<PdmProductSpec> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package org.nl.b_lms.pdm.productSpec.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.nl.b_lms.pdm.productSpec.dao.PdmProductSpec;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.common.enums.SpecEnum;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@code @Description:} 子卷包装关系表(PdmBiSubpackagerelation)服务接口层
|
||||||
|
* {@code @Author:} gbx
|
||||||
|
*
|
||||||
|
* @since 2024-02-01
|
||||||
|
*/
|
||||||
|
public interface IpdmProductSpecService extends IService<PdmProductSpec> {
|
||||||
|
public void record(SpecEnum spec, Map param, Boolean sucess,String msg, List<String> container_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
package org.nl.b_lms.pdm.productSpec.service;
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package org.nl.b_lms.pdm.productSpec.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import lombok.extern.log4j.Log4j;
|
||||||
|
|
||||||
|
import org.nl.b_lms.pdm.productSpec.dao.PdmProductSpec;
|
||||||
|
import org.nl.b_lms.pdm.productSpec.dao.mapper.PdmProductSpecMapper;
|
||||||
|
import org.nl.b_lms.pdm.productSpec.service.IpdmProductSpecService;
|
||||||
|
import org.nl.common.enums.SpecEnum;
|
||||||
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@code @Description:} 子卷包装关系表(PdmBiSubpackagerelation)服务实现层
|
||||||
|
* {@code @Author:} gbx
|
||||||
|
*
|
||||||
|
* @since 2024-02-01
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Log4j
|
||||||
|
public class PdmProductSpecServiceImpl extends ServiceImpl<PdmProductSpecMapper, PdmProductSpec> implements IpdmProductSpecService {
|
||||||
|
|
||||||
|
|
||||||
|
public static void doRecord(SpecEnum spec, Map param, Boolean sucess,String msg, List<String> container_name) {
|
||||||
|
IpdmProductSpecService service = SpringContextHolder.getBean(IpdmProductSpecService.class);
|
||||||
|
service.record(spec,param,sucess,msg,container_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void doRecord(SpecEnum spec, Map param, Boolean sucess,String msg, String container_name) {
|
||||||
|
IpdmProductSpecService service = SpringContextHolder.getBean(IpdmProductSpecService.class);
|
||||||
|
List<String> list = new ArrayList<>();
|
||||||
|
list.add(container_name);
|
||||||
|
service.record(spec,param,sucess,msg,list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Async
|
||||||
|
public void record(SpecEnum spec, Map param, Boolean sucess,String msg, List<String> container_name) {
|
||||||
|
if (!CollectionUtils.isEmpty(container_name)){
|
||||||
|
for (String s : container_name) {
|
||||||
|
PdmProductSpec productSpec = new PdmProductSpec();
|
||||||
|
productSpec.setSpec(spec.getValue());
|
||||||
|
productSpec.setContainer_name(s);
|
||||||
|
productSpec.setResult(sucess);
|
||||||
|
productSpec.setMsg(msg);
|
||||||
|
if (!CollectionUtils.isEmpty(param)){
|
||||||
|
productSpec.setParam(JSONObject.toJSONString(param));
|
||||||
|
}
|
||||||
|
this.save(productSpec);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -25,6 +25,7 @@ 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.dao.PdmBiOrderbominfo;
|
||||||
import org.nl.b_lms.pdm.info.service.IPdmBiContainerinboundService;
|
import org.nl.b_lms.pdm.info.service.IPdmBiContainerinboundService;
|
||||||
import org.nl.b_lms.pdm.info.service.IPdmBiOrderbominfoService;
|
import org.nl.b_lms.pdm.info.service.IPdmBiOrderbominfoService;
|
||||||
|
import org.nl.b_lms.pdm.productSpec.service.impl.PdmProductSpecServiceImpl;
|
||||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||||
import org.nl.b_lms.pdm.subpackagerelation.dao.mapper.PdmBiSubpackagerelationMapper;
|
import org.nl.b_lms.pdm.subpackagerelation.dao.mapper.PdmBiSubpackagerelationMapper;
|
||||||
import org.nl.b_lms.pdm.subpackagerelation.dto.PdmBiSubpackagerelationDto;
|
import org.nl.b_lms.pdm.subpackagerelation.dto.PdmBiSubpackagerelationDto;
|
||||||
@@ -48,6 +49,7 @@ import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.OutBoxMana
|
|||||||
import org.nl.common.TableDataInfo;
|
import org.nl.common.TableDataInfo;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||||
|
import org.nl.common.enums.SpecEnum;
|
||||||
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.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
@@ -369,6 +371,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
|||||||
}
|
}
|
||||||
Set<String> collect = subList.stream().map(PdmBiSubpackagerelation::getPackage_box_sn).collect(Collectors.toSet());
|
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());
|
Set<String> containers = subList.stream().map(PdmBiSubpackagerelation::getContainer_name).collect(Collectors.toSet());
|
||||||
|
List<String> containerList = subList.stream().map(PdmBiSubpackagerelation::getContainer_name).collect(Collectors.toList());
|
||||||
if (collect.size() == 0){
|
if (collect.size() == 0){
|
||||||
throw new BadRequestException("当前子卷还未进行装箱组盘操作");
|
throw new BadRequestException("当前子卷还未进行装箱组盘操作");
|
||||||
}
|
}
|
||||||
@@ -455,26 +458,8 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
|||||||
jsonTaskParam.put("request_param", request_param.toString());
|
jsonTaskParam.put("request_param", request_param.toString());
|
||||||
twoOutBoxTask.createTask(jsonTaskParam);
|
twoOutBoxTask.createTask(jsonTaskParam);
|
||||||
twoOutBoxTask.immediateNotifyAcs(null);
|
twoOutBoxTask.immediateNotifyAcs(null);
|
||||||
|
PdmProductSpecServiceImpl.doRecord(SpecEnum.ZXRK,null,Boolean.TRUE,null,containerList);
|
||||||
|
|
||||||
// String is_labeling = iSysParamService.findByCode("is_checkbox").getValue();
|
|
||||||
// if (is_labeling.equals("1")) {
|
|
||||||
// //给MES传输验箱结果
|
|
||||||
// CompletableFuture.runAsync(() -> {
|
|
||||||
// try {
|
|
||||||
// log.debug("----回传子卷包装关系----");
|
|
||||||
// String isConnect2 = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("IS_CONNECT_MES2").getValue();
|
|
||||||
// if ("1".equals(isConnect2)) {
|
|
||||||
// JSONObject param_jo = new JSONObject();
|
|
||||||
// param_jo.put("box_no", boxSn);
|
|
||||||
// param_jo.put("box_weight", subList.get(0).getBox_weight());
|
|
||||||
//
|
|
||||||
// lmsToMesServiceImpl.BoxDataCollectionSubmit2(param_jo);
|
|
||||||
// }
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// log.error("验箱回传MES异常,BoxDataCollectionSubmit2给MES传输子卷包装关系异常,木箱号为:" + boxSn + ",异常信息:" + e);
|
|
||||||
// }
|
|
||||||
// }, pool);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkEntityList(JSONObject whereJson, List<PdmBiSubpackagerelation> packagerelationList) {
|
private void checkEntityList(JSONObject whereJson, List<PdmBiSubpackagerelation> packagerelationList) {
|
||||||
@@ -549,6 +534,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
|||||||
updateWrapper.in("workorder_id", workIdList);
|
updateWrapper.in("workorder_id", workIdList);
|
||||||
pdmBiSubpackagerelationMapper.update(null, updateWrapper);
|
pdmBiSubpackagerelationMapper.update(null, updateWrapper);
|
||||||
//给MES传输子卷包装关系
|
//给MES传输子卷包装关系
|
||||||
|
PdmProductSpecServiceImpl.doRecord(SpecEnum.BZ,null,Boolean.TRUE,null,containerNameList.stream().collect(Collectors.toList()));
|
||||||
CompletableFuture.runAsync(() -> {
|
CompletableFuture.runAsync(() -> {
|
||||||
try {
|
try {
|
||||||
log.error("----回传子卷包装关系----");
|
log.error("----回传子卷包装关系----");
|
||||||
@@ -796,6 +782,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
|||||||
}
|
}
|
||||||
this.removeById(containerName.getWorkorder_id());
|
this.removeById(containerName.getWorkorder_id());
|
||||||
result.put("message", code+"子卷包装解除成功,同时确认MES装箱以解绑定");
|
result.put("message", code+"子卷包装解除成功,同时确认MES装箱以解绑定");
|
||||||
|
PdmProductSpecServiceImpl.doRecord(SpecEnum.BZ_REMOVE,MapOf.of("子卷编号",code),Boolean.TRUE,null,code);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import org.nl.b_lms.pda.service.PrintTableTwoService;
|
|||||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.IPdmBiSlittingproductionplanService;
|
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.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
|
||||||
import org.nl.b_lms.pdm.info.service.IPdmBiContainerinfoService;
|
import org.nl.b_lms.pdm.info.service.IPdmBiContainerinfoService;
|
||||||
|
import org.nl.b_lms.pdm.productSpec.service.impl.PdmProductSpecServiceImpl;
|
||||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||||
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
||||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||||
@@ -30,6 +31,7 @@ import org.nl.b_lms.sch.tasks.first_floor_area.auto.AutoSendVehicleToDjq;
|
|||||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||||
|
import org.nl.common.enums.SpecEnum;
|
||||||
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.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
@@ -1065,6 +1067,7 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
PdmProductSpecServiceImpl.doRecord(SpecEnum.ZJ,MapOf.of("质检结果",whereJson.getString("ivt_status")),Boolean.TRUE,null,dtoList.get(0).getContainer_name());
|
||||||
updateWrapper.set("container_name", dtoList.get(0).getContainer_name());
|
updateWrapper.set("container_name", dtoList.get(0).getContainer_name());
|
||||||
updateWrapper.set("ivt_status", whereJson.getString("ivt_status"));
|
updateWrapper.set("ivt_status", whereJson.getString("ivt_status"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -277,6 +277,7 @@ public class InBussManageServiceImpl implements InBussManageService {
|
|||||||
mst.put("remark", "");
|
mst.put("remark", "");
|
||||||
// 明细
|
// 明细
|
||||||
ArrayList<LinkedHashMap> tableData = new ArrayList<>();
|
ArrayList<LinkedHashMap> tableData = new ArrayList<>();
|
||||||
|
List<String> subs = new ArrayList<>();
|
||||||
for (int i = 0; i < subList.size(); i++) {
|
for (int i = 0; i < subList.size(); i++) {
|
||||||
JSONObject json = subList.get(i);
|
JSONObject json = subList.get(i);
|
||||||
LinkedHashMap<String, Object> jsonDtl = new LinkedHashMap<>();
|
LinkedHashMap<String, Object> jsonDtl = new LinkedHashMap<>();
|
||||||
@@ -296,12 +297,15 @@ public class InBussManageServiceImpl implements InBussManageService {
|
|||||||
jsonDtl.put("quality_scode", IOSEnum.QUALITY_SCODE.code("合格品"));
|
jsonDtl.put("quality_scode", IOSEnum.QUALITY_SCODE.code("合格品"));
|
||||||
jsonDtl.put("is_active", IOSEnum.IS_SEND.code("是"));
|
jsonDtl.put("is_active", IOSEnum.IS_SEND.code("是"));
|
||||||
tableData.add(jsonDtl);
|
tableData.add(jsonDtl);
|
||||||
|
subs.add(json.getString("container_name"));
|
||||||
}
|
}
|
||||||
String package_box_sn = (String) tableData.get(0).get("package_box_sn");
|
String package_box_sn = (String) tableData.get(0).get("package_box_sn");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
JSONObject param_jo = new JSONObject();
|
JSONObject param_jo = new JSONObject();
|
||||||
param_jo.put("box_no", package_box_sn);
|
param_jo.put("box_no", package_box_sn);
|
||||||
param_jo.put("box_weight", subList.get(0).getString("box_weight"));
|
param_jo.put("box_weight", subList.get(0).getString("box_weight"));
|
||||||
|
param_jo.put("container_name", subs);
|
||||||
lmsToMesServiceImpl.BoxDataCollectionSubmit2(param_jo);
|
lmsToMesServiceImpl.BoxDataCollectionSubmit2(param_jo);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("验箱回传MES异常,BoxDataCollectionSubmit2给MES传输子卷包装关系异常,木箱号为:" + package_box_sn + ",异常信息:" + e);
|
log.error("验箱回传MES异常,BoxDataCollectionSubmit2给MES传输子卷包装关系异常,木箱号为:" + package_box_sn + ",异常信息:" + e);
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package org.nl.common.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: lyd
|
||||||
|
* @Description:
|
||||||
|
* @Date: 2023/5/9
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum SpecEnum {
|
||||||
|
|
||||||
|
FQ(1, "分切",""),
|
||||||
|
XX(2, "子卷下线",""),
|
||||||
|
ZJ(3, "质检",""),
|
||||||
|
BZ(4, "包装",""),
|
||||||
|
BZ_REMOVE(5, "包装解除",""),
|
||||||
|
BZ_MES(6, "包装回传","CamstarApi/momBoxPackageSubmit"),
|
||||||
|
ZXRK(7, "装箱入库",""),
|
||||||
|
TYCK(8, "退异常口",""),
|
||||||
|
YX_MES(9, "验箱","CamstarApi/BoxDataCollectionSubmit2"),
|
||||||
|
RK(10, "入库",""),
|
||||||
|
;
|
||||||
|
|
||||||
|
private final Integer value;
|
||||||
|
private final String desc;
|
||||||
|
private final String url;
|
||||||
|
}
|
||||||
@@ -26,6 +26,7 @@ import org.nl.b_lms.pdm.bi.slittingproductionplan.service.IPdmBiSlittingproducti
|
|||||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
|
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.PdmBiContainerinbound;
|
||||||
import org.nl.b_lms.pdm.info.service.IPdmBiContainerinboundService;
|
import org.nl.b_lms.pdm.info.service.IPdmBiContainerinboundService;
|
||||||
|
import org.nl.b_lms.pdm.productSpec.service.impl.PdmProductSpecServiceImpl;
|
||||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||||
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
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.dao.SchBaseTask;
|
||||||
@@ -45,6 +46,7 @@ import org.nl.b_lms.storage_manage.ios.service.iostorInv.IStIvtIostorinvOutServi
|
|||||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.*;
|
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.*;
|
||||||
import org.nl.common.enums.NoticeTypeEnum;
|
import org.nl.common.enums.NoticeTypeEnum;
|
||||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||||
|
import org.nl.common.enums.SpecEnum;
|
||||||
import org.nl.common.utils.CodeUtil;
|
import org.nl.common.utils.CodeUtil;
|
||||||
import org.nl.common.utils.MapOf;
|
import org.nl.common.utils.MapOf;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
@@ -1867,6 +1869,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
try {
|
try {
|
||||||
if (tryLock) {
|
if (tryLock) {
|
||||||
//1.查询满轴缓存位是否有空位
|
//1.查询满轴缓存位是否有空位
|
||||||
|
PdmProductSpecServiceImpl.doRecord(SpecEnum.XX,whereJson,Boolean.TRUE,null,containerName);
|
||||||
List<BstIvtPackageinfoivt> bstIvtPackageinfoivtList = packageinfoivtService
|
List<BstIvtPackageinfoivt> bstIvtPackageinfoivtList = packageinfoivtService
|
||||||
.list(new LambdaUpdateWrapper<BstIvtPackageinfoivt>().eq(BstIvtPackageinfoivt::getIs_used, PackageInfoIvtEnum.IS_USED.code("启用"))
|
.list(new LambdaUpdateWrapper<BstIvtPackageinfoivt>().eq(BstIvtPackageinfoivt::getIs_used, PackageInfoIvtEnum.IS_USED.code("启用"))
|
||||||
.orderByAsc(BstIvtPackageinfoivt::getSort_seq));
|
.orderByAsc(BstIvtPackageinfoivt::getSort_seq));
|
||||||
@@ -2049,6 +2052,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
String box_no = jsonObject.getString("box_no");
|
String box_no = jsonObject.getString("box_no");
|
||||||
Integer box_weight = jsonObject.getIntValue("box_weight");
|
Integer box_weight = jsonObject.getIntValue("box_weight");
|
||||||
Integer current_weight = jsonObject.getIntValue("current_weight");
|
Integer current_weight = jsonObject.getIntValue("current_weight");
|
||||||
|
List<String> containers = jsonObject.getObject("containers", List.class);
|
||||||
|
|
||||||
int count = taskService.count(new QueryWrapper<SchBaseTask>()
|
int count = taskService.count(new QueryWrapper<SchBaseTask>()
|
||||||
.eq("point_code1", whereJson.getString("device_code"))
|
.eq("point_code1", whereJson.getString("device_code"))
|
||||||
@@ -2080,6 +2084,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
if (CollectionUtils.isEmpty(errorMsg)) {
|
if (CollectionUtils.isEmpty(errorMsg)) {
|
||||||
whereJson.put("bill_type", IOSEnum.IN_TYPE.code("生产入库"));
|
whereJson.put("bill_type", IOSEnum.IN_TYPE.code("生产入库"));
|
||||||
inBussManageService.inTask(whereJson);
|
inBussManageService.inTask(whereJson);
|
||||||
|
PdmProductSpecServiceImpl.doRecord(SpecEnum.RK,null,Boolean.TRUE,null,containers);
|
||||||
} else {
|
} else {
|
||||||
iPdmBiContainerinboundService
|
iPdmBiContainerinboundService
|
||||||
.update(new UpdateWrapper<PdmBiContainerinbound>()
|
.update(new UpdateWrapper<PdmBiContainerinbound>()
|
||||||
@@ -2112,6 +2117,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
TwoExceptionInTask bean = SpringContextHolder.getBean(TwoExceptionInTask.class);
|
TwoExceptionInTask bean = SpringContextHolder.getBean(TwoExceptionInTask.class);
|
||||||
bean.createTask(jsonTaskParam);
|
bean.createTask(jsonTaskParam);
|
||||||
bean.immediateNotifyAcs(null);
|
bean.immediateNotifyAcs(null);
|
||||||
|
PdmProductSpecServiceImpl.doRecord(SpecEnum.TYCK,null,Boolean.FALSE,errorMsg.toString(),containers);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (type.equals(IOSEnum.ACSTOLMS_TYPE.code("空盘入库"))) {
|
} else if (type.equals(IOSEnum.ACSTOLMS_TYPE.code("空盘入库"))) {
|
||||||
|
|||||||
@@ -15,9 +15,11 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.checkerframework.checker.units.qual.A;
|
import org.checkerframework.checker.units.qual.A;
|
||||||
import org.nl.b_lms.pdm.info.dao.PdmBiContainerinfo;
|
import org.nl.b_lms.pdm.info.dao.PdmBiContainerinfo;
|
||||||
import org.nl.b_lms.pdm.info.service.IPdmBiContainerinfoService;
|
import org.nl.b_lms.pdm.info.service.IPdmBiContainerinfoService;
|
||||||
|
import org.nl.b_lms.pdm.productSpec.service.impl.PdmProductSpecServiceImpl;
|
||||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||||
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
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.IBstIvtBoxinfoService;
|
||||||
|
import org.nl.common.enums.SpecEnum;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
@@ -28,6 +30,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LMS系统为客户端,MES为服务端
|
* LMS系统为客户端,MES为服务端
|
||||||
*/
|
*/
|
||||||
@@ -948,7 +954,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
param.put("QuanlityInBox", num);
|
param.put("QuanlityInBox", num);
|
||||||
param.put("BoxWeight", box_weight);
|
param.put("BoxWeight", box_weight);
|
||||||
param.put("ContainerList", rows);
|
param.put("ContainerList", rows);
|
||||||
|
List<String> list = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
String resultMsg = HttpRequest.post(url)
|
String resultMsg = HttpRequest.post(url)
|
||||||
.body(String.valueOf(param))
|
.body(String.valueOf(param))
|
||||||
@@ -961,6 +967,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
for (int i = 0; i < array.size(); i++) {
|
for (int i = 0; i < array.size(); i++) {
|
||||||
JSONObject row = array.getJSONObject(i);
|
JSONObject row = array.getJSONObject(i);
|
||||||
String ContainerName = row.getString("ContainerName");
|
String ContainerName = row.getString("ContainerName");
|
||||||
|
list.add(ContainerName);
|
||||||
String AttributeValue = row.getString("AttributeValue");
|
String AttributeValue = row.getString("AttributeValue");
|
||||||
subpackagerelationService.update(new LambdaUpdateWrapper<PdmBiSubpackagerelation>().set(PdmBiSubpackagerelation::getNet_weight, AttributeValue).eq(PdmBiSubpackagerelation::getContainer_name, ContainerName));
|
subpackagerelationService.update(new LambdaUpdateWrapper<PdmBiSubpackagerelation>().set(PdmBiSubpackagerelation::getNet_weight, AttributeValue).eq(PdmBiSubpackagerelation::getContainer_name, ContainerName));
|
||||||
}
|
}
|
||||||
@@ -970,11 +977,14 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
|
|
||||||
String RTYPE = result.getString("RTYPE");
|
String RTYPE = result.getString("RTYPE");
|
||||||
if ("E".equals(RTYPE)) {
|
if ("E".equals(RTYPE)) {
|
||||||
|
PdmProductSpecServiceImpl.doRecord(SpecEnum.BZ_MES,param,Boolean.FALSE,result.getString("RTMSG"),list);
|
||||||
throw new BadRequestException(result.getString("RTMSG"));
|
throw new BadRequestException(result.getString("RTMSG"));
|
||||||
}
|
}
|
||||||
|
PdmProductSpecServiceImpl.doRecord(SpecEnum.BZ_MES,param,Boolean.TRUE,null,list);
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
PdmProductSpecServiceImpl.doRecord(SpecEnum.BZ_MES,param,Boolean.FALSE,e.getMessage(),list);
|
||||||
throw new BadRequestException("MES提示错误:" + e.getMessage());
|
throw new BadRequestException("MES提示错误:" + e.getMessage());
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@@ -988,6 +998,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
|
|
||||||
String box_no = param.getString("box_no");
|
String box_no = param.getString("box_no");
|
||||||
String box_weight = param.getString("box_weight");
|
String box_weight = param.getString("box_weight");
|
||||||
|
List containerName = param.getObject("container_name", List.class);
|
||||||
|
|
||||||
if (StrUtil.isEmpty(box_no)) {
|
if (StrUtil.isEmpty(box_no)) {
|
||||||
throw new BadRequestException("木箱号不能为空!");
|
throw new BadRequestException("木箱号不能为空!");
|
||||||
@@ -1044,11 +1055,14 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
|
|
||||||
String RTYPE = result.getString("RTYPE");
|
String RTYPE = result.getString("RTYPE");
|
||||||
if ("E".equals(RTYPE)) {
|
if ("E".equals(RTYPE)) {
|
||||||
|
PdmProductSpecServiceImpl.doRecord(SpecEnum.YX_MES,param,Boolean.FALSE,result.getString("RTMSG"),containerName);
|
||||||
throw new BadRequestException("MES提示错误:" +result.getString("RTMSG"));
|
throw new BadRequestException("MES提示错误:" +result.getString("RTMSG"));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
PdmProductSpecServiceImpl.doRecord(SpecEnum.YX_MES,param,Boolean.FALSE,e.getMessage(),containerName);
|
||||||
throw new BadRequestException("MES错误:" + e.getMessage());
|
throw new BadRequestException("MES错误:" + e.getMessage());
|
||||||
}
|
}
|
||||||
|
PdmProductSpecServiceImpl.doRecord(SpecEnum.YX_MES,param,Boolean.TRUE,null,containerName);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class ComPareUtil {
|
public class ComPareUtil {
|
||||||
|
|
||||||
@@ -78,6 +79,7 @@ public class ComPareUtil {
|
|||||||
json.put("box_no", sub.getPackage_box_sn());
|
json.put("box_no", sub.getPackage_box_sn());
|
||||||
json.put("box_weight", sub.getBox_weight().intValue());
|
json.put("box_weight", sub.getBox_weight().intValue());
|
||||||
json.put("current_weight", new BigDecimal(current_weight).intValue());
|
json.put("current_weight", new BigDecimal(current_weight).intValue());
|
||||||
|
json.put("containers", list.stream().map(a->a.getContainer_name()).collect(Collectors.toList()));
|
||||||
json.put("inbound", (pdmBiContainerinbound != null ? pdmBiContainerinbound.getInbound():false));
|
json.put("inbound", (pdmBiContainerinbound != null ? pdmBiContainerinbound.getInbound():false));
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -178,6 +178,40 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</crudOperation>
|
</crudOperation>
|
||||||
<!--表单组件-->
|
<!--表单组件-->
|
||||||
|
<el-dialog
|
||||||
|
title="子卷步序信息"
|
||||||
|
append-to-body
|
||||||
|
:visible.sync="dtlVisible"
|
||||||
|
destroy-on-close
|
||||||
|
width="1000px"
|
||||||
|
>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table
|
||||||
|
:data="childrenList">
|
||||||
|
<el-table-column prop="container_name" label="子卷号" show-overflow-tooltip width="210px" />
|
||||||
|
<el-table-column prop="spec" label="步序" show-overflow-tooltip width="120">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ dict.label.subSpec[scope.row.spec] }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="result" label="执行结果" show-overflow-tooltip width="120">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.result.toString() }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="param" label="执行参数" show-overflow-tooltip width="150"/>
|
||||||
|
<el-table-column prop="msg" label="备注" show-overflow-tooltip width="150"/>
|
||||||
|
<el-table-column prop="create_time" label="创建时间">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ new Date(scope.row.create_time).toLocaleString() }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dtlVisible = false">取 消</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:before-close="crud.cancelCU"
|
:before-close="crud.cancelCU"
|
||||||
@@ -445,7 +479,11 @@
|
|||||||
prop="container_name"
|
prop="container_name"
|
||||||
label="子卷号"
|
label="子卷号"
|
||||||
:min-width="flexWidth('container_name',crud.data,'子卷号')"
|
:min-width="flexWidth('container_name',crud.data,'子卷号')"
|
||||||
/>
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link type="warning" @click="toView(scope.row.container_name)">{{ scope.row.container_name }}</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="product_name" label="产品编码" :min-width="flexWidth('product_name',crud.data,'产品描述')" />
|
<el-table-column prop="product_name" label="产品编码" :min-width="flexWidth('product_name',crud.data,'产品描述')" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="product_description"
|
prop="product_description"
|
||||||
@@ -596,6 +634,8 @@ import pagination from '@crud/Pagination'
|
|||||||
import { download } from '@/api/data'
|
import { download } from '@/api/data'
|
||||||
import { downloadFile } from '@/utils'
|
import { downloadFile } from '@/utils'
|
||||||
import crudUserStor from "@/views/wms/basedata/st/userStor/userStor";
|
import crudUserStor from "@/views/wms/basedata/st/userStor/userStor";
|
||||||
|
import crudPastivtquery from '@/views/wms/stat/pastivt/pastivtquery'
|
||||||
|
import { format } from 'date-fns';
|
||||||
|
|
||||||
const defaultForm = {
|
const defaultForm = {
|
||||||
workorder_id: null,
|
workorder_id: null,
|
||||||
@@ -635,7 +675,7 @@ const defaultForm = {
|
|||||||
}
|
}
|
||||||
export default {
|
export default {
|
||||||
name: 'Subpackagerelation',
|
name: 'Subpackagerelation',
|
||||||
dicts: ['sub_package_relation', 'IS_OR_NOT'],
|
dicts: ['sub_package_relation', 'IS_OR_NOT', 'subSpec'],
|
||||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
cruds() {
|
cruds() {
|
||||||
@@ -650,6 +690,8 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
dtlVisible: false,
|
||||||
|
childrenList: [],
|
||||||
permission: {
|
permission: {
|
||||||
add: ['admin', 'sub:add'],
|
add: ['admin', 'sub:add'],
|
||||||
edit: ['admin', 'sub:edit'],
|
edit: ['admin', 'sub:edit'],
|
||||||
@@ -739,6 +781,14 @@ export default {
|
|||||||
[CRUD.HOOK.beforeRefresh]() {
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
|
toView(data) {
|
||||||
|
crudPastivtquery.subRecord(data).then(res => {
|
||||||
|
if (res){
|
||||||
|
this.dtlVisible = true
|
||||||
|
this.childrenList = res;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
initQuery() {
|
initQuery() {
|
||||||
const end = new Date()
|
const end = new Date()
|
||||||
const start = new Date()
|
const start = new Date()
|
||||||
|
|||||||
@@ -24,4 +24,11 @@ export function edit(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export default { add, edit, del }
|
export function subRecord(code) {
|
||||||
|
return request({
|
||||||
|
url: '/api/pdmProductSpec/subSpec/'+code,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { add, edit, del, subRecord }
|
||||||
|
|||||||
Reference in New Issue
Block a user