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