|
@@ -13,7 +13,10 @@ import com.lframework.starter.mq.core.service.MqProducerService; |
|
@@ -13,7 +13,10 @@ import com.lframework.starter.mq.core.service.MqProducerService; |
|
13
|
import com.lframework.starter.web.core.components.security.SecurityUtil;
|
13
|
import com.lframework.starter.web.core.components.security.SecurityUtil;
|
|
14
|
import com.lframework.starter.web.inner.dto.message.SysSiteMessageDto;
|
14
|
import com.lframework.starter.web.inner.dto.message.SysSiteMessageDto;
|
|
15
|
import com.lframework.starter.web.inner.entity.SysDataDicItem;
|
15
|
import com.lframework.starter.web.inner.entity.SysDataDicItem;
|
|
|
|
16
|
+import com.lframework.starter.web.inner.entity.SysRole;
|
|
16
|
import com.lframework.starter.web.inner.service.system.SysDataDicItemService;
|
17
|
import com.lframework.starter.web.inner.service.system.SysDataDicItemService;
|
|
|
|
18
|
+import com.lframework.starter.web.inner.service.system.SysRoleService;
|
|
|
|
19
|
+import com.lframework.starter.web.inner.service.system.SysUserDeptService;
|
|
17
|
import com.lframework.starter.web.inner.service.system.SysUserRoleService;
|
20
|
import com.lframework.starter.web.inner.service.system.SysUserRoleService;
|
|
18
|
import com.lframework.xingyun.basedata.entity.Workshop;
|
21
|
import com.lframework.xingyun.basedata.entity.Workshop;
|
|
19
|
import com.lframework.xingyun.basedata.service.workshop.WorkshopService;
|
22
|
import com.lframework.xingyun.basedata.service.workshop.WorkshopService;
|
|
@@ -72,6 +75,9 @@ public class ContractDistributorStandardServiceImpl extends |
|
@@ -72,6 +75,9 @@ public class ContractDistributorStandardServiceImpl extends |
|
72
|
private static final String FORMAL_FLAG = "FORMAL_CONTRACT"; // 正式合同审批
|
75
|
private static final String FORMAL_FLAG = "FORMAL_CONTRACT"; // 正式合同审批
|
|
73
|
private static final String STANDARD_FLAG = "STANDARD_CONTRACT"; // 标准合同审批
|
76
|
private static final String STANDARD_FLAG = "STANDARD_CONTRACT"; // 标准合同审批
|
|
74
|
|
77
|
|
|
|
|
78
|
+ private static final String YWY_ROLE_CODE = "ywy"; // 业务员角色
|
|
|
|
79
|
+ private static final String QYFZR_ROLE_CODE = "qyfzr"; // 区域负责人角色
|
|
|
|
80
|
+
|
|
75
|
@Autowired
|
81
|
@Autowired
|
|
76
|
private ContractDistributorLineService contractDistributorLineService;
|
82
|
private ContractDistributorLineService contractDistributorLineService;
|
|
77
|
@Autowired
|
83
|
@Autowired
|
|
@@ -92,6 +98,10 @@ public class ContractDistributorStandardServiceImpl extends |
|
@@ -92,6 +98,10 @@ public class ContractDistributorStandardServiceImpl extends |
|
92
|
private WorkshopService workshopService;
|
98
|
private WorkshopService workshopService;
|
|
93
|
@Autowired
|
99
|
@Autowired
|
|
94
|
private MqProducerService mqProducerService;
|
100
|
private MqProducerService mqProducerService;
|
|
|
|
101
|
+ @Resource
|
|
|
|
102
|
+ private SysRoleService sysRoleService;
|
|
|
|
103
|
+ @Resource
|
|
|
|
104
|
+ private SysUserDeptService sysUserDeptService;
|
|
95
|
|
105
|
|
|
96
|
@Override
|
106
|
@Override
|
|
97
|
public PageResult<ContractDistributorStandard> query(Integer pageIndex, Integer pageSize, QueryContractDistributorStandardVo vo) {
|
107
|
public PageResult<ContractDistributorStandard> query(Integer pageIndex, Integer pageSize, QueryContractDistributorStandardVo vo) {
|
|
@@ -99,14 +109,30 @@ public class ContractDistributorStandardServiceImpl extends |
|
@@ -99,14 +109,30 @@ public class ContractDistributorStandardServiceImpl extends |
|
99
|
Assert.greaterThanZero(pageIndex);
|
109
|
Assert.greaterThanZero(pageIndex);
|
|
100
|
Assert.greaterThanZero(pageSize);
|
110
|
Assert.greaterThanZero(pageSize);
|
|
101
|
|
111
|
|
|
|
|
112
|
+ // 获取当前人员的待办任务数据
|
|
|
|
113
|
+ List<FlowTaskDto> flowTaskList = flowTaskWrapperMapper.queryTodoList(new QueryTodoTaskListVo(), SecurityUtil.getCurrentUser().getId());
|
|
|
|
114
|
+ if (!"DELETED".equals(vo.getStatus())) { // 不为删除状态,则根据角色查询不同的数据
|
|
|
|
115
|
+ String userId = SecurityUtil.getCurrentUser().getId();
|
|
|
|
116
|
+ List<SysRole> sysRoleList = sysRoleService.getByUserId(userId);
|
|
|
|
117
|
+ String roleCodeStr = CollectionUtils.emptyIfNull(sysRoleList).stream().map(SysRole::getCode).collect(Collectors.joining(","));
|
|
|
|
118
|
+ if (StringUtils.isNotBlank(roleCodeStr) && roleCodeStr.equals(YWY_ROLE_CODE)) { // 业务员只查询自己的数据
|
|
|
|
119
|
+ vo.setCreateById(userId);
|
|
|
|
120
|
+ } else {
|
|
|
|
121
|
+ Map<String, List<String>> userIdMap = sysUserDeptService.mapAllUserByUserId(Collections.singletonList(userId), true);
|
|
|
|
122
|
+ vo.setCreateByIdList(userIdMap.get(userId));
|
|
|
|
123
|
+ vo.getCreateByIdList().add(userId);
|
|
|
|
124
|
+ }
|
|
|
|
125
|
+
|
|
|
|
126
|
+ List<String> contractIdList = CollectionUtils.emptyIfNull(flowTaskList).stream().map(FlowTaskDto::getBusinessId).collect(Collectors.toList());
|
|
|
|
127
|
+ vo.setContractIdList(contractIdList);
|
|
|
|
128
|
+ }
|
|
|
|
129
|
+
|
|
102
|
PageHelperUtil.startPage(pageIndex, pageSize);
|
130
|
PageHelperUtil.startPage(pageIndex, pageSize);
|
|
103
|
List<ContractDistributorStandard> datas = this.query(vo);
|
131
|
List<ContractDistributorStandard> datas = this.query(vo);
|
|
104
|
if (CollectionUtils.isEmpty(datas)) {
|
132
|
if (CollectionUtils.isEmpty(datas)) {
|
|
105
|
return PageResultUtil.convert(new PageInfo<>(datas));
|
133
|
return PageResultUtil.convert(new PageInfo<>(datas));
|
|
106
|
}
|
134
|
}
|
|
107
|
|
135
|
|
|
108
|
- // 获取当前人员的待办任务数据
|
|
|
|
109
|
- List<FlowTaskDto> flowTaskList = flowTaskWrapperMapper.queryTodoList(new QueryTodoTaskListVo(), SecurityUtil.getCurrentUser().getId());
|
|
|
|
110
|
if (CollectionUtils.isEmpty(flowTaskList)) {
|
136
|
if (CollectionUtils.isEmpty(flowTaskList)) {
|
|
111
|
return PageResultUtil.convert(new PageInfo<>(datas));
|
137
|
return PageResultUtil.convert(new PageInfo<>(datas));
|
|
112
|
}
|
138
|
}
|