diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/CategoryController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/CategoryController.java new file mode 100644 index 00000000..948207e5 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/CategoryController.java @@ -0,0 +1,25 @@ +package com.ruoyi.system; + +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.framework.web.service.CategoryService; +import com.ruoyi.system.domain.SysCategory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.List; +import java.util.Map; + + +@Controller +@RequestMapping("/system/category") +public class CategoryController extends BaseController { + @Autowired + private CategoryService categoryService; + @RequestMapping("getChildCode") + @ResponseBody + public List getChildCode(String code) { + return categoryService.getChildByCode(code); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseExpenseAccountController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseExpenseAccountController.java index 2c0fae8e..5473c0d6 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseExpenseAccountController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseExpenseAccountController.java @@ -5,11 +5,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.system.domain.BaseExpenseAccount; @@ -84,7 +80,7 @@ public class BaseExpenseAccountController extends BaseController @Log(title = "报销单", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody - public AjaxResult addSave(BaseExpenseAccount baseExpenseAccount) + public AjaxResult addSave(@RequestBody BaseExpenseAccount baseExpenseAccount) { return toAjax(baseExpenseAccountService.insertBaseExpenseAccount(baseExpenseAccount)); } @@ -107,7 +103,7 @@ public class BaseExpenseAccountController extends BaseController @Log(title = "报销单", businessType = BusinessType.UPDATE) @PostMapping("/edit") @ResponseBody - public AjaxResult editSave(BaseExpenseAccount baseExpenseAccount) + public AjaxResult editSave(@RequestBody BaseExpenseAccount baseExpenseAccount) { return toAjax(baseExpenseAccountService.updateBaseExpenseAccount(baseExpenseAccount)); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java index 55169ac4..4a5154bb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java @@ -38,6 +38,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Set; +import java.util.stream.Collectors; /** * 客户报价信息Controller @@ -68,6 +69,8 @@ public class SysCustomerQuoteController extends BaseController @Autowired private RuntimeService runtimeService; + @Autowired + private ISysUserService sysUserService; @Autowired private IProcessService processService; @@ -90,16 +93,33 @@ public class SysCustomerQuoteController extends BaseController @ResponseBody public TableDataInfo list(SysCustomerQuoteVo sysCustomerQuoteVo) { - SysUser curUser = ShiroUtils.getSysUser(); - Long userId = curUser.getUserId(); - Set roleKeys = roleService.selectRoleKeys(userId); - // 业务员角色只能看到自己创建的数据 - if(roleKeys.contains("ywyRole")){ - sysCustomerQuoteVo.setCreateBy(curUser.getLoginName()); + try { + SysUser curUser = ShiroUtils.getSysUser(); + Long userId = curUser.getUserId(); + Set roleKeys = roleService.selectRoleKeys(userId); + startPage(); + List list = sysCustomerQuoteService.selectSysCustomerQuoteList(sysCustomerQuoteVo); + String loginName = ShiroUtils.getLoginName(); + List sysUserlist = sysUserService.selectRoleToUserList("ywyRole"); + sysUserlist.add(curUser); + if (roleKeys.contains("ywjlRole")) { + List findUser = sysUserlist.stream().filter(item -> (item.getDeptId().equals(curUser.getDeptId()))).collect(Collectors.toList()); + Set user = findUser.stream().map(SysUser::getLoginName).collect(Collectors.toSet()); + startPage(); + List list2 = list.stream().filter(item -> user.contains(item.getApplyUser())).collect(Collectors.toList()); + return getDataTable(list2); + } + // 业务员角色只能看到自己创建的数据 + if (roleKeys.contains("ywyRole")) { + sysCustomerQuoteVo.setApplyUser(curUser.getLoginName()); + startPage(); + List list2 = sysCustomerQuoteService.selectSysCustomerQuoteList(sysCustomerQuoteVo); + return getDataTable(list2); + } + return getDataTable(list); + }catch(NullPointerException e){ + throw new NullPointerException("当前用户没有申请客户报价信息"); } - startPage(); - List list = sysCustomerQuoteService.selectSysCustomerQuoteList(sysCustomerQuoteVo); - return getDataTable(list); } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java index 0effb596..3b512cf2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java @@ -25,6 +25,7 @@ import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.system.domain.*; import com.ruoyi.system.domain.exportDto.SysSalesFinishDto; import com.ruoyi.system.domain.exportDto.SysSalesOrderDto; +import com.ruoyi.system.mapper.SysSalesOrderMapper; import com.ruoyi.system.service.*; import org.activiti.engine.RuntimeService; import org.activiti.engine.TaskService; @@ -85,6 +86,9 @@ public class SysSalesOrderController extends BaseController @Autowired private ISysMakeOrderService sysMakeOrderService; + @Autowired + private SysSalesOrderMapper sysSalesOrderMapper; + @RequiresPermissions("system:salesOrder:view") @GetMapping() public String salesOrder(ModelMap mmap) @@ -110,6 +114,14 @@ public class SysSalesOrderController extends BaseController Set roleKeys = roleService.selectRoleKeys(userId); List sysUserlist = sysUserService.selectRoleToUserList("ywyRole"); sysUserlist.add(curUser); + if (curUser.getUserName().contains("admin")) { + SysSalesOrderVo sysSalesOrderVo2 = new SysSalesOrderVo(); + startPage(); + List list2 = sysSalesOrderService.selectSysSalesOrderList(sysSalesOrderVo2); + return getDataTable(list2); + } + //如果主管审批,查看当前自己部门的审核 + //如果经理审计需要查询自己部门下所有业务员的提交的订单,以及自身的提交的订单 if (roleKeys.contains("ywjlRole")) { List findUser = sysUserlist.stream().filter(item -> (item.getDeptId().equals(curUser.getDeptId()))).collect(Collectors.toList()); Set user = findUser.stream().map(SysUser::getLoginName).collect(Collectors.toSet()); @@ -117,12 +129,12 @@ public class SysSalesOrderController extends BaseController List list2 = list.stream().filter(item -> user.contains(item.getApplyUser())).collect(Collectors.toList()); return getDataTable(list2); } - // 业务员角色只能看到自己创建的数据 + // 业务员角色只能看到自己创建的数据 if (roleKeys.contains("ywyRole")) { - sysSalesOrderVo.setApplyUser(curUser.getUserName()); + sysSalesOrderVo.setApplyUser(curUser.getLoginName()); startPage(); - list = sysSalesOrderService.selectSysSalesOrderList(sysSalesOrderVo); - return getDataTable(list); + List list2 = sysSalesOrderService.selectSysSalesOrderList(sysSalesOrderVo); + return getDataTable(list2); } return getDataTable(list); }catch(NullPointerException e){ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExpenseAccount.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExpenseAccount.java index 93987c47..bedd7f70 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExpenseAccount.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExpenseAccount.java @@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; +import java.util.List; + /** * 报销单对象 base_emp_expense_account * @@ -80,6 +82,16 @@ public class BaseExpenseAccount extends BaseEntity private String del_flag; + private List expenseAccountChildList; + + public List getExpenseAccountChildList() { + return expenseAccountChildList; + } + + public void setExpenseAccountChildList(List expenseAccountChildList) { + this.expenseAccountChildList = expenseAccountChildList; + } + public String getDel_flag() { return del_flag; } diff --git a/ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountMapper.xml index 3ddc8565..13b44b1e 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountMapper.xml @@ -55,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - insert into base_emp_expense_account + insert into base_expense_account audit_status, manager_audit_status, @@ -103,7 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - update base_emp_expense_account + update base_expense_account audit_status = #{auditStatus}, manager_audit_status = #{managerAuditStatus}, @@ -130,22 +130,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from base_emp_expense_account where expense_id = #{expenseId} + delete from base_expense_account where expense_id = #{expenseId} - delete from base_emp_expense_account where expense_id in + delete from base_expense_account where expense_id in #{expenseId} - update base_emp_expense_account set del_flag = '1' where expense_id = #{expenseId} + update base_expense_account set del_flag = '1' where expense_id = #{expenseId} - update base_emp_expense_account set del_flag = '0' where expense_id = #{expenseId} + update base_expense_account set del_flag = '0' where expense_id = #{expenseId} \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/baseExpense/add.html b/ruoyi-admin/src/main/resources/templates/system/baseExpense/add.html index bfa9b111..c15ed92d 100644 --- a/ruoyi-admin/src/main/resources/templates/system/baseExpense/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/baseExpense/add.html @@ -90,12 +90,15 @@ \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/baseExpense/baseExpense.html b/ruoyi-admin/src/main/resources/templates/system/baseExpense/baseExpense.html index a7dfff00..35d9636c 100644 --- a/ruoyi-admin/src/main/resources/templates/system/baseExpense/baseExpense.html +++ b/ruoyi-admin/src/main/resources/templates/system/baseExpense/baseExpense.html @@ -54,13 +54,14 @@
  • - +
  • -
  • @@ -99,13 +100,14 @@ \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/baseExpenseChild/baseExpenseChild.html b/ruoyi-admin/src/main/resources/templates/system/baseExpenseChild/baseExpenseChild.html index 4022b236..807a99b6 100644 --- a/ruoyi-admin/src/main/resources/templates/system/baseExpenseChild/baseExpenseChild.html +++ b/ruoyi-admin/src/main/resources/templates/system/baseExpenseChild/baseExpenseChild.html @@ -17,8 +17,7 @@
  • @@ -92,69 +91,33 @@ restoreUrl: prefix + "/restore/{id}", exportUrl: prefix + "/export", modalName: "报销单分类子", - columns: [{ - checkbox: true - }, - { - title: '报销单分项子表', - field: 'expenseChildId', - visible: false - }, - { - title: '关联报销单号', - field: 'quoteId', - }, - { - title: '成本类型', - field: 'cost type', - }, - { - title: '成本小类', - field: 'costSmallType', - }, - { - title: '用途', - field: 'purpose', - }, - { - title: '金额', - field: 'amounts', - }, - { - title: '报销时间', - field: 'expenseTime', - }, - { - title: '出差单号', - field: 'evectionCode', - }, - { - title: '采购单号', - field: 'purcahseCode', - }, - { - title: '委外单号', - field: 'outsourceCode', - }, - { - title: '备注', - field: 'remark', - }, - { - title: '操作', - align: 'center', - formatter: function(value, row, index) { - var actions = []; - actions.push('编辑 '); - actions.push('删除 '); - if(row.delFlag == '0'){ - actions.push('作废 '); - }else{ - actions.push('恢复 '); + columns: [ + {checkbox: true}, + {title: '报销单分项子表',field: 'expenseChildId',visible: false}, + {title: '关联报销单号',field: 'quoteId',}, + {title: '成本类型',field: 'cosType',}, + {title: '成本小类',field: 'costSmallType',}, + {title: '用途',field: 'purpose',}, + {title: '金额',field: 'amounts',}, + {title: '报销时间',field: 'expenseTime',}, + {title: '出差单号',field: 'evectionCode',}, + {title: '采购单号',field: 'purcahseCode',}, + {title: '委外单号',field: 'outsourceCode',}, + {title: '备注',field: 'remark',}, + {title: '操作',align: 'center', + formatter: function(value, row, index) { + var actions = []; + actions.push('编辑 '); + actions.push('删除 '); + if(row.delFlag == '0'){ + actions.push('作废 '); + }else{ + actions.push('恢复 '); + } + return actions.join(''); } - return actions.join(''); } - }] + ] }; $.table.init(options); });