修复spotbugs检测的问题

uat-temp-nht-2506050000-spotbugs
jason 1 month ago
parent 20c3601ae9
commit 92856e6ccf

@ -41,11 +41,9 @@ public class PcnPojoAspect {
@After("controllerPointcut()")
public void after(JoinPoint joinPoint){
Object[] objs = joinPoint.getArgs();
String methodName = joinPoint.getSignature().getName();
if (methodName.startsWith("save") || methodName.startsWith("update")) {
Object[] args = joinPoint.getArgs();
List<Object> list = new ArrayList<>();
for (Object arg : args) {
if (arg.getClass().isArray()) {
int len = Array.getLength(arg);

@ -72,7 +72,7 @@ public class MesInputDefectRecordController {
ValidatorBean.checkNotNull(model.getOrganizeCode(), "工厂不能为空");
ValidatorBean.checkNotNull(model.getUserInfo(), "操作人不能为空");
if (StringUtils.isEmpty(model.getSn()) &&
(StringUtils.isEmpty(model.getPartNo()) || StringUtils.isEmpty(model.getLotNo()) || StringUtils.isEmpty(model.getQty()) || MathOperation.compareTo(model.getQty(), new Double(0)) == 0)) {
(StringUtils.isEmpty(model.getPartNo()) || StringUtils.isEmpty(model.getLotNo()) || model.getQty() == null || MathOperation.compareTo(model.getQty(), 0) == 0)) {
throw new ImppBusiException("条码为空或零件号+批次+数量为空");
}

@ -92,8 +92,8 @@ public class MesInsertBatchDaoImpl implements IMesInsertBatchDao {
parameterMap.put(new StringJoiner(MesPcnExtConstWords.E_UNDERLINE).add(splitField[j]).add(String.valueOf(i)).toString(), logList.get(i).getTypeCode());
Query queryObject = entityManager.createNativeQuery(insertStr + fieldBuilder.substring(MesPcnExtConstWords.ZERO, fieldBuilder.lastIndexOf(MesPcnExtConstWords.COMMA) - MesPcnExtConstWords.ONE).replaceAll("%s", String.valueOf(i)) + " ); ");
//数据填充
for (String key : parameterMap.keySet()) {
queryObject.setParameter(key, parameterMap.get(key));
for (Map.Entry<String, Object> entry : parameterMap.entrySet()) {
queryObject.setParameter(entry.getKey(), entry.getValue());
}
queryObject.executeUpdate();
}

@ -23,7 +23,7 @@ import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
@Slf4j
public class PcnMqttCallback implements MqttCallbackExtended {
public final class PcnMqttCallback implements MqttCallbackExtended {
private static ExecutorService executorService = new ThreadPoolExecutor(100, 100,
0L, TimeUnit.MILLISECONDS,
@ -113,15 +113,15 @@ public class PcnMqttCallback implements MqttCallbackExtended {
*/
@Override
public void messageArrived(String topic, MqttMessage mqttMessage) {
log.info("== pcnMqttCallback ==> messageArrived 接收消息主题: {},接收消息内容: {}", topic, new String(mqttMessage.getPayload()));
log.info("== pcnMqttCallback ==> messageArrived 接收消息主题: {},接收消息内容: {}", topic, new String(mqttMessage.getPayload(), StandardCharsets.UTF_8));
executorService.execute(() -> saveData(topic, mqttMessage));
}
private void saveData(String topic, MqttMessage mqttMessage) {
log.info("== pcnMqttCallback ==> messageArrived 接收消息主题: {},异步处理开始 消息内容: {}", topic, new String(mqttMessage.getPayload()));
log.info("== pcnMqttCallback ==> messageArrived 接收消息主题: {},异步处理开始 消息内容: {}", topic, new String(mqttMessage.getPayload(), StandardCharsets.UTF_8));
try{
String resStr = new String(mqttMessage.getPayload(), "UTF-8").trim();
String resStr = new String(mqttMessage.getPayload(), StandardCharsets.UTF_8).trim();
/**
* if-else
*/

@ -23,7 +23,7 @@ public class PcnMqttClient {
/**
* MQTT
*/
private static MqttClient client;
private static volatile MqttClient client;
/**
*
@ -76,7 +76,11 @@ public class PcnMqttClient {
*/
public void connect() throws MqttException {
if (client == null) {
client = new MqttClient(host, clientId, new MemoryPersistence());
synchronized (PcnMqttClient.class) {
if (client == null) {
client = new MqttClient(host, clientId, new MemoryPersistence());
}
}
// 设置回调
client.setCallback(new PcnMqttCallback(PcnMqttClient.this, equipmentLogService));
}
@ -97,7 +101,11 @@ public class PcnMqttClient {
*/
public void unconnect() throws MqttException {
if (client == null) {
client = new MqttClient(host, clientId, new MemoryPersistence());
synchronized (PcnMqttClient.class) {
if (client == null) {
client = new MqttClient(host, clientId, new MemoryPersistence());
}
}
// 设置回调
client.setCallback(new PcnMqttCallback(PcnMqttClient.this));
}
@ -131,11 +139,14 @@ public class PcnMqttClient {
MqttTopic mqttTopic = PcnMqttClient.getClient().getTopic(topic);
if (null == mqttTopic) {
log.error("== MyMqttClient ==> topic is not exist");
return;
}
MqttDeliveryToken token;//Delivery:配送
synchronized (this) {//注意这里一定要同步否则在多线程publish的情况下线程会发生死锁分析见文章最后补充
//注意这里一定要同步否则在多线程publish的情况下线程会发生死锁分析见文章最后补充
synchronized (this) {
try {
token = mqttTopic.publish(message);//也是发送到执行队列中,等待执行线程执行,将消息发送到消息中间件
//也是发送到执行队列中,等待执行线程执行,将消息发送到消息中间件
token = mqttTopic.publish(message);
token.waitForCompletion(1000L);
} catch (MqttPersistenceException e) {
e.printStackTrace();

@ -37,16 +37,10 @@ public class MesCheckSyncDataJob extends BaseMesScheduleJob {
String jobParam = this.getJobParam();
JSONObject params= JSONUtil.parseObj(jobParam);
String organizeCode = params.getStr("organizeCode");
String email = params.getStr("email");
if (StringUtils.isEmpty(organizeCode)){
log.info("保存工艺参数JOB --- ERROR --- JOB未配置工厂参数");
return;
}
}
}

@ -26,9 +26,10 @@ import java.util.List;
@Component
@ApiOperation("仪表读数job")
public class MesMeterReadingJob extends BaseMesScheduleJob {
private static final long serialVersionUID = 4556321104575284415L;
@Autowired
private MesMaximoServiceImpl maximoService;
private transient MesMaximoServiceImpl maximoService;
public MesMeterReadingJob() {
super(MesMeterReadingJob.class, "仪表读数job");

@ -93,7 +93,6 @@ public class MesReportNoSortJob extends BaseMesScheduleJob {
return;
}
try {
Map<String, Integer> map = new HashMap<>();
for (MesProductionRecord mesProductionRecord : unReportMesProduceSn) {
workOrderService.doProductHasOrderReportByRecord(mesProductionRecord, organizeCode, userName);
}

@ -217,7 +217,7 @@ public class MesEquipmentLogService implements IMesEquipmentLogService {
private MesEquipmentVariable getMesEquipmentVariable(EquipLogMqttMsg equipLogMqttMsg) {
String variableKey = getVariableKey(equipLogMqttMsg.getPTCode(), "MES_EQUIPMENT_VARIABLE");
Object obj = redisMesPcn.getHash(variableKey, equipLogMqttMsg.getKey());
MesEquipmentVariable mesEquipmentVariable = new MesEquipmentVariable();
MesEquipmentVariable mesEquipmentVariable;
if (obj == null) {
log.info("== mesEquipmentVariable查询开始");
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean();

@ -65,22 +65,22 @@ public class MesMaximoServiceImpl implements IMesMaximoService {
private void call(String meterName,String assetNum,String organizeCode,int count , String url){
String xml = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:max=\"http://www.ibm.com/maximo\">\n" +
" <soapenv:Header/>\n" +
" <soapenv:Body>\n" +
" <max:CreateCUR_METERREADING creationDateTime=\"EN\" baseLanguage=\"EN\">\n" +
" <max:CUR_METERREADINGSet>\n" +
" <max:METERDATA action=\"Change\">\n" +
" <max:MAXINTERRORMSG>?</max:MAXINTERRORMSG>\n" +
" <max:ASSETNUM changed=\"?\">%s</max:ASSETNUM>\n" +
" <max:METERNAME changed=\"?\">%s</max:METERNAME>\n" +
" <max:NEWREADING changed=\"?\">%s</max:NEWREADING>\n" +
" <max:NEWREADINGDATE changed=\"?\">%s</max:NEWREADINGDATE>\n" +
" <max:SITEID changed=\"?\">%s</max:SITEID>\n" +
" </max:METERDATA>\n" +
" </max:CUR_METERREADINGSet>\n" +
" </max:CreateCUR_METERREADING>\n" +
" </soapenv:Body>\n" +
String xml = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:max=\"http://www.ibm.com/maximo\">%n" +
" <soapenv:Header/>%n" +
" <soapenv:Body>%n" +
" <max:CreateCUR_METERREADING creationDateTime=\"EN\" baseLanguage=\"EN\">%n" +
" <max:CUR_METERREADINGSet>%n" +
" <max:METERDATA action=\"Change\">%n" +
" <max:MAXINTERRORMSG>?</max:MAXINTERRORMSG>%n" +
" <max:ASSETNUM changed=\"?\">%s</max:ASSETNUM>%n" +
" <max:METERNAME changed=\"?\">%s</max:METERNAME>%n" +
" <max:NEWREADING changed=\"?\">%s</max:NEWREADING>%n" +
" <max:NEWREADINGDATE changed=\"?\">%s</max:NEWREADINGDATE>%n" +
" <max:SITEID changed=\"?\">%s</max:SITEID>%n" +
" </max:METERDATA>%n" +
" </max:CUR_METERREADINGSet>%n" +
" </max:CreateCUR_METERREADING>%n" +
" </soapenv:Body>%n" +
"</soapenv:Envelope>";
//2024-05-30T11:10:00
LocalDateTime now = LocalDateTime.now();

@ -51,7 +51,6 @@ public class MesPojoVersionServiceImpl implements IMesPojoVersionService {
@Override
public MesPojoVersion getPojoVersion(MesPojoVersion bean) {
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(bean);
return mesPojoVersionRepository.getByProperty(DdlPackBean.getDdlPackBean(bean));
}
@ -146,7 +145,7 @@ public class MesPojoVersionServiceImpl implements IMesPojoVersionService {
public void recordPojoVersion(MesPojoVersion afterMesPojoVersion) {
MesPojoVersion beforePojoVersion = new MesPojoVersion();
MesPojoVersionDetail beforePojoVersionDetail = new MesPojoVersionDetail();
MesPojoVersionDetail beforePojoVersionDetail;
Map<String, Object> beforeMap = new HashMap<>();
Map<String, Object> afterMap = JsonUtilTool.decode(afterMesPojoVersion.getBean(), Map.class);
MesPojoVersionDetail afterPojoVersionDetail = null;
@ -160,7 +159,6 @@ public class MesPojoVersionServiceImpl implements IMesPojoVersionService {
Integer versionNo; // 对象版本
CommonEnumUtil.DAO_OPERATE_TYPE operateType = CommonEnumUtil.DAO_OPERATE_TYPE.INSERT; // 操作类型
Map<String, MapDifference.ValueDifference<Object>> mapDiff; // 版本对比
String userName = StringUtils.isNotBlank(afterMesPojoVersion.getModifyUser()) ? afterMesPojoVersion.getModifyUser() : afterMesPojoVersion.getCreateUser();
Map<String, String> mapPropDesc = afterMesPojoVersion.getPojoPropDesc();
boolean isInsert = true;

@ -850,7 +850,7 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService {
//报工调整
// 2024-11-27 物料报解后AME或者质量如何快速把正确委件返回流?A变B流程怎么走?-物料拆解需要去掉自动负报工接口,待开发
MesWorkOrder mesWorkOrderDb = mesWorkOrderService.findMesWorkOrderList(requestModel.getOrganizeCode(), optional.get().getWorkOrderNo());
MesProductVersion productVersion = getProductVersion(mesWorkOrderDb);
getProductVersion(mesWorkOrderDb);
/*
mesWorkOrderDb.setNum(MesPcnExtConstWords.ONE);
mesWorkOrderService.doProductReportReversal(mesWorkOrderDb,productVersion, requestModel.getUserName());*/
@ -1167,41 +1167,41 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService {
mesQmsScrapRepository.insert(mesQmsScrap);
}
private void doCreateMove(MesWorkCenter mesWorkCenter, String destLocate, MesProductionAssemblyModel assemblyModel,String userName) {
MesMove move = new MesMove();
move.setMatnr(assemblyModel.getAssemblyPartNo());
move.setOrganizeCode(mesWorkCenter.getOrganizeCode());
move.setFactoryCode(mesWorkCenter.getOrganizeCode());
move.setLgort(mesWorkCenter.getRawLocate());
move.setUmlgo(destLocate);
move.setMenge(assemblyModel.getScrapQty());
move.setPostDate(TimeTool.getToday());
move.setPostTime(TimeTool.getTimeShortWithColon());
move.setMoveType(MesExtEnumUtil.MOVE_TYPE.SCRAP_MOVE.getValue());
move.setProductSn(assemblyModel.getAssemblySn());
move.setWorkCenter(mesWorkCenter.getErpWorkCenter());
ConvertBean.serviceModelInitialize(move, userName);
moveRepository.insert(move);
}
private void doCreateMove(MesReworkTaskRequestModel requestModel,String srcLocate, String destLocate,String workCenterCode,String partNo) {
MesPartSap mesPartSap = mesPartService.getMesPartSapByPartNo(partNo, requestModel.getOrganizeCode());
MesMove move = new MesMove();
move.setMatnr(mesPartSap.getPartNo());
move.setOrganizeCode(requestModel.getOrganizeCode());
move.setFactoryCode(requestModel.getOrganizeCode());
move.setLgort(srcLocate);
move.setUmlgo(destLocate);
move.setMenge(1d);
move.setMeins(mesPartSap.getUnit());
move.setPostDate(TimeTool.getToday());
move.setPostTime(TimeTool.getTimeShortWithColon());
move.setMoveType(MesExtEnumUtil.MOVE_TYPE.SCRAP_MOVE.getValue());
move.setProductSn(requestModel.getSn());
move.setWorkCenter(workCenterCode);
ConvertBean.serviceModelInitialize(move, requestModel.getUserName());
moveRepository.insert(move);
}
// private void doCreateMove(MesWorkCenter mesWorkCenter, String destLocate, MesProductionAssemblyModel assemblyModel,String userName) {
// MesMove move = new MesMove();
// move.setMatnr(assemblyModel.getAssemblyPartNo());
// move.setOrganizeCode(mesWorkCenter.getOrganizeCode());
// move.setFactoryCode(mesWorkCenter.getOrganizeCode());
// move.setLgort(mesWorkCenter.getRawLocate());
// move.setUmlgo(destLocate);
// move.setMenge(assemblyModel.getScrapQty());
// move.setPostDate(TimeTool.getToday());
// move.setPostTime(TimeTool.getTimeShortWithColon());
// move.setMoveType(MesExtEnumUtil.MOVE_TYPE.SCRAP_MOVE.getValue());
// move.setProductSn(assemblyModel.getAssemblySn());
// move.setWorkCenter(mesWorkCenter.getErpWorkCenter());
// ConvertBean.serviceModelInitialize(move, userName);
// moveRepository.insert(move);
// }
//
// private void doCreateMove(MesReworkTaskRequestModel requestModel,String srcLocate, String destLocate,String workCenterCode,String partNo) {
// MesPartSap mesPartSap = mesPartService.getMesPartSapByPartNo(partNo, requestModel.getOrganizeCode());
// MesMove move = new MesMove();
// move.setMatnr(mesPartSap.getPartNo());
// move.setOrganizeCode(requestModel.getOrganizeCode());
// move.setFactoryCode(requestModel.getOrganizeCode());
// move.setLgort(srcLocate);
// move.setUmlgo(destLocate);
// move.setMenge(1d);
// move.setMeins(mesPartSap.getUnit());
// move.setPostDate(TimeTool.getToday());
// move.setPostTime(TimeTool.getTimeShortWithColon());
// move.setMoveType(MesExtEnumUtil.MOVE_TYPE.SCRAP_MOVE.getValue());
// move.setProductSn(requestModel.getSn());
// move.setWorkCenter(workCenterCode);
// ConvertBean.serviceModelInitialize(move, requestModel.getUserName());
// moveRepository.insert(move);
// }
private void doCreateReworkMove(MesReworkTaskRequestModel requestModel,String srcLocate, String destLocate,String workCenterCode,String partNo,Long partInspectionId) {

@ -108,8 +108,8 @@ public class MesAssemblyExtService implements IMesAssemblyExtService {
if (CollectionUtils.isEmpty(workOrderAssemblyList)) return null;
// 搜集非已装配的数据
List<MesWorkOrderAssembly> unBindList = workOrderAssemblyList.stream().filter(o -> (null != o &&
o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue()) != 0)).collect(Collectors.toList());
// List<MesWorkOrderAssembly> unBindList = workOrderAssemblyList.stream().filter(o -> (null != o &&
// o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue()) != 0)).collect(Collectors.toList());
//获取装配件绑定记录
Map<Long, List<MesProductionAssembly>> productionAssemblyMap = groupProductionAssembly(getProductionAssemblySortList(prodRuleContext.getOrganizeCode(), prodRuleContext.getProductSn()));

@ -624,7 +624,6 @@ public class MesBoxingErrorProofingService implements IMesBoxingErrorProofingSer
|| StringUtils.isEmpty(split[packingDefine.getSerialIdIndex() - 1])) {
MesPcnException.throwMesBusiException("序列号所在位置不存在,请检查数据!");
}
String serialNo = split[packingDefine.getSerialIdIndex() - 1];
}
private void checkOrganizeCode(MesPackageDetail mesPackageDetail, MesPackingDefine packingDefine, String[] split) {

@ -16,12 +16,5 @@ public class MesCheckSyncDataServiceImpl implements IMesCheckSyncDataService {
@Override
public void doCheckSyncData(String organizeCode, List<String> workCenterCodeList, List<String> workCellCodeList) {
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
if (workCellCodeList !=null && !workCellCodeList.isEmpty()){
}
}
}

@ -160,10 +160,8 @@ public class MesEarlyWarningServiceImpl implements IMesEarlyWarningService {
Calendar calendar1 = Calendar.getInstance();
calendar1.setTime(now);
int productCount = kanBan.getProductCount();
int productDay = kanBan.getProductDay();
calendar1.add(Calendar.DATE,-productDay);
// List<String> vehicleNoList = getCLWarning(sdf1.format(calendar1.getTime()), productCount,organizeCode);
List<String> vehicleNoList = new ArrayList<>();
//9.汇总数据
return doGetSGMData(kanBan, gmGepicsList, lastCimGmGepics, lastOne, lastWorkOrder, lastOfflineOrder, workCounts, vehicleNoList);
@ -243,9 +241,9 @@ public class MesEarlyWarningServiceImpl implements IMesEarlyWarningService {
// List<MesWorkOrderAssembly> mesWorkOrderAssemblyList = workOrderAssemblyRao.findByHqlWhere(assemblyPackBean);
// //todo 有内存溢出风险 调试一下,写hql按照分组查询出workOrderNoList
// List<String> workOrderNoList = mesWorkOrderAssemblyList.stream().map(MesWorkOrderAssembly::getWorkOrderNo).distinct().collect(Collectors.toList());
List<Integer> orderStatusList = new ArrayList<>();
orderStatusList.add(MesExtEnumUtil.ORDER_STATUS.CLOSE.getValue());
orderStatusList.add(MesExtEnumUtil.ORDER_STATUS.DISMANTLE.getValue());
// List<Integer> orderStatusList = new ArrayList<>();
// orderStatusList.add(MesExtEnumUtil.ORDER_STATUS.CLOSE.getValue());
// orderStatusList.add(MesExtEnumUtil.ORDER_STATUS.DISMANTLE.getValue());
List<String> orderFlagList = new ArrayList<>();
orderFlagList.add(MesExtEnumUtil.ORDER_TYPE_IDENTIFICATION.E.getValue());
@ -362,7 +360,7 @@ public class MesEarlyWarningServiceImpl implements IMesEarlyWarningService {
//需要保留截图
//需要发声音
//需要发送记录信息 当前csnNo进行了跳号
errorMsg.append(String.format("当前CsnNo:%d进行了跳号;\n",curCsnNo));
errorMsg.append(String.format("当前CsnNo:%d进行了跳号;%n",curCsnNo));
}
}
if (errorMsg.length()>0){

@ -108,16 +108,16 @@ public class MesFengRenBatchReportService implements IMesFengRenBatchReportServi
MesPcnException.throwBusiException("汇报失败:生产工单[%s]信息当前状态[%s]!", MesExtEnumUtil.ORDER_STATUS.valueOfDescription(workOrderDb.getWorkOrderStatus()));
//验证超工单
Double reportedQty = MathOperation.add(new Double(model.getNum()), workOrderDb.getReportedQty());
Integer workOrderStatus = MesExtEnumUtil.ORDER_STATUS.COMPLETE.getValue();
double reportedQty = MathOperation.add(model.getNum().doubleValue(), workOrderDb.getReportedQty());
int workOrderStatus = MesExtEnumUtil.ORDER_STATUS.COMPLETE.getValue();
if (MathOperation.compareTo(reportedQty, workOrderDb.getQty()) > 0) {
MesWorkCenter workCenter = prodOrgExtService.getWorkCenterDb(model.getOrganizeCode(), workOrderDb.getWorkCenterCode());
if (StringUtils.isEmpty(workCenter.getIsCheckOrderQty()) || workCenter.getIsCheckOrderQty().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) != 0)
MesPcnException.throwMesBusiException("汇报失败:工单号[%s]计划数量[%s]已报工数量[%s],当前不允许超工单!", workOrderDb.getWorkOrderNo(), workOrderDb.getQty(), workOrderDb.getReportedQty());
Double rate = MathOperation.div((MathOperation.sub(reportedQty, workOrderDb.getQty())), workOrderDb.getQty());
if (MathOperation.compareTo(rate, MathOperation.div(workCenter.getOrderRate(), new Double(MesPcnExtConstWords.ONE_HUNDRED))) > 0)
double rate = MathOperation.div((MathOperation.sub(reportedQty, workOrderDb.getQty())), workOrderDb.getQty());
if (MathOperation.compareTo(rate, MathOperation.div(workCenter.getOrderRate(), MesPcnExtConstWords.ONE_HUNDRED)) > 0)
MesPcnException.throwMesBusiException("汇报失败:请检查工单数量,工单号[%s]计划数量[%s]已报工数量[%s]超工单比例[%s]!", workOrderDb.getWorkOrderNo(), workOrderDb.getQty(), workOrderDb.getReportedQty(), workCenter.getOrderRate());
}
@ -163,8 +163,8 @@ public class MesFengRenBatchReportService implements IMesFengRenBatchReportServi
MesPackageDataContext packageDataContext = (MesPackageDataContext) queryPackSpecQtyFengRenBatchReport(reqBean, stepResult, model.getPartNo());
//计数
Double unCompleteQty = MathOperation.sub(workOrderDb.getQty(), reportedQty);
if (MathOperation.compareTo(unCompleteQty, new Double(0)) < 0) unCompleteQty = new Double(0);
double unCompleteQty = MathOperation.sub(workOrderDb.getQty(), reportedQty);
if (MathOperation.compareTo(unCompleteQty, 0) < 0) unCompleteQty = 0;
if (MathOperation.compareTo(reportedQty, workOrderDb.getQty()) < 0) workOrderStatus = MesExtEnumUtil.ORDER_STATUS.PROCESS.getValue();
log.info("工厂{}缝纫批量汇报 --- PROCESS_INFO --- MesBomSize:{} --- MesPackageDataContext:{} --- workOrderStatus:{} --- reportedQty:{} --- {}", model.getOrganizeCode(), mesBoms.size(), JSONObject.toJSONString(packageDataContext), workOrderStatus, reportedQty, Thread.currentThread().getName());

@ -1136,7 +1136,6 @@ public class MesNcProcessingService implements IMesNcProcessingService {
mesPartInspectionAllList.addAll(mesPartInspectionList);
}
//获取前一天的所有ncStatus=40报废状态下可疑品缺陷
DdlPackBean singlePackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.PART_INSPECTION_STATUS.FAIL.getValue(), "inspectionStatus", packBean);
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.PART_INSPECTION_NC_STATUS.SCRAP.getValue(), "ncStatus", packBean);
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue(), "sourceType", packBean);

@ -400,14 +400,14 @@ public class MesNingDeShippingCheckService implements IMesNingDeShippingCheckSer
List<MesShippingOrderManagementDetail> resultDetails = new ArrayList<>();
Map<Long, List<MesShippingOrderManagementDetail>> detailMap = detailList.stream().collect(Collectors.groupingBy(MesShippingOrderManagementDetail::getCustInfoSeq));
List<String> partTypeList = Arrays.asList(mesPartShippingGroup.getPartType().split(MesPcnExtConstWords.COMMA));
for (Long seq : detailMap.keySet()) {
List<MesShippingOrderManagementDetail> details = detailMap.get(seq);
for (Map.Entry<Long, List<MesShippingOrderManagementDetail>> entry: detailMap.entrySet()) {
List<MesShippingOrderManagementDetail> details = entry.getValue();
if (details.size() > MesPcnExtConstWords.ONE) {
Map<String, List<MesShippingOrderManagementDetail>> containsMap = details.stream().filter(t -> partTypeList.contains(t.getPartTypeCode())).collect(Collectors.groupingBy(MesShippingOrderManagementDetail::getPartTypeCode));
List<MesShippingOrderManagementDetail> noContains = details.stream().filter(t -> !partTypeList.contains(t.getPartTypeCode())).collect(Collectors.toList());
//按照维护的总成类型显示
for (String type : partTypeList){
if (!Objects.isNull(containsMap) && containsMap.containsKey(type)){
if (containsMap.containsKey(type)){
resultDetails.addAll(containsMap.get(type));
}
}
@ -473,7 +473,7 @@ public class MesNingDeShippingCheckService implements IMesNingDeShippingCheckSer
throw new ImppBusiException(String.format("【%s】条码已进行二次发运扫描请检查数据", model.getSn()));
}
}
MesProduceSn produceSn = checkSecondSn(model);
checkSecondSn(model);
//更新明细
MesShippingOrderManagementDetail detail = shippingOrderManagementDetailOptional.get();
detail.setBarcode(model.getSn());
@ -525,9 +525,6 @@ public class MesNingDeShippingCheckService implements IMesNingDeShippingCheckSer
orderManagement.setStatus(MesExtEnumUtil.SHIPPING_ORDER_STATUS.SECOND_SHIPPED.getValue());
orderManagement.setEndScanTime(TimeTool.getNowTime(true));
//零件发运组
MesPartShippingGroup shippingGroup = Objects.isNull(model.getMesPartShippingGroup()) ? getMesPartShippingGroup(orderManagement.getOrganizeCode(), orderManagement.getShippingGroupCode()) : model.getMesPartShippingGroup();
//发运单明细状态修改为校验完成
DdlPackBean orderManagementDetailPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getNumEqualPack(orderManagement.getId(), "pid", orderManagementDetailPackBean);

@ -357,7 +357,7 @@ public class MesProduceSnPrintService implements IMesProduceSnPrintService {
//模板信息丢失抛出异常
if (labelTemplate == null) {
workOrderCutDb.setRemark(String.format("请检查裁片方案,裁片方案[%s]模板代码[%s]无效!", cutScheme.getCutCode(), cutScheme.getTemplateCode()));
workOrderCutDb.setRemark(String.format("请检查裁片方案,裁片方案[%s]模板代码[%s]无效!", cutScheme != null ? cutScheme.getCutCode() : "", cutScheme != null ? cutScheme.getTemplateCode() : ""));
workOrderCutDb.setSystemSyncStatus(CommonEnumUtil.FALSE);
ConvertBean.serviceModelUpdate(workOrderCutDb, workOrderCut.getModifyUser());
continue;
@ -368,7 +368,7 @@ public class MesProduceSnPrintService implements IMesProduceSnPrintService {
//模板信息丢失抛出异常
if (StringUtils.isEmpty(methodCode)) {
workOrderCutDb.setRemark(String.format("裁片方案[%s]模板代码[%s]方法类为空,请配置!", cutScheme.getCutCode(), labelTemplate.getTemplateCode()));
workOrderCutDb.setRemark(String.format("裁片方案[%s]模板代码[%s]方法类为空,请配置!", cutScheme != null ? cutScheme.getCutCode() : "", labelTemplate.getTemplateCode()));
workOrderCutDb.setSystemSyncStatus(CommonEnumUtil.FALSE);
ConvertBean.serviceModelUpdate(workOrderCutDb, workOrderCut.getModifyUser());
continue;

@ -153,8 +153,8 @@ public class MesProductionRecordService implements IMesProductionRecordService {
List<MesProductionRecord> mesProductionRecordList = productionRecordRepository.findByHqlWhere(ddlPackBean);
List<Long> failList = new ArrayList<>();
List<Long> noFailList = new ArrayList<>();
List<Long> failList;
List<Long> noFailList;
if (!CollectionUtils.isEmpty(mesProductionRecordList)) {
failList = mesProductionRecordList.stream().filter(mesProductionRecord -> Objects.equals(mesProductionRecord.getReportStatus(), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_40.getValue())).map(MesProductionRecord::getId).collect(Collectors.toList());
noFailList = mesProductionRecordList.stream().filter(mesProductionRecord -> !Objects.equals(mesProductionRecord.getReportStatus(), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_40.getValue())).map(MesProductionRecord::getId).collect(Collectors.toList());

@ -529,8 +529,8 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
List<MesShippingOrderManagementDetail> resultDetails = new ArrayList<>();
Map<Long, List<MesShippingOrderManagementDetail>> detailMap = detailList.stream().collect(Collectors.groupingBy(MesShippingOrderManagementDetail::getCustInfoSeq));
List<String> partTypeList = Arrays.asList(mesPartShippingGroup.getPartType().split(MesPcnExtConstWords.COMMA));
for (Long seq : detailMap.keySet()) {
List<MesShippingOrderManagementDetail> details = detailMap.get(seq);
for (Map.Entry<Long, List<MesShippingOrderManagementDetail>> entry: detailMap.entrySet()) {
List<MesShippingOrderManagementDetail> details = entry.getValue();
if (details.size() > MesPcnExtConstWords.ONE) {
Map<String, List<MesShippingOrderManagementDetail>> containsMap = details.stream().filter(t -> partTypeList.contains(t.getPartTypeCode())).collect(Collectors.groupingBy(MesShippingOrderManagementDetail::getPartTypeCode));
List<MesShippingOrderManagementDetail> noContains = details.stream().filter(t -> !partTypeList.contains(t.getPartTypeCode())).collect(Collectors.toList());

@ -28,7 +28,7 @@ public class MesStationServiceImpl implements IMesStationService {
@Override
public MesStation getMesStationByEquipmentCode(String organizeCode, String equipmentCode) {
if (StringUtil.isEmptyAndNull(organizeCode) || StringUtil.isEmptyAndNull(organizeCode)) {
if (StringUtil.isEmptyAndNull(organizeCode) || StringUtil.isEmptyAndNull(equipmentCode)) {
return null;
}
return mesStationRepository.getByProperty(

@ -416,18 +416,18 @@ public class MesWorkOrderService implements IMesWorkOrderService {
return mesBoms.stream().collect(Collectors.groupingBy(t -> t.getBomCode() + t.getEffStartTime())).get(next.getBomCode() + next.getEffStartTime());
}
private MesProductVersion getMesProductVersion(MesWorkOrder mesWorkOrder) {
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(mesWorkOrder.getOrganizeCode());
DdlPreparedPack.getStringEqualPack(mesWorkOrder.getPartNo(), "partNo", ddlPackBean);
DdlPreparedPack.getStringEqualPack(mesWorkOrder.getErpWorkCenter(), "workCenterCode", ddlPackBean);
// DdlPreparedPack.getStringEqualPack(mesWorkOrder.getProductVersion(), "productVersion", ddlPackBean);
MesProductVersion mesProductVersion = mesProductVersionRDao.getByProperty(ddlPackBean);
if (null == mesProductVersion) {
LOGGER.info("物料{}生产版本信息不存在", mesWorkOrder.getPartNo());
MesPcnException.throwMesBusiException("物料【%s】生产版本信息不存在", mesWorkOrder.getPartNo());
}
return mesProductVersion;
}
// private MesProductVersion getMesProductVersion(MesWorkOrder mesWorkOrder) {
// DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(mesWorkOrder.getOrganizeCode());
// DdlPreparedPack.getStringEqualPack(mesWorkOrder.getPartNo(), "partNo", ddlPackBean);
// DdlPreparedPack.getStringEqualPack(mesWorkOrder.getErpWorkCenter(), "workCenterCode", ddlPackBean);
//// DdlPreparedPack.getStringEqualPack(mesWorkOrder.getProductVersion(), "productVersion", ddlPackBean);
// MesProductVersion mesProductVersion = mesProductVersionRDao.getByProperty(ddlPackBean);
// if (null == mesProductVersion) {
// LOGGER.info("物料{}生产版本信息不存在", mesWorkOrder.getPartNo());
// MesPcnException.throwMesBusiException("物料【%s】生产版本信息不存在", mesWorkOrder.getPartNo());
// }
// return mesProductVersion;
// }
private void updateProductionRecord(String organizeCode, String userName, Long id) {
@ -791,8 +791,6 @@ public class MesWorkOrderService implements IMesWorkOrderService {
* @return
*/
private List<MesWorkOrder> getMesWorkOrder(MesProductionRecord productionRecord, String organizeCode) {
MesWorkOrder mesWorkOrder = new MesWorkOrder();
List<MesWorkOrder> workOrders = new ArrayList<>();
/**
* 线
@ -802,7 +800,6 @@ public class MesWorkOrderService implements IMesWorkOrderService {
return null;
}
// 获取当前班次
String shiftCode = productionRecord.getShiftCode();
String workCenterCode = productionRecord.getWorkCenterCode();
//查询工作中心
@ -818,7 +815,6 @@ public class MesWorkOrderService implements IMesWorkOrderService {
if (CollectionUtils.isEmpty(shiftList)) {
throw new ImppBusiException(String.format("班次信息未维护,产线=%s",workCenterCode));
}
List<MesShift> shifts = shiftList.stream().filter(mesShift -> Objects.equals(mesShift.getWorkCenterCode(), workCenterCode)).collect(Collectors.toList());
// 获取产品加工记录对应时间的班次
Integer hours = transfer(productionRecord.getCompleteDateTime()).getHours();
@ -952,6 +948,9 @@ public class MesWorkOrderService implements IMesWorkOrderService {
} catch (ParseException e) {
e.printStackTrace();
}
if (d == null) {
return "";
}
Calendar cal = Calendar.getInstance();
cal.setTime(d);
if (flag == 1) {
@ -984,7 +983,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"modifyDatetime"}, ddlPackBean);
String numStr = configService.getCfgValue(organizeCode, "MES_PCN_REPORT_NUM");
int num = StringUtils.isEmpty(numStr) ? 50 : Integer.valueOf(numStr);
int num = StringUtils.isEmpty(numStr) ? 50 : Integer.parseInt(numStr);
List<MesProductionRecord> mesProductionRecordList = productionRecordRao.findByHqlTopWhere(ddlPackBean, num);
List<MesProductionRecord> recordList = new ArrayList<>();
@ -1016,7 +1015,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"modifyDatetime"}, ddlPackBean);
String numStr = configService.getCfgValue(organizeCode, "MES_PCN_REPORT_NUM");
int num = StringUtils.isEmpty(numStr) ? 50 : Integer.valueOf(numStr);
int num = StringUtils.isEmpty(numStr) ? 50 : Integer.parseInt(numStr);
List<MesProductionRecord> mesProductionRecordList = productionRecordRao.findByHqlTopWhere(ddlPackBean, num);
List<MesProductionRecord> recordList = new ArrayList<>();
@ -1358,10 +1357,9 @@ public class MesWorkOrderService implements IMesWorkOrderService {
item.setPlanEndTime(today + " " + mesShift.getEndTime());
//生成工单号
List<String> orderList = new ArrayList<>();
GenSerialNoModel genSerialNoModel = new GenSerialNoModel("MES_WORK_CENTER_ORDER_NO");
genSerialNoModel.setPartNo(workCenterCode);
orderList = syncFuncService.syncSerialNo(genSerialNoModel, userName, organizeCode, 1).getResultList();
List<String> orderList = syncFuncService.syncSerialNo(genSerialNoModel, userName, organizeCode, 1).getResultList();
String orderNo = "A-" + orderList.get(0);
DdlPackBean orderPackBean = DdlPackBean.getDdlPackBean(item.getOrganizeCode());
@ -1809,6 +1807,9 @@ public class MesWorkOrderService implements IMesWorkOrderService {
} catch (ParseException e) {
e.printStackTrace();
}
if (d == null) {
return "";
}
Calendar cal = Calendar.getInstance();
cal.setTime(d);
if (flag == 1) {

@ -114,7 +114,7 @@ public class MesShippingCheckVolvoRackNoAndPartNoStrategyServiceImpl implements
}
MesCustSortInfo custSoftInfo = custSoftInfoRDao.getById(Long.parseLong(workOrder.getWorkOrderSource()));
if (custSoftInfo == null || !Objects.equals(detail.getCustInfoSeq(), custSoftInfo.getCustInfoSeq())) {
throw new ImppBusiException(String.format("发运单【%s】启用明细顺序防错序号【%s】前还有未扫描的发运单明细请检查数据", orderManagement.getShippingCode(), custSoftInfo.getCustInfoSeq()));
throw new ImppBusiException(String.format("发运单【%s】启用明细顺序防错序号【%s】前还有未扫描的发运单明细请检查数据", orderManagement.getShippingCode(), custSoftInfo != null ? custSoftInfo.getCustInfoSeq() : ""));
}
}

@ -73,10 +73,6 @@ public class MesFordFetchWebServiceImpl implements IFordFetchWebService {
}
MesFordFetchParameter parameter = list.get(0);
//尝试登录
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("username", parameter.getUid());
paramMap.put("password", parameter.getPwd());
paramMap.put("t", String.valueOf(System.currentTimeMillis()));
String body = "username="+parameter.getUid()+"&password="+parameter.getPwd()+"&t="+ System.currentTimeMillis();
String loginUrl = parameter.getLoginUrl();
HttpResponse loginResponse = HttpRequest.post(loginUrl).body(body)

@ -64,9 +64,9 @@ public class MesWorkOrderCalcQtyRestoreDispatchService implements IMesWorkOrderC
}
//计数
Double completeQty = !StringUtils.isEmpty(workOrder.getCompleteQty()) ? workOrder.getCompleteQty() : new Double(MesPcnExtConstWords.ZERO);
Double suspiciousPartQty = !StringUtils.isEmpty(workOrder.getSuspiciousPartQty()) ? workOrder.getSuspiciousPartQty() : new Double(MesPcnExtConstWords.ZERO);
Double scrapPartQty = !StringUtils.isEmpty(workOrder.getScrapPartQty()) ? workOrder.getScrapPartQty() : new Double(MesPcnExtConstWords.ZERO);
double completeQty = !StringUtils.isEmpty(workOrder.getCompleteQty()) ? workOrder.getCompleteQty() : MesPcnExtConstWords.ZERO;
double suspiciousPartQty = !StringUtils.isEmpty(workOrder.getSuspiciousPartQty()) ? workOrder.getSuspiciousPartQty() : MesPcnExtConstWords.ZERO;
double scrapPartQty = !StringUtils.isEmpty(workOrder.getScrapPartQty()) ? workOrder.getScrapPartQty() : MesPcnExtConstWords.ZERO;
for (MesWorkOrderCalcQtyRecord workOrderCalcQtyRecord : workOrderCalcQtyRecordList) {
if (null == workOrderCalcQtyRecord) continue;
if (!StringUtils.isEmpty(workOrderCalcQtyRecord.getCompleteQty())) completeQty = MathOperation.add(completeQty, workOrderCalcQtyRecord.getCompleteQty());
@ -75,9 +75,9 @@ public class MesWorkOrderCalcQtyRestoreDispatchService implements IMesWorkOrderC
}
//未完成数
Double unCompleteQty = !StringUtils.isEmpty(workOrder.getUnCompleteQty()) ? workOrder.getUnCompleteQty() : workOrder.getQty();
unCompleteQty = MathOperation.compareTo(unCompleteQty, new Double(MesPcnExtConstWords.ZERO)) <= MesPcnExtConstWords.ZERO ? new Double(MesPcnExtConstWords.ZERO) : MathOperation.sub(workOrder.getQty(), completeQty);
if (MathOperation.compareTo(unCompleteQty, new Double(MesPcnExtConstWords.ZERO)) < MesPcnExtConstWords.ZERO) unCompleteQty = new Double(MesPcnExtConstWords.ZERO);
double unCompleteQty = !StringUtils.isEmpty(workOrder.getUnCompleteQty()) ? workOrder.getUnCompleteQty() : workOrder.getQty();
unCompleteQty = MathOperation.compareTo(unCompleteQty, MesPcnExtConstWords.ZERO) <= MesPcnExtConstWords.ZERO ? MesPcnExtConstWords.ZERO : MathOperation.sub(workOrder.getQty(), completeQty);
if (MathOperation.compareTo(unCompleteQty, MesPcnExtConstWords.ZERO) < MesPcnExtConstWords.ZERO) unCompleteQty = MesPcnExtConstWords.ZERO;
//状态
Integer workOrderStatus = workOrder.getWorkOrderStatus();
@ -141,7 +141,7 @@ public class MesWorkOrderCalcQtyRestoreDispatchService implements IMesWorkOrderC
String[] propertyName = new String[propertyMap.size()];
Object[] propertyValue = new Object[propertyMap.size()];
Integer index = 0;
int index = 0;
for (Map.Entry<String, Object> innerEntry : propertyMap.entrySet()) {
if (null == innerEntry) continue;
propertyName[index] = innerEntry.getKey();

@ -174,21 +174,21 @@ public class MesWorkOrderOfflineRestoreDispatchService implements IMesWorkOrderO
}
//工单装配件离线数据根据工位进行分组
Map<String, List<MesWorkOrderAssemblyOffline>> cellMap = CollectionUtils.isEmpty(workOrderAssemblyOfflineList) ? null :
workOrderAssemblyOfflineList.stream().filter(o -> null != o).collect(Collectors.groupingBy(MesWorkOrderAssemblyOffline::getWorkCellCode));
Map<String, List<MesWorkOrderAssemblyOffline>> cellMap = workOrderAssemblyOfflineList.stream().filter(o -> null != o).collect(Collectors.groupingBy(MesWorkOrderAssemblyOffline::getWorkCellCode));
//解析加工记录工位字段信息 拼接新增过的工位加工记录 [{"id":"1","workCellCode":"100-10"},{"id":"2","workCellCode":"100-20"}....]
List<MesProductionRecordOfflineModel> productionRecordOfflineModelList = StringUtils.isEmpty(workOrderOffline.getProductionRecord()) ? new ArrayList<>() : JSONObject.parseArray(workOrderOffline.getProductionRecord(), MesProductionRecordOfflineModel.class);
Map<String, String> productionRecordOfflineMap = CollectionUtils.isEmpty(productionRecordOfflineModelList) ? null :
productionRecordOfflineModelList.stream().filter(o -> null != o).collect(Collectors.toMap(MesProductionRecordOfflineModel::getWorkCellCode, MesProductionRecordOfflineModel::getId));
for (Map.Entry<String, List<MesWorkOrderAssemblyOffline>> entry : cellMap.entrySet()) {
if (null == entry) continue;
List<MesWorkOrderAssemblyOffline> assemblyOfflineList = entry.getValue();
Boolean isExistProductionRecord = (CollectionUtils.isEmpty(productionRecordOfflineMap) || !productionRecordOfflineMap.containsKey(entry.getKey())) ? false : true;
Long productionRecordId = !isExistProductionRecord ? snowflakeIdMaker.nextId() : Long.valueOf(productionRecordOfflineMap.get(entry.getKey()));
boolean isExistProductionRecord = (CollectionUtils.isEmpty(productionRecordOfflineMap) || !productionRecordOfflineMap.containsKey(entry.getKey())) ? false : true;
Long productionRecordId = !isExistProductionRecord ? snowflakeIdMaker.nextId() : Long.parseLong(productionRecordOfflineMap.get(entry.getKey()));
//写入加工记录
MesProductionRecord productionRecord;

@ -33,7 +33,6 @@ public class MesNoSortCustSnNumberRuleStrategyService implements INumberRulePack
@Override
public GenSerialNoModel execute(GenSerialNoModel genSerialNoModel) {
Map<String, Object> dataMap = genSerialNoModel.getDataMap();
final String custPartNo = customerPartService.getCustPartNo(genSerialNoModel.getOrganizeCode(), genSerialNoModel.getPartNo());
if (StringUtils.isEmpty(custPartNo)) {
MesPcnException.throwMesBusiException("请检查客户零件信息,零件[%s]客户零件关系未维护", genSerialNoModel.getPartNo());

@ -94,7 +94,6 @@ public class ChengDuVolvoShippingPrintStrategyService extends SortShippingDispat
private ChengDuVolvoShippingPrintModel getPrintData(MesShippingOrderManagement shippingOrder) {
final String organizeCode = AuthUtil.getOrganize().getOrganizeCode();
final String userName = AuthUtil.getSessionUser().getUserName();
ChengDuVolvoShippingPrintModel model = new ChengDuVolvoShippingPrintModel();
DdlPackBean shippingDetailPackBean = DdlPackBean.getDdlPackBean(organizeCode);

@ -98,7 +98,7 @@ public class ChengDuVolvoPartPrintStrategy implements IPrintTemplateStrategyServ
private Map<String, Object> getPrintContextMap(MesProduceSn produceSn, MesWorkOrder workOrder) {
if (workOrder == null || StringUtils.isEmpty(workOrder.getWorkOrderSource())) {
MesPcnException.throwBusiException("客户条码[%s]对应的工单信息缺少来源!", workOrder.getCustSn());
MesPcnException.throwBusiException("客户条码[%s]对应的工单信息缺少来源!", workOrder != null ? workOrder.getCustSn() : "");
}
MesCustSortInfo custSoftInfo = custSoftInfoRDao.getById(Long.parseLong(workOrder.getWorkOrderSource()));

@ -76,7 +76,7 @@ public class MesNumberRuleMatchRegularExpressionService implements IMesNumberRul
Pattern regex = Pattern.compile(regStr);
//end update
if (regex.matcher(barcodeNoSpecialChar.toLowerCase()).matches()) return true;
if (rule == barCode) return true;
if (rule.equals(barCode)) return true;
}
return false;

@ -166,41 +166,41 @@ public class MesTimeEfficientCfgMatchService implements IMesTimeEfficientCfgMatc
return true;
}
public static void main(String[] args) {
try {
Double minValue = 1d;
Double maxValue = 240d;
SimpleDateFormat sdf = new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT);
// Date now = new Date();
Date now = sdf.parse("2025-03-21 11:19:06");
Date productDateTime = sdf.parse("2025-03-21 11:15:06");
int minDiff = (int) ((now.getTime() - productDateTime.getTime())/(60 * 1000));
Integer matchRule = 40;
if (MesExtEnumUtil.MATCH_RULE.MATCH_RULE_20.getValue().equals(matchRule)) {
//差值 小于最小时差有效
if (minDiff >= minValue){
System.out.println(false);
}
} else if (MesExtEnumUtil.MATCH_RULE.MATCH_RULE_30.getValue().equals(matchRule)) {
// 差值 大于最大时差有效
if (minDiff <= maxValue){
System.out.println(false);
}
} else if (MesExtEnumUtil.MATCH_RULE.MATCH_RULE_40.getValue().equals(matchRule)) {
// 差值 最大最小时差有效 在 最大值 最小值之间
if (minDiff <= minValue || minDiff >= maxValue){
System.out.println(false);
}
} else if (MesExtEnumUtil.MATCH_RULE.MATCH_RULE_50.getValue().equals(matchRule)) {
// 差值 最大外或最小内有效
if (minDiff >= minValue && minDiff <= maxValue){
System.out.println(false);
}
}
System.out.println("执行完成");
} catch (ParseException e) {
e.printStackTrace();
}
}
// public static void main(String[] args) {
// try {
// Double minValue = 1d;
// Double maxValue = 240d;
// SimpleDateFormat sdf = new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT);
//// Date now = new Date();
// Date now = sdf.parse("2025-03-21 11:19:06");
// Date productDateTime = sdf.parse("2025-03-21 11:15:06");
// int minDiff = (int) ((now.getTime() - productDateTime.getTime())/(60 * 1000));
// Integer matchRule = 40;
// if (MesExtEnumUtil.MATCH_RULE.MATCH_RULE_20.getValue().equals(matchRule)) {
// //差值 小于最小时差有效
// if (minDiff >= minValue){
// System.out.println(false);
// }
// } else if (MesExtEnumUtil.MATCH_RULE.MATCH_RULE_30.getValue().equals(matchRule)) {
// // 差值 大于最大时差有效
// if (minDiff <= maxValue){
// System.out.println(false);
// }
// } else if (MesExtEnumUtil.MATCH_RULE.MATCH_RULE_40.getValue().equals(matchRule)) {
// // 差值 最大最小时差有效 在 最大值 最小值之间
// if (minDiff <= minValue || minDiff >= maxValue){
// System.out.println(false);
// }
// } else if (MesExtEnumUtil.MATCH_RULE.MATCH_RULE_50.getValue().equals(matchRule)) {
// // 差值 最大外或最小内有效
// if (minDiff >= minValue && minDiff <= maxValue){
// System.out.println(false);
// }
// }
// System.out.println("执行完成");
// } catch (ParseException e) {
// e.printStackTrace();
// }
// }
}

@ -21,10 +21,6 @@ public class OrderWriteVariableService extends AbstractWriteVariableService{
@Autowired
private IMesProductionDispatchContextStepService mesProductionDispatchContextStepService;
private Map<String, String> map = new HashMap<>();
private String orderNo;
@Override
public String transferValue(StationRequestBean reqBean, String value, Integer foreignKey, Integer index) {
@ -43,19 +39,4 @@ public class OrderWriteVariableService extends AbstractWriteVariableService{
}
return null;
}
/* public void addList(String orderNo){
orderNoList.add(orderNo);
}
@Override
public void handlerValue() {
orderNoList.add(this.orderNo);
}
@Override
public void removeValue() {
orderNoList.clear();
orderNo = null;
}*/
}

@ -21,10 +21,6 @@ public class PartWriteVariableService extends AbstractWriteVariableService{
@Autowired
private IMesProductionDispatchContextStepService mesProductionDispatchContextStepService;
private Map<String, String> map = new HashMap<>();
private String orderNo;
@Override
public String transferValue(StationRequestBean reqBean, String value, Integer foreignKey, Integer index) {
@ -35,30 +31,6 @@ public class PartWriteVariableService extends AbstractWriteVariableService{
if (mesProductionPartContext != null) {
return mesProductionPartContext.getPartNo();
}
/*
for (MesProductionPartContext mesProductionPartContext : productionPartContextList) {
if (orderNoList.contains(mesProductionPartContext.getWorkOrderNo())) {
continue;
}
orderNo = mesProductionPartContext.getWorkOrderNo();
return mesProductionPartContext.getWorkOrderNo();
}*/
return null;
}
/* public void addList(String orderNo){
orderNoList.add(orderNo);
}
@Override
public void handlerValue() {
orderNoList.add(this.orderNo);
}
@Override
public void removeValue() {
orderNoList.clear();
orderNo = null;
}*/
}

@ -68,16 +68,17 @@ public class MesFunctionPackageProgressService extends BaseSwsService implements
List<MesPackageDataContext> resultList = new ArrayList<>();
//封装页面数据
for (String partNo : packageDataContextMap.keySet()) {
for (Map.Entry<String, String> entry : packageDataContextMap.entrySet()) {
String partNo = entry.getKey();
if (StringUtils.isEmpty(partNo)) continue;
List<MesPackageDataContext> packageDataContextList = JSONObject.parseArray(packageDataContextMap.get(partNo), MesPackageDataContext.class);
List<MesPackageDataContext> packageDataContextList = JSONObject.parseArray(entry.getValue(), MesPackageDataContext.class);
packageDataContextList = packageDataContextList.stream().filter(o -> null != o).sorted(Comparator.comparing(MesPackageDataContext::getModifyDatetime).reversed()).collect(Collectors.toList());
//列表展示: 包装条码, 装箱个数, 包装规格数量, 装箱开始时间, 装箱结束时间
resultList.add(new MesPackageDataContext(
packageDataContextList.get(0).getPartNo(), packageDataContextList.get(0).getPartName(),
packageDataContextList.get(0).getPackageNo(), new Double(packageDataContextList.size()), packageDataContextList.get(0).getPackSpecQty(),
packageDataContextList.get(0).getPackageNo(), (double) packageDataContextList.size(), packageDataContextList.get(0).getPackSpecQty(),
packageDataContextList.get(0).getCreateDatetime(), packageDataContextList.get(0).getModifyDatetime(), packageDataContextList.get(0).getGenerateType())
);
}
@ -96,7 +97,7 @@ public class MesFunctionPackageProgressService extends BaseSwsService implements
resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PICK.getValue()).scanInfo(packageDataContext.getPackageNo());
if (null == packageDataContext || StringUtils.isEmpty(packageDataContext.getBusiType())) {
if (StringUtils.isEmpty(packageDataContext.getBusiType())) {
return packResultMap(reqBean, resultBean, resultMap,
String.format("生产线[%s]工位[%s]打包进度操作按钮执行失败,参数异常!", reqBean.getWorkCenterCode(), reqBean.getWorkCellCode()));
}
@ -146,7 +147,7 @@ public class MesFunctionPackageProgressService extends BaseSwsService implements
//修改包装信息的数量
packageNoGenerateStepService.savePackageData(reqBean, packageDb, packageDataContext.getQty());
//打包数据更新数量(判断是增加还是减少数量)
if (MathOperation.compareTo(packageDataContext.getQty(), new Double(packageDataContextList.size())) < 0) {
if (MathOperation.compareTo(packageDataContext.getQty(), packageDataContextList.size()) < 0) {
packageDataContextList = packageDataContextList.subList(0, packageDataContext.getQty().intValue());
} else {
Integer loopTimes = packageDataContext.getQty().intValue() - packageDataContextList.size();

@ -193,7 +193,7 @@ public class MesFunctionQueueOrderPushService extends BaseSwsService implements
Integer processSeq;
if (!StringUtils.isEmpty(paramMap.get(MesPcnExtConstWords.PROCESS_SEQ))) processSeq = Integer.valueOf(paramMap.get(MesPcnExtConstWords.PROCESS_SEQ));
else if (!StringUtils.isEmpty(paramMap.get(MesPcnExtConstWords.PROCESS_SEQ_UP))) processSeq = queueOrderPushService.getQueueOrderPushCalcSeq(reqBean.getOrganizeCode(), optional.get(), Integer.valueOf(paramMap.get(MesPcnExtConstWords.PROCESS_SEQ_UP)));
else processSeq = Integer.valueOf(paramMap.get(MesPcnExtConstWords.PROCESS_SEQ_DOWN)) + 1;
else processSeq = Integer.parseInt(paramMap.get(MesPcnExtConstWords.PROCESS_SEQ_DOWN)) + 1;
//根据条件修改生产队列工位推送信息
queueOrderPushService.saveQueueOrderPushByCondition(
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.ID},

@ -186,7 +186,7 @@ public class MesProductionCustomContextStepService extends BaseStepService imple
AtomicReference<Boolean> flag = new AtomicReference<>(false);
stationKvBeans.stream().forEach(stationKvBean -> {
if (stationKvBean.getKey().contains(mesProdShiftKvBean.getShiftGroup())) {
stationKvBean.setValue(stationKvBean == null ? countStr : String.valueOf(Integer.valueOf(stationKvBean.getValue()) + count));
stationKvBean.setValue(stationKvBean == null ? countStr : String.valueOf(Integer.parseInt(stationKvBean.getValue()) + count));
amount.set(Integer.valueOf(stationKvBean.getValue()));
flag.set(true);
}

@ -423,7 +423,7 @@ public class MesProductionDispatchContextStepService extends BaseStepService imp
removeFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), item);
return true;
}
dispatchFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), item, String.valueOf(Integer.valueOf(endlessLoopReadTimes) + 1));
dispatchFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), item, String.valueOf(Integer.parseInt(endlessLoopReadTimes) + 1));
return false;
}

@ -50,7 +50,7 @@ public class MesWorkOrderCheckCompleteQtyStepService extends BaseStepService {
if (!stepResult.isCompleted() || CollectionUtils.isEmpty(productionPartContextList)) return null;
//根据产出零件或者腔数拿到需要的加工规则数量, 优先使用产出零件数量
Integer needQty = !CollectionUtils.isEmpty(productionPartContextList) ? productionPartContextList.size() : productionProcessContext.getCurCellEquip().getCavity();
int needQty = !CollectionUtils.isEmpty(productionPartContextList) ? productionPartContextList.size() : productionProcessContext.getCurCellEquip().getCavity();
//验证是否满足腔数
if (!CollectionUtils.isEmpty(productionPsInContextList) && productionPsInContextList.size() < needQty) return null;
@ -103,17 +103,17 @@ public class MesWorkOrderCheckCompleteQtyStepService extends BaseStepService {
private MesWorkOrderCompleteQtyContext dispatchWorkOrderCompleteQty(StationRequestBean reqBean, StationResultBean resultBean,
StepResult stepResult, MesWorkCenter workCenter, Boolean noCalcOrderQty,
List<MesProductionPartContext> productionPartContextList, Map<Integer, MesProductionPsInContext> productionPsInContextMap) {
Double calcCompleteQty = new Double(MesPcnExtConstWords.ZERO);
double calcCompleteQty = MesPcnExtConstWords.ZERO;
for (MesProductionPartContext productionPartContext : productionPartContextList) {
MesProductionPsInContext productionPsInContext = getProductionPsInContext(productionPsInContextMap, productionPartContext.getForeignKey());
//验证进料零件与产出零件是否一致
Boolean isSamePart = isSamePart(productionPsInContext, productionPartContext, null);
//验证是否计数
Boolean isCalcCompleteQty = isCalcCompleteQty(isSamePart, productionPsInContext, productionPartContext);
if (isCalcCompleteQty) calcCompleteQty = MathOperation.add(calcCompleteQty, new Double(MesPcnExtConstWords.ONE));
if (isCalcCompleteQty) calcCompleteQty = MathOperation.add(calcCompleteQty, MesPcnExtConstWords.ONE);
}
//当前工单无须计算工单完成数
if (MathOperation.compareTo(calcCompleteQty, new Double(MesPcnExtConstWords.ZERO)) == 0) return null;
if (MathOperation.compareTo(calcCompleteQty, MesPcnExtConstWords.ZERO) == 0) return null;
//根据noCalcOrderQty判断维度处理工单完成数上下文[查询]【noCalcOrderQty=true代表工位维度的统计,最终不会实际累加到工单上】【noCalcOrderQty=false代表生产线维度的统计,才会实际累加到工单上】
MesWorkOrderCompleteQtyContext workOrderCompleteQtyContext = productionCustomContextStepService.dispatchWorkOrderCompleteQtyContext(reqBean, noCalcOrderQty, productionPartContextList.get(0));
@ -171,7 +171,7 @@ public class MesWorkOrderCheckCompleteQtyStepService extends BaseStepService {
MesWorkOrderCompleteQtyContext workOrderCompleteQtyContext, Double calcCompleteQty, Boolean noCalcOrderQty) {
//当前工序的预计达到的完成数
Double complateQty = MathOperation.add(workOrderCompleteQtyContext.getCompleteQty(), calcCompleteQty);
double complateQty = MathOperation.add(workOrderCompleteQtyContext.getCompleteQty(), calcCompleteQty);
// 如果预完成数量 小于等于工单数量,则直接过
if (MathOperation.compareTo(workOrderCompleteQtyContext.getQty(), complateQty) >= 0) return;
//判断不支持超工单生产
@ -184,8 +184,8 @@ public class MesWorkOrderCheckCompleteQtyStepService extends BaseStepService {
return;
}
//支持超工单生产情况下判断超出比例
Double rate = MathOperation.div((MathOperation.sub(complateQty, workOrderCompleteQtyContext.getQty())), workOrderCompleteQtyContext.getQty());
if (MathOperation.compareTo(rate, MathOperation.div(workCenter.getOrderRate(), new Double(MesPcnExtConstWords.ONE_HUNDRED))) > 0) {
double rate = MathOperation.div((MathOperation.sub(complateQty, workOrderCompleteQtyContext.getQty())), workOrderCompleteQtyContext.getQty());
if (MathOperation.compareTo(rate, MathOperation.div(workCenter.getOrderRate(), MesPcnExtConstWords.ONE_HUNDRED)) > 0) {
stepNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult.obj(false), String.format("请检查工单数量,工单[%s]计划数量[%s]%s已完成数量[%s]超工单比例[%s]!",
workOrderCompleteQtyContext.getWorkOrderNo(), workOrderCompleteQtyContext.getQty().intValue(),
noCalcOrderQty ? "当前工位" : MesPcnExtConstWords.EMPTY, workOrderCompleteQtyContext.getCompleteQty().intValue(), workCenter.getOrderRate()));

@ -45,7 +45,7 @@ public class MesAssemblyShowContext implements Serializable {
private Integer matchType;
@ApiParam("扫描规则")
public String matchRule;
private String matchRule;
@ApiParam("装配零件状态")
private String assemblyStatusName;
@ -54,7 +54,7 @@ public class MesAssemblyShowContext implements Serializable {
private String matchTypeName;
@ApiParam("工位代码")
public String workCellCode;
private String workCellCode;
@ApiParam(value = "工艺顺序号")
private Integer processSeq;
@ -63,7 +63,7 @@ public class MesAssemblyShowContext implements Serializable {
private Integer index;
@ApiParam("匹配时间")
public String matchDatetime;
private String matchDatetime;
@ApiParam(value = "是否置顶")
private Integer isTop = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();

@ -2,12 +2,14 @@ package cn.estsh.i3plus.ext.mes.pcn.pojo.context;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
*
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class MesPackageDataContext extends MesPackageRuleContext implements Serializable {

@ -14,54 +14,54 @@ public class MesPackageRuleContext implements Serializable {
private static final long serialVersionUID = 1369218116212836881L;
@ApiParam(name = "包装代码")
public String packageCode;
private String packageCode;
@ApiParam(name = "行号")
public String lineNo;
private String lineNo;
@ApiParam(name = "零件号")
public String partNo;
protected String partNo;
@ApiParam(name = "零件名称")
public String partName;
protected String partName;
@ApiParam(name = "零件类型")
public String partType;
private String partType;
@ApiParam("包装规格数量")
public Double packSpecQty;
protected Double packSpecQty;
@ApiParam("最小数量")
public Double minQty;
private Double minQty;
@ApiParam("取整数量")
public Double roundnessQty;
private Double roundnessQty;
@ApiParam(name = "计量单位")
public String unit;
private String unit;
@ApiParam(name = "是否默认包装")
public Integer defaultFlag;
private Integer defaultFlag;
@ApiParam(name = "统计方式")
public Integer generateType;
protected Integer generateType;
@ApiParam(name = "箱类别代号")
public String packCode;
private String packCode;
@ApiParam(name = "包装条码编码规则")
public String packageBarcodeRule;
private String packageBarcodeRule;
@ApiParam(name = "包装条码模板")
public String packageTemplate;
private String packageTemplate;
@ApiParam(name = "打印机")
public String printer;
private String printer;
@ApiParam(name = "同步状态WMS")
public Integer systemSyncStatusWms = 2;
private Integer systemSyncStatusWms = 2;
@ApiParam("零件打包加工单号")
public String partPackWorkOrderNo;
private String partPackWorkOrderNo;
}

@ -3,6 +3,7 @@ package cn.estsh.i3plus.ext.mes.pcn.pojo.context;
import cn.estsh.i3plus.pojo.mes.bean.MesPart;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.beans.BeanUtils;
import java.io.Serializable;
@ -10,8 +11,9 @@ import java.io.Serializable;
/**
* -()
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class MesPartContext extends MesPart implements Serializable {
public final class MesPartContext extends MesPart implements Serializable {
private static final long serialVersionUID = -1221271846639577097L;

@ -25,7 +25,7 @@ public class MesProdRuleContext implements Serializable {
private static final long serialVersionUID = 1522652732930288854L;
@ApiParam("组织代码")
public String organizeCode;
private String organizeCode;
@ApiParam(name = "数据关联键")
private Integer foreignKey;
@ -43,16 +43,16 @@ public class MesProdRuleContext implements Serializable {
private String productSn;
@ApiParam("装配件绑定清单 [JSON]List<MesProductionAssemblyContext>")
public String assemblyDataJson;
private String assemblyDataJson;
@ApiParam("生产线代码")
public String workCenterCode;
private String workCenterCode;
@ApiParam("工位代码")
public String workCellCode;
private String workCellCode;
@ApiParam("工序代码")
public String processCode;
private String processCode;
@ApiParam("工艺代码")
private String craftCode;
@ -63,7 +63,7 @@ public class MesProdRuleContext implements Serializable {
//-------以下非排序属性-------------
@ApiParam("非排序产品加工规则ID")
public Long pid;
private Long pid;
@ApiParam(name = "进料零件号")
private String inPartNo;

@ -14,13 +14,13 @@ public class MesProdTempDataContext implements Serializable {
private static final long serialVersionUID = -5184127961206077150L;
@ApiParam("组织代码")
public String organizeCode;
private String organizeCode;
@ApiParam(name = "数据关联键")
private Integer foreignKey;
@ApiParam("流水号")
public String serialNo;
private String serialNo;
public MesProdTempDataContext() {}

@ -17,115 +17,115 @@ public class MesProductionAssemblyContext implements Serializable {
private static final long serialVersionUID = 2382117884422723639L;
@ApiParam("生产工单号")
public String workOrderNo;
private String workOrderNo;
@ApiParam("装配件零件编码")
public String assemblyPartNo;
private String assemblyPartNo;
@ApiParam("装配件零件名称")
public String assemblyPartName;
private String assemblyPartName;
@ApiParam("装配件条码")
public String assemblySn;
protected String assemblySn;
@ApiParam("生产工单零件号")
public String partNo;
private String partNo;
@ApiParam("生产工单零件名称")
public String partName;
private String partName;
@ApiParam("装配零件状态")
public Integer assemblyStatus;
protected Integer assemblyStatus;
@ApiParam("是否跳过")
public Integer isSkip = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
protected Integer isSkip = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
@ApiParam("装配件条码确认方式")
public Integer matchType;
protected Integer matchType;
@ApiParam("扫描规则")
public String matchRule;
private String matchRule;
@ApiParam("不可用规则")
public String prodRuleIgnoreCfg;
protected String prodRuleIgnoreCfg;
@ApiParam("自制件ID")
public Long productSnId;
protected Long productSnId;
@ApiParam("数据来源")
public Integer dataSource;
protected Integer dataSource;
@ApiParam("来源ID")
public Long sourceId;
protected Long sourceId;
@ApiParam(value = "排序/非排序产品加工规则ID")
public Long pid;
private Long pid;
@ApiParam("最小值")
public Double minValue;
private Double minValue;
@ApiParam("最大值")
public Double maxValue;
private Double maxValue;
@ApiParam(value = "装备序号")
public Integer routeSeq;
protected Integer routeSeq;
@ApiParam(value = "装配爆炸图FID")
public Long imageFileId;
protected Long imageFileId;
@ApiParam(value = "音频文件")
public Long audioFileId;
protected Long audioFileId;
@ApiParam(value = "装配爆炸图URL")
public String imageFileUrl;
protected String imageFileUrl;
@ApiParam(value = "音频文件URL")
public String audioFileUrl;
protected String audioFileUrl;
@ApiParam(value = "装配爆炸图URL")
public Integer fileIsFinished = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
protected Integer fileIsFinished = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
@ApiParam("前道工艺代码")
public String preCraftCode;
private String preCraftCode;
@ApiParam("组织代码")
public String organizeCode;
private String organizeCode;
@ApiParam("区域代码")
public String areaCode;
private String areaCode;
@ApiParam("生产线代码")
public String workCenterCode;
private String workCenterCode;
@ApiParam("工位代码")
public String workCellCode;
private String workCellCode;
@ApiParam("设备代码")
public String equipmentCode;
private String equipmentCode;
@ApiParam("工序代码")
public String processCode;
private String processCode;
@ApiParam("工序名称")
public String processName;
private String processName;
@ApiParam("工艺代码")
public String craftCode;
private String craftCode;
@ApiParam("工艺名称")
public String craftName;
private String craftName;
@ApiParam(name = "数据关联键")
public Integer foreignKey;
protected Integer foreignKey;
@ApiParam(value = "是否可复用条码")
public Integer isRepeat = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
private Integer isRepeat = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
@ApiParam(value = "是否可复用条码是否写入上下文进行复用")
public Integer isRepeat2Cache = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue();
protected Integer isRepeat2Cache = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue();
@ApiParam("匹配时间")
public String matchDatetime;
protected String matchDatetime;
public String repeatKeyToString() {
if (StringUtils.isEmpty(this.equipmentCode) || StringUtils.isEmpty(this.matchType) || (StringUtils.isEmpty(this.matchRule) && StringUtils.isEmpty(this.assemblyPartNo))) return null;

@ -7,6 +7,7 @@ import cn.estsh.i3plus.pojo.mes.bean.MesProductionAssembly;
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.beans.BeanUtils;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
@ -19,6 +20,7 @@ import java.util.Map;
/**
* -()
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class MesProductionAssemblyNosortContext extends MesProductionAssemblyContext implements Serializable {
@ -28,7 +30,7 @@ public class MesProductionAssemblyNosortContext extends MesProductionAssemblyCon
private String bomDetailId;
@ApiParam(name = "任意装配件扫描错误判断工位isResetScan后是否重新扫描")
public Integer isResetScan = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue();
private Integer isResetScan = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue();
@ApiParam(value = "是否忽略回车")
private Integer isIgnoreEntry;
@ -50,16 +52,16 @@ public class MesProductionAssemblyNosortContext extends MesProductionAssemblyCon
BeanUtils.copyProperties(prodRuleContext, this);
this.dataSource = MesExtEnumUtil.WORK_CENTER_TYPE.NOSORT.getValue();
setDataSource(MesExtEnumUtil.WORK_CENTER_TYPE.NOSORT.getValue());
this.sourceId = assemblyNosortCfg.getId();
setSourceId(assemblyNosortCfg.getId());
this.partNo = prodRuleContext.getOutPartNo();
setPartNo(prodRuleContext.getOutPartNo());
if (StringUtils.isEmpty(this.routeSeq)) this.routeSeq = MesPcnExtConstWords.ZERO;
if (StringUtils.isEmpty(this.isRepeat) || this.isRepeat.compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) != 0) this.isRepeat = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
if (StringUtils.isEmpty(this.getRouteSeq())) this.setRouteSeq(MesPcnExtConstWords.ZERO);
if (StringUtils.isEmpty(this.getIsRepeat()) || this.getIsRepeat().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) != 0) this.setIsRepeat(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue();
this.setAssemblyStatus(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue());
return this;
}

@ -8,6 +8,7 @@ import cn.estsh.i3plus.pojo.mes.bean.MesWorkOrderAssembly;
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.beans.BeanUtils;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
@ -20,6 +21,7 @@ import java.util.Map;
/**
* -
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class MesProductionAssemblySortContext extends MesProductionAssemblyContext implements Serializable {
@ -107,7 +109,7 @@ public class MesProductionAssemblySortContext extends MesProductionAssemblyConte
private String productGroupCode;
@ApiParam(value = "装配件记录表ID")
public Long id;
private Long id;
@ApiParam("开模记录ID")
private Long mouldRecordId;
@ -116,16 +118,16 @@ public class MesProductionAssemblySortContext extends MesProductionAssemblyConte
private Long productionRecordId;
@ApiParam(value = "工单装配件信息备注")
public String woaRemark;
private String woaRemark;
@ApiParam(value = "装配件记录信息备注")
public String paRemark;
private String paRemark;
@ApiParam(value = "装配件记录表创建时间")
public String createDatetime;
private String createDatetime;
@ApiParam(value = "装配件记录表创建人")
public String createUser;
private String createUser;
@ApiParam(name = "是否顺序扫描")
private Integer isCheckBindSeq;

@ -172,9 +172,11 @@ public class MesProductionProcessContext implements Serializable {
//上下文赋值生产线对象
public MesProductionProcessContext workCenterJson(MesWorkCenter workCenter) {
if (StringUtils.isEmpty(workCenter.getIsCheckOrderQty())) workCenter.setIsCheckOrderQty(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
if (StringUtils.isEmpty(workCenter.getIsIgnoreQc())) workCenter.setIsCheckOrderQty(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
if (StringUtils.isEmpty(workCenter.getIsPushQueue())) workCenter.setIsPushQueue(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
if (workCenter != null) {
if (StringUtils.isEmpty(workCenter.getIsCheckOrderQty())) workCenter.setIsCheckOrderQty(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
if (StringUtils.isEmpty(workCenter.getIsIgnoreQc())) workCenter.setIsCheckOrderQty(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
if (StringUtils.isEmpty(workCenter.getIsPushQueue())) workCenter.setIsPushQueue(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
}
this.workCenterJson = null != workCenter ? JSONObject.toJSONString(workCenter) : null;
return this.isNeedCache();
}
@ -188,12 +190,14 @@ public class MesProductionProcessContext implements Serializable {
//上下文赋值工位对象
public MesProductionProcessContext workCellJson(MesWorkCell workCell) {
if (StringUtils.isEmpty(workCell.getIsCheckSeq())) workCell.setIsCheckSeq(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
if (StringUtils.isEmpty(workCell.getIsCheckCraft())) workCell.setIsCheckCraft(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
if (StringUtils.isEmpty(workCell.getIsSeqScan())) workCell.setIsCheckSeq(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
if (StringUtils.isEmpty(workCell.getIsResetScan())) workCell.setIsResetScan(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
if (StringUtils.isEmpty(workCell.getNoCalcOrderQty())) workCell.setNoCalcOrderQty(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
if (StringUtils.isEmpty(workCell.getIsEndWorkCell())) workCell.setIsEndWorkCell(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
if (workCell != null) {
if (StringUtils.isEmpty(workCell.getIsCheckSeq())) workCell.setIsCheckSeq(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
if (StringUtils.isEmpty(workCell.getIsCheckCraft())) workCell.setIsCheckCraft(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
if (StringUtils.isEmpty(workCell.getIsSeqScan())) workCell.setIsCheckSeq(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
if (StringUtils.isEmpty(workCell.getIsResetScan())) workCell.setIsResetScan(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
if (StringUtils.isEmpty(workCell.getNoCalcOrderQty())) workCell.setNoCalcOrderQty(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
if (StringUtils.isEmpty(workCell.getIsEndWorkCell())) workCell.setIsEndWorkCell(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
}
this.workCellJson = null != workCell ? JSONObject.toJSONString(workCell) : null;
return this.isNeedCache();
}
@ -255,10 +259,12 @@ public class MesProductionProcessContext implements Serializable {
//上下文赋值工位当前要使用的设备
public MesProductionProcessContext curCellEquipJson(MesCellEquipContext curEquip) {
//未配置则默认1腔
if (StringUtils.isEmpty(curEquip.getCavity()) || curEquip.getCavity().compareTo(MesPcnExtConstWords.ZERO) == 0) curEquip.setCavity(MesPcnExtConstWords.ONE);
//未配置则默认没有装配件
if (StringUtils.isEmpty(curEquip.getBindQty())) curEquip.setBindQty(MesPcnExtConstWords.ZERO);
if (curEquip != null) {
//未配置则默认1腔
if (StringUtils.isEmpty(curEquip.getCavity()) || curEquip.getCavity().compareTo(MesPcnExtConstWords.ZERO) == 0) curEquip.setCavity(MesPcnExtConstWords.ONE);
//未配置则默认没有装配件
if (StringUtils.isEmpty(curEquip.getBindQty())) curEquip.setBindQty(MesPcnExtConstWords.ZERO);
}
this.curCellEquipJson = null != curEquip ? JSONObject.toJSONString(curEquip) : null;
return this.isNeedCache();
}

@ -15,7 +15,7 @@ import java.io.Serializable;
* -(/)
*/
@Data
public class MesProductionPsInContext implements Serializable {
public final class MesProductionPsInContext implements Serializable {
private static final long serialVersionUID = 4337949265011880288L;

@ -2,7 +2,9 @@ package cn.estsh.i3plus.ext.mes.pcn.pojo.model;
import cn.estsh.i3plus.pojo.mes.bean.*;
import io.swagger.annotations.ApiParam;
import lombok.AccessLevel;
import lombok.Data;
import lombok.Getter;
import java.util.ArrayList;
import java.util.List;
@ -37,6 +39,7 @@ public class MesProduceSnPrintModel {
private Integer printQty;
@ApiParam("标包数量")
@Getter(AccessLevel.NONE)
private Double qty;
@ApiParam("打印模板")

@ -3,6 +3,11 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>impp.framework</groupId>
<artifactId>impp-framework</artifactId>
<version>1.0.1-YZ</version>
</parent>
<groupId>i3plus.ext.mes.pcn</groupId>
<artifactId>i3plus-ext-mes-pcn</artifactId>
@ -16,13 +21,6 @@
<module>modules/i3plus-ext-mes-pcn-icloud</module>
</modules>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version>
<relativePath/>
</parent>
<properties>
<project.name>i3plus-ext-mes-pcn</project.name>
<java.version>1.8</java.version>

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
<!-- &lt;!&ndash; 忽略特定类型的Bug &ndash;&gt;-->
<Match>
<Bug pattern="EI_EXPOSE_REP,EI_EXPOSE_REP2,MS_MUTABLE_ARRAY,BX_UNBOXING_IMMEDIATELY_REBOXED,RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE,NM_CLASS_NOT_EXCEPTION,DM_DEFAULT_ENCODING,ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD,REC_CATCH_EXCEPTION,EI_EXPOSE_STATIC_REP2,MS_EXPOSE_REP,BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATOR,RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE,RV_RETURN_VALUE_IGNORED_BAD_PRACTICE,RV_RETURN_VALUE_IGNORED,DMI_HARDCODED_ABSOLUTE_FILENAME,AT_OPERATION_SEQUENCE_ON_CONCURRENT_ABSTRACTION,DMI_RANDOM_USED_ONLY_ONCE,DM_NEXTINT_VIA_NEXTDOUBLE,SE_BAD_FIELD"/>
</Match>
<!-- &lt;!&ndash; 按类名忽略 &ndash;&gt;-->
<!-- <Match>-->
<!-- <Class name="com.example.MyClass"/>-->
<!-- </Match>-->
<!-- &lt;!&ndash; 按包名忽略 &ndash;&gt;-->
<Package name="cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step" />
<Package name="cn.estsh.i3plus.mes.pcn.serviceimpl.fsm" />
</FindBugsFilter>
Loading…
Cancel
Save