Procházet zdrojové kódy

财务-账户列表

yangzian před 4 roky
rodič
revize
1fbf6880c8

+ 1 - 1
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/policy/controller/CwjsSaleAssistantInfoController.java

@@ -204,7 +204,7 @@ public class CwjsSaleAssistantInfoController {
 
 
 
-	 @ApiOperation(value="政策新增-销售回显下拉框", notes="政策新增-销售回显下拉框")
+	 @ApiOperation(value="政策-筛选广告主", notes="政策-筛选广告主")
 	 @GetMapping(value = "/cwjsParticipateList")
 	 public Result cwjsParticipateList(@RequestBody ProjectMember projectMember) {
 		 return  cwjsSaleAssistantInfoService.cwjsParticipateList(projectMember);

+ 5 - 1
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/policy/service/impl/CwjsSaleAssistantInfoServiceImpl.java

@@ -82,7 +82,11 @@ public class CwjsSaleAssistantInfoServiceImpl extends ServiceImpl<CwjsSaleAssist
     }
 
 
-
+    /**
+     * 获取销售和助理的对应关系
+     * @param userId
+     * @return 人员id
+     */
     @Override
     public List<String> getCwSaleAndAssistantListStr(String userId) {
         List<CwjsSaleAssistantInfo> list = getCwSaleAndAssistantList(userId);

+ 17 - 15
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/controller/SettlementController.java

@@ -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);
     }
 

+ 1 - 1
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/mapper/xml/SettlementInfoMapper.xml

@@ -53,7 +53,7 @@
             <if test="endTime !=null and endTime != ''">
                 AND DATE_FORMAT(create_time,'%Y-%m-%d') &lt;= #{endTime}
             </if>
-            <if test="userIds !=null and userIds != ''">
+            <if test="userIds !=null and userIds.size() > 0">
                 AND create_user_id in
               <foreach collection="userIds" item="item" separator=","
                        open="(" close=")">