报表修改

master
赵嘉伟 3 years ago
parent 1f7bd10d8f
commit 6bc6898dd5

@ -1,8 +1,10 @@
package com.foreverwin.mesnac.anomaly.dto;
import com.foreverwin.mesnac.anomaly.model.AbnormalBill;
import com.foreverwin.mesnac.meapi.model.DataFieldList;
import java.time.LocalDateTime;
import java.util.List;
/**
* @Description TODO
@ -50,6 +52,8 @@ public class AbnormalBillDto extends AbnormalBill {
private String checkUsr;
private List<DataFieldList> cancelCodeList;
public String getCheckUsr() {
return checkUsr;
}
@ -163,4 +167,12 @@ public class AbnormalBillDto extends AbnormalBill {
public void setProductionCategory(String productionCategory) {
this.productionCategory = productionCategory;
}
public List<DataFieldList> getCancelCodeList() {
return cancelCodeList;
}
public void setCancelCodeList(List<DataFieldList> cancelCodeList) {
this.cancelCodeList = cancelCodeList;
}
}

@ -309,11 +309,17 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
//异常代码
//通过设备找到异常车间
Resrce resrce = new Resrce();
resrce.setSite(site);
resrce.setResrce(abnormalBill.getResrce());
WorkCenter workCenterByResrce = workCenterMapper.findWorkCenterByResrce(resrce);
abnormalBill.setWorkCenter(workCenterByResrce.getWorkCenter());
try{
Resrce resrce = new Resrce();
resrce.setSite(site);
resrce.setResrce(abnormalBill.getResrce());
WorkCenter workCenterByResrce = workCenterMapper.findWorkCenterByResrce(resrce);
abnormalBill.setWorkCenter(workCenterByResrce.getWorkCenter());
}catch (Exception e){
throw new BaseException("根据资源(设备)查找异常车间报错,请查看工作中心维护。报错信息:"+e.getMessage());
}
List<NcCodeDto> ncCodesAndNcGroups = ncCodeService.findNcCodeDescriptionByNcCode(abnormalBill.getNcCode());
List<AbnormalNcCode> abnormalNcCodes = new LinkedList<>();
for(int i = 0; i < ncCodesAndNcGroups.size(); i ++){
@ -451,7 +457,13 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
if(StringUtil.isEmpty(abnormalBill.getAbnormalNo())){
return null;
}
return abnormalBillMapper.findAllByAbnormalNoDevice(abnormalBill,local);
DataField dataField = new DataField();
dataField.setSite(site);
dataField.setDataField("RERR_CANCEL_REASON");
List<DataFieldList> dataFieldList = dataFieldListMapper.findDataFieldList(dataField);
AbnormalBillDto abnormalBillDto = abnormalBillMapper.findAllByAbnormalNoDevice(abnormalBill, local);
abnormalBillDto.setCancelCodeList(dataFieldList);
return abnormalBillDto;
}
@Override
@ -480,10 +492,10 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
LocalDateTime now = LocalDateTime.now();
abnormalBillDispose.setHandle(HandleEnum.ABNORMAL_BILL_DISPOSE.getHandle(site,abnormalBill.getAbnormalNo()));
AbnormalBill abnormalBill1 = abnormalBillMapper.selectById(HandleEnum.ABNORMAL_BILL.getHandle(site, abnormalBill.getAbnormalNo()));
if("true".equals(abnormalBill1.getProgram())){
throw BusinessException.build("该异常单已经方案确认");
}
// AbnormalBill abnormalBill1 = abnormalBillMapper.selectById(HandleEnum.ABNORMAL_BILL.getHandle(site, abnormalBill.getAbnormalNo()));
// if("true".equals(abnormalBill1.getProgram())){
// throw BusinessException.build("该异常单已经方案确认");
// }
if(!StringUtil.isBlank(abnormalBillDispose.getRouterBo())){
//分割该工艺路线
@ -531,18 +543,23 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
AbnormalBillDispose abnormalBillDispose1 = abnormalBillDisposeMapper.selectById(abnormalBillDispose.getHandle());
abnormalPlanService.saveAbnormalPlan(abnormalBill2,abnormalBillDispose1,now);
}
//判断该异常解决方案是否是让步放行、配作、线下换料、试装,并且关联来源不是空,如果是,就调用孙豪的方法
//判断该异常解决方案是否是让步放行、配作、线下换料、试装,并且关联来源不是空,如果是,就调用孙豪的方法,并且sfc不能为空
if((Constants.CONCESSION.equals(abnormalBillDispose.getAbnormalMethod()) ||
Constants.MATCH.equals(abnormalBillDispose.getAbnormalMethod()) ||
Constants.OFFLINE_REFUELING.equals(abnormalBillDispose.getAbnormalMethod()) ||
Constants.TEST_EQUIPMENT.equals(abnormalBillDispose.getAbnormalMethod()))
&& !StringUtil.isBlank(abnormalBill2.getObjectBo())){
&& !StringUtil.isBlank(abnormalBill2.getObjectBo())
&& StringUtil.notBlank(abnormalBill2.getSfc())){
try{
this.creatInspectionTask(site,abnormalBill2.getObjectBo(),abnormalBill2.getSfc(),abnormalBill2.getStepId(),AnomalyConstant.AnomalyMethod.msg(abnormalBillDispose.getAbnormalMethod()));
}catch (Exception e){
throw new BaseException("createInspectionTask方法报错,"+e.getMessage());
}
}else if(Constants.REPAIR.equals(abnormalBillDispose.getAbnormalMethod()) && StringUtil.isBlank(abnormalBillDispose.getResolveShopOrder())){
}else if(Constants.REPAIR.equals(abnormalBillDispose.getAbnormalMethod()) &&
StringUtil.isBlank(abnormalBillDispose.getResolveShopOrder()) &&
StringUtil.notBlank(abnormalBill2.getSfc())){
Sfc sfc = sfcMapper.selectById(HandleEnum.SFC.getHandle(site, abnormalBill2.getSfc()));
if(sfc.getQty() > Double.parseDouble(abnormalBill2.getNcQty())){
//跳过啥都不做
@ -558,10 +575,8 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
}
sfcDto.setStepId((String) map.get("STEP_ID"));
this.batchRepair(sfcDto);
}
}
this.anomalyCreatedAndSendMessage(abnormalBill2,abnormalBillDispose);
}

@ -45,14 +45,20 @@
CASE WHEN S2.STATUS = '405' THEN '是' ELSE '否' END DISPATCH_STATUS,
ZSD.EARLIEST_START_DATE EARLIEST_START_DATE,ZSD.LATEST_END_DATE LATEST_END_DATE,
ZSD.ACTUAL_START_DATE ACTUAL_START_DATE,ZSD.ACTUAL_COMPLETE_DATE ACTUAL_COMPLETE_DATE,
CF2.VALUE WORK_ORDER
CF2.VALUE WORK_ORDER,OT2.DESCRIPTION CURRENT_OPERATION_DESCRIPTION,O2.OPERATION CURRENT_OPERATION
FROM SFC S
LEFT JOIN SFC_ROUTING SR ON SR.SFC_BO = S.HANDLE
LEFT JOIN SFC_ROUTER ST ON ST.SFC_ROUTING_BO = SR.HANDLE
LEFT JOIN SFC_STEP SS ON SS.SFC_ROUTER_BO = ST.HANDLE AND (SS.QTY_IN_QUEUE > 0 OR SS.QTY_IN_WORK > 0)
INNER JOIN SHOP_ORDER SO ON SO.HANDLE = S.SHOP_ORDER_BO
INNER JOIN ITEM I ON I.HANDLE = SO.ITEM_BO
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = I.HANDLE AND IT.LOCALE = #{locale}
INNER JOIN Z_SFC_DISPATCH ZSD ON S.SFC = ZSD.SFC AND S.SITE = ZSD.SITE
INNER JOIN OPERATION O ON O.OPERATION = ZSD.OPERATION AND O.SITE = S.SITE AND O.CURRENT_REVISION = 'true'
INNER JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE AND OT.LOCALE = #{locale}
LEFT JOIN Z_SFC_DISPATCH ZSD ON S.SFC = ZSD.SFC AND S.SITE = ZSD.SITE
LEFT JOIN OPERATION O ON O.OPERATION = ZSD.OPERATION AND O.SITE = S.SITE AND O.CURRENT_REVISION = 'true'
LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE AND OT.LOCALE = #{locale}
LEFT JOIN OPERATION O2 ON O2.OPERATION = SUBSTR(SS.OPERATION_BO,INSTR(SS.OPERATION_BO,',',1,1)+1,INSTR(SS.OPERATION_BO,',',1,2) - INSTR(SS.OPERATION_BO,',') -1)
AND O2.SITE = S.SITE AND O2.CURRENT_REVISION = 'true'
LEFT JOIN OPERATION_T OT2 ON OT2.OPERATION_BO = O2.HANDLE AND OT2.LOCALE = #{locale}
LEFT JOIN Z_NWA_USER ZNU ON ZNU.USER_NAME = ZSD.EMPLOYEE AND ZSD.DISPATCH_SEQ = (
SELECT MAX(ZSD2.DISPATCH_SEQ) FROM Z_SFC_DISPATCH ZSD2 WHERE S.SFC = ZSD2.SFC AND S.SITE = ZSD2.SITE
)

@ -50,6 +50,8 @@ public interface Constants {
String PRODUCT_SCRAP = "C";//产品报废
String MATCH = "P"; //配作
String REPAIR = "F";//返修
String REPAIR_OUT_SOURCING = "FW";//返修(外协)
String REPAIR_NOT_ROUTER = "FB";//返修(不回原工艺)
String REGULAR_REPAIR = "CG";//常规维修
String PLAN_REPAIR = "JH";//计划维修
String MAJOR_REPAIR = "DX";//大项修

@ -224,7 +224,10 @@ public enum AnomalyConstant {
AnomalyMethod3("R","让步放行"),
AnomalyMethod4("C","产品报废"),
AnomalyMethod5("P","配作"),
AnomalyMethod6("F","返修");
AnomalyMethod6("F","返修"),
AnomalyMethod7("FW","返修(外协)"),
AnomalyMethod8("FB","返修(不返回原工艺)");

Loading…
Cancel
Save