Commit c10054005f21ac922165af5b6e109d684b477bb3

Authored by chenhang4442024
1 parent b498609e

feat:生产科角色对于订单的可见范围

src/main/java/com/order/erp/controller/ReceiveEmailMappingController.java
1 package com.order.erp.controller; 1 package com.order.erp.controller;
2 2
  3 +import com.order.erp.common.annotation.AnonymousAccess;
3 import com.order.erp.common.constant.ServerResult; 4 import com.order.erp.common.constant.ServerResult;
4 import com.order.erp.domain.dto.order.ReceiveEmailMappingDO; 5 import com.order.erp.domain.dto.order.ReceiveEmailMappingDO;
5 import com.order.erp.domain.vo.order.ReceiveEmailMappingQueryVO; 6 import com.order.erp.domain.vo.order.ReceiveEmailMappingQueryVO;
@@ -34,6 +35,7 @@ public class ReceiveEmailMappingController { @@ -34,6 +35,7 @@ public class ReceiveEmailMappingController {
34 * @return 查询结果 35 * @return 查询结果
35 */ 36 */
36 @PostMapping("/list") 37 @PostMapping("/list")
  38 + @AnonymousAccess
37 public ServerResult list() { 39 public ServerResult list() {
38 return receiveEmailMappingService.listGetAll(); 40 return receiveEmailMappingService.listGetAll();
39 } 41 }
@@ -46,6 +48,7 @@ public class ReceiveEmailMappingController { @@ -46,6 +48,7 @@ public class ReceiveEmailMappingController {
46 * @return 新增结果 48 * @return 新增结果
47 */ 49 */
48 @PostMapping("/add") 50 @PostMapping("/add")
  51 + @AnonymousAccess
49 public ServerResult add(@RequestBody ReceiveEmailMappingVO receiveEmailMappingVO) { 52 public ServerResult add(@RequestBody ReceiveEmailMappingVO receiveEmailMappingVO) {
50 return receiveEmailMappingService.add(receiveEmailMappingVO); 53 return receiveEmailMappingService.add(receiveEmailMappingVO);
51 } 54 }
@@ -57,6 +60,7 @@ public class ReceiveEmailMappingController { @@ -57,6 +60,7 @@ public class ReceiveEmailMappingController {
57 * @return 编辑结果 60 * @return 编辑结果
58 */ 61 */
59 @PostMapping("/edit") 62 @PostMapping("/edit")
  63 + @AnonymousAccess
60 public ServerResult edit(@RequestBody ReceiveEmailMappingVO receiveEmailMappingVO) { 64 public ServerResult edit(@RequestBody ReceiveEmailMappingVO receiveEmailMappingVO) {
61 return receiveEmailMappingService.edit(receiveEmailMappingVO); 65 return receiveEmailMappingService.edit(receiveEmailMappingVO);
62 } 66 }
@@ -68,6 +72,7 @@ public class ReceiveEmailMappingController { @@ -68,6 +72,7 @@ public class ReceiveEmailMappingController {
68 * @return 删除是否成功 72 * @return 删除是否成功
69 */ 73 */
70 @PostMapping("/delete_by_id") 74 @PostMapping("/delete_by_id")
  75 + @AnonymousAccess
71 public ServerResult deleteById(@RequestBody ReceiveEmailMappingVO receiveEmailMappingVO) { 76 public ServerResult deleteById(@RequestBody ReceiveEmailMappingVO receiveEmailMappingVO) {
72 return receiveEmailMappingService.deleteById(receiveEmailMappingVO); 77 return receiveEmailMappingService.deleteById(receiveEmailMappingVO);
73 } 78 }
@@ -78,6 +83,7 @@ public class ReceiveEmailMappingController { @@ -78,6 +83,7 @@ public class ReceiveEmailMappingController {
78 * @return 实例对象 83 * @return 实例对象
79 */ 84 */
80 @PostMapping("/query_by_id") 85 @PostMapping("/query_by_id")
  86 + @AnonymousAccess
81 public ServerResult queryById(@RequestBody ReceiveEmailMappingQueryVO receiveEmailMappingQueryVO) { 87 public ServerResult queryById(@RequestBody ReceiveEmailMappingQueryVO receiveEmailMappingQueryVO) {
82 return receiveEmailMappingService.queryById(receiveEmailMappingQueryVO); 88 return receiveEmailMappingService.queryById(receiveEmailMappingQueryVO);
83 } 89 }
@@ -89,6 +95,7 @@ public class ReceiveEmailMappingController { @@ -89,6 +95,7 @@ public class ReceiveEmailMappingController {
89 * @return 操作结果 95 * @return 操作结果
90 */ 96 */
91 @PostMapping("/opt") 97 @PostMapping("/opt")
  98 + @AnonymousAccess
92 public ServerResult opt(@RequestBody ReceiveEmailMappingDO receiveEmailMappingDo) { 99 public ServerResult opt(@RequestBody ReceiveEmailMappingDO receiveEmailMappingDo) {
93 return receiveEmailMappingService.opt(receiveEmailMappingDo); 100 return receiveEmailMappingService.opt(receiveEmailMappingDo);
94 } 101 }
src/main/java/com/order/erp/service/order/impl/OrderBaseInfoServiceImpl.java
@@ -1282,6 +1282,10 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O @@ -1282,6 +1282,10 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O
1282 if (Objects.nonNull(roleEnum) && roleEnum.getId().equals(RoleEnum.BUSINESS_USER.getId())) { 1282 if (Objects.nonNull(roleEnum) && roleEnum.getId().equals(RoleEnum.BUSINESS_USER.getId())) {
1283 queryVO.setBusinessPerson(Arrays.asList(dataScope.getUser().getNickName())); 1283 queryVO.setBusinessPerson(Arrays.asList(dataScope.getUser().getNickName()));
1284 } 1284 }
  1285 + // 生产科
  1286 + if(Objects.nonNull(roleEnum) && roleEnum.getId().equals(RoleEnum.PRODUCE_USER.getId())){
  1287 + queryVO.setProductionDepartment(Arrays.asList(dataScope.getUser().getNickName()));
  1288 + }
1285 if (StringUtils.isNotBlank(queryVO.getCommitUserPhone())) { 1289 if (StringUtils.isNotBlank(queryVO.getCommitUserPhone())) {
1286 AdminUserDO userDO = userService.getOne(new LambdaQueryWrapper<AdminUserDO>() 1290 AdminUserDO userDO = userService.getOne(new LambdaQueryWrapper<AdminUserDO>()
1287 .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) 1291 .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN)