Merge remote-tracking branch 'origin/master'

master
赵嘉伟
commit 5c42465472

@ -83,6 +83,7 @@ public class PrinterController {
return R.ok("保存成功");
} else {
printerModel.setDescription(printer.getDescription());
printerModel.setEnabled(printer.getEnabled());
printerModel.setModifiedDateTime(nowDate);
printerService.updateById(printerModel);
return R.ok("修改成功");

@ -984,8 +984,8 @@
ZCI.SHOP_ORDER , ZCI.RESRCE,
IM.ITEM, IT.DESCRIPTION ITEM_DESCRIPTION,ZCI.COMPONENT_BO ,
CP.ITEM COMPONENT, ITT.DESCRIPTION COMPONENT_DESCRIPTION, ZSD.BLANKING_SIZE,
MIN(ZSD.PLANNED_START_DATE) ,
/*MIN(SO.PLANNED_START_DATE) , ZCI.CALL_TYPE,*/
/*MIN(ZSD.PLANNED_START_DATE) ,
MIN(SO.PLANNED_START_DATE) , ZCI.CALL_TYPE,*/
SUM(ZCI.REQUIRED_QTY) REQUIRED_QTY
FROM Z_CALL_ITEM ZCI
INNER JOIN Z_SFC_DISPATCH ZSD ON ZSD.HANDLE = ZCI.SFC_DISPATCH_BO

@ -190,7 +190,7 @@ public class ResourceRepairTaskController {
String resourceNo = resourceRepairTask.getResourceNo();
String resourceTypeNo = resourceRepairTask.getResourceTypeNo();
if (workCenterNo != null){
resourceRepairTask.setWorkCenterBo(HandleEnum.RESOURCE_INSPECT_PLAN.getHandle(site,workCenterNo));
resourceRepairTask.setWorkCenterBo(HandleEnum.WORK_CENTER.getHandle(site,workCenterNo));
}
if (resourceNo != null){
resourceRepairTask.setResourceBo(HandleEnum.RESOURCE.getHandle(site,resourceNo));

@ -145,6 +145,7 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
@Override
public ResourceRepairTask selOrStartRepairTask(ResourceRepairTask resourceRepairTask) {
String user = CommonMethods.getUser();
// 根据HANDLE查询维修任务
String handle = resourceRepairTask.getHandle();
String stopMachine = resourceRepairTask.getStopMachine();
@ -166,7 +167,9 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
if (stopMachine != null && status.equals("501")){
repairTask.setStatus("501");
repairTask.setActualStartDate(LocalDateTime.now());
repairTask.setRepairUsers(CommonMethods.getUser());
repairTask.setRepairUsers(user);
NwaUser userByUserName = nwaUserService.findUserByUserName(user);
repairTask.setRepairUserName(userByUserName.getFullName());
resourceRepairTaskService.updateById(repairTask);
// 修改设备状态---若stopMachie=Y则状态改为非预定停机
if (stopMachine.equals("Y")){

@ -894,7 +894,7 @@
INNER JOIN WIP.RESRCE R ON RRT.SITE = R.SITE AND R.RESRCE = RRT.RESOURCE_NO
LEFT JOIN WIP.WORK_CENTER_MEMBER WCM ON WCM.WORK_CENTER_OR_RESOURCE_GBO = R.HANDLE
LEFT JOIN WIP.WORK_CENTER_MEMBER WCMA ON WCMA.WORK_CENTER_OR_RESOURCE_GBO = WCM.WORK_CENTER_BO
LEFT JOIN WIP.WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WCMA.WORK_CENTER_BO
LEFT JOIN WIP.WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WCMA.WORK_CENTER_BO AND WCT.LOCALE = 'zh'
INNER JOIN WIP.RESOURCE_TYPE_RESOURCE RTR ON RTR.RESOURCE_BO = R.HANDLE
WHERE RRT.SITE = #{site}
<if test="resourceNo != null and resourceNo != ''">
@ -910,7 +910,7 @@
AND RRT.STATUS = #{status}
</if>
<if test="workCenterBo != null and workCenterBo != ''">
AND WCM.WORK_CENTER_BO = #{workCenterBo}
AND WCMA.WORK_CENTER_BO = #{workCenterBo}
</if>
<if test="resourceTypeBo != null and resourceTypeBo != ''">
AND RTR.RESOURCE_TYPE_BO = #{resourceTypeBo}

@ -819,7 +819,6 @@ public class InterfaceServiceImpl implements InterfaceService {
LocalDateTime now = LocalDateTime.now();
List<PrintLog> printLogList = new ArrayList<>();
//循环处理 物料批次
for (int i = 0; i < itemBatchDtoList.size(); i++) {
ItemBatchDto itemBatchDto = itemBatchDtoList.get(i);
@ -867,42 +866,40 @@ public class InterfaceServiceImpl implements InterfaceService {
itemBatch.setCreateUser(Constants.SITE_ADMIN);
itemBatch.setCreatedDateTime(now);
itemBatchService.save(itemBatch);
//打印模板参数
List<LabelPrintDto> labelPrintDtoList = new ArrayList<>();
LabelPrintDto labelPrintDto = new LabelPrintDto();
labelPrintDto.setSite(site);
labelPrintDto.setPrintTemplate(Constants.PRINT_TYPE_INV);
labelPrintDto.setItem(item);
labelPrintDto.setItemDescription(itemModel.getDescription());
labelPrintDto.setSupplier(supplier);
//labelPrintDto.setBatch(inventory);
labelPrintDto.setBatch(batch);
labelPrintDto.setLabel(inventory);
labelPrintDtoList.add(labelPrintDto);
//记录打印数据
PrintLog printLog = new PrintLog();
printLog.setHandle(UUID.randomUUID().toString());
printLog.setSite(site);
printLog.setCategory(Constants.PRINT_TYPE_INV);
printLog.setPrintName("");
printLog.setPrintTemplate(Constants.PRINT_TYPE_INV);
printLog.setPrintParam(JSON.toJSONString(labelPrintDtoList));
printLog.setInventory(inventory);
printLog.setItemBo(itemModel.getHandle());
printLog.setIsPrint("false");
printLog.setPrintNum(0);
printLog.setCreateUser("SITE_ADMIN");
printLog.setCreatedDateTime(LocalDateTime.now());
printLogService.save(printLog);
}
//打印模板参数
List<LabelPrintDto> labelPrintDtoList = new ArrayList<>();
LabelPrintDto labelPrintDto = new LabelPrintDto();
labelPrintDto.setSite(site);
labelPrintDto.setPrintTemplate(Constants.PRINT_TYPE_INV);
labelPrintDto.setItem(item);
labelPrintDto.setItemDescription(itemModel.getDescription());
labelPrintDto.setSupplier(supplier);
//labelPrintDto.setBatch(inventory);
labelPrintDto.setBatch(batch);
labelPrintDto.setLabel(inventory);
labelPrintDtoList.add(labelPrintDto);
//记录打印数据
PrintLog printLog = new PrintLog();
printLog.setHandle(UUID.randomUUID().toString());
printLog.setSite(site);
printLog.setCategory(Constants.PRINT_TYPE_INV);
printLog.setPrintName("");
printLog.setPrintTemplate(Constants.PRINT_TYPE_INV);
printLog.setPrintParam(JSON.toJSONString(labelPrintDtoList));
printLog.setInventory(inventory);
printLog.setItemBo(itemModel.getHandle());
printLog.setIsPrint("false");
printLog.setPrintNum(0);
printLog.setCreateUser("SITE_ADMIN");
printLog.setCreatedDateTime(LocalDateTime.now());
printLogList.add(printLog);
}
if (printLogList != null && printLogList.size() > 0) {
printLogService.saveBatch(printLogList);
}
}
/**

@ -7,10 +7,14 @@ import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.service.SfcDispatchCommonService;
import com.foreverwin.mesnac.common.util.ExceptionUtil;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.dto.RouterStepDto;
import com.foreverwin.mesnac.meapi.dto.SfcDto;
import com.foreverwin.mesnac.meapi.model.Router;
import com.foreverwin.mesnac.meapi.model.WorkCenter;
import com.foreverwin.mesnac.meapi.service.RouterService;
import com.foreverwin.mesnac.meapi.service.RouterStepService;
import com.foreverwin.mesnac.meapi.service.ShopOrderService;
import com.foreverwin.mesnac.meapi.service.WorkCenterService;
import com.foreverwin.mesnac.production.dto.SplitSfcDto;
import com.foreverwin.mesnac.production.mapper.SfcCrossMapper;
import com.foreverwin.mesnac.production.mapper.SplitSfcMapper;
@ -18,6 +22,7 @@ import com.foreverwin.mesnac.production.model.SplitSfc;
import com.foreverwin.mesnac.production.model.StepOperation;
import com.foreverwin.mesnac.production.service.SplitSfcService;
import com.foreverwin.modular.core.exception.BaseException;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.meext.MEServices;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
@ -53,10 +58,14 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
@Autowired
private SfcDispatchCommonService sfcDispatchCommonService;
@Autowired
private WorkCenterService workCenterService;
@Autowired
private ShopOrderService shopOrderService;
@Autowired
private RouterService routerService;
@Autowired
private RouterStepService routerStepService;
@Autowired
private SfcCrossMapper sfcCrossMapper;
@Override
public IPage<SplitSfc> selectPage(FrontPage<SplitSfc> frontPage, SplitSfc splitSfc) {
@ -122,7 +131,10 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
//根据sfc找工单等信息
SfcDto sfcData =getGoodSfcData(sfc);
if (sfcData==null){
throw new BaseException("未找到产品条码信息");
}
String operation = sfcData.getOperation();
SplitSfcRequest splitSfcRequest=new SplitSfcRequest();
try {
SplitSerializeServiceInterface splitService = MEServices.create("com.sap.me.production", "SplitSerializeService",site);
@ -147,9 +159,19 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
splitSfc.setCreateUser(CommonMethods.getUser());
splitSfc.setCreatedDateTime(LocalDateTime.now());
save(splitSfc);
String workCenterBo = shopOrderService.getById(HandleEnum.SHOP_ORDER.getHandle(site, sfcData.getShopOrder())).getPlannedWorkCenterBo();
String workCenter = null;
if (operation.contains("_")) {
workCenter = operation.split("_")[0];
} else {
workCenter = operation;
}
String workCenterBo = HandleEnum.WORK_CENTER.getHandle(site, workCenter);
WorkCenter workCenterModel = workCenterService.getById(workCenterBo);
if (workCenterModel == null) {
throw BusinessException.build("生产车间【" +workCenter+ "】不存在");
}
Router routerBySfcBo = routerService.getRouterBySfcBo(HandleEnum.SFC.getHandle(site, sfc));
sfcDispatchCommonService.saveSfcDispatch(site,CommonMethods.getUser(),StringUtil.trimHandle(workCenterBo),newSfc, sfcData.getShopOrder(),routerBySfcBo.getHandle());
sfcDispatchCommonService.saveSfcDispatch(site,CommonMethods.getUser(),workCenter,newSfc, sfcData.getShopOrder(),routerBySfcBo.getHandle());
return splitSfc;
} catch (Exception e) {
ExceptionUtil.throwException(e);
@ -235,8 +257,23 @@ public class SplitSfcServiceImpl extends ServiceImpl<SplitSfcMapper, SplitSfc> i
dispositionSfcsRequest.setDispositionSelection(dispositionSelection);
dispositionSfcsRequest.setProdCtx(new ProductionContext());
ncProductionService.dispositionMultipleSfcs(dispositionSfcsRequest);
String workCenterBo = shopOrderService.getById(HandleEnum.SHOP_ORDER.getHandle(site, sfcData.getShopOrder())).getPlannedWorkCenterBo();
sfcDispatchCommonService.saveSfcDispatch(site,CommonMethods.getUser(),StringUtil.trimHandle(workCenterBo),newSfc, sfcData.getShopOrder(),maxRevisionRouter.getHandle());
String workCenter;
List<RouterStepDto> routerOperationByRouterBo = routerStepService.findRouterOperationByRouterBo(site, routerBo);
if (routerOperationByRouterBo.isEmpty()){
throw new BaseException("处置工艺路线没有步骤");
}
String routerOperation = routerOperationByRouterBo.get(0).getOperation();
if (routerOperation.contains("_")) {
workCenter = routerOperation.split("_")[0];
} else {
workCenter = routerOperation;
}
String workCenterBo = HandleEnum.WORK_CENTER.getHandle(site, workCenter);
WorkCenter workCenterModel = workCenterService.getById(workCenterBo);
if (workCenterModel == null) {
throw BusinessException.build("生产车间【" +workCenter+ "】不存在");
}
sfcDispatchCommonService.saveSfcDispatch(site,CommonMethods.getUser(),workCenter,newSfc, sfcData.getShopOrder(),maxRevisionRouter.getHandle());
}
SplitSfc splitSfc=new SplitSfc();
splitSfc.setHandle(HandleEnum.SPLIT_SFC.getHandle(site,newSfc));

Loading…
Cancel
Save