From 14c9a5ce1179bc77b04ea9cf7ebf46229ee95134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=99=93=E8=BF=AA?= <2596750866@qq.com> Date: Sat, 19 Oct 2024 09:08:25 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E5=9F=BA=E7=A1=80=E8=B5=84=E6=96=99=20?= =?UTF-8?q?=E5=87=BA=E5=B7=AE=E5=8D=95=20=E4=BF=AE=E6=94=B9=E5=87=BA?= =?UTF-8?q?=E5=B7=AE=E5=8D=95=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?=E5=8E=BB=E9=99=A4=E7=94=B3=E8=AF=B7=E4=BA=BA=E5=88=97=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=EF=BC=8C=E8=AE=BE=E7=BD=AE=E5=88=97=E5=B1=85=E4=B8=AD?= =?UTF-8?q?=EF=BC=8C=E6=96=B0=E5=A2=9E=E8=A1=8C=E6=A0=B7=E5=BC=8F=EF=BC=9B?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E6=96=B0=E5=A2=9E=E3=80=81=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E9=9D=A2=E8=A1=A8=E5=8D=95=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=95=88=E6=9E=9C=EF=BC=8C=E5=8E=BB=E9=99=A4=E6=88=96=E8=A1=A5?= =?UTF-8?q?=E5=85=85=E5=AD=97=E6=AE=B5=EF=BC=9B=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=87=BA=E5=B7=AE=E5=8D=95vo=E7=B1=BB=EF=BC=8C=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=BD=93=E5=89=8D=E7=8A=B6=E6=80=81=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=EF=BC=9B=20=E4=BF=AE=E6=94=B9=E5=87=BA=E5=B7=AE=E5=8D=95?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2controller=E6=96=B9?= =?UTF-8?q?=E6=B3=95=EF=BC=9B=20=E4=BF=AE=E6=94=B9=E5=87=BA=E5=B7=AE?= =?UTF-8?q?=E7=9A=84=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2service=E6=96=B9?= =?UTF-8?q?=E6=B3=95=EF=BC=8C=E6=B7=BB=E5=8A=A0=E8=A7=92=E8=89=B2=E9=99=90?= =?UTF-8?q?=E5=88=B6=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=8C=89=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E8=8A=82=E7=82=B9=E5=8F=98=E9=87=8F=E6=96=B9?= =?UTF-8?q?=E6=B3=95=EF=BC=9B=20=E4=BF=AE=E6=94=B9=E5=87=BA=E5=B7=AE?= =?UTF-8?q?=E7=BB=8F=E7=90=86=E5=AE=A1=E6=89=B9=E9=A1=B5=E9=9D=A2=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E6=98=BE=E7=A4=BA=EF=BC=9B=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=BA=BA=E4=BA=8B=E5=BD=95=E5=85=A5=E9=A1=B5=E9=9D=A2=E3=80=81?= =?UTF-8?q?=E7=A0=94=E5=8F=91=E6=80=BB=E7=9B=91=E5=AE=A1=E6=89=B9=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BaseEvectionFormController.java | 7 +- .../system/domain/Vo/BaseEvectionFormVo.java | 2 + .../service/IBaseEvectionFormService.java | 2 +- .../impl/BaseEvectionFormServiceImpl.java | 123 ++++++++---- .../system/baseEvectionForm/add.html | 119 +++++------- .../baseEvectionForm/baseEvectionForm.html | 91 +++++---- .../system/baseEvectionForm/detail.html | 115 +++++++---- .../system/baseEvectionForm/hrRecord.html | 182 ++++++++++++++++++ .../baseEvectionForm/taskCcjlVerify.html | 24 +-- .../baseEvectionForm/taskYfzjVerify.html | 134 +++++++++++++ 10 files changed, 599 insertions(+), 200 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/system/baseEvectionForm/hrRecord.html create mode 100644 ruoyi-admin/src/main/resources/templates/system/baseEvectionForm/taskYfzjVerify.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseEvectionFormController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseEvectionFormController.java index 48fa64e0..851249a7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseEvectionFormController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseEvectionFormController.java @@ -67,8 +67,7 @@ public class BaseEvectionFormController extends BaseController @RequiresPermissions("system:baseEvectionForm:list") @PostMapping("/list") @ResponseBody - public TableDataInfo list(BaseEvectionFormVo baseEvectionFormVo) - { + public TableDataInfo list(BaseEvectionFormVo baseEvectionFormVo) throws Exception { startPage(); List list = baseEvectionFormService.selectBaseEvectionFormList(baseEvectionFormVo); return getDataTable(list); @@ -81,8 +80,7 @@ public class BaseEvectionFormController extends BaseController @Log(title = "出差单", businessType = BusinessType.EXPORT) @PostMapping("/export") @ResponseBody - public AjaxResult export(BaseEvectionFormVo baseEvectionFormVo) - { + public AjaxResult export(BaseEvectionFormVo baseEvectionFormVo) throws Exception { List list = baseEvectionFormService.selectBaseEvectionFormList(baseEvectionFormVo); ExcelUtil util = new ExcelUtil(BaseEvectionFormVo.class); return util.exportExcel(list, "出差单数据"); @@ -166,6 +164,7 @@ public class BaseEvectionFormController extends BaseController if("submit".equals(instanceType)){ // 使用状态-是 baseEvectionFormVo.setUseStatus("1"); + baseEvectionFormVo.setPersonnelAdministration("0");//待录入 } // 作废 else if("cancel".equals(instanceType)){ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/BaseEvectionFormVo.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/BaseEvectionFormVo.java index 109da674..0f480c4a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/BaseEvectionFormVo.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/BaseEvectionFormVo.java @@ -16,6 +16,8 @@ public class BaseEvectionFormVo extends BaseEvectionForm { private String taskId; /** 任务名称 */ private String taskName; + // 当前状态 + private String taskStatus; /** 办理时间 */ private Date doneTime; /** 创建人 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseEvectionFormService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseEvectionFormService.java index 81530887..bcaf1e50 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseEvectionFormService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseEvectionFormService.java @@ -29,7 +29,7 @@ public interface IBaseEvectionFormService * @param baseEvectionForm 出差单 * @return 出差单集合 */ - public List selectBaseEvectionFormList(BaseEvectionForm baseEvectionForm); + public List selectBaseEvectionFormList(BaseEvectionForm baseEvectionForm) throws Exception; /** * 新增出差单 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseEvectionFormServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseEvectionFormServiceImpl.java index 9a4c842e..12a57568 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseEvectionFormServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseEvectionFormServiceImpl.java @@ -4,8 +4,11 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.stream.Collectors; import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.page.PageDomain; import com.ruoyi.common.core.page.TableSupport; @@ -19,6 +22,7 @@ import com.ruoyi.system.domain.BaseExpenseAccount; import com.ruoyi.system.domain.Vo.BaseEvectionFormVo; import com.ruoyi.system.domain.Vo.BaseExpenseAccountVo; import com.ruoyi.system.mapper.SysUserMapper; +import com.ruoyi.system.service.IBaseExpenseAccountService; import com.ruoyi.system.service.ISysRoleService; import org.activiti.engine.TaskService; import org.activiti.engine.impl.persistence.entity.TaskEntityImpl; @@ -64,6 +68,9 @@ public class BaseEvectionFormServiceImpl implements IBaseEvectionFormService @Autowired private ISysRoleService roleService; + @Autowired + private IBaseExpenseAccountService expenseAccountService; + /** * 查询出差单 * @@ -83,13 +90,25 @@ public class BaseEvectionFormServiceImpl implements IBaseEvectionFormService * @return 出差单 */ @Override - public List selectBaseEvectionFormList(BaseEvectionForm baseEvectionForm) - { + public List selectBaseEvectionFormList(BaseEvectionForm baseEvectionForm) throws Exception { + SysUser curUser = ShiroUtils.getSysUser(); + Long userId = curUser.getUserId(); + Set roleKeys = roleService.selectRoleKeys(userId); + List Volist = baseEvectionFormMapper.selectBaseEvectionFormList(baseEvectionForm); +// 获取当前登录名下可看用户列表 + Set users = expenseAccountService.userLimitedList(roleKeys,curUser); + + List matchedList = Volist.stream() + .filter(expenseAccount -> users.contains(expenseAccount.getApplyUser())) + .collect(Collectors.toList()); + PageDomain pageDomain = TableSupport.buildPageRequest(); Integer pageNum = pageDomain.getPageNum(); Integer pageSize = pageDomain.getPageSize(); + PageHelper.startPage(pageNum, pageSize); //PageHelper 仅对第一List分页有效 - Page list = (Page) baseEvectionFormMapper.selectBaseEvectionFormList(baseEvectionForm); + PageInfo pageInfo = new PageInfo<>(matchedList); + List list = pageInfo.getList(); Page returnList = new Page<>(); for(BaseEvectionFormVo baseEvectionFormVo : list){ SysUser sysUser = userMapper.selectUserByLoginName(baseEvectionFormVo.getCreateBy()); @@ -130,9 +149,15 @@ public class BaseEvectionFormServiceImpl implements IBaseEvectionFormService } else { baseEvectionFormVo.setTaskName("未启动"); } + baseEvectionFormVo.setTaskStatus(baseEvectionFormVo.getTaskName()); + if(baseEvectionFormVo.getAuditStatus()!=null && baseEvectionFormVo.getAuditStatus().equals("1")){ + baseEvectionFormVo.setTaskStatus("审核通过"); + }else if(baseEvectionFormVo.getAuditStatus()!=null && baseEvectionFormVo.getAuditStatus().equals("2")){ + baseEvectionFormVo.setTaskStatus("审核拒绝"); + } returnList.add(baseEvectionFormVo); } - returnList.setTotal(CollectionUtils.isEmpty(list) ? 0 : list.getTotal()); + returnList.setTotal(CollectionUtils.isEmpty(list) ? 0 : list.size()); returnList.setPageNum(pageNum); returnList.setPageSize(pageSize); return returnList; @@ -275,45 +300,67 @@ public class BaseEvectionFormServiceImpl implements IBaseEvectionFormService Set roleKeys = roleService.selectRoleKeys(user.getUserId()); variables.put("authority",1); - //判断请购人的角色,进入相应的逻辑,设置节点审批人变量 - if(roleKeys.contains("ywyRole") || roleKeys.contains("ywjlRole") || roleKeys.contains("ywzgRole")){ - // 业务经理 + variables.put("zgExist",false); + variables.put("jlExist",true); + variables.put("yfzjExist",false); + variables.put("fzjlExist",false); + //判断领料人的角色,进入相应的逻辑,设置节点审批人变量 + if(roleKeys.contains("ywyRole")){ + // 业务员/业务助理--->业务部经理 variables.put("ccjlRole","ywjlRole"); - // 业务主管 - variables.put("cczgRole","ywzgRole"); - }else if(roleKeys.contains("cgyRole") || roleKeys.contains("cgjlRole") || roleKeys.contains("cgzgRole")){ - // 采购经理 - variables.put("ccjlRole","cgjlRole"); - // 采购主管 - variables.put("cczgRole","cgzgRole"); - }else if (roleKeys.contains("gcwyRole") || roleKeys.contains("gcjlRole") || roleKeys.contains("gczgRole")){ - // 工程经理 + }else if(roleKeys.contains("jggcsRole")){ + //结构工程师--->工程经理--->研发总监 variables.put("ccjlRole","gcjlRole"); - // 工程主管 - variables.put("cczgRole","gczgRole"); - } else if (roleKeys.contains("scyRole") || roleKeys.contains("scjlRole") || roleKeys.contains("sczgRole")){ - // 生产经理 - variables.put("ccjlRole","scjlRoe"); - // 生产主管 - variables.put("cczgRole","sczgRole"); - }else if (roleKeys.contains("shgcsRole") || roleKeys.contains("shjlRole") || roleKeys.contains("shzgRole")){ - // 售后经理 + variables.put("yfzjExist",true); + }else if(roleKeys.contains("dqgcsRole")){ + //电气工程师--->电气主管--->研发总监 + variables.put("cczgRole","dqzgRole"); + variables.put("jlExist",false); + variables.put("yfzjExist",true); + }else if(roleKeys.contains("rjgcsRole")||roleKeys.contains("csgcsRole")||roleKeys.contains("gcwyRole") + ||roleKeys.contains("dqzgRole")||roleKeys.contains("gcjlRole")){ + //软件工程师/测试工程师/工程文员--->研发总监 + //电气主管 ---> 研发总监 + //工程经理 ---> 研发总监 + variables.put("jlExist",false); + variables.put("yfzjExist",true); + } else if(roleKeys.contains("cgyRole")){ + // 采购员--->副总经理 + variables.put("jlExist",false); + variables.put("fzjlExist",true); + }else if (roleKeys.contains("scyRole")){ + // 生产员--->生产经理 + variables.put("ccjlRole","scjlRole"); + }else if(roleKeys.contains("pzwyRole")||roleKeys.contains("iqczyRole")||roleKeys.contains("ipqczyRole")||roleKeys.contains("fqczyRole")){ + // IQC/IPQC/FQC/品质文员--->品质经理 + variables.put("ccjlRole","pzjlRole"); + }else if (roleKeys.contains("shgcsRole")){ + // 售后工程师--->售后主管--->售后经理 variables.put("ccjlRole","shjlRole"); - // 售后主管 - variables.put("cczgRole","shzgRole"); - }else if(roleKeys.contains("cgyyRole") || roleKeys.contains("ckzgRole")){ - variables.put("ccjlRole","shzgRole"); - // 售后主管 variables.put("cczgRole","shzgRole"); - }else if (roleKeys.contains("cwRole") || roleKeys.contains("cwjlRole")){ - variables.put("ccjlRole","cwjlRole"); - // 售后主管 - variables.put("cczgRole","cwJlRole"); - }else{ - variables.put("authority",2); + variables.put("zgExist",true); + }else if (roleKeys.contains("shzgRole")){ + // 售后主管--->售后经理 + variables.put("ccjlRole","shjlRole"); + } else if(roleKeys.contains("cgyyRole")){ + // 仓库文员--->仓库主管 + variables.put("cczgRole","ckzgRole"); + variables.put("zgExist",true); + variables.put("jlExist",false); + }else if(roleKeys.contains("hrzyRole")){ + // 人事助理/专员--->人事经理 + variables.put("ccjlRole","hrjlRole"); + }else if (roleKeys.contains("cwzyRole")){ + // 会计--->财务主管 + variables.put("cczgRole","cwzgRole"); + variables.put("zgExist",true); + variables.put("jlExist",false); } - if(roleKeys.contains("admin")){ - // 角色包含业务经理、采购经理、工程经理、生产经理 + if(roleKeys.contains("admin")||roleKeys.contains("ywjlRole")||roleKeys.contains("yfzjRole") + ||roleKeys.contains("fzjlRole")||roleKeys.contains("scjlRole")||roleKeys.contains("pzjlRole") + ||roleKeys.contains("shjlRole")||roleKeys.contains("ckzgRole")||roleKeys.contains("hrjlRole") + ||roleKeys.contains("cwzgRole")||roleKeys.contains("zjlRole")||roleKeys.contains("zozjRole")){ + // 角色包含业务经理、研发总监、生产经理、品质经理、售后经理、仓库主管、人事经理、财务主管、副总经理、总经理、总经总助、admin variables.put("authority",2); } } diff --git a/ruoyi-admin/src/main/resources/templates/system/baseEvectionForm/add.html b/ruoyi-admin/src/main/resources/templates/system/baseEvectionForm/add.html index 94ded6b3..cc4847d5 100644 --- a/ruoyi-admin/src/main/resources/templates/system/baseEvectionForm/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/baseEvectionForm/add.html @@ -8,128 +8,80 @@
- +
- +
- +
- +
- +
- +
- +
- +
- + - - +
- +
- +
- -
- + +
+
- -
- + +
+
- +
- +
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
- - - - - - - - - - - - -
- -
- -
-
-
- +
@@ -140,13 +92,38 @@ \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/baseEvectionForm/hrRecord.html b/ruoyi-admin/src/main/resources/templates/system/baseEvectionForm/hrRecord.html new file mode 100644 index 00000000..a80c7031 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/baseEvectionForm/hrRecord.html @@ -0,0 +1,182 @@ + + + + + + + +
+ + + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + + - + + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+

人事行政

+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + + - + + +
+
+
+ +
+ + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/baseEvectionForm/taskCcjlVerify.html b/ruoyi-admin/src/main/resources/templates/system/baseEvectionForm/taskCcjlVerify.html index e9de922f..c472d88f 100644 --- a/ruoyi-admin/src/main/resources/templates/system/baseEvectionForm/taskCcjlVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/baseEvectionForm/taskCcjlVerify.html @@ -15,59 +15,59 @@
- +
- +
- +
- +
- +
- +
- +
- + - - +
@@ -75,13 +75,13 @@
- +
- +
diff --git a/ruoyi-admin/src/main/resources/templates/system/baseEvectionForm/taskYfzjVerify.html b/ruoyi-admin/src/main/resources/templates/system/baseEvectionForm/taskYfzjVerify.html new file mode 100644 index 00000000..0a4d4190 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/baseEvectionForm/taskYfzjVerify.html @@ -0,0 +1,134 @@ + + + + + + + +
+
+ + + + + + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + + - + + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + + + \ No newline at end of file