|
|
@@ -3,6 +3,9 @@ package com.jeesite.modules.mes.web;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
@@ -47,18 +50,19 @@ public class MesProductGp12CheckController extends BaseController {
|
|
|
/**
|
|
|
* 查询列表
|
|
|
*/
|
|
|
- @RequiresPermissions("mes:mesProductCate:view")
|
|
|
+ @RequiresPermissions("mes:mesProductGp12Check:view")
|
|
|
@RequestMapping(value = {"list", ""})
|
|
|
public String list(MesProductGp12Check mesProductGp12Check, Model model) {
|
|
|
model.addAttribute("mesProductGp12Check", mesProductGp12Check);
|
|
|
model.addAttribute("cateInfo", findCateInfo(mesProductGp12Check.getCateSn()));
|
|
|
+ model.addAttribute("cateList", findCateList());
|
|
|
return "modules/mes/mesProductGp12CheckList";
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查询列表数据
|
|
|
*/
|
|
|
- @RequiresPermissions("mes:mesProductCate:view")
|
|
|
+ @RequiresPermissions("mes:mesProductGp12Check:view")
|
|
|
@RequestMapping(value = "listData")
|
|
|
@ResponseBody
|
|
|
public Page<MesProductGp12Check> listData(MesProductGp12Check mesProductGp12Check,
|
|
|
@@ -76,21 +80,19 @@ public class MesProductGp12CheckController extends BaseController {
|
|
|
/**
|
|
|
* 查看编辑表单
|
|
|
*/
|
|
|
- @RequiresPermissions("mes:mesProductCate:view")
|
|
|
+ @RequiresPermissions("mes:mesProductGp12Check:view")
|
|
|
@RequestMapping(value = "form")
|
|
|
public String form(MesProductGp12Check mesProductGp12Check, Model model) {
|
|
|
model.addAttribute("mesProductGp12Check", mesProductGp12Check);
|
|
|
model.addAttribute("cateInfo", findCateInfo(mesProductGp12Check.getCateSn()));
|
|
|
- MesProductCate query = new MesProductCate();
|
|
|
- query.setStatus(MesProductCate.STATUS_NORMAL);
|
|
|
- model.addAttribute("cateList", mesProductCateService.findList(query));
|
|
|
+ model.addAttribute("cateList", findCateList());
|
|
|
return "modules/mes/mesProductGp12CheckForm";
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 保存数据
|
|
|
*/
|
|
|
- @RequiresPermissions("mes:mesProductCate:edit")
|
|
|
+ @RequiresPermissions("mes:mesProductGp12Check:view")
|
|
|
@PostMapping(value = "save")
|
|
|
@ResponseBody
|
|
|
public String save(@Validated MesProductGp12Check mesProductGp12Check) {
|
|
|
@@ -110,7 +112,7 @@ public class MesProductGp12CheckController extends BaseController {
|
|
|
/**
|
|
|
* 停用数据
|
|
|
*/
|
|
|
- @RequiresPermissions("mes:mesProductCate:edit")
|
|
|
+ @RequiresPermissions("mes:mesProductGp12Check:view")
|
|
|
@RequestMapping(value = "disable")
|
|
|
@ResponseBody
|
|
|
public String disable(MesProductGp12Check mesProductGp12Check) {
|
|
|
@@ -122,7 +124,7 @@ public class MesProductGp12CheckController extends BaseController {
|
|
|
/**
|
|
|
* 启用数据
|
|
|
*/
|
|
|
- @RequiresPermissions("mes:mesProductCate:edit")
|
|
|
+ @RequiresPermissions("mes:mesProductGp12Check:view")
|
|
|
@RequestMapping(value = "enable")
|
|
|
@ResponseBody
|
|
|
public String enable(MesProductGp12Check mesProductGp12Check) {
|
|
|
@@ -134,7 +136,7 @@ public class MesProductGp12CheckController extends BaseController {
|
|
|
/**
|
|
|
* 删除数据
|
|
|
*/
|
|
|
- @RequiresPermissions("mes:mesProductCate:edit")
|
|
|
+ @RequiresPermissions("mes:mesProductGp12Check:view")
|
|
|
@RequestMapping(value = "delete")
|
|
|
@ResponseBody
|
|
|
public String delete(MesProductGp12Check mesProductGp12Check) {
|
|
|
@@ -149,6 +151,24 @@ public class MesProductGp12CheckController extends BaseController {
|
|
|
return mesProductCateService.findBySn(cateSn);
|
|
|
}
|
|
|
|
|
|
+ private List<MesProductCate> findCateList() {
|
|
|
+ MesProductCate query = new MesProductCate();
|
|
|
+ query.setStatus(MesProductCate.STATUS_NORMAL);
|
|
|
+ List<MesProductCate> list = mesProductCateService.findList(query);
|
|
|
+ if (list == null) {
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+ // 仅展示 HEV 系列工件类型(新增 GP12 检查项时只能选择 HEV 产品)
|
|
|
+ List<MesProductCate> result = new ArrayList<>();
|
|
|
+ for (MesProductCate cate : list) {
|
|
|
+ if (cate != null && StringUtils.isNotBlank(cate.getSn())
|
|
|
+ && cate.getSn().trim().toUpperCase().startsWith("HEV")) {
|
|
|
+ result.add(cate);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
private void fillCateTitle(MesProductGp12Check item) {
|
|
|
if (item == null || StringUtils.isBlank(item.getCateSn())) {
|
|
|
return;
|