|
@@ -25,91 +25,91 @@ public class IfMesEmsSwapfileController extends BaseRESTfulController {
|
|
|
@Autowired
|
|
|
IIfMesEmsSwapfileService ifMesEmsSwapfileService;
|
|
|
|
|
|
- @ApiOperation(value="获取列表", notes="分页查询")
|
|
|
+ @ApiOperation(value = "获取列表", notes = "分页查询")
|
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
|
|
|
- @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
|
|
|
+ @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
|
|
|
+ @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
|
|
|
})
|
|
|
//@RequiresPermissions("trmunit:view")
|
|
|
@GetMapping(value = "/")
|
|
|
- public RESTfulResult list(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
|
|
|
+ public RESTfulResult list(@RequestParam HashMap parmas, Integer pageNum, Integer pageSize) {
|
|
|
PageList<IfMesEmsSwapfile> list = ifMesEmsSwapfileService.queryForPage(parmas, pageNum, pageSize);
|
|
|
return success(list);
|
|
|
}
|
|
|
-
|
|
|
- @ApiOperation(value="获取列表", notes="分页模糊查询")
|
|
|
+
|
|
|
+ @ApiOperation(value = "获取列表", notes = "分页模糊查询")
|
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
|
|
|
- @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
|
|
|
+ @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
|
|
|
+ @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
|
|
|
})
|
|
|
//@RequiresPermissions("tpmcaseact:view")
|
|
|
@GetMapping(value = "/like/")
|
|
|
- public RESTfulResult listLike(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
|
|
|
+ public RESTfulResult listLike(@RequestParam HashMap parmas, Integer pageNum, Integer pageSize) {
|
|
|
PageList<IfMesEmsSwapfile> list = ifMesEmsSwapfileService.queryLikeForPage(parmas, pageNum, pageSize);
|
|
|
return success(list);
|
|
|
}
|
|
|
|
|
|
|
|
|
- @ApiOperation(value="立即从MES同步数据", notes="从MES同步投入产出数据")
|
|
|
+ @ApiOperation(value = "立即从MES同步数据", notes = "从MES同步投入产出数据")
|
|
|
@PostMapping(value = "/synchronousMesAnEmsData")
|
|
|
- public RESTfulResult synchronousMesAnEmsData(@ModelAttribute IfMesEmsSwapfile model){
|
|
|
+ public RESTfulResult synchronousMesAnEmsData(@ModelAttribute IfMesEmsSwapfile model) {
|
|
|
String s = ifMesEmsSwapfileService.synchronousMesAnEmsData();
|
|
|
return success(s);
|
|
|
}
|
|
|
|
|
|
@GetMapping("/getLgDateProd")
|
|
|
- public RESTfulResult getLgDateProd (){
|
|
|
+ public RESTfulResult getLgDateProd() {
|
|
|
ifMesEmsSwapfileService.getLgDateProd();
|
|
|
return success();
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value="获取列表", notes="分页模糊查询")
|
|
|
+ @ApiOperation(value = "获取列表", notes = "分页模糊查询")
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
|
|
|
@ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
|
|
|
})
|
|
|
//@RequiresPermissions("tpmcaseact:view")
|
|
|
@GetMapping(value = "/queryList/")
|
|
|
- public RESTfulResult queryList(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
|
|
|
- if(parmas.containsKey("workprocid") && parmas.get("workprocid") != null && !"".equals(parmas.get("workprocid").toString())){
|
|
|
+ public RESTfulResult queryList(@RequestParam HashMap parmas, Integer pageNum, Integer pageSize) {
|
|
|
+ if (parmas.containsKey("workprocid") && parmas.get("workprocid") != null && !"".equals(parmas.get("workprocid").toString())) {
|
|
|
PageList<Map<String, Object>> list = ifMesEmsSwapfileService.getQueryList(parmas, pageNum, pageSize);
|
|
|
return success(list);
|
|
|
}
|
|
|
return failed(null, "菜单工序id为空,请联系管理员");
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value="获取列表", notes="分页模糊查询")
|
|
|
+ @ApiOperation(value = "获取列表", notes = "分页模糊查询")
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
|
|
|
@ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
|
|
|
})
|
|
|
@GetMapping(value = "/queryProductAndMaterial/")
|
|
|
- public RESTfulResult queryProductAndMaterial(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
|
|
|
- if(parmas.containsKey("workprocid") && parmas.get("workprocid") != null && !"".equals(parmas.get("workprocid").toString())){
|
|
|
- if(parmas.containsKey("type") && parmas.get("type") != null && !"".equals(parmas.get("type").toString())) {
|
|
|
+ public RESTfulResult queryProductAndMaterial(@RequestParam HashMap parmas, Integer pageNum, Integer pageSize) {
|
|
|
+ if (parmas.containsKey("workprocid") && parmas.get("workprocid") != null && !"".equals(parmas.get("workprocid").toString())) {
|
|
|
+ if (parmas.containsKey("type") && parmas.get("type") != null && !"".equals(parmas.get("type").toString())) {
|
|
|
Object type = parmas.get("type");
|
|
|
if ("1".equals(type)) {
|
|
|
- parmas.put("table_name","T_RM_WORKPROC_MATERIAL");
|
|
|
- parmas.put("table_name2","T_RM_WORKPROC_MATERIAL_VALUE");
|
|
|
- parmas.put("listing","MATERIALID");
|
|
|
+ parmas.put("table_name", "T_RM_WORKPROC_MATERIAL");
|
|
|
+ parmas.put("table_name2", "T_RM_WORKPROC_MATERIAL_VALUE");
|
|
|
+ parmas.put("listing", "MATERIALID");
|
|
|
} else if ("2".equals(type)) {
|
|
|
- parmas.put("table_name","T_RM_WORKPROC_PRODUCT");
|
|
|
- parmas.put("table_name2","T_RM_WORKPROC_PRODUCT_VALUE");
|
|
|
- parmas.put("listing","PRODUCTID");
|
|
|
+ parmas.put("table_name", "T_RM_WORKPROC_PRODUCT");
|
|
|
+ parmas.put("table_name2", "T_RM_WORKPROC_PRODUCT_VALUE");
|
|
|
+ parmas.put("listing", "PRODUCTID");
|
|
|
} else {
|
|
|
return failed(null, "数据类型有误");
|
|
|
}
|
|
|
PageList<Map<String, Object>> list = ifMesEmsSwapfileService.queryProductAndMaterial(parmas, pageNum, pageSize);
|
|
|
return success(list);
|
|
|
}
|
|
|
- return failed(null,"请选择数据类型");
|
|
|
+ return failed(null, "请选择数据类型");
|
|
|
}
|
|
|
return failed(null, "菜单工序id为空,请联系管理员");
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value="批量更新详细信息", notes="根据传过来的parmas数组信息来更新详细信息")
|
|
|
+ @ApiOperation(value = "批量更新详细信息", notes = "根据传过来的parmas数组信息来更新详细信息")
|
|
|
@ApiImplicitParam(name = "parmas", value = "详细实体usageData", required = true, dataType = "usageData")
|
|
|
- @PutMapping(value = "/updateProductAndMaterial", produces = "application/json;charset=UTF-8")
|
|
|
+ @PutMapping(value = "/updateProductAndMaterial", produces = "application/json;charset=UTF-8")
|
|
|
public RESTfulResult updateProductAndMaterial(@RequestBody HashMap[] parmas) {
|
|
|
|
|
|
for (int i = 0; i < parmas.length; i++) {
|
|
@@ -148,18 +148,61 @@ public class IfMesEmsSwapfileController extends BaseRESTfulController {
|
|
|
}
|
|
|
return success();
|
|
|
}
|
|
|
+
|
|
|
@Autowired
|
|
|
ITRmWorkprocProductValueService tRmWorkprocProductValueService;
|
|
|
|
|
|
@Autowired
|
|
|
ITRmWorkprocMaterialValueService tRmWorkprocMaterialValueService;
|
|
|
|
|
|
- @ApiOperation(value="从T_RM_PRODUCT,T_RM_MATERIAL生成模板数据", notes="从生成投入产出数据模板")
|
|
|
+ @ApiOperation(value = "从T_RM_PRODUCT,T_RM_MATERIAL生成模板数据", notes = "从生成投入产出数据模板")
|
|
|
@GetMapping(value = "/generateProductAndMaterial")
|
|
|
- public RESTfulResult generateProductAndMaterial(@ModelAttribute IfMesEmsSwapfile model){
|
|
|
+ public RESTfulResult generateProductAndMaterial(@ModelAttribute IfMesEmsSwapfile model) {
|
|
|
String s = ifMesEmsSwapfileService.generateProductAndMaterial();
|
|
|
tRmWorkprocProductValueService.synchronousData();
|
|
|
tRmWorkprocMaterialValueService.synchronousData();
|
|
|
return success(s);
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value = "查询盘库数据,获取列表", notes = "分页模糊查询")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
|
|
|
+ @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
|
|
|
+ })
|
|
|
+ @GetMapping(value = "/queryWorkprocInventory/")
|
|
|
+ public RESTfulResult queryWorkprocInventory(@RequestParam HashMap parmas, Integer pageNum, Integer pageSize) {
|
|
|
+ PageList<Map<String, Object>> list = ifMesEmsSwapfileService.queryWorkprocInventory(parmas, pageNum, pageSize);
|
|
|
+ return success(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "批量更新盘库数据详细信息", notes = "根据传过来的parmas数组信息来更新详细信息")
|
|
|
+ @ApiImplicitParam(name = "parmas", value = "详细实体usageData", required = true, dataType = "usageData")
|
|
|
+ @PutMapping(value = "/updateWorkprocInventory", produces = "application/json;charset=UTF-8")
|
|
|
+ public RESTfulResult updateWorkprocInventory(@RequestBody HashMap[] parmas) {
|
|
|
+ for (int i = 0; i < parmas.length; i++) {
|
|
|
+ HashMap parma = parmas[i];
|
|
|
+ if (!parma.containsKey("itemid") || parma.get("itemid") == null || "".equals(parma.get("itemid").toString())) {
|
|
|
+ return failed(null, "缺少参数itemid");
|
|
|
+ }
|
|
|
+ if (!parma.containsKey("tableName") || parma.get("tableName") == null || "".equals(parma.get("tableName").toString())) {
|
|
|
+ return failed(null, "缺少参数tableName");
|
|
|
+ }
|
|
|
+ if (!parma.containsKey("clock") || parma.get("clock") == null || "".equals(parma.get("clock").toString())) {
|
|
|
+ return failed(null, "缺少参数clock");
|
|
|
+ }
|
|
|
+ if (!parma.containsKey("timegranid") || parma.get("timegranid") == null || "".equals(parma.get("timegranid").toString())) {
|
|
|
+ return failed(null, "缺少参数timegranid");
|
|
|
+ }
|
|
|
+ if (!parma.containsKey("JTZ") || parma.get("JTZ") == null || "".equals(parma.get("JTZ").toString())) {
|
|
|
+ return failed(null, "缺少参数JTZ");
|
|
|
+ }
|
|
|
+ if (!parma.containsKey("bz")) {
|
|
|
+ return failed(null, "缺少参数bz");
|
|
|
+ }
|
|
|
+ parma.put("upman", JwtUtil.getUseridByToken());
|
|
|
+ parma.put("uptime", DateUtils.getCurrentTimetoDate("yyyy-MM-dd HH:mm:ss"));
|
|
|
+ ifMesEmsSwapfileService.updateWorkprocInventory(parma);
|
|
|
+ }
|
|
|
+ return success();
|
|
|
+ }
|
|
|
}
|