|
@@ -68,6 +68,9 @@ public class BizProcessInspecionController extends BaseController {
|
|
|
@Resource
|
|
|
private IBizLotService bizLotService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private IBizCarrierService bizCarrierService;
|
|
|
+
|
|
|
@Resource
|
|
|
private IBizProductService productService;
|
|
|
@Resource
|
|
@@ -409,7 +412,9 @@ public class BizProcessInspecionController extends BaseController {
|
|
|
*/
|
|
|
@PostMapping("/getLotOutsourcedInfo")
|
|
|
public AjaxResult getLotOutsourcedInfo(@RequestBody BizDayworkCarrier dayworkCarrier) throws NoSuchFieldException, IllegalAccessException {
|
|
|
- List<String> processCodes = dayworkCarrier.getProcessCode();
|
|
|
+ List<String> codes=new ArrayList<>();
|
|
|
+ codes.add("27110");
|
|
|
+ List<String> processCodes = dayworkCarrier.getProcessCode()==null?codes:dayworkCarrier.getProcessCode();
|
|
|
System.out.println("查询工序编码:processCodes" + processCodes);
|
|
|
//根据箱号查询当前绑定信息
|
|
|
dayworkCarrier = bizDayworkCarrierService.getByCarrierCode(dayworkCarrier);
|
|
@@ -485,18 +490,76 @@ public class BizProcessInspecionController extends BaseController {
|
|
|
* 根据箱号查询批次信息
|
|
|
*/
|
|
|
// @PreAuthorize("@ss.hasPermi('business:inspecion:list')")
|
|
|
+// @PostMapping("/getLotInfo")
|
|
|
+// public AjaxResult getLotInfo(@RequestBody BizDayworkCarrier dayworkCarrier) throws NoSuchFieldException, IllegalAccessException {
|
|
|
+// //根据箱号查询当前绑定信息
|
|
|
+// dayworkCarrier = bizDayworkCarrierService.getByCarrierCode(dayworkCarrier);
|
|
|
+// if (dayworkCarrier == null) {
|
|
|
+// throw new RuntimeException("该箱号未绑定任何批次");
|
|
|
+// }
|
|
|
+//
|
|
|
+// //获取报工信息
|
|
|
+// List<BizDayworkItem> itemList = bizDayworkItemService.getByDayworkId(dayworkCarrier.getDayworkId());
|
|
|
+// if (itemList.size() == 0) {
|
|
|
+// throw new RuntimeException("改批次未开始加工");
|
|
|
+// }
|
|
|
+// BizDayworkItem item = itemList.get(0);
|
|
|
+// BizProductionPlanDetail productionPlanDetail = productionPlanDetailService.getById(item.getProductionPlanDetailId());
|
|
|
+// BizProduct product = productService.getById(productionPlanDetail.getProductId());
|
|
|
+// SysUser user = sysUserService.selectUserById(product.getTechnicianId());
|
|
|
+// if (user != null) {
|
|
|
+// item.setTechnicianName(user.getNickName());
|
|
|
+// item.setTechnicianId(user.getUserId());
|
|
|
+// } else {
|
|
|
+// item.setTechnicianName("");
|
|
|
+// item.setTechnicianId(0L);
|
|
|
+// }
|
|
|
+//
|
|
|
+// //查询是否为正常批次
|
|
|
+// BizLot lot = new BizLot();
|
|
|
+// lot.setId(item.getLotId());
|
|
|
+// lot = bizLotService.getAllList(lot).get(0);
|
|
|
+// if (lot.getIsWaste() == 1) {
|
|
|
+// throw new RuntimeException("该批次已批废");
|
|
|
+// }
|
|
|
+// if (lot.getIsAmend() == 1 || lot.getIsWasteRecycling() == 1) {
|
|
|
+// BizLotTechnologicalProcessDetail process = bizLotTechnologicalProcessDetailService.getById(item.getTechnologicalProcessDetailId());
|
|
|
+// lot.setProcessAlias(process.getProcessAlias());
|
|
|
+// } else {
|
|
|
+// BizTechnologicalProcessDetail process = bizTechnologicalProcessDetailService.getById(item.getTechnologicalProcessDetailId());
|
|
|
+// lot.setProcessAlias(process.getProcessAlias());
|
|
|
+// }
|
|
|
+// lot.setAllCarrierName(item.getCarrierName());
|
|
|
+// lot.setDayworkItemId(item.getId());
|
|
|
+// lot.setCarrierCode(dayworkCarrier.getCarrierCode());
|
|
|
+// lot.setCarrierId(dayworkCarrier.getCarrierId());
|
|
|
+// lot.setPudName(item.getProdNum() == 0 ? lot.getProductionQuantity() : item.getProdNum());
|
|
|
+// return success(lot);
|
|
|
+// }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据箱号查询批次信息
|
|
|
+ */
|
|
|
@PostMapping("/getLotInfo")
|
|
|
- public AjaxResult getLotInfo(@RequestBody BizDayworkCarrier dayworkCarrier) throws NoSuchFieldException, IllegalAccessException {
|
|
|
+ public AjaxResult getLotOrCarrierInfo(@RequestBody BizDayworkCarrier dayworkCarrier) throws NoSuchFieldException, IllegalAccessException {
|
|
|
+
|
|
|
+ /** 因为需要绑定检查载具所以需要先查询出载具信息 **/
|
|
|
+ List<BizCarrier> carriers=bizCarrierService.query().eq("code",dayworkCarrier.getCarrierCode()).list();
|
|
|
+ if(carriers.isEmpty()){
|
|
|
+ return error("箱号信息错误,未找到该载具");
|
|
|
+ }
|
|
|
+ BizCarrier carrier=carriers.get(0);
|
|
|
//根据箱号查询当前绑定信息
|
|
|
dayworkCarrier = bizDayworkCarrierService.getByCarrierCode(dayworkCarrier);
|
|
|
+ /** 判断载具类型,是检查载具并且没有 **/
|
|
|
if (dayworkCarrier == null) {
|
|
|
- throw new RuntimeException("该箱号未绑定任何批次");
|
|
|
+ return error("该箱号未绑定任何批次");
|
|
|
}
|
|
|
|
|
|
//获取报工信息
|
|
|
List<BizDayworkItem> itemList = bizDayworkItemService.getByDayworkId(dayworkCarrier.getDayworkId());
|
|
|
if (itemList.size() == 0) {
|
|
|
- throw new RuntimeException("改批次未开始加工");
|
|
|
+ return error("改批次未开始加工");
|
|
|
}
|
|
|
BizDayworkItem item = itemList.get(0);
|
|
|
BizProductionPlanDetail productionPlanDetail = productionPlanDetailService.getById(item.getProductionPlanDetailId());
|
|
@@ -515,7 +578,7 @@ public class BizProcessInspecionController extends BaseController {
|
|
|
lot.setId(item.getLotId());
|
|
|
lot = bizLotService.getAllList(lot).get(0);
|
|
|
if (lot.getIsWaste() == 1) {
|
|
|
- throw new RuntimeException("改批次已批废");
|
|
|
+ return error("改批次已批废");
|
|
|
}
|
|
|
if (lot.getIsAmend() == 1 || lot.getIsWasteRecycling() == 1) {
|
|
|
BizLotTechnologicalProcessDetail process = bizLotTechnologicalProcessDetailService.getById(item.getTechnologicalProcessDetailId());
|