|
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.xujie.sys.common.exception.XJException; |
|
|
|
import com.xujie.sys.common.utils.PageUtils; |
|
|
|
import com.xujie.sys.modules.part.entity.*; |
|
|
|
import com.xujie.sys.modules.part.mapper.PartInformationMapper; |
|
|
|
@ -338,6 +339,14 @@ public class RoutingManagementServiceImpl extends ServiceImpl<RoutingManagementM |
|
|
|
if (!checkList.isEmpty()) { |
|
|
|
throw new RuntimeException("该工序已存在,请检查!"); |
|
|
|
} |
|
|
|
// 调用存储过程校验参数 |
|
|
|
Map<String, Object> resultMap = this.checkSaveRoutingComponent(data); |
|
|
|
// 判断是否检验成功 |
|
|
|
String code = String.valueOf(resultMap.get("resultCode")); |
|
|
|
if ("600".equalsIgnoreCase(code)) { |
|
|
|
String msg = String.valueOf(resultMap.get("resultMsg")); |
|
|
|
throw new XJException(msg, Integer.parseInt(code)); |
|
|
|
} |
|
|
|
// 新增routing子明细物料 |
|
|
|
routingManagementMapper.saveRoutingComponent(data); |
|
|
|
// 查询bom子明细列表 |
|
|
|
@ -347,6 +356,29 @@ public class RoutingManagementServiceImpl extends ServiceImpl<RoutingManagementM |
|
|
|
return list; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 物料新增校验参数 |
|
|
|
* @param inData |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public Map<String, Object> checkSaveRoutingComponent(RoutingComponentEntity inData){ |
|
|
|
// 公共参数 |
|
|
|
String site = inData.getSite(); |
|
|
|
String buNo = inData.getBuNo(); |
|
|
|
String workCenterNo = inData.getWorkCenterNo(); |
|
|
|
String laborClassNo = inData.getLaborClassNo(); |
|
|
|
String setupLaborClassNo = inData.getSetupLaborClassNo(); |
|
|
|
List<Object> params = new ArrayList<>(); |
|
|
|
params.add(site); |
|
|
|
params.add(buNo); |
|
|
|
params.add(workCenterNo); |
|
|
|
params.add(laborClassNo); |
|
|
|
params.add(setupLaborClassNo); |
|
|
|
// 执行方法 |
|
|
|
List<Map<String, Object>> resultList = procedureDao.getProcedureData("checkSaveRoutingComponent", params); |
|
|
|
return resultList.get(0); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 修改bom子明细 |
|
|
|
* @param data |
|
|
|
@ -360,6 +392,14 @@ public class RoutingManagementServiceImpl extends ServiceImpl<RoutingManagementM |
|
|
|
if (checkList.isEmpty()) { |
|
|
|
throw new RuntimeException("该工序不存在,请检查!"); |
|
|
|
} |
|
|
|
// 调用存储过程校验参数 |
|
|
|
Map<String, Object> resultMap = this.checkSaveRoutingComponent(data); |
|
|
|
// 判断是否检验成功 |
|
|
|
String code = String.valueOf(resultMap.get("resultCode")); |
|
|
|
if ("600".equalsIgnoreCase(code)) { |
|
|
|
String msg = String.valueOf(resultMap.get("resultMsg")); |
|
|
|
throw new XJException(msg, Integer.parseInt(code)); |
|
|
|
} |
|
|
|
// 修改routing子明细物料 |
|
|
|
routingManagementMapper.updateRoutingComponent(data); |
|
|
|
// 查询routing子明细列表 |
|
|
|
|