Merge remote-tracking branch 'origin/master'

master
赵嘉伟 3 years ago
commit c65c313289

@ -33,7 +33,7 @@ ftp:
#打印服务器配置
print:
server: http://localhost:8080/CodeSoftPrintWeb/printService
server: http://172.16.251.188:8022/print/mesnacprint
activeMq:
sendWeChatMessage: tcp://localhost:61616?wireFormat.maxInactivityDuration=0

@ -442,13 +442,13 @@ public class InterfaceServiceImpl implements InterfaceService {
* 2.MES=_ERP
* 3.MES=MES
*/
String erpWorkCenter = componentDto.getOPERATION();
if (StringUtil.isBlank(erpWorkCenter)) {
throw BusinessException.build("BOM节点下字段【OPERATION】不能为空!");
String stepId = componentDto.getSTEP_ID();
if (StringUtil.isBlank(stepId)) {
throw BusinessException.build("步骤标示不能为空!");
}
Operation operationModel = operationService.queryOperationByErpWorkCenter(site, erpWorkCenter);
Operation operationModel = operationService.getOperationByRouterStepId(site, bom, stepId);
if (operationModel == null) {
throw BusinessException.build("ERP工作中心【" +erpWorkCenter+"】对应的MES工序未维护");
throw BusinessException.build("步骤标识【"+stepId+"】在工艺路线【"+bom+"】未到对应的工序");
}
String operationBo = operationModel.getHandle();
@ -532,10 +532,21 @@ public class InterfaceServiceImpl implements InterfaceService {
String stepId = routerStepDto.getSTEP_ID();
String erpWorkCenter = routerStepDto.getOPERATION().trim();
if (StringUtil.isBlank(entryRouterStep)) {
entryRouterStep = stepId;
}
//上一步骤添加当前步骤为下一步骤
if (i > 0) {
RouterNextStep routerNextStep = new RouterNextStep();
routerNextStep.setNextStepId(stepId);
routerStepList.get(i - 1).getRouterNextStepList().add(routerNextStep);
}
String operation = null;
String operationBo = null;
if (StringUtil.isBlank(erpWorkCenter)) {
operation = (i == 0) ? "HJ01_6106GX" : "6106GX";
operation = "6106GX";
Operation operationModel = operationService.getCurrentRevisionRef(site, operation);
if (operationModel == null) {
throw BusinessException.build("工序编号【" +operation+ "】不存在");
@ -543,19 +554,6 @@ public class InterfaceServiceImpl implements InterfaceService {
operation = operationModel.getOperation();
operationBo = operationModel.getHandle();
} else {
if (StringUtil.isBlank(entryRouterStep)) {
entryRouterStep = stepId;
}
//上一步骤添加当前步骤为下一步骤
if (i > 0) {
RouterNextStep routerNextStep = new RouterNextStep();
routerNextStep.setNextStepId(stepId);
routerStepList.get(i - 1).getRouterNextStepList().add(routerNextStep);
}
/**
*
* 1.ERP
@ -680,6 +678,18 @@ public class InterfaceServiceImpl implements InterfaceService {
if (StringUtil.isBlank(plannedItem)) {
throw BusinessException.build("工单的计划物料不能拿为空");
}
//查询物料清单和工艺路线
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+ "】的工艺路线未同步!");
}
String plannedItemBo = HandleEnum.ITEM.getHandle(site, plannedItem, "A");
String plannedBomBo = HandleEnum.BOM.getHandle(site, plannedBom, bomType, "#");
String plannedRouterBo = HandleEnum.ROUTER.getHandle(site, plannedRouter, routerType, "#");

@ -29,5 +29,5 @@ public interface OperationMapper extends BaseMapper<Operation> {
IPage<Operation> selectOperationStep( IPage<Operation> page, @Param("locale") String locale,@Param("ew") Wrapper<Operation> wrapper);
Operation selectOperationByRouterStepId(@Param("site") String site, @Param("router") String router, @Param("stepId") String stepId);
}

@ -40,4 +40,13 @@ public interface OperationService extends IService<Operation> {
*/
Operation queryOperationByErpWorkCenter(String site, String erpWorkCenter);
/**
* By 线&
*
* @param site
* @param router
* @param stepId
* @return
*/
Operation getOperationByRouterStepId(String site, String router, String stepId);
}

@ -66,7 +66,10 @@ public class OperationServiceImpl extends ServiceImpl<OperationMapper, Operation
return operationMapper.queryOperationByErpWorkCenter(site, erpWorkCenter);
}
@Override
public Operation getOperationByRouterStepId(String site, String router, String stepId) {
return operationMapper.selectOperationByRouterStepId(site, router, stepId);
}
}

@ -636,5 +636,12 @@
ORDER BY RS.STEP_ID
</select>
<select id="selectOperationByRouterStepId" resultMap="BaseResultMap">
SELECT OP.HANDLE, OP.CHANGE_STAMP, OP.SITE, OP.OPERATION, OP.TYPE, OP.SPECIAL_ROUTER_BO, OP.STATUS_BO, OP.RESOURCE_TYPE_BO, OP.REVISION, OP.CURRENT_REVISION, OP.EFF_START_DATE, OP.EFF_END_DATE, OP.CREATED_DATE_TIME, OP.MODIFIED_DATE_TIME, OP.PCA_DASHBOARD_MODE, OP.DEFAULT_NC_CODE_BO, OP.FAILURE_TRACKING_CONFIG_BO, OP.RESOURCE_BO, OP.MAX_LOOP, OP.REQUIRED_TIME_IN_PROCESS, OP.REPORTING_STEP, OP.PREV_SITE, OP.ORIGINAL_TRANSFER_KEY, OP.SPECIAL_INSTRUCTION, OP.REPORTING_CENTER_BO, OP.ERP_CONTROL_KEY_BO, OP.ERP_WORK_CENTER_BO
FROM ROUTER RT
INNER JOIN ROUTER_STEP RS ON RS.ROUTER_BO = RT.HANDLE AND RT.CURRENT_REVISION = 'true'
INNER JOIN ROUTER_OPERATION RO ON RO.ROUTER_STEP_BO = RS.HANDLE
INNER JOIN OPERATION OP ON RO.OPERATION_BO = 'OperationBO:' ||OP.SITE||','||OP.OPERATION||',#' AND OP.CURRENT_REVISION = 'true'
WHERE RT.SITE = #{site} AND RT.ROUTER = #{router} AND RS.STEP_ID = #{stepId}
</select>
</mapper>

@ -26,9 +26,9 @@ public class SplitSfcController {
@ResponseBody
@GetMapping("/getSfcData")
public R getSfcData(String sfc){
public R getSfcData(SfcDto dto){
SfcDto result;
result = splitSfcService.getSfcData(sfc);
result = splitSfcService.getSfcData(dto);
return R.ok(result);
}
@ -49,7 +49,7 @@ public class SplitSfcController {
@ResponseBody
@GetMapping("/splitSfc")
public R getSfcData(SfcDto sfcDto){
public R splitSfc(SfcDto sfcDto){
return R.ok( splitSfcService.splitSfc(sfcDto));
}

@ -20,5 +20,5 @@ public interface SplitSfcMapper extends BaseMapper<SplitSfc> {
SfcDto getSfcData(@Param("handle") String handle);
SplitSfcDto getAbnormalQty(@Param("site")String site, @Param("sfc")String sfc, @Param("operation") String operation);
SplitSfcDto getAbnormalQty(@Param("site") String site, @Param("sfc") String sfc, @Param("operation") String operation,@Param("abnormalNo") String abnormalNo);
}

@ -27,7 +27,7 @@ public interface SplitSfcService extends IService<SplitSfc> {
List<SplitSfc> selectList(SplitSfc splitSfc);
SfcDto getSfcData(String sfc);
SfcDto getSfcData(SfcDto dto);
SfcDto getGoodSfcData(String sfc);

@ -73,9 +73,15 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
}
@Override
public SfcDto getSfcData(String sfc) {
public SfcDto getSfcData(SfcDto dto) {
String site = CommonMethods.getSite();
String handle = HandleEnum.SFC.getHandle(site, sfc);
String handle = HandleEnum.SFC.getHandle(site, dto.getSfc());
if (StringUtil.isBlank(dto.getSfc())){
throw new BaseException("产品条码不能为空");
}
if (StringUtil.isBlank(dto.getAbnormalNo())){
throw new BaseException("异常单号不能为空");
}
//根据sfc找工单等信息
SfcDto sfcData = splitSfcMapper.getSfcData(handle);
if (sfcData==null){
@ -83,7 +89,7 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
}
String operation = sfcData.getOperation();
//查询质量异常记录数量
SplitSfcDto sfcDto=splitSfcMapper.getAbnormalQty(site,sfc,operation);
SplitSfcDto sfcDto=splitSfcMapper.getAbnormalQty(site,dto.getSfc(),operation,dto.getAbnormalNo());
if (sfcDto==null){
throw new BaseException("未找到闭环关闭的质量异常");
}
@ -154,6 +160,10 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
public SplitSfc splitSfc(SfcDto sfcDto){
String site = CommonMethods.getSite();
String sfc = sfcDto.getSfc();
String abnormalNo = sfcDto.getAbnormalNo();
if (StringUtil.isBlank(abnormalNo)){
throw new BaseException("异常单号不能为空");
}
String handle = HandleEnum.SFC.getHandle(site, sfc);
BigDecimal splitQty = new BigDecimal(sfcDto.getQty());
@ -164,7 +174,7 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
throw new BaseException("未找到产品条码信息");
}
//查询质量异常记录数量 处置工艺路线及不良代码
SplitSfcDto splitSfcDto=splitSfcMapper.getAbnormalQty(site,sfc,operation);
SplitSfcDto splitSfcDto=splitSfcMapper.getAbnormalQty(site,sfc,operation, abnormalNo);
String routerBo = splitSfcDto.getRouterBo();
String ncCode = splitSfcDto.getNcCode();
if (StringUtil.isBlank(routerBo)){

@ -380,7 +380,7 @@
<select id="getAbnormalQty" resultType="com.foreverwin.mesnac.production.dto.SplitSfcDto">
SELECT zab.NC_QTY,zsbd.ROUTER_BO,zab.NC_CODE,zab.ABNORMAL_NO FROM Z_ABNORMAL_BILL zab
JOIN Z_ABNORMAL_BILL_DISPOSE zsbd ON zab.HANDLE=ZSBD.ABNORMAL_BILL_BO
WHERE ZAB.SFC=#{sfc} AND zab.SITE=#{site} AND ZAB.OPERATION=#{operation} AND zab.STATUS='G' AND zab."TYPE"='Z' AND (zsbd.ABNORMAL_METHOD='F' OR zsbd.ABNORMAL_METHOD='C')
WHERE ZAB.SFC=#{sfc} AND zab.ABNORMAL_NO=#{abnormalNo} AND zab.SITE=#{site} AND ZAB.OPERATION=#{operation} AND zab.STATUS='G' AND zab."TYPE"='Z' AND (zsbd.ABNORMAL_METHOD='F' OR zsbd.ABNORMAL_METHOD='C')
</select>
</mapper>

Loading…
Cancel
Save