Browse Source

opt: 日志打印

master
李永德 1 year ago
parent
commit
9fa97946ae
  1. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/common/mnt/websocket/WebSocketServer.java
  2. 3
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/LogMessageConstant.java
  3. 43
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java
  4. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJMKTask.java
  5. 2
      lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml
  6. 14
      lms/nladmin-system/nlsso-server/src/main/resources/stopword.dic

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/common/mnt/websocket/WebSocketServer.java

@ -106,7 +106,7 @@ public class WebSocketServer {
* */ * */
public static void sendInfo(SocketMsg socketMsg, @PathParam("sid") String sid) throws IOException { public static void sendInfo(SocketMsg socketMsg, @PathParam("sid") String sid) throws IOException {
String message = JSONObject.toJSONString(socketMsg); String message = JSONObject.toJSONString(socketMsg);
log.info("推送消息到"+sid+",推送内容:"+message); log.debug("推送消息到"+sid+",推送内容:"+message);
for (WebSocketServer item : webSocketSet) { for (WebSocketServer item : webSocketSet) {
try { try {
//这里可以设定只推送给这个sid的,为null则全部推送 //这里可以设定只推送给这个sid的,为null则全部推送

3
lms/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/LogMessageConstant.java

@ -42,5 +42,6 @@ public class LogMessageConstant {
public final static String BACKGROUND_YELLOW = "\u001B[43m"; public final static String BACKGROUND_YELLOW = "\u001B[43m";
/** 索引路径 */ /** 索引路径 */
public final static String INDEX_DIR = "D:\\lucene\\index"; public final static String INDEX_DIR = "E:\\lucene\\index";
} }

43
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java

@ -59,11 +59,11 @@ public class WmsToMesServiceImpl implements WmsToMesService {
@Override @Override
public void reportMudConsumption(MesMudConsumptionDto mudObject) { public void reportMudConsumption(MesMudConsumptionDto mudObject) {
log.info("上报mes消耗泥料记录的信息: {}", mudObject);
// 请求mes插入mes数据库 // 请求mes插入mes数据库
try { try {
mesRequestMapper.insertMudConsumptionInfo(mudObject); mesRequestMapper.insertMudConsumptionInfo(mudObject);
} catch (Exception e) { } catch (Exception e) {
log.error("上报mes消耗泥料记录的数据:{}", mudObject);
log.error("上报mes消耗泥料记录失败:{}", e.getMessage()); log.error("上报mes消耗泥料记录失败:{}", e.getMessage());
// todo:发送通知 // todo:发送通知
noticeService.createNotice("上报mes消耗泥料数据失败", "消耗泥料数据" + mudObject.getPWORKSCHE_ID(), noticeService.createNotice("上报mes消耗泥料数据失败", "消耗泥料数据" + mudObject.getPWORKSCHE_ID(),
@ -117,7 +117,6 @@ public class WmsToMesServiceImpl implements WmsToMesService {
@Override @Override
// @DSTransactional // @DSTransactional
public void reportProductData(String groupId) { public void reportProductData(String groupId) {
log.info("压机产出数据记录");
// 获取组盘信息 // 获取组盘信息
SchBaseVehiclematerialgroup vehiclematerialgroup = vehiclematerialgroupService.getById(groupId); SchBaseVehiclematerialgroup vehiclematerialgroup = vehiclematerialgroupService.getById(groupId);
String workorderCode = vehiclematerialgroup.getWorkorder_code(); String workorderCode = vehiclematerialgroup.getWorkorder_code();
@ -125,7 +124,7 @@ public class WmsToMesServiceImpl implements WmsToMesService {
PdmBdWorkorder workorder = pdmBdWorkorderService.getByCode(workorderCode); PdmBdWorkorder workorder = pdmBdWorkorderService.getByCode(workorderCode);
String extData = workorder.getExt_data(); String extData = workorder.getExt_data();
MesWorkOrderDto mesWorkOrderDto = JSON.parseObject(extData, MesWorkOrderDto.class); MesWorkOrderDto mesWorkOrderDto = JSON.parseObject(extData, MesWorkOrderDto.class);
log.info("获取MES给的工单数据:{}", mesWorkOrderDto);
SchBasePoint basePoint = pointService.getById(workorder.getPoint_code()); SchBasePoint basePoint = pointService.getById(workorder.getPoint_code());
MesProductDataDto mesProductDataDto = new MesProductDataDto(); MesProductDataDto mesProductDataDto = new MesProductDataDto();
mesProductDataDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr()); mesProductDataDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr());
@ -146,11 +145,13 @@ public class WmsToMesServiceImpl implements WmsToMesService {
? workorder.getProduce_date() : DateUtil.now()); ? workorder.getProduce_date() : DateUtil.now());
mesProductDataDto.setCREATE_TM(DateUtil.now()); mesProductDataDto.setCREATE_TM(DateUtil.now());
mesProductDataDto.setOP_FLAG(GeneralDefinition.NO); mesProductDataDto.setOP_FLAG(GeneralDefinition.NO);
log.info("压机产出返给MES的数据:{}", mesProductDataDto);
// 插入mes数据库 // 插入mes数据库
try { try {
mesRequestMapper.insertProductData(mesProductDataDto); mesRequestMapper.insertProductData(mesProductDataDto);
} catch (Exception e) { } catch (Exception e) {
log.error("压机产出-获取MES给的工单数据:{}", mesWorkOrderDto);
log.error("压机产出返给MES的数据:{}", mesProductDataDto);
log.error("反馈压机产出插入mes数据库失败:{}", e.getMessage()); log.error("反馈压机产出插入mes数据库失败:{}", e.getMessage());
// 发送通知 // 发送通知
noticeService.createNotice("反馈压机产出插入mes数据库失败", "压机产出" noticeService.createNotice("反馈压机产出插入mes数据库失败", "压机产出"
@ -168,7 +169,7 @@ public class WmsToMesServiceImpl implements WmsToMesService {
PdmBdWorkorder workorder = pdmBdWorkorderService.getByCode(workorderCode); PdmBdWorkorder workorder = pdmBdWorkorderService.getByCode(workorderCode);
String extData = workorder.getExt_data(); String extData = workorder.getExt_data();
MesWorkOrderDto mesWorkOrderDto = JSON.parseObject(extData, MesWorkOrderDto.class); MesWorkOrderDto mesWorkOrderDto = JSON.parseObject(extData, MesWorkOrderDto.class);
log.info("获取MES给的工单数据:{}", mesWorkOrderDto);
MesSemiProductionInfoInDto semiProductionInfoInDto = new MesSemiProductionInfoInDto(); MesSemiProductionInfoInDto semiProductionInfoInDto = new MesSemiProductionInfoInDto();
semiProductionInfoInDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr()); semiProductionInfoInDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr());
semiProductionInfoInDto.setFORDER_NO(mesWorkOrderDto.getFORDER_NO()); semiProductionInfoInDto.setFORDER_NO(mesWorkOrderDto.getFORDER_NO());
@ -188,11 +189,13 @@ public class WmsToMesServiceImpl implements WmsToMesService {
semiProductionInfoInDto.setPRODATE(workorder.getProduce_date()); semiProductionInfoInDto.setPRODATE(workorder.getProduce_date());
semiProductionInfoInDto.setCREATE_TM(DateUtil.now()); semiProductionInfoInDto.setCREATE_TM(DateUtil.now());
semiProductionInfoInDto.setOP_FLAG(GeneralDefinition.NO); semiProductionInfoInDto.setOP_FLAG(GeneralDefinition.NO);
log.info("半成品入库返给MES的数据:{}", semiProductionInfoInDto);
// 插入mes数据库 // 插入mes数据库
try { try {
mesRequestMapper.insertSemiProductInfo(semiProductionInfoInDto); mesRequestMapper.insertSemiProductInfo(semiProductionInfoInDto);
} catch (Exception e) { } catch (Exception e) {
log.error("半成品入库-获取MES给的工单数据:{}", mesWorkOrderDto);
log.error("半成品入库返给MES的数据:{}", semiProductionInfoInDto);
log.error("半成品入库插入mes数据库失败:{}", e.getMessage()); log.error("半成品入库插入mes数据库失败:{}", e.getMessage());
// todo:发送通知 // todo:发送通知
noticeService.createNotice("半成品入库插入mes数据库失败", "半成品入库" noticeService.createNotice("半成品入库插入mes数据库失败", "半成品入库"
@ -202,7 +205,6 @@ public class WmsToMesServiceImpl implements WmsToMesService {
@Override @Override
public void reportSemiProductionInfoOut(String groupId) { public void reportSemiProductionInfoOut(String groupId) {
log.info("半成品出库");
// 获取组盘信息 // 获取组盘信息
SchBaseVehiclematerialgroup vehiclematerialgroup = vehiclematerialgroupService.getById(groupId); SchBaseVehiclematerialgroup vehiclematerialgroup = vehiclematerialgroupService.getById(groupId);
String workorderCode = vehiclematerialgroup.getWorkorder_code(); String workorderCode = vehiclematerialgroup.getWorkorder_code();
@ -213,7 +215,7 @@ public class WmsToMesServiceImpl implements WmsToMesService {
if (ObjectUtil.isNotEmpty(extData)) { if (ObjectUtil.isNotEmpty(extData)) {
mesWorkOrderDto = JSON.parseObject(extData, MesWorkOrderDto.class); mesWorkOrderDto = JSON.parseObject(extData, MesWorkOrderDto.class);
} }
log.info("获取MES给的工单数据:{}", mesWorkOrderDto);
MesSemiProductionInfoOutDto semiProductionInfoOutDto = new MesSemiProductionInfoOutDto(); MesSemiProductionInfoOutDto semiProductionInfoOutDto = new MesSemiProductionInfoOutDto();
semiProductionInfoOutDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr()); semiProductionInfoOutDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr());
semiProductionInfoOutDto.setSEMIPRODUCT_BATCHNO(workorder.getBatch_no()); semiProductionInfoOutDto.setSEMIPRODUCT_BATCHNO(workorder.getBatch_no());
@ -230,11 +232,13 @@ public class WmsToMesServiceImpl implements WmsToMesService {
semiProductionInfoOutDto.setOUTTYPE("成品出库"); semiProductionInfoOutDto.setOUTTYPE("成品出库");
semiProductionInfoOutDto.setCREATE_TM(DateUtil.now()); semiProductionInfoOutDto.setCREATE_TM(DateUtil.now());
semiProductionInfoOutDto.setOP_FLAG(GeneralDefinition.NO); semiProductionInfoOutDto.setOP_FLAG(GeneralDefinition.NO);
log.info("半成品出库返给MES的数据:{}", semiProductionInfoOutDto);
// 插入mes数据库 // 插入mes数据库
try { try {
mesRequestMapper.insertSemiProductOutInfo(semiProductionInfoOutDto); mesRequestMapper.insertSemiProductOutInfo(semiProductionInfoOutDto);
} catch (Exception e) { } catch (Exception e) {
log.error("半成品出库-获取MES给的工单数据:{}", mesWorkOrderDto);
log.error("半成品出库返给MES的数据:{}", semiProductionInfoOutDto);
log.error("半成品出库插入mes数据库失败:{}", e.getMessage()); log.error("半成品出库插入mes数据库失败:{}", e.getMessage());
// todo:发送通知 // todo:发送通知
noticeService.createNotice("半成品出库插入mes数据库失败", "半成品出库" + semiProductionInfoOutDto.getMSGID(), noticeService.createNotice("半成品出库插入mes数据库失败", "半成品出库" + semiProductionInfoOutDto.getMSGID(),
@ -244,7 +248,6 @@ public class WmsToMesServiceImpl implements WmsToMesService {
@Override @Override
public void reportGdyMaterialInfoIn(String groupId) { public void reportGdyMaterialInfoIn(String groupId) {
log.info("物料入窑");
// 获取组盘信息 // 获取组盘信息
SchBaseVehiclematerialgroup vehiclematerialgroup = vehiclematerialgroupService.getById(groupId); SchBaseVehiclematerialgroup vehiclematerialgroup = vehiclematerialgroupService.getById(groupId);
String workorderCode = vehiclematerialgroup.getWorkorder_code(); String workorderCode = vehiclematerialgroup.getWorkorder_code();
@ -252,7 +255,7 @@ public class WmsToMesServiceImpl implements WmsToMesService {
PdmBdWorkorder workorder = pdmBdWorkorderService.getByCode(workorderCode); PdmBdWorkorder workorder = pdmBdWorkorderService.getByCode(workorderCode);
String extData = workorder.getExt_data(); String extData = workorder.getExt_data();
MesWorkOrderDto mesWorkOrderDto = JSON.parseObject(extData, MesWorkOrderDto.class); MesWorkOrderDto mesWorkOrderDto = JSON.parseObject(extData, MesWorkOrderDto.class);
log.info("获取MES给的工单数据:{}", mesWorkOrderDto);
MesGdyMaterialInDto gdyMaterialInDto = new MesGdyMaterialInDto(); MesGdyMaterialInDto gdyMaterialInDto = new MesGdyMaterialInDto();
gdyMaterialInDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr()); gdyMaterialInDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr());
gdyMaterialInDto.setTRAY_NO(vehiclematerialgroup.getVehicle_code()); gdyMaterialInDto.setTRAY_NO(vehiclematerialgroup.getVehicle_code());
@ -270,11 +273,13 @@ public class WmsToMesServiceImpl implements WmsToMesService {
gdyMaterialInDto.setIN_DATE(vehiclematerialgroup.getInto_kiln_time()); gdyMaterialInDto.setIN_DATE(vehiclematerialgroup.getInto_kiln_time());
gdyMaterialInDto.setCREATE_TM(DateUtil.now()); gdyMaterialInDto.setCREATE_TM(DateUtil.now());
gdyMaterialInDto.setOP_FLAG(GeneralDefinition.NO); gdyMaterialInDto.setOP_FLAG(GeneralDefinition.NO);
log.info("入窑返给MES的数据:{}", gdyMaterialInDto);
// 插入mes数据库 // 插入mes数据库
try { try {
mesRequestMapper.insertGdyMaterialIn(gdyMaterialInDto); mesRequestMapper.insertGdyMaterialIn(gdyMaterialInDto);
} catch (Exception e) { } catch (Exception e) {
log.error("入窑-获取MES给的工单数据:{}", mesWorkOrderDto);
log.error("入窑返给MES的数据:{}", gdyMaterialInDto);
log.error("入窑插入mes数据库失败:{}", e.getMessage()); log.error("入窑插入mes数据库失败:{}", e.getMessage());
// todo:发送通知 // todo:发送通知
noticeService.createNotice("入窑插入mes数据库失败", "入窑" + gdyMaterialInDto.getMSGID(), noticeService.createNotice("入窑插入mes数据库失败", "入窑" + gdyMaterialInDto.getMSGID(),
@ -284,7 +289,6 @@ public class WmsToMesServiceImpl implements WmsToMesService {
@Override @Override
public void reportGdyMaterialInfoOut(String groupId) { public void reportGdyMaterialInfoOut(String groupId) {
log.info("物料出窑");
// 获取组盘信息 // 获取组盘信息
SchBaseVehiclematerialgroup vehiclematerialgroup = vehiclematerialgroupService.getById(groupId); SchBaseVehiclematerialgroup vehiclematerialgroup = vehiclematerialgroupService.getById(groupId);
String workorderCode = vehiclematerialgroup.getWorkorder_code(); String workorderCode = vehiclematerialgroup.getWorkorder_code();
@ -292,7 +296,7 @@ public class WmsToMesServiceImpl implements WmsToMesService {
PdmBdWorkorder workorder = pdmBdWorkorderService.getByCode(workorderCode); PdmBdWorkorder workorder = pdmBdWorkorderService.getByCode(workorderCode);
String extData = workorder.getExt_data(); String extData = workorder.getExt_data();
MesWorkOrderDto mesWorkOrderDto = JSON.parseObject(extData, MesWorkOrderDto.class); MesWorkOrderDto mesWorkOrderDto = JSON.parseObject(extData, MesWorkOrderDto.class);
log.info("获取MES给的工单数据:{}", mesWorkOrderDto);
MesGdyMaterialOutDto gdyMaterialOutDto = new MesGdyMaterialOutDto(); MesGdyMaterialOutDto gdyMaterialOutDto = new MesGdyMaterialOutDto();
gdyMaterialOutDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr()); gdyMaterialOutDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr());
gdyMaterialOutDto.setTRAY_NO(vehiclematerialgroup.getVehicle_code()); gdyMaterialOutDto.setTRAY_NO(vehiclematerialgroup.getVehicle_code());
@ -310,11 +314,13 @@ public class WmsToMesServiceImpl implements WmsToMesService {
gdyMaterialOutDto.setOUT_DATE(vehiclematerialgroup.getOut_kiln_time()); gdyMaterialOutDto.setOUT_DATE(vehiclematerialgroup.getOut_kiln_time());
gdyMaterialOutDto.setCREATE_TM(DateUtil.now()); gdyMaterialOutDto.setCREATE_TM(DateUtil.now());
gdyMaterialOutDto.setOP_FLAG(GeneralDefinition.NO); gdyMaterialOutDto.setOP_FLAG(GeneralDefinition.NO);
log.info("出窑返给MES的数据:{}", gdyMaterialOutDto);
// 插入mes数据库 // 插入mes数据库
try { try {
mesRequestMapper.insertGdyMaterialOut(gdyMaterialOutDto); mesRequestMapper.insertGdyMaterialOut(gdyMaterialOutDto);
} catch (Exception e) { } catch (Exception e) {
log.error("出窑-获取MES给的工单数据:{}", mesWorkOrderDto);
log.error("出窑返给MES的数据:{}", gdyMaterialOutDto);
log.error("出窑插入mes数据库失败:{}", e.getMessage()); log.error("出窑插入mes数据库失败:{}", e.getMessage());
// todo:发送通知 // todo:发送通知
noticeService.createNotice("出窑插入mes数据库失败", "出窑" + gdyMaterialOutDto.getMSGID(), noticeService.createNotice("出窑插入mes数据库失败", "出窑" + gdyMaterialOutDto.getMSGID(),
@ -343,7 +349,7 @@ public class WmsToMesServiceImpl implements WmsToMesService {
int number = mesRequestMapper.countFPNumber(orderObj.getWorkorder_code(), orderObj.getPoint_code()); int number = mesRequestMapper.countFPNumber(orderObj.getWorkorder_code(), orderObj.getPoint_code());
MdBaseMaterial material = mdBaseMaterialService.getById(orderObj.getMaterial_id()); MdBaseMaterial material = mdBaseMaterialService.getById(orderObj.getMaterial_id());
SchBasePoint basePoint = pointService.getById(orderObj.getPoint_code()); SchBasePoint basePoint = pointService.getById(orderObj.getPoint_code());
log.info("统计到设备:{} 不合格砖数:{}", orderObj.getPoint_name(), number);
// 设置字段值 // 设置字段值
MesUnusedDto mesUnusedDto = new MesUnusedDto(); MesUnusedDto mesUnusedDto = new MesUnusedDto();
mesUnusedDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr()); mesUnusedDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr());
@ -361,11 +367,13 @@ public class WmsToMesServiceImpl implements WmsToMesService {
mesUnusedDto.setPRODATE(orderObj.getProduce_date()); mesUnusedDto.setPRODATE(orderObj.getProduce_date());
mesUnusedDto.setCREATE_TM(DateUtil.now()); mesUnusedDto.setCREATE_TM(DateUtil.now());
mesUnusedDto.setOP_FLAG(GeneralDefinition.NO); mesUnusedDto.setOP_FLAG(GeneralDefinition.NO);
log.info("插入mes机口判废数据库的数据:{}", mesUnusedDto);
// 存入mes数据库 // 存入mes数据库
try { try {
mesRequestMapper.insertMesUnusedInfo(mesUnusedDto); mesRequestMapper.insertMesUnusedInfo(mesUnusedDto);
} catch (Exception e) { } catch (Exception e) {
log.error("统计到设备:{} 不合格砖数:{}", orderObj.getPoint_name(), number);
log.error("插入mes机口判废数据库的数据:{}", mesUnusedDto);
log.error("插入机口判废失败:{}", e.getMessage()); log.error("插入机口判废失败:{}", e.getMessage());
// todo:发送通知 // todo:发送通知
noticeService.createNotice("机口判废插入mes数据库失败", "机口判废" + mesUnusedDto.getMSGID(), noticeService.createNotice("机口判废插入mes数据库失败", "机口判废" + mesUnusedDto.getMSGID(),
@ -386,6 +394,7 @@ public class WmsToMesServiceImpl implements WmsToMesService {
try { try {
mesRequestMapper.insertQSPressMonitorData(mesQSPressMonitorData); mesRequestMapper.insertQSPressMonitorData(mesQSPressMonitorData);
} catch (Exception e) { } catch (Exception e) {
log.error("插入压机检测数据:{}", mesQSPressMonitorData);
log.error("插入压机检测失败:{}", e.getMessage()); log.error("插入压机检测失败:{}", e.getMessage());
// todo:发送通知 // todo:发送通知
noticeService.createNotice("压机检测插入mes数据库失败", "压机检测" noticeService.createNotice("压机检测插入mes数据库失败", "压机检测"

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJMKTask.java

@ -182,7 +182,7 @@ public class FJMKTask extends AbstractTask {
throw new BadRequestException("包装线不可用!"); throw new BadRequestException("包装线不可用!");
} }
task.setPoint_code2(packagePoint.getPoint_code()); // 包装线 task.setPoint_code2(packagePoint.getPoint_code()); // 包装线
// todo: 校验是否够码满一托 // 校验是否够码满一托
List<ApplyDeviceDto> list = JSONArray.parseArray(jsonObject.getString("list"), ApplyDeviceDto.class); List<ApplyDeviceDto> list = JSONArray.parseArray(jsonObject.getString("list"), ApplyDeviceDto.class);
// 1 获取点位相应数量 // 1 获取点位相应数量
int sum = 0; int sum = 0;

2
lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml

@ -42,7 +42,7 @@ spring:
freemarker: freemarker:
check-template-location: false check-template-location: false
profiles: profiles:
active: dev active: prod
jackson: jackson:
time-zone: GMT+8 time-zone: GMT+8
data: data:

14
lms/nladmin-system/nlsso-server/src/main/resources/stopword.dic

@ -1240,3 +1240,17 @@ $
上来 上来
上去 上去
获取MES给的工单数据 获取MES给的工单数据
上报mes消耗泥料记录的数据
上报mes消耗泥料记录失败
压机产出-获取MES给的工单数据
压机产出返给MES的数据
反馈压机产出插入mes数据库失败
半成品入库-获取MES给的工单数据
半成品入库返给MES的数据
半成品入库插入mes数据库失败
半成品出库-获取MES给的工单数据
半成品出库返给MES的数据
半成品出库插入mes数据库失败
压机产出-获取MES给的工单数据
压机产出返给MES的数据
反馈压机产出插入mes数据库失败

Loading…
Cancel
Save