|
|
|
@ -176,8 +176,8 @@ public class SapRouterServiceImpl implements SapRouterService {
|
|
|
|
|
"删除标识:" + LOEKZ+
|
|
|
|
|
"物料号:" + MATNR+
|
|
|
|
|
"物料描述:" + MAKTX+
|
|
|
|
|
"任务清单使用"+VERWE+
|
|
|
|
|
"状态"+STATU+
|
|
|
|
|
"任务清单使用:"+VERWE+
|
|
|
|
|
"状态:"+STATU+
|
|
|
|
|
"任务清单描述:" + KTEXT+
|
|
|
|
|
" 操作/活动编号:" + VORNR+
|
|
|
|
|
"控制码:" + STEUS+
|
|
|
|
@ -190,16 +190,14 @@ public class SapRouterServiceImpl implements SapRouterService {
|
|
|
|
|
"工作中心:" + ARBPL+
|
|
|
|
|
"基本数量:" + BMSCH+
|
|
|
|
|
"工序计量单位:" + MEINH+
|
|
|
|
|
"标准值01:" + VGW01+
|
|
|
|
|
"计量单位01:" + VGE01+
|
|
|
|
|
"标准值02:" + VGE02+
|
|
|
|
|
"计量单位02:" + VGE02+
|
|
|
|
|
"标准值03:" + VGE03+
|
|
|
|
|
"计量单位03:" + VGE03+
|
|
|
|
|
" 标准值04:" + VGE04+
|
|
|
|
|
" 计量单位04:" + VGE04);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"标准值01(机器):" + VGW01+
|
|
|
|
|
"计量单位01:" + VGE01+
|
|
|
|
|
"标准值02(人工):" + VGW02+
|
|
|
|
|
"计量单位02:" + VGE02+
|
|
|
|
|
"标准值03(折旧):" + VGW03+
|
|
|
|
|
"计量单位03:" + VGE03+
|
|
|
|
|
"标准值04(其它):" + VGW04+
|
|
|
|
|
" 计量单位04:" + VGE04);
|
|
|
|
|
//工艺路线下的工序
|
|
|
|
|
if (StringUtil.isBlank(PLNNR)) {
|
|
|
|
|
throw new ServiceException("任务清单组码不能为空");
|
|
|
|
@ -239,6 +237,18 @@ public class SapRouterServiceImpl implements SapRouterService {
|
|
|
|
|
sapProRoute.setAttr1("job");//说明是来自定时任务
|
|
|
|
|
sapProRoute.setCreateTime(DateUtils.dateTime("yyyy-MM-dd", ANDAT));
|
|
|
|
|
sapProRoute.setRouteVersion("1.0");
|
|
|
|
|
//机器
|
|
|
|
|
sapProRoute.setTecMachine(VGW01);
|
|
|
|
|
sapProRoute.setTecMachineUnit(VGE01);
|
|
|
|
|
//人工
|
|
|
|
|
sapProRoute.setTecMan(VGW02);
|
|
|
|
|
sapProRoute.setTecManUnit(VGE02);
|
|
|
|
|
//折旧
|
|
|
|
|
sapProRoute.setTecDepreciation(VGW03);
|
|
|
|
|
sapProRoute.setTecDepreciationUnit(VGE03);
|
|
|
|
|
//其它
|
|
|
|
|
sapProRoute.setTecOther(VGW04);
|
|
|
|
|
sapProRoute.setTecOtherUnit(VGE04);
|
|
|
|
|
sapProRouteMapper.insertProRoute(sapProRoute);
|
|
|
|
|
|
|
|
|
|
//增加工艺路线和工序的关系
|
|
|
|
@ -265,58 +275,79 @@ public class SapRouterServiceImpl implements SapRouterService {
|
|
|
|
|
successNum++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//更新工艺路线
|
|
|
|
|
else {
|
|
|
|
|
sapProRoute.setRouteName(KTEXT);
|
|
|
|
|
sapProRoute.setRouteDesc(KTEXT);
|
|
|
|
|
sapProRoute.setEnableFlag("Y");
|
|
|
|
|
|
|
|
|
|
else{
|
|
|
|
|
//验证是否存在工序
|
|
|
|
|
sapProProcess.setProcessName(LTXA1);
|
|
|
|
|
SapProProcess operation = sapProProcessMapper.selectProProcessByProcessName(sapProProcess);
|
|
|
|
|
//验证原材料是否存在
|
|
|
|
|
SapBaseProduct sapBaseProduct=new SapBaseProduct();
|
|
|
|
|
sapBaseProduct.setProductCode(MATNR);
|
|
|
|
|
sapBaseProduct = sapBaseProductMapper.selectBaseProductByProductCode(sapBaseProduct);
|
|
|
|
|
if (StringUtils.isNull(operation)){
|
|
|
|
|
failureNum++;
|
|
|
|
|
failureMsg.append(failureNum+"、工艺路线【" + PLNNR + "】下的工序【" + LTXA1 + "】不存在!");
|
|
|
|
|
}
|
|
|
|
|
else if (StringUtils.isNull(sapBaseProduct)){
|
|
|
|
|
failureNum++;
|
|
|
|
|
failureMsg.append(failureNum+"、工艺路线【" + PLNNR + "】下的物料【" + MATNR + "】不存在!");
|
|
|
|
|
}
|
|
|
|
|
else if(!StringUtils.isNull(operation) && !StringUtils.isNull(sapBaseProduct)) {
|
|
|
|
|
//验证是否存在工艺路线和工序的关系
|
|
|
|
|
SapProRouteProcess sapProRouteProcess = new SapProRouteProcess();
|
|
|
|
|
sapProRouteProcess.setRouteId(sapProRoute.getRouteId());
|
|
|
|
|
sapProRouteProcess.setProcessId(operation.getProcessId());
|
|
|
|
|
List<SapProRouteProcess> sapProRouteProcessList = sapProRouteProcessMapper.selectProRouteProcessList(sapProRouteProcess);
|
|
|
|
|
if (sapProRouteProcessList .size()==0) {
|
|
|
|
|
//增加工艺路线和工序的关系
|
|
|
|
|
sapProRouteProcess.setRecordId(IdUtils.fastSimpleUUID());
|
|
|
|
|
sapProRouteProcess.setRouteId(sapProRoute.getRouteId());
|
|
|
|
|
sapProRouteProcess.setProcessId(operation.getProcessId());
|
|
|
|
|
sapProRouteProcess.setProcessCode(operation.getProcessCode());
|
|
|
|
|
sapProRouteProcess.setProcessName(operation.getProcessName());
|
|
|
|
|
sapProRouteProcess.setOrderNum(1);
|
|
|
|
|
sapProRouteProcess.setCreateTime(DateUtils.dateTime("yyyy-MM-dd", ANDAT));
|
|
|
|
|
sapProRouteProcess.setCreateBy(ANNAM);
|
|
|
|
|
sapProRouteProcessMapper.insertProRouteProcess(sapProRouteProcess);
|
|
|
|
|
}
|
|
|
|
|
//验证是否存在工艺路线和物料的关系
|
|
|
|
|
SapProRouteProduct sapProRouteProduct = new SapProRouteProduct();
|
|
|
|
|
sapProRouteProduct.setRouteId(sapProRoute.getRouteId());
|
|
|
|
|
sapProRouteProduct.setItemCode(MATNR);
|
|
|
|
|
List<SapProRouteProduct> sapProRouteProductList = sapProRouteProductMapper.selectProRouteProductList(sapProRouteProduct);
|
|
|
|
|
if (sapProRouteProductList .size()==0) {
|
|
|
|
|
sapProRouteProduct.setRecordId(IdUtils.fastSimpleUUID());
|
|
|
|
|
sapProRouteProduct.setRouteId(sapProRoute.getRouteId());
|
|
|
|
|
sapProRouteProduct.setItemId(sapBaseProduct.getProductId());
|
|
|
|
|
sapProRouteProduct.setItemCode(MATNR);
|
|
|
|
|
sapProRouteProduct.setItemName(sapBaseProduct.getProductDescZh());
|
|
|
|
|
sapProRouteProduct.setCreateBy(ANNAM);
|
|
|
|
|
sapProRouteProduct.setCreateTime(DateUtils.dateTime("yyyy-MM-dd", ANDAT));
|
|
|
|
|
sapProRouteProductMapper.insertProRouteProduct(sapProRouteProduct);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//机器
|
|
|
|
|
sapProRoute.setTecMachine(VGW01);
|
|
|
|
|
sapProRoute.setTecMachineUnit(VGE01);
|
|
|
|
|
//人工
|
|
|
|
|
sapProRoute.setTecMan(VGW02);
|
|
|
|
|
sapProRoute.setTecManUnit(VGE02);
|
|
|
|
|
//折旧
|
|
|
|
|
sapProRoute.setTecDepreciation(VGW03);
|
|
|
|
|
sapProRoute.setTecDepreciationUnit(VGE03);
|
|
|
|
|
//其它
|
|
|
|
|
sapProRoute.setTecOther(VGW04);
|
|
|
|
|
sapProRoute.setTecOtherUnit(VGE04);
|
|
|
|
|
sapProRoute.setUpdateBy(ANNAM);
|
|
|
|
|
sapProRoute.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
|
sapProRouteMapper.updateProRoute(sapProRoute);
|
|
|
|
|
}
|
|
|
|
|
// else{
|
|
|
|
|
// //验证是否存在工序
|
|
|
|
|
// sapProProcess.setProcessName(LTXA1);
|
|
|
|
|
// SapProProcess operation = sapProProcessMapper.selectProProcessByProcessName(sapProProcess);
|
|
|
|
|
// //验证产品是否存在
|
|
|
|
|
// SapBaseProduct sapBaseProduct=new SapBaseProduct();
|
|
|
|
|
// sapBaseProduct.setProductCode(MATNR);
|
|
|
|
|
// sapBaseProduct = sapBaseProductMapper.selectBaseProductByProductCode(sapBaseProduct);
|
|
|
|
|
// if (StringUtils.isNull(operation)){
|
|
|
|
|
// failureNum++;
|
|
|
|
|
// failureMsg.append(failureNum+"、工艺路线【" + PLNNR + "】下的工序【" + LTXA1 + "】不存在!");
|
|
|
|
|
// }
|
|
|
|
|
// else if (StringUtils.isNull(sapBaseProduct)){
|
|
|
|
|
// failureNum++;
|
|
|
|
|
// failureMsg.append(failureNum+"、工艺路线【" + PLNNR + "】下的物料【" + MATNR + "】不存在!");
|
|
|
|
|
// }
|
|
|
|
|
// else if(!StringUtils.isNull(operation) && !StringUtils.isNull(sapBaseProduct)) {
|
|
|
|
|
// //验证是否存在工艺路线和工序的关系
|
|
|
|
|
// SapProRouteProcess sapProRouteProcess = new SapProRouteProcess();
|
|
|
|
|
// sapProRouteProcess.setRouteId(sapProRoute.getRouteId());
|
|
|
|
|
// sapProRouteProcess.setProcessId(operation.getProcessId());
|
|
|
|
|
// List<SapProRouteProcess> sapProRouteProcessList = sapProRouteProcessMapper.selectProRouteProcessList(sapProRouteProcess);
|
|
|
|
|
// if (sapProRouteProcessList .size()==0) {
|
|
|
|
|
// //增加工艺路线和工序的关系
|
|
|
|
|
// sapProRouteProcess.setRecordId(IdUtils.fastSimpleUUID());
|
|
|
|
|
// sapProRouteProcess.setRouteId(sapProRoute.getRouteId());
|
|
|
|
|
// sapProRouteProcess.setProcessId(operation.getProcessId());
|
|
|
|
|
// sapProRouteProcess.setProcessCode(operation.getProcessCode());
|
|
|
|
|
// sapProRouteProcess.setProcessName(operation.getProcessName());
|
|
|
|
|
// sapProRouteProcess.setOrderNum(1);
|
|
|
|
|
// sapProRouteProcess.setCreateTime(DateUtils.dateTime("yyyy-MM-dd", ANDAT));
|
|
|
|
|
// sapProRouteProcess.setCreateBy(ANNAM);
|
|
|
|
|
// sapProRouteProcessMapper.insertProRouteProcess(sapProRouteProcess);
|
|
|
|
|
// }
|
|
|
|
|
// //验证是否存在工艺路线和物料的关系
|
|
|
|
|
// SapProRouteProduct sapProRouteProduct = new SapProRouteProduct();
|
|
|
|
|
// sapProRouteProduct.setRouteId(sapProRoute.getRouteId());
|
|
|
|
|
// sapProRouteProduct.setItemCode(MATNR);
|
|
|
|
|
// List<SapProRouteProduct> sapProRouteProductList = sapProRouteProductMapper.selectProRouteProductList(sapProRouteProduct);
|
|
|
|
|
// if (sapProRouteProductList .size()==0) {
|
|
|
|
|
// sapProRouteProduct.setRecordId(IdUtils.fastSimpleUUID());
|
|
|
|
|
// sapProRouteProduct.setRouteId(sapProRoute.getRouteId());
|
|
|
|
|
// sapProRouteProduct.setItemId(sapBaseProduct.getProductId());
|
|
|
|
|
// sapProRouteProduct.setItemCode(MATNR);
|
|
|
|
|
// sapProRouteProduct.setItemName(sapBaseProduct.getProductDescZh());
|
|
|
|
|
// sapProRouteProduct.setCreateBy(ANNAM);
|
|
|
|
|
// sapProRouteProduct.setCreateTime(DateUtils.dateTime("yyyy-MM-dd", ANDAT));
|
|
|
|
|
// sapProRouteProductMapper.insertProRouteProduct(sapProRouteProduct);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|