C类问题处理,设备异常消息通知。

master
yangwl 2 years ago
parent ea28c1c9bf
commit 53ac6752e9

@ -314,6 +314,7 @@ public class AbnormalBillController {
public R saveDevice(@RequestBody List<AbnormalBillDto> abnormalBillList) {
Boolean flag;
StringBuffer message = new StringBuffer();
String site = CommonMethods.getSite();
List<AbnormalBill> abnormalBills=new ArrayList<>();
try {
for (AbnormalBillDto ab:abnormalBillList) {
@ -321,6 +322,7 @@ public class AbnormalBillController {
abnormalBill.setHandle("AbnormalBillBo:1000,"+ab.getAbnormalNo());
abnormalBill.setUserConTime(LocalDateTime.now());
abnormalBill.setUserIsCon("true");
abnormalBill.setSite(site);
abnormalBills.add(abnormalBill);
}
flag=abnormalBillService.deviceRepairComplete(abnormalBills);

@ -1639,7 +1639,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
//发送维修完成的消息给相关人员
for (AbnormalBill abnormalBill : abnormalBills){
abnormalBill.setType("S");
abnormalBill.setReportSendUserGroup("SBYC-REPAIRCOMPLETE");
abnormalBill.setReportSendUserGroup("SBYCSB-REPAIRCOMPLETE");
this.sendMessageToDeviceRepairComplete(abnormalBill);
}
}

@ -269,7 +269,7 @@ public class AbnormalPlanServiceImpl extends ServiceImpl<AbnormalPlanMapper, Abn
shopOrder.setQtyOrdered(new Double(abnormalBill.getNcQty()));
shopOrder.setQtyToBuild(new Double(abnormalBill.getNcQty()));
try {
// CreateRepairShopOrder(site,shopOrder);
CreateRepairShopOrder(site,shopOrder);
}catch (Exception e){
throw new BaseException(e.getMessage().trim());
}
@ -390,7 +390,8 @@ public class AbnormalPlanServiceImpl extends ServiceImpl<AbnormalPlanMapper, Abn
//计划物料不能为空 为返修物料
String plannedItem = repairshopOrder.getPlannedItemBo();
String plannedBom = repairshopOrder.getPlannedBomBo();
//固定返修Bom清单为 000100490612
String plannedBom = "000100490612";
// plannedBom = StringUtil.notBlank(plannedBom) ? plannedBom : shopOrder;
//计划工艺路线为 工艺维护的返修工艺路线
String plannedRouter = repairshopOrder.getRouterBo();
@ -401,20 +402,19 @@ public class AbnormalPlanServiceImpl extends ServiceImpl<AbnormalPlanMapper, Abn
//计划BOM类型默认为工单BOMH
String bomType = BomType.SHOPORDERBOM.value();
String routerType = RouterType.SPECIAL.value();
if (StringUtil.isBlank(plannedItem)) {
throw BusinessException.build("工单的计划物料不能为空");
throw BusinessException.build("工单的计划物料不能为空");
}
//查询物料清单和工艺路线
// Bom bomModel = bomService.getMaxRevisionBom(site, plannedBom);
// if (bomModel == null) {
// throw BusinessException.build("工单【" +shopOrder+ "】的物料清单未同步!");
// }
Bom bomModel = bomService.getMaxRevisionBom(site, plannedBom);
if (bomModel == null) {
throw BusinessException.build("返修工单【" +shopOrder+ "】的物料清单未同步!");
}
Router routerModel = routerService.getMaxRevisionRouter(site, plannedRouter);
if (routerModel == null) {
throw BusinessException.build("工单【" +shopOrder+ "】的返修工艺路线不存在!");
throw BusinessException.build("返修工单【" +shopOrder+ "】的返修工艺路线不存在!");
}
// String plannedItemBo = HandleEnum.ITEM.getHandle(site, plannedItem, "A");
@ -429,11 +429,11 @@ public class AbnormalPlanServiceImpl extends ServiceImpl<AbnormalPlanMapper, Abn
request.setQuantityToBuild(new BigDecimal(repairshopOrder.getQtyToBuild()));
//工单创建
// try {
try {
shopOrderMeService.createShopOrder(request);
// } catch (com.sap.me.frame.domain.BusinessException e) {
// throw BusinessException.build("工单【" +shopOrder+ "】的物料清单未同步!");
// }
} catch (com.sap.me.frame.domain.BusinessException e) {
throw BusinessException.build("返修工单【" +shopOrder+ "】创建失败!");
}
}
//工单自定义字段

@ -1382,7 +1382,7 @@
ON r.RESRCE = zab.RESRCE AND r.SITE = zab.SITE
LEFT JOIN WORK_CENTER wc
ON wc.WORK_CENTER = zab.WORK_CENTER AND wc.SITE = zab.SITE
LEFT JOIN Z_NWA_USER ZNU ON ZNU.USER_NAME=zab.CREATED_USER
LEFT JOIN Z_NWA_USER ZNU ON ZNU.USER_NAME=zab.PB_USER
LEFT JOIN WORK_CENTER_T wct
ON wct.WORK_CENTER_BO = wc.HANDLE AND wct.LOCALE = 'zh'
<where>

@ -336,9 +336,8 @@
ELSE TO_CHAR(TO_NUMBER((SYSDATE -ZRRT.CREATED_DATE_TIME)*24),'FM9999990.000')
END REPORT_WAIT_TIME ,
CASE WHEN ZRRT.ACTUAL_COMPLETE_DATE IS NOT NULL THEN
TO_CHAR(TO_NUMBER((ZRRT.ACTUAL_COMPLETE_DATE-ZRRT.CREATED_DATE_TIME)*24) -
NVL(ZRRT.WAIT_TIME,0),'FM9999990.000')
ELSE TO_CHAR(TO_NUMBER((SYSDATE- 8/24 - ZRRT.CREATED_DATE_TIME-ZRRT.WAIT_TIME)*24),'FM9999990.000')
TO_CHAR(TO_NUMBER((ZRRT.ACTUAL_COMPLETE_DATE-ZRRT.CREATED_DATE_TIME)*24),'FM9999990.000')
ELSE TO_CHAR(TO_NUMBER((SYSDATE- 8/24 - ZRRT.CREATED_DATE_TIME)*24),'FM9999990.000')
END REPAIR_TIME ,
CASE WHEN ZRRT.STATUS = '401' THEN '待维修'
WHEN ZRRT.STATUS = '501' THEN '维修中'

@ -124,8 +124,18 @@ public class InspectionTask extends Model<InspectionTask> {
@TableField("SFC_DISPATCH_BO")
private String sfcDispatchBo;
@TableField("QUESTION_C")
private String questionC;
public String getHandle() {
public String getQuestionC() {
return questionC;
}
public void setQuestionC(String questionC) {
this.questionC = questionC;
}
public String getHandle() {
return handle;
}

@ -227,6 +227,13 @@ public class ResourceRepairTask extends Model<ResourceRepairTask> {
@TableField("MODIFIED_DATE_TIME")
private LocalDateTime modifiedDateTime;
/**
* OPERATOR_CONF_TIME
*/
@TableField("OPERATOR_CONF_TIME")
private LocalDateTime operatorConfTime;
/**
* HANDLE
*/
@ -307,8 +314,15 @@ public class ResourceRepairTask extends Model<ResourceRepairTask> {
@TableField(exist = false)
private String repairUserName;
public LocalDateTime getOperatorConfTime() {
return operatorConfTime;
}
public void setOperatorConfTime(LocalDateTime operatorConfTime) {
this.operatorConfTime = operatorConfTime;
}
public String getRepairUserName() {
public String getRepairUserName() {
return repairUserName;
}

@ -298,21 +298,18 @@ public class PodTemplateServiceImpl implements PodTemplateService {
InspectionTask inspectionTask = list.get(0);
String result = inspectionTask.getResult();
if (!inspectionTask.getStatus().equals(Constants.INSPECTION_TASK_STATUS_COMPLETE)||StringUtil.isBlank(result)){
String checkUser = resrceMapper.findCustomFieldByResrce(site, inspectionTask.getResrce(), "CHECK_USR");
throw new BaseException("请联系"+checkUser+",处理专检任务。");
// if (routerStep.getRework().equals("true") && stepId.startsWith("9")){
// return;
// }else if (!result.equals(Constants.RSESULT_OK )||StringUtil.isBlank(result)){
//
// String checkUser = resrceMapper.findCustomFieldByResrce(site, inspectionTask.getResrce(), "CHECK_USR");
// throw new BaseException("请联系"+checkUser+",处理专检任务。");
// }
/***
*
*/
}else if (routerStep.getRework().equals("true") && stepId.startsWith("9") && !result.equals(Constants.RSESULT_OK )){
}else if ( !result.equals(Constants.RSESULT_OK ) && inspectionTask.getStatus().equals(Constants.INSPECTION_TASK_STATUS_COMPLETE)
&& !routerStep.getRework().equals("true") && !stepId.startsWith("9")){
String checkUser = resrceMapper.findCustomFieldByResrce(site, inspectionTask.getResrce(), "CHECK_USR");
throw new BaseException("上工序不合格无法开始本工序,请联系"+checkUser+"处理专检任务");
}
/***
*
*/
else if (routerStep.getRework().equals("true") && stepId.startsWith("9") && !result.equals(Constants.RSESULT_OK )){
try {
sfcCrossService.startAction(site, currentRevisionRef.getHandle(), resrce, sfcServiceById.getHandle(), qty);
} catch (Exception e) {
@ -322,14 +319,16 @@ public class PodTemplateServiceImpl implements PodTemplateService {
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dispatchNo, DispatchStatusEnum.START.getCode(),null);
return;
}
}else {
try {
sfcCrossService.startAction(site, currentRevisionRef.getHandle(), resrce, sfcServiceById.getHandle(), qty);
} catch (Exception e) {
ExceptionUtil.throwException(e);
}
//更改派工单状态
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dispatchNo, DispatchStatusEnum.START.getCode(),null);
}
try {
sfcCrossService.startAction(site, currentRevisionRef.getHandle(), resrce, sfcServiceById.getHandle(), qty);
} catch (Exception e) {
ExceptionUtil.throwException(e);
}
//更改派工单状态
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dispatchNo, DispatchStatusEnum.START.getCode(),null);
});
}

@ -3,6 +3,7 @@ package com.foreverwin.mesnac.quality.controller;
import cn.hutool.core.date.DateUtil;
import com.foreverwin.mesnac.common.service.InspectionTaskService;
import com.foreverwin.mesnac.quality.dto.InspectionTaskManageRequest;
import com.foreverwin.mesnac.quality.model.AbnormalBillDisposeinspectionTask;
import com.foreverwin.mesnac.quality.model.InspectionTaskManage;
import com.foreverwin.mesnac.quality.service.InspectionTaskManageService;
import com.foreverwin.modular.core.exception.BusinessException;
@ -86,7 +87,7 @@ public class InspectionTaskManageController {
@ResponseBody
@PostMapping("/saveInspectionTaskDetail")
public R saveInspectionTaskDetail(@RequestBody InspectionTaskManage inspectionTaskManage ) {
public R saveInspectionTaskDetail(@RequestBody InspectionTaskManage inspectionTaskManage) {
try {
String site = CommonMethods.getSite();
String user = CommonMethods.getUser();
@ -94,10 +95,10 @@ public class InspectionTaskManageController {
} catch (Exception e) {
return R.failed(e.getMessage());
}
return R.ok();
}
@Autowired
private InspectionTaskService inspectionTaskService;

@ -16,4 +16,6 @@ public interface InspectionTaskManageMapper {
List<InspectionTaskManageDetail> selectInspectionItemDetail(@Param("inspectionItemBo") String inspectionItemBo);
List<InspectionTaskManageDetail> selectInspectionTaskDetail(@Param("inspectionTaskBo") String inspectionTaskBo);
}

@ -39,10 +39,6 @@ public class InspectionTaskManage implements Serializable {
private String questionC;
private String itemBo;
public String getItemBo() {
return itemBo;
}

@ -55,9 +55,11 @@ public class InspectionTaskManageServiceImpl implements InspectionTaskManageServ
@Autowired
private RouterService routerService;
private static Logger logger = LoggerFactory.getLogger(InspectionTaskManageServiceImpl.class);
@Override
public List<InspectionTaskManage> findInspectionTask(InspectionTaskManageRequest inspectionTaskManageRequest) {
return inspectionTaskManageMapper.findInspectionTask(inspectionTaskManageRequest);
@ -174,7 +176,7 @@ public class InspectionTaskManageServiceImpl implements InspectionTaskManageServ
queryWrapper.eq(SfcDispatch.DISPATCH_SEQ,String.valueOf(Integer.parseInt(sfcDispatchById.getDispatchSeq())+1));
SfcDispatch nextsfcDispatch=sfcDispatchService.getOne(queryWrapper);
//判断下道工序是否为空
if (nextsfcDispatch!=null && !nextsfcDispatch.getOperation().equals("HJ_6106JYGX") && !nextsfcDispatch.getOperation().equals("HJ_6106JRGX")){
if (nextsfcDispatch!=null && (!nextsfcDispatch.getOperation().equals("HJ_6106JYGX") || !nextsfcDispatch.getOperation().equals("HJ_6106JRGX"))){
logger.error("质检工序合格"+sfcDispatchById.getOperation()+"的下道工序不为空,下道工序为"+nextsfcDispatch.getOperation());
//如果不等于空,判断下道工序的工作中心和质检完的工作中心是否一致
if (!sfcDispatchById.getWorkCenter().equals(nextsfcDispatch.getWorkCenter())){
@ -290,7 +292,7 @@ public class InspectionTaskManageServiceImpl implements InspectionTaskManageServ
queryWrapper.eq(SfcDispatch.DISPATCH_SEQ,String.valueOf(Integer.parseInt(sfcDispatchById.getDispatchSeq())+1));
SfcDispatch nextsfcDispatch=sfcDispatchService.getOne(queryWrapper);
//判断下道工序是否为空
if (nextsfcDispatch!=null && !nextsfcDispatch.getOperation().equals("HJ_6106JYGX") && !nextsfcDispatch.getOperation().equals("HJ_6106JRGX")){
if (nextsfcDispatch!=null && (!nextsfcDispatch.getOperation().equals("HJ_6106JYGX") || !nextsfcDispatch.getOperation().equals("HJ_6106JRGX")) ){
logger.error("质检工序合格"+sfcDispatchById.getOperation()+"的下道工序不为空,下道工序为"+nextsfcDispatch.getOperation());
//如果不等于空,判断下道工序的工作中心和质检完的工作中心是否一致
if (!sfcDispatchById.getWorkCenter().equals(nextsfcDispatch.getWorkCenter())){
@ -340,6 +342,7 @@ public class InspectionTaskManageServiceImpl implements InspectionTaskManageServ
inspectionTaskModel.setComments(inspectionTaskManage.getComments());
inspectionTaskModel.setModifyUser(user);
inspectionTaskModel.setModifiedDateTime(dateTime);
inspectionTaskModel.setQuestionC(inspectionTaskManage.getQuestionC());
inspectionTaskService.updateById(inspectionTaskModel);

Loading…
Cancel
Save