|
@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.ctop.finance.policy.service.impl.CwjsPolicyInfoServiceImpl;
|
|
|
+import org.jeecg.ctop.finance.policy.service.impl.CwjsSaleAssistantInfoServiceImpl;
|
|
|
+import org.jeecg.ctop.finance.policy.utils.Check;
|
|
|
import org.jeecg.ctop.finance.settlement.entity.pojo.CtopCwjsSettlementInfo;
|
|
|
|
|
|
|
|
@@ -14,10 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
-import java.util.HashSet;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Set;
|
|
|
+import java.util.*;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -40,6 +39,10 @@ public class SettlementController {
|
|
|
@Autowired
|
|
|
private IMaterialReportOverViewService materialReportOverViewService;
|
|
|
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private CwjsSaleAssistantInfoServiceImpl cwjsSaleAssistantInfoService;
|
|
|
+
|
|
|
@ApiOperation(value="财务结算-账户列表查询", notes="财务结算-账户列表查询")
|
|
|
@GetMapping(value = "/getSettlementList")
|
|
|
public Result getSettlementList(CtopCwjsSettlementInfo settlementInfo,
|
|
@@ -47,18 +50,17 @@ public class SettlementController {
|
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
|
|
|
//查询用户角色
|
|
|
String roleCode = sysRoleService.getRoleCodeByUserId(settlementInfo.getCreateUserId());
|
|
|
- //普通用户
|
|
|
- settlementInfo.setUserIds(new HashSet<String>(){{
|
|
|
- add(settlementInfo.getCreateUserId());
|
|
|
- }});
|
|
|
- if ("admin".equals(roleCode)){
|
|
|
- settlementInfo.setUserIds(null);
|
|
|
- //销售总监
|
|
|
- }else if ("saleDirector".equals(roleCode)){
|
|
|
- //查询所有包含自己的下级
|
|
|
- Set<String> subordinates= materialReportOverViewService.recursiveQuerySubordinate(settlementInfo.getCreateUserId());
|
|
|
- settlementInfo.setUserIds(subordinates);
|
|
|
+ //查询所有包含自己的下级
|
|
|
+ //Set<String> subordinates= materialReportOverViewService.recursiveQuerySubordinate(settlementInfo.getCreateUserId());
|
|
|
+ List<String> userIds = new ArrayList<>();
|
|
|
+ if (!"admin".equals(roleCode)){
|
|
|
+ //查询 销售及助理 关联对应的人员
|
|
|
+ userIds = cwjsSaleAssistantInfoService.getCwSaleAndAssistantListStr(settlementInfo.getCreateUserId());
|
|
|
+ if (Check.isNull(userIds)){
|
|
|
+ return Result.errorMsg("该用户暂无数据。");
|
|
|
+ }
|
|
|
}
|
|
|
+ settlementInfo.setUserIds(new HashSet<>(userIds));
|
|
|
return settlementInfoService.getSettlementList(settlementInfo,pageNo,pageSize);
|
|
|
}
|
|
|
|