|
@@ -559,8 +559,15 @@ public class AdminMachineController {
|
|
|
@RequestMapping("/_to_add_renovation")
|
|
|
public ModelAndView toAddRenovationMachine() {
|
|
|
ModelAndView mv = new ModelAndView("pts/machine/addRenovationMachine");
|
|
|
- //查询所有状态为可用的批次
|
|
|
- List<PtsBatch> listptsBatch = ptsBatchService.listPtsBatchByStatus();
|
|
|
+ //查询所有产品
|
|
|
+ List<Produce> produceList = produceService.getProduceList();
|
|
|
+ mv.addObject("produceList", produceList);
|
|
|
+ List<PtsBatch> listptsBatch = null;
|
|
|
+ if(produceList.size() > 0){
|
|
|
+ PtsBatch ptsBatch = new PtsBatch();
|
|
|
+ ptsBatch.setProduceId(produceList.get(0).getProduceId());
|
|
|
+ listptsBatch = ptsBatchService.listPtsBatch(ptsBatch);
|
|
|
+ }
|
|
|
mv.addObject("listptsBatch", listptsBatch);
|
|
|
//查询所有软件版本
|
|
|
PtsMachineVersion ptsMachineVersion = new PtsMachineVersion();
|
|
@@ -568,7 +575,7 @@ public class AdminMachineController {
|
|
|
List<PtsMachineVersion> ListVersion = machineVersionService.listMachineVersion(ptsMachineVersion);
|
|
|
mv.addObject("listVersion", ListVersion);
|
|
|
//根据第一个批次查询所有bom
|
|
|
- if (listptsBatch.size() > 0) {
|
|
|
+ if (listptsBatch!= null && listptsBatch.size() > 0) {
|
|
|
PtsBom ptsBom = new PtsBom();
|
|
|
ptsBom.setBomId(listptsBatch.get(0).getBomId());
|
|
|
List<PtsBom> listBom = ptsBomService.listBom(ptsBom);
|
|
@@ -838,6 +845,21 @@ public class AdminMachineController {
|
|
|
rj.setResultMsg("取消出库操作成功");
|
|
|
return rj;
|
|
|
}
|
|
|
-
|
|
|
+ @ResponseBody
|
|
|
+ @RequiresPermissions("machine:select_all:machine")
|
|
|
+ @RequestMapping("/select_Batch")
|
|
|
+ public ResponseJson selectBatch(HttpServletRequest request,Integer productId){
|
|
|
+ ResponseJson responseJson = new ResponseJson();
|
|
|
+ if(productId == null){
|
|
|
+ responseJson = new ResponseJson(500, "ERROR", 500);
|
|
|
+ return responseJson;
|
|
|
+ }
|
|
|
+ PtsBatch ptsBatch = new PtsBatch();
|
|
|
+ ptsBatch.setProduceId(productId);
|
|
|
+ List<PtsBatch> listptsBatch = ptsBatchService.listPtsBatch(ptsBatch);
|
|
|
+ ResponseJson rj = new ResponseJson(200, "SUCCESS", 200);
|
|
|
+ rj.addResponseKeyValue("listptsBatch",listptsBatch);
|
|
|
+ return rj;
|
|
|
+ }
|
|
|
}
|
|
|
|