Преглед изворни кода

Merge remote-tracking branch 'origin/test' into test

Qchen пре 1 година
родитељ
комит
823fa28729
27 измењених фајлова са 380 додато и 118 уклоњено
  1. 0 12
      src/main/java/com/ydtech/modules/admin/controller/SysChannelGradeController.java
  2. 2 2
      src/main/java/com/ydtech/modules/admin/controller/SysUserAccountController.java
  3. 1 1
      src/main/java/com/ydtech/modules/admin/dao/SysUserAccountMapper.java
  4. 2 0
      src/main/java/com/ydtech/modules/admin/dao/SysUserMapper.java
  5. 6 0
      src/main/java/com/ydtech/modules/admin/model/dto/SysGeographyPositionDto.java
  6. 5 0
      src/main/java/com/ydtech/modules/admin/model/po/SysUserAccount.java
  7. 6 0
      src/main/java/com/ydtech/modules/admin/model/vo/BusinessAgentData.java
  8. 2 0
      src/main/java/com/ydtech/modules/admin/model/vo/SysMenuRecordVo.java
  9. 0 15
      src/main/java/com/ydtech/modules/admin/service/SysChannelGradeService.java
  10. 1 1
      src/main/java/com/ydtech/modules/admin/service/SysUserAccountService.java
  11. 0 8
      src/main/java/com/ydtech/modules/admin/service/impl/SysChannelCostServiceImpl.java
  12. 0 20
      src/main/java/com/ydtech/modules/admin/service/impl/SysChannelGradeServiceImpl.java
  13. 43 2
      src/main/java/com/ydtech/modules/admin/service/impl/SysDeptServiceImpl.java
  14. 158 28
      src/main/java/com/ydtech/modules/admin/service/impl/SysGeographyPositionServiceImpl.java
  15. 39 1
      src/main/java/com/ydtech/modules/admin/service/impl/SysMenuRecordServiceImpl.java
  16. 2 1
      src/main/java/com/ydtech/modules/admin/service/impl/SysPcAddressServiceImpl.java
  17. 44 16
      src/main/java/com/ydtech/modules/admin/service/impl/SysUserAccountServiceImpl.java
  18. 40 1
      src/main/java/com/ydtech/modules/admin/service/impl/TaskStatisticsServiceImpl.java
  19. 2 3
      src/main/java/com/ydtech/modules/admin/utils/KztGetDeptUtils.java
  20. 1 1
      src/main/java/com/ydtech/modules/ins/model/vo/CarInfoVo.java
  21. 1 1
      src/main/java/com/ydtech/modules/order/entity/InsOrders.java
  22. 3 1
      src/main/java/com/ydtech/modules/order/entity/vo/OrderQueryVo.java
  23. 1 0
      src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java
  24. 6 1
      src/main/resources/mapper/modules/admin/SysUserAccountMapper.xml
  25. 12 1
      src/main/resources/mapper/modules/admin/SysUserMapper.xml
  26. 2 1
      src/main/resources/mapper/modules/admin/TaskStatisticsMapper.xml
  27. 1 1
      src/main/resources/mapper/modules/order/InsOrdersMapper.xml

+ 0 - 12
src/main/java/com/ydtech/modules/admin/controller/SysChannelGradeController.java

@@ -40,11 +40,6 @@ public class SysChannelGradeController  extends BaseController {
         return HttpResult.ok(sysChannelGradeService.queryList());
     }
 
-    @PostMapping(value = "/queryRelationList/{id}")
-    @ApiOperation(value = "获取关联机构列表")
-    public HttpResult<Object> queryRelationList(@PathVariable Long id){
-        return HttpResult.ok(sysChannelGradeService.queryRelationList(id));
-    }
 
     @PostMapping(value = "/queryRelation")
     @ApiOperation(value = "获取关联机构列表")
@@ -110,13 +105,6 @@ public class SysChannelGradeController  extends BaseController {
         return HttpResult.ok("删除成功");
     }
 
-    @DeleteMapping("/deleteAuth")
-    @ApiOperation("删除分组授权机构")
-    public HttpResult deleteAuth(@RequestBody AuthSysChannelGradeVo authSysChannelGradeVo) {
-        sysChannelGradeService.deleteAuth(authSysChannelGradeVo);
-        return HttpResult.ok("删除成功");
-    }
-
     @PostMapping("/grade/authorized")
     @ApiOperation("渠道分组授权机构")
     public HttpResult authorized(@RequestBody @Valid AuthSysChannelGradeVo authSysChannelGradeVo) {

+ 2 - 2
src/main/java/com/ydtech/modules/admin/controller/SysUserAccountController.java

@@ -46,8 +46,8 @@ public class SysUserAccountController extends BaseController {
 
     @PostMapping("/queryPageList")
     @ApiOperation(value = "用户账户表分页2")
-    public HttpResult<IPage<SysUserAccount>> queryPageList(@RequestBody SysUserAccountVo sysUserAccountVo) {
-        IPage<SysUserAccount> result = sysUserAccountService.queryByVo1(sysUserAccountVo);
+    public HttpResult<BasePageResult<SysUserAccount>> queryPageList(@RequestBody SysUserAccountVo sysUserAccountVo) {
+        BasePageResult<SysUserAccount> result = sysUserAccountService.queryByVo1(sysUserAccountVo);
         return HttpResult.ok("success", result);
     }
 

+ 1 - 1
src/main/java/com/ydtech/modules/admin/dao/SysUserAccountMapper.java

@@ -21,7 +21,7 @@ public interface SysUserAccountMapper extends BaseMapper<SysUserAccount> {
 
     Page<SysUserAccount> queryPageOrder(SysUserAccountVo sysUserAccountVo,@Param("page") Page page);
 
-    List<SysUserAccount> queryPageOrder1(@Param("sysUserAccountVo") SysUserAccountVo sysUserAccountVo);
+    Page<SysUserAccount> queryPageOrder1(@Param("sysUserAccountVo") SysUserAccountVo sysUserAccountVo,@Param("page") Page page);
 
     SysUserAccount getById(String userId);
     /**

+ 2 - 0
src/main/java/com/ydtech/modules/admin/dao/SysUserMapper.java

@@ -509,6 +509,8 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
      *  @Description:  通过机构id查询后线用户数据
      */
     List<SysUser> getLeadListDeptId(@Param("deptId") String deptId);
+
+    List<SysUser> selectByLeadId(String userId);
 }
 
 

+ 6 - 0
src/main/java/com/ydtech/modules/admin/model/dto/SysGeographyPositionDto.java

@@ -25,4 +25,10 @@ public class SysGeographyPositionDto {
     @ApiModelProperty(value = "在线状态(0:离线; 1:在线)")
     private Integer status;
 
+    @ApiModelProperty("用户id")
+    private String queryId;
+
+    @ApiModelProperty("类型:1。机构 2.用户")
+    private Integer type;
+
 }

+ 5 - 0
src/main/java/com/ydtech/modules/admin/model/po/SysUserAccount.java

@@ -144,4 +144,9 @@ public class SysUserAccount implements Serializable {
      */
     @TableField(value = "sum_amount_payment")
     private BigDecimal sumAmountPayment;
+
+    @TableField(exist = false)
+    private  String  managementSource;
+    @TableField(exist = false)
+    private  String  roleId;
 }

+ 6 - 0
src/main/java/com/ydtech/modules/admin/model/vo/BusinessAgentData.java

@@ -56,4 +56,10 @@ public class BusinessAgentData {
     @ApiModelProperty(value = "总人数")
     private String totalNumber;
 
+    @ApiModelProperty(value = "部门名称")
+    private String deptName;
+
+    @ApiModelProperty(value = "部门id")
+    private String deptId;
+
 }

+ 2 - 0
src/main/java/com/ydtech/modules/admin/model/vo/SysMenuRecordVo.java

@@ -20,6 +20,8 @@ public class SysMenuRecordVo {
      */
     @ApiModelProperty(value = "用户姓名")
     private String userName;
+    @ApiModelProperty(value = "机构名称")
+    private String deptName;
 
     /**
      * 点击车险录单数量

+ 0 - 15
src/main/java/com/ydtech/modules/admin/service/SysChannelGradeService.java

@@ -50,16 +50,6 @@ public interface SysChannelGradeService extends BaseIService<SysChannelGrade> {
      */
     Page<SysChannelGrade> queryPage(Page page, SysChannelGradePageVo sysChannelGradePageVo);
 
-
-    /**
-     * 获取关联机构列表
-     *
-     * @param id
-     * @return
-     */
-    List<String> queryRelationList(Long id);
-
-
     /**
      * 获取关联机构列表
      * @param sysChannelVo
@@ -67,9 +57,4 @@ public interface SysChannelGradeService extends BaseIService<SysChannelGrade> {
      */
     List<SysChannelAreaRelation> queryRelation(SysChannelVo sysChannelVo);
 
-    /**
-     * 删除分组授权机构
-     * @param authSysChannelGradeVo
-     */
-    void deleteAuth(AuthSysChannelGradeVo authSysChannelGradeVo);
 }

+ 1 - 1
src/main/java/com/ydtech/modules/admin/service/SysUserAccountService.java

@@ -24,7 +24,7 @@ public interface SysUserAccountService extends IService<SysUserAccount> {
 
     BasePageResult<SysUserAccount> queryByVo(SysUserAccountVo sysUserAccountVo);
 
-    IPage<SysUserAccount> queryByVo1(SysUserAccountVo sysUserAccountVo);
+    BasePageResult<SysUserAccount> queryByVo1(SysUserAccountVo sysUserAccountVo);
 
     HttpResult<Object> inert(SysUserAccountVo sysUserAccountVo);
 

+ 0 - 8
src/main/java/com/ydtech/modules/admin/service/impl/SysChannelCostServiceImpl.java

@@ -312,14 +312,6 @@ public class SysChannelCostServiceImpl extends ServiceImpl<SysChannelCostMapper,
             }
         });
     }
-
-    public static void main(String[] args) {
-        BigDecimal a = new BigDecimal("10");
-        BigDecimal b = new BigDecimal("10.00");
-        if(a.compareTo(b) == -1){
-            System.out.println(1);
-        }
-    }
 }
 
 

+ 0 - 20
src/main/java/com/ydtech/modules/admin/service/impl/SysChannelGradeServiceImpl.java

@@ -105,14 +105,6 @@ public class SysChannelGradeServiceImpl extends ServiceImpl<SysChannelGradeMappe
         return channelGradePage;
     }
 
-    @Override
-    public List<String> queryRelationList(Long id) {
-        LambdaQueryWrapper<SysChannelAreaRelation> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(SysChannelAreaRelation::getGradeId, id);
-        return sysChannelAreaRelationService.list(wrapper).stream()
-                .map(SysChannelAreaRelation::getAreaId).collect(Collectors.toList());
-    }
-
     @Override
     public List<SysChannelAreaRelation> queryRelation(SysChannelVo sysChannelVo) {
         List<SysChannelAreaRelation> relationList = sysChannelAreaRelationService.queryRelationList(sysChannelVo);
@@ -126,18 +118,6 @@ public class SysChannelGradeServiceImpl extends ServiceImpl<SysChannelGradeMappe
         }
     }
 
-    @Override
-    public void deleteAuth(AuthSysChannelGradeVo authSysChannelGradeVo) {
-        List<String> areaIds = authSysChannelGradeVo.getAreaIdList();
-        if (CollUtil.isNotEmpty(areaIds)) {
-            for (String areaId : areaIds) {
-                LambdaQueryWrapper<SysChannelAreaRelation> wrapper = new LambdaQueryWrapper<>();
-                wrapper.eq(SysChannelAreaRelation::getGradeId, authSysChannelGradeVo.getId())
-                        .eq(SysChannelAreaRelation::getAreaId, areaId);
-                sysChannelAreaRelationService.remove(wrapper);
-            }
-        }
-    }
 }
 
 

+ 43 - 2
src/main/java/com/ydtech/modules/admin/service/impl/SysDeptServiceImpl.java

@@ -771,7 +771,10 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept>
     public KztUserDeptTreeDto  getUserDeptTree(SysDeptVo sysDeptVo) {
         KztUserDeptTreeDto kztUserDeptTreeDto = new KztUserDeptTreeDto();
         String userId = BaseController.getUserId();
-        if (userId.contains("M")) {
+        QueryWrapper<SysDept> queryWrapper = new QueryWrapper<>();
+        QueryWrapper<SysDept> leaderId = queryWrapper.eq("leader_id", userId);
+        List<SysDept> sysDepts = sysDeptMapper.selectList(leaderId);
+        if (!sysDepts.isEmpty()) {
             kztUserDeptTreeDto.setType("1"); //前线
         } else {
             kztUserDeptTreeDto.setType("2"); //代理
@@ -796,7 +799,10 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept>
 
         List<SysUser> users = sysUserMapper.selectByParams(params);
 
-        if (users == null || users.size() == 0) {
+        for (SysUser user : users) {
+            this.appendName(user);
+        }
+        if (users == null || users.isEmpty()) {
             return new ArrayList<>();
         }
         List<SysUser> topUsers = new ArrayList<>(); //存放1级用户,即没有直接上级的用户
@@ -804,6 +810,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept>
         if("admin".equals(sysUser.getName())){
             topUsers.add(sysUserMapper.selectById("99D1501"));
         }else {
+            this.appendName(sysUser);
             topUsers.add(sysUser);
         }
         // 递归构建用户树结构
@@ -811,6 +818,40 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept>
         return topUsers;
     }
 
+    /**
+     * 拼接机构来源
+     * @param users
+     */
+    private void appendName(SysUser user) {
+        StringBuilder stringBuilder = new StringBuilder();
+        String deptId = user.getDeptId();
+        if (StringUtils.isNotEmpty(deptId)) {
+            int length = deptId.length();
+            if (length > 0) {
+                if (length <= 5) {
+                    String dept = deptId.replaceAll("[^\\d]*(\\d+).*", "$1");
+                    SysDept cityName = baseMapper.selectById(dept);
+                    String name = cityName.getName();
+                    stringBuilder.append("(").append(name).append(")");
+                } else if (length > 5) {
+                    String dept = deptId.replaceAll("[^\\d]*(\\d+).*", "$1");
+                    if (dept.length() < 5) {
+                        SysDept dept1 = baseMapper.selectById(dept);
+                        SysDept cityName = baseMapper.selectById(deptId);
+                        stringBuilder.append("(").append(dept1.getName()).append(cityName.getName()).append(")");
+                    } else {
+                        String deptIdTwo = dept.substring(0, 4);
+
+                        SysDept dept1 = baseMapper.selectById(deptIdTwo);
+                        SysDept dept2 = baseMapper.selectById(dept);
+                        stringBuilder.append("(").append(dept1.getName()).append(dept2.getName()).append(")");
+                    }
+                }
+                user.setName(user.getName()+stringBuilder.toString());
+            }
+        }
+    }
+
     private List<SysDeptTreeVo> getFiveLevelDeptKzt(SysUser byUserId) {
         SysDept sysDept = getById("9");
         SysDeptVo sysDeptVo = new SysDeptVo();

+ 158 - 28
src/main/java/com/ydtech/modules/admin/service/impl/SysGeographyPositionServiceImpl.java

@@ -10,11 +10,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ydtech.modules.admin.dao.SysDeptMapper;
 import com.ydtech.modules.admin.dao.SysGeographyPositionMapper;
 import com.ydtech.modules.admin.dao.SysGeographyPositionRecordMapper;
+import com.ydtech.modules.admin.dao.SysUserMapper;
 import com.ydtech.modules.admin.model.SysDept;
 import com.ydtech.modules.admin.model.SysGeographyPosition;
 import com.ydtech.modules.admin.model.SysGeographyPositionRecord;
 import com.ydtech.modules.admin.model.SysUser;
 import com.ydtech.modules.admin.model.dto.*;
+import com.ydtech.modules.admin.model.po.SysPcAddress;
 import com.ydtech.modules.admin.model.vo.*;
 import com.ydtech.modules.admin.service.GeoService;
 import com.ydtech.modules.admin.service.SysGeographyPositionRecordService;
@@ -45,6 +47,9 @@ public class SysGeographyPositionServiceImpl extends ServiceImpl<SysGeographyPos
 
     @Resource
     private SysDeptMapper sysDeptMapper;
+
+    @Resource
+    private SysUserMapper sysUserMapper;
     @Resource
     private GeoService geoService;
 
@@ -54,47 +59,159 @@ public class SysGeographyPositionServiceImpl extends ServiceImpl<SysGeographyPos
     @Override
     public SysGeographyPositionVo queryPosition(SysGeographyPositionDto sysGeographyPositionDto) {
         SysGeographyPositionVo sysGeographyPositionVo = new SysGeographyPositionVo();
+        // 类型:1。机构 2.用户
+        Integer type = sysGeographyPositionDto.getType();
+
+        if (type == 1) {
+            List<SysGeographyPosition> list = sysGeographyPositionMapper.selectList(new LambdaQueryWrapper<SysGeographyPosition>()
+                    .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getProvince()), SysGeographyPosition::getProvince, sysGeographyPositionDto.getProvince())
+                    .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getCity()), SysGeographyPosition::getCity, sysGeographyPositionDto.getCity())
+                    .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getDistrict()), SysGeographyPosition::getDistrict, sysGeographyPositionDto.getDistrict())
+                    .in(SysGeographyPosition::getSource, Arrays.asList("1", "2"))
+                    .likeRight(StringUtils.isNotEmpty(sysGeographyPositionDto.getQueryId()), SysGeographyPosition::getId, sysGeographyPositionDto.getQueryId())
+                    .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getSource()), SysGeographyPosition::getSource, sysGeographyPositionDto.getSource())
+                    .eq(sysGeographyPositionDto.getStatus() != null, SysGeographyPosition::getStatus, sysGeographyPositionDto.getStatus())
+                    .orderByDesc(SysGeographyPosition::getCreateTime));
+            if (list.size() == 0) return new SysGeographyPositionVo();
+
+            List<SysGeographyPositionInfoVo> sysGeographyPositionList = BeanUtil.copyToList(list, SysGeographyPositionInfoVo.class);
+            //填充机构名
+            for (SysGeographyPositionInfoVo sysGeographyPositionInfoVo : sysGeographyPositionList) {
+                SysUser sysUser = sysUserService.getById(sysGeographyPositionInfoVo.getId());
+                if (sysUser == null) continue;
+                sysGeographyPositionInfoVo.setLeaderName(sysUser.getLeaderName());
+                SysDept sysDept = sysDeptMapper.selectOne(new LambdaQueryWrapper<SysDept>()
+                        .eq(SysDept::getId, sysUser.getDeptId()).eq(SysDept::getDelFlag, 0));
+                if (sysDept == null) continue;
+                String deptName = getDeptName(sysUser.getDeptId());
+//            sysGeographyPositionInfoVo.setDeptName(sysDept.getName());
+                sysGeographyPositionInfoVo.setDeptName(deptName);
+            }
 
-        List<SysGeographyPosition> list = sysGeographyPositionMapper.selectList(new LambdaQueryWrapper<SysGeographyPosition>()
-                .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getProvince()), SysGeographyPosition::getProvince, sysGeographyPositionDto.getProvince())
-                .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getCity()), SysGeographyPosition::getCity, sysGeographyPositionDto.getCity())
-                .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getDistrict()), SysGeographyPosition::getDistrict, sysGeographyPositionDto.getDistrict())
-                .in(SysGeographyPosition::getSource, Arrays.asList("1", "2"))
-                .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getSource()), SysGeographyPosition::getSource, sysGeographyPositionDto.getSource())
-                .eq(sysGeographyPositionDto.getStatus() != null, SysGeographyPosition::getStatus, sysGeographyPositionDto.getStatus())
-                .orderByDesc(SysGeographyPosition::getCreateTime));
-        if (list.size() == 0) return new SysGeographyPositionVo();
+            sysGeographyPositionVo.setList(sysGeographyPositionList);
+
+        }else if (type == 2){
+            List<SysUser> sysUsers = sysUserMapper.selectList(new LambdaQueryWrapper<SysUser>()
+                    .eq(SysUser::getLeaderId, sysGeographyPositionDto.getQueryId()).ne(SysUser::getStatus, 0));
+            List<String> collect = sysUsers.stream().map(SysUser::getId).collect(Collectors.toList());
+            List<String> ids = new ArrayList<>();
+            List<String> idList = queryList(collect, ids);
+            collect.addAll(idList);
+            if (collect.size() == 0) {
+                return sysGeographyPositionVo;
+            }
 
-        List<SysGeographyPositionInfoVo> sysGeographyPositionList = BeanUtil.copyToList(list, SysGeographyPositionInfoVo.class);
-        //填充机构名
-        for (SysGeographyPositionInfoVo sysGeographyPositionInfoVo : sysGeographyPositionList) {
-            SysUser sysUser = sysUserService.getById(sysGeographyPositionInfoVo.getId());
-            if (sysUser == null) continue;
-            sysGeographyPositionInfoVo.setLeaderName(sysUser.getLeaderName());
-            SysDept sysDept = sysDeptMapper.selectOne(new LambdaQueryWrapper<SysDept>()
-                    .eq(SysDept::getId, sysUser.getDeptId()).eq(SysDept::getDelFlag, 0));
-            if (sysDept == null) continue;
-            String deptName = getDeptName(sysUser.getDeptId());
-            sysGeographyPositionInfoVo.setDeptName(sysDept.getName());
+            List<SysGeographyPosition> list = sysGeographyPositionMapper.selectList(new LambdaQueryWrapper<SysGeographyPosition>()
+                    .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getProvince()), SysGeographyPosition::getProvince, sysGeographyPositionDto.getProvince())
+                    .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getCity()), SysGeographyPosition::getCity, sysGeographyPositionDto.getCity())
+                    .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getDistrict()), SysGeographyPosition::getDistrict, sysGeographyPositionDto.getDistrict())
+                    .in(SysGeographyPosition::getSource, Arrays.asList("1", "2"))
+                    .in(CollectionUtil.isNotEmpty(collect), SysGeographyPosition::getId, collect)
+                    .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getSource()), SysGeographyPosition::getSource, sysGeographyPositionDto.getSource())
+                    .eq(sysGeographyPositionDto.getStatus() != null, SysGeographyPosition::getStatus, sysGeographyPositionDto.getStatus())
+                    .orderByDesc(SysGeographyPosition::getCreateTime));
+            if (list.size() == 0) return new SysGeographyPositionVo();
+
+            List<SysGeographyPositionInfoVo> sysGeographyPositionList = BeanUtil.copyToList(list, SysGeographyPositionInfoVo.class);
+            //填充机构名
+            for (SysGeographyPositionInfoVo sysGeographyPositionInfoVo : sysGeographyPositionList) {
+                SysUser sysUser = sysUserService.getById(sysGeographyPositionInfoVo.getId());
+                if (sysUser == null) continue;
+                sysGeographyPositionInfoVo.setLeaderName(sysUser.getLeaderName());
+                SysDept sysDept = sysDeptMapper.selectOne(new LambdaQueryWrapper<SysDept>()
+                        .eq(SysDept::getId, sysUser.getDeptId()).eq(SysDept::getDelFlag, 0));
+                if (sysDept == null) continue;
+                String deptName = getDeptName(sysUser.getDeptId());
+//            sysGeographyPositionInfoVo.setDeptName(sysDept.getName());
+                sysGeographyPositionInfoVo.setDeptName(deptName);
+            }
 
+            sysGeographyPositionVo.setList(sysGeographyPositionList);
+
+
+
+        }else {
+
+            List<SysGeographyPosition> list = sysGeographyPositionMapper.selectList(new LambdaQueryWrapper<SysGeographyPosition>()
+                    .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getProvince()), SysGeographyPosition::getProvince, sysGeographyPositionDto.getProvince())
+                    .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getCity()), SysGeographyPosition::getCity, sysGeographyPositionDto.getCity())
+                    .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getDistrict()), SysGeographyPosition::getDistrict, sysGeographyPositionDto.getDistrict())
+                    .in(SysGeographyPosition::getSource, Arrays.asList("1", "2"))
+                    .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getSource()), SysGeographyPosition::getSource, sysGeographyPositionDto.getSource())
+                    .eq(sysGeographyPositionDto.getStatus() != null, SysGeographyPosition::getStatus, sysGeographyPositionDto.getStatus())
+                    .orderByDesc(SysGeographyPosition::getCreateTime));
+            if (list.size() == 0) return new SysGeographyPositionVo();
+
+            List<SysGeographyPositionInfoVo> sysGeographyPositionList = BeanUtil.copyToList(list, SysGeographyPositionInfoVo.class);
+            //填充机构名
+            for (SysGeographyPositionInfoVo sysGeographyPositionInfoVo : sysGeographyPositionList) {
+                SysUser sysUser = sysUserService.getById(sysGeographyPositionInfoVo.getId());
+                if (sysUser == null) continue;
+                sysGeographyPositionInfoVo.setLeaderName(sysUser.getLeaderName());
+                SysDept sysDept = sysDeptMapper.selectOne(new LambdaQueryWrapper<SysDept>()
+                        .eq(SysDept::getId, sysUser.getDeptId()).eq(SysDept::getDelFlag, 0));
+                if (sysDept == null) continue;
+                String deptName = getDeptName(sysUser.getDeptId());
+//            sysGeographyPositionInfoVo.setDeptName(sysDept.getName());
+                sysGeographyPositionInfoVo.setDeptName(deptName);
+            }
+
+            sysGeographyPositionVo.setList(sysGeographyPositionList);
         }
 
-        sysGeographyPositionVo.setList(sysGeographyPositionList);
-        Long aLong = sysGeographyPositionMapper.selectCount(new LambdaQueryWrapper<SysGeographyPosition>().eq(SysGeographyPosition::getStatus, 1).in(SysGeographyPosition::getSource, Arrays.asList("1", "2")));
-        sysGeographyPositionVo.setManNum(aLong);
+
 
         return sysGeographyPositionVo;
     }
 
+    private List<String> queryList(List<String> collect, List<String> ids) {
+        if (collect.size() > 0) {
+            for (String id : collect) {
+                List<SysUser> sysUsers = sysUserMapper.selectList(new LambdaQueryWrapper<SysUser>()
+                        .eq(SysUser::getLeaderId, id).ne(SysUser::getStatus, 0));
+                if (sysUsers.size() > 0) {
+                    List<String> list = sysUsers.stream().map(SysUser::getId).collect(Collectors.toList());
+                    ids.addAll(list);
+                    queryList(list, ids);
+
+                }
+            }
+
+        }
+
+        return ids;
+    }
+
     private String getDeptName(String deptId) {
+        StringBuilder stringBuilder = new StringBuilder();
         SysDept sysDept = sysDeptMapper.selectOne(new LambdaQueryWrapper<SysDept>()
                 .eq(SysDept::getId, deptId).eq(SysDept::getDelFlag, 0));
-//        if (sysDept.getComlevel()==) {
-//
-//        }
+        if (StringUtils.isEmpty(sysDept.getComlevel())) {
+            SysDept sysDept5 = sysDeptMapper.selectById(sysDept.getParentId());
+            SysDept sysDept4 = sysDeptMapper.selectById(sysDept5.getParentId());
+            SysDept sysDept3 = sysDeptMapper.selectById(sysDept4.getParentId());
+            SysDept sysDept2 = sysDeptMapper.selectById(sysDept3.getParentId());
+            stringBuilder.append(sysDept2.getName()).append("-").append(sysDept3.getName())
+                    .append("-").append(sysDept4.getName()).append("-").append(sysDept5.getName()).append("-").append(sysDept.getName());
+        }else if (sysDept.getComlevel().equals("5")) {
+            SysDept sysDept4 = sysDeptMapper.selectById(sysDept.getParentId());
+            SysDept sysDept3 = sysDeptMapper.selectById(sysDept4.getParentId());
+            SysDept sysDept2 = sysDeptMapper.selectById(sysDept3.getParentId());
+            stringBuilder.append(sysDept2.getName()).append("-").append(sysDept3.getName()).append("-").append(sysDept4.getName()).append("-").append(sysDept.getName());
+        }else if (sysDept.getComlevel().equals("4")) {
+            SysDept sysDept3 = sysDeptMapper.selectById(sysDept.getParentId());
+            SysDept sysDept2 = sysDeptMapper.selectById(sysDept3.getParentId());
+            stringBuilder.append(sysDept2.getName()).append("-").append(sysDept3.getName()).append("-").append(sysDept.getName());
+        }else if (sysDept.getComlevel().equals("3")) {
+            SysDept sysDept2 = sysDeptMapper.selectById(sysDept.getParentId());
+            stringBuilder.append(sysDept2.getName()).append("-").append(sysDept.getName());
+
+        }else if (sysDept.getComlevel().equals("2")) {
+            stringBuilder.append(sysDept.getName());
+        }
 
 
-        return null;
+        return stringBuilder.toString();
     }
 
     @Override
@@ -106,6 +223,17 @@ public class SysGeographyPositionServiceImpl extends ServiceImpl<SysGeographyPos
         wrapper.orderByDesc(SysGeographyPositionRecord::getCreateTime);
 
         Page<SysGeographyPositionRecord> insOrdersPage = sysGeographyPositionRecordService.page(page, wrapper);
+        List<SysGeographyPositionRecord> records = insOrdersPage.getRecords();
+        if (records.size()>0) {
+            for (SysGeographyPositionRecord record : records) {
+                SysUser sysUser = sysUserService.getById(record.getUserId());
+                if (sysUser == null) continue;
+                record.setLeaderName(sysUser.getLeaderName());
+                String deptName = getDeptName(sysUser.getDeptId());
+                record.setDeptName(deptName);
+
+            }
+        }
 
         return new BasePageResult<>(sysGeographyPositionPageDto.getPageNum(), page.getSize(), insOrdersPage.getTotal(), page.getPages(),
                 insOrdersPage.getRecords());
@@ -237,7 +365,9 @@ public class SysGeographyPositionServiceImpl extends ServiceImpl<SysGeographyPos
             SysDept sysDept = sysDeptMapper.selectOne(new LambdaQueryWrapper<SysDept>()
                     .eq(SysDept::getId, sysUser.getDeptId()).eq(SysDept::getDelFlag, 0));
             if (sysDept == null) continue;
-            sysGeographyPositionInfoVo.setDeptName(sysDept.getName());
+            String deptName = getDeptName(sysUser.getDeptId());
+            sysGeographyPositionInfoVo.setDeptName(deptName);
+//            sysGeographyPositionInfoVo.setDeptName(sysDept.getName());
 
         }
 

+ 39 - 1
src/main/java/com/ydtech/modules/admin/service/impl/SysMenuRecordServiceImpl.java

@@ -11,6 +11,7 @@ import com.ydtech.modules.admin.model.SysMenuRecord;
 import com.ydtech.modules.admin.model.SysUser;
 import com.ydtech.modules.admin.model.dto.SysMenuRecordDto;
 import com.ydtech.modules.admin.model.vo.SysMenuRecordVo;
+import com.ydtech.modules.admin.service.SysGeographyPositionService;
 import com.ydtech.modules.admin.service.SysMenuRecordService;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.order.entity.BasePageResult;
@@ -35,6 +36,9 @@ public class SysMenuRecordServiceImpl  extends ServiceImpl<SysMenuRecordMapper,
     @Resource
     private SysUserMapper sysUserMapper;
 
+    @Resource
+    private SysGeographyPositionServiceImpl sysGeographyPositionService;
+
     @Override
     public boolean insert(Integer type, Integer menuType) {
         SysMenuRecord sysMenuRecord = new SysMenuRecord();
@@ -68,7 +72,7 @@ public class SysMenuRecordServiceImpl  extends ServiceImpl<SysMenuRecordMapper,
 
     @Override
     public SysMenuRecordVo getClickMenu(SysMenuRecordDto sysMenuRecordDto) {
-        SysMenuRecordVo sysMenuRecordVo = new SysMenuRecordVo(null,null,0l,0l,0l,0l,0l,0l,null,null,null,null,null,null);
+        SysMenuRecordVo sysMenuRecordVo = new SysMenuRecordVo(null,null,null,0l,0l,0l,0l,0l,0l,null,null,null,null,null,null);
         List<SysMenuRecord> sysMenuRecords = baseMapper.selectList(new LambdaQueryWrapper<SysMenuRecord>().eq(!StringUtils.isNotEmpty(sysMenuRecordDto.getUserId()), SysMenuRecord::getUserId, sysMenuRecordDto.getUserId())
                 .eq(sysMenuRecordDto.getType() != null, SysMenuRecord::getType, sysMenuRecordDto.getType())
                 .eq( SysMenuRecord::getUserId, sysMenuRecordDto.getUserId())
@@ -78,6 +82,8 @@ public class SysMenuRecordServiceImpl  extends ServiceImpl<SysMenuRecordMapper,
         SysUser sysUser = sysUserMapper.selectById(sysMenuRecordDto.getUserId());
         sysMenuRecordVo.setUserId(sysUser.getId());
         sysMenuRecordVo.setUserName(sysUser.getName());
+        String deptName = getDeptName(sysUser.getDeptId());
+        sysMenuRecordVo.setDeptName(deptName);
         if (sysMenuRecords.size()==0) return sysMenuRecordVo;
         SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         //客户端:1:APP;2:PC
@@ -161,5 +167,37 @@ public class SysMenuRecordServiceImpl  extends ServiceImpl<SysMenuRecordMapper,
         return sysMenuRecordVo;
     }
 
+    private String getDeptName(String deptId) {
+        StringBuilder stringBuilder = new StringBuilder();
+        SysDept sysDept = sysDeptMapper.selectOne(new LambdaQueryWrapper<SysDept>()
+                .eq(SysDept::getId, deptId).eq(SysDept::getDelFlag, 0));
+        if (StringUtils.isEmpty(sysDept.getComlevel())) {
+            SysDept sysDept5 = sysDeptMapper.selectById(sysDept.getParentId());
+            SysDept sysDept4 = sysDeptMapper.selectById(sysDept5.getParentId());
+            SysDept sysDept3 = sysDeptMapper.selectById(sysDept4.getParentId());
+            SysDept sysDept2 = sysDeptMapper.selectById(sysDept3.getParentId());
+            stringBuilder.append(sysDept2.getName()).append("-").append(sysDept3.getName())
+                    .append("-").append(sysDept4.getName()).append("-").append(sysDept5.getName()).append("-").append(sysDept.getName());
+        }else if (sysDept.getComlevel().equals("5")) {
+            SysDept sysDept4 = sysDeptMapper.selectById(sysDept.getParentId());
+            SysDept sysDept3 = sysDeptMapper.selectById(sysDept4.getParentId());
+            SysDept sysDept2 = sysDeptMapper.selectById(sysDept3.getParentId());
+            stringBuilder.append(sysDept2.getName()).append("-").append(sysDept3.getName()).append("-").append(sysDept4.getName()).append("-").append(sysDept.getName());
+        }else if (sysDept.getComlevel().equals("4")) {
+            SysDept sysDept3 = sysDeptMapper.selectById(sysDept.getParentId());
+            SysDept sysDept2 = sysDeptMapper.selectById(sysDept3.getParentId());
+            stringBuilder.append(sysDept2.getName()).append("-").append(sysDept3.getName()).append("-").append(sysDept.getName());
+        }else if (sysDept.getComlevel().equals("3")) {
+            SysDept sysDept2 = sysDeptMapper.selectById(sysDept.getParentId());
+            stringBuilder.append(sysDept2.getName()).append("-").append(sysDept.getName());
+
+        }else if (sysDept.getComlevel().equals("2")) {
+            stringBuilder.append(sysDept.getName());
+        }
+
+
+        return stringBuilder.toString();
+    }
+
 
 }

+ 2 - 1
src/main/java/com/ydtech/modules/admin/service/impl/SysPcAddressServiceImpl.java

@@ -528,6 +528,7 @@ public class SysPcAddressServiceImpl extends ServiceImpl<SysPcAddressMapper, Sys
         queryWrapper.isNotNull("leader_id");
 
         List<SysUser> users = sysUserMapper.selectList(queryWrapper);
+        List<SysUser> userList = users.stream().filter(SysUser -> !SysUser.getId().contains("M")).collect(Collectors.toList());
         if (users == null || users.size() == 0) {
             return new ArrayList<>();
         }
@@ -540,7 +541,7 @@ public class SysPcAddressServiceImpl extends ServiceImpl<SysPcAddressMapper, Sys
             topUsers.add(sysUser);
         }
         // 递归构建用户树结构
-        buildUserTree(topUsers, users);
+        buildUserTree(topUsers, userList);
         return topUsers;
     }
 

+ 44 - 16
src/main/java/com/ydtech/modules/admin/service/impl/SysUserAccountServiceImpl.java

@@ -1,5 +1,6 @@
 package com.ydtech.modules.admin.service.impl;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -244,16 +245,43 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
 
     //
     @Override
-    public IPage<SysUserAccount> queryByVo1(SysUserAccountVo sysUserAccountVo) {
-        PageRequest pageRequest = new PageRequest();
-        pageRequest.setPageNum(sysUserAccountVo.getPageNum());
-        pageRequest.setPageSize(sysUserAccountVo.getPageSize());
-        List<SysUserAccount> sysUserAccountHistoryPage = baseMapper.queryPageOrder1(sysUserAccountVo);
-        IPage ipage = PageRequest.buildPageRequest(pageRequest);
-        ipage.setRecords(sysUserAccountHistoryPage.stream().skip((sysUserAccountVo.getPageNum() - 1) * sysUserAccountVo.getPageSize()).limit(sysUserAccountVo.getPageSize()).
-                collect(Collectors.toList()));
-        ipage.setTotal(sysUserAccountHistoryPage.size());
-        return ipage;
+    public BasePageResult<SysUserAccount> queryByVo1(SysUserAccountVo sysUserAccountVo) {
+        Page<SysUserAccount> page = new Page<>(sysUserAccountVo.getPageNum(), sysUserAccountVo.getPageSize());
+        Page<SysUserAccount> sysUserAccountHistoryPage = baseMapper.queryPageOrder1(sysUserAccountVo,page);
+        if(sysUserAccountHistoryPage!=null){
+            List<SysUserAccount> records = sysUserAccountHistoryPage.getRecords();
+            List<SysUserAccount> newRecords = new ArrayList<>();
+            if(records!=null && !records.isEmpty()){
+                for(SysUserAccount  sysUserAccount :records){
+                    //重新赋值总金额  - 已提现金额  支付中金额
+                    MySumAmountQueryDto mySumAmountQueryDto =new MySumAmountQueryDto();
+                    mySumAmountQueryDto.setUserId(sysUserAccount.getUserId());
+                    //出单员是19 且是渠道的话,给渠道团队长
+                    if ("21".equals(sysUserAccount.getRoleId()) && "1".equals(sysUserAccount.getManagementSource())) {
+                        mySumAmountQueryDto.setDeptId(sysUserAccount.getDeptId());
+                    }
+                    //如果是电销组长,将组员的数据算进来
+                    if ("72".equals(sysUserAccount.getRoleId()) && "3".equals(sysUserAccount.getManagementSource())) {
+                        mySumAmountQueryDto.setGroupFlag(true);
+                    }
+                    // 已提现金额   查询历史表中的审核状态为3的数据
+                    BigDecimal ysTXAmount = insFeeOrderNewService.findMyAmountYTXmount(mySumAmountQueryDto.getUserId(), "3",mySumAmountQueryDto.getGroupFlag());
+                    // 提现中
+                    BigDecimal txzTXAmount = insFeeOrderNewService.findMyAmountYTXmount(mySumAmountQueryDto.getUserId(), "2",mySumAmountQueryDto.getGroupFlag());
+                    // 可提现
+                    BigDecimal ssKTAmount = sysUserAccount.getSumAmount()==null?BigDecimal.ZERO:sysUserAccount.getSumAmount();
+                    //总的 =  已提现金额+  可提现金额 +  提现中
+                    BigDecimal sumAmount = ysTXAmount.add(ssKTAmount).add(txzTXAmount);
+                    sysUserAccount.setSumAmountWithdrawal(sumAmount);
+                    sysUserAccount.setSumAmountAccount(ysTXAmount);
+                    sysUserAccount.setSumAmountPayment(txzTXAmount);
+                    newRecords.add(sysUserAccount);
+                }
+            }
+            sysUserAccountHistoryPage.setRecords(newRecords);
+        }
+        return new BasePageResult<>(sysUserAccountVo.getPageNum(), page.getSize(), sysUserAccountHistoryPage.getTotal(), page.getPages(),
+                sysUserAccountHistoryPage.getRecords());
     }
 
     @Override
@@ -273,13 +301,13 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
         }
         // add  by hxl 2024-09-12  =============== 添加提现用户是渠道的话,只能提现100的整数金额
         BigDecimal amount = sysUserAccountVo.getAmount();
-       // judgeAmount(amount, userId);   注释掉  2024-09-18
+        // judgeAmount(amount, userId);   注释掉  2024-09-18
         // add  by  hxl  end =============================
         BigDecimal zero = BigDecimal.ZERO;
         BigDecimal beforeAmount;
         BigDecimal afterAmount;
 //       用户当前金额
-    //    BigDecimal amount = sysUserAccountVo.getAmount();
+        //    BigDecimal amount = sysUserAccountVo.getAmount();
         SysUserAccountHistory sysUserAccountHistory = new SysUserAccountHistory();  // 记录
         sysUserAccountHistory.setDocumentary(1);  // 1提现
         sysUserAccountHistory.setUserId(userId);
@@ -405,7 +433,7 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
         BigDecimal beforeAmount;
         BigDecimal afterAmount;
 //       用户当前金额
-       // BigDecimal amount = sysUserAccountVo.getAmount();
+        // BigDecimal amount = sysUserAccountVo.getAmount();
         SysUserAccountHistory sysUserAccountHistory = new SysUserAccountHistory();  // 记录
         sysUserAccountHistory.setDocumentary(1);  // 1支出
         sysUserAccountHistory.setUserId(userId);
@@ -1584,9 +1612,9 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
         //if(mySumAmountQueryDto.getGroupFlag()){
         //    ssKTAmount = baseMapper.getGroupById(mySumAmountQueryDto.getUserId());
         //}else {
-            if (sysUserAccountEntity != null) {
-                ssKTAmount = sysUserAccountEntity.getSumAmount() == null ? BigDecimal.ZERO : sysUserAccountEntity.getSumAmount();
-            }
+        if (sysUserAccountEntity != null) {
+            ssKTAmount = sysUserAccountEntity.getSumAmount() == null ? BigDecimal.ZERO : sysUserAccountEntity.getSumAmount();
+        }
         //}
         //总的 =  已提现金额+  可提现金额 +  提现中
         BigDecimal sumAmount = ysTXAmount.add(ssKTAmount).add(txzTXAmount);

+ 40 - 1
src/main/java/com/ydtech/modules/admin/service/impl/TaskStatisticsServiceImpl.java

@@ -11,6 +11,7 @@ import com.ydtech.core.page.HttpResult;
 import com.ydtech.core.page.PageRequest;
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.admin.dao.SysAmountAuditingMapper;
+import com.ydtech.modules.admin.dao.SysDeptMapper;
 import com.ydtech.modules.admin.dao.SysUserMapper;
 import com.ydtech.modules.admin.dao.TaskStatisticsMapper;
 import com.ydtech.modules.admin.model.SysDept;
@@ -23,6 +24,7 @@ import com.ydtech.modules.admin.model.vo.TaskStatisticsVo;
 import com.ydtech.modules.admin.service.SysDeptService;
 import com.ydtech.modules.admin.service.TaskStatisticsService;
 import com.ydtech.modules.admin.utils.SliceUpDateUtil;
+import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.base.model.vo.PageVo;
 import com.ydtech.modules.inv.utils.EasyExcelUtils;
 import com.ydtech.modules.order.dao.InsAreaCompanyMapper;
@@ -70,6 +72,8 @@ public class TaskStatisticsServiceImpl  implements TaskStatisticsService {
     private SysDeptService sysDeptService;
     @Autowired
     private SysUserMapper sysUserMapper;
+    @Autowired
+    private SysDeptMapper sysDeptMapper;
 
 
     @Value("${upload.file.path}")
@@ -373,6 +377,7 @@ public class TaskStatisticsServiceImpl  implements TaskStatisticsService {
             }else if ("1".equals(taskStatisticsVo.getTreeType())){
                 taskStatisticsVo.setDeptId(taskStatisticsVo.getTreeUserId());
                 taskStatisticsVo.setTreeUserId(null);
+                taskStatisticsVo.setUserIds(new ArrayList<>());
             }
         }
         PageVo<TaskStatisticsVo> pageVo = new PageVo<>();
@@ -387,6 +392,10 @@ public class TaskStatisticsServiceImpl  implements TaskStatisticsService {
         taskStatisticsVo.setCreatetimeEnd(dateMapByType.get("endDate"));
 
         IPage<BusinessAgentData> list = this.taskStatisticsMapper.getBusinessAgentData(page,taskStatisticsVo);
+        List<BusinessAgentData> records = list.getRecords();
+        for (BusinessAgentData record : records) {
+            this.appendName(record);
+        }
         Long  total = this.taskStatisticsMapper.getBusinessAgentDataTotal(taskStatisticsVo);
         list.setTotal(total);
         return list;
@@ -537,10 +546,11 @@ public class TaskStatisticsServiceImpl  implements TaskStatisticsService {
             }else if ("1".equals(taskStatisticsVo.getTreeType())){
                 taskStatisticsVo.setDeptId(taskStatisticsVo.getTreeUserId());
                 taskStatisticsVo.setTreeUserId(null);
+                taskStatisticsVo.setUserIds(new ArrayList<>());
             }
         }
 
-
+        String deptId = BaseController.getDeptId();
         BusinessAgentData result = this.taskStatisticsMapper.getBusinessAgentDataTotalAdd(taskStatisticsVo);
         Long  total = this.taskStatisticsMapper.getBusinessAgentDataTotal(taskStatisticsVo);
         result.setTotalNumber(total.toString());
@@ -629,4 +639,33 @@ public class TaskStatisticsServiceImpl  implements TaskStatisticsService {
         IPage<TaskStatisticsDto> list = this.taskStatisticsMapper.channelAgentDetails(page,taskStatisticsVo);
         return list;
     }
+    private void appendName(BusinessAgentData user) {
+        StringBuilder stringBuilder = new StringBuilder();
+        String deptId = user.getDeptId();
+        if (com.ydtech.utils.StringUtils.isNotEmpty(deptId)) {
+            int length = deptId.length();
+            if (length > 0) {
+                if (length <= 5) {
+                    String dept = deptId.replaceAll("[^\\d]*(\\d+).*", "$1");
+                    SysDept cityName = sysDeptMapper.selectById(dept);
+                    String name = cityName.getName();
+                    stringBuilder.append("(").append(name).append(")");
+                } else if (length > 5) {
+                    String dept = deptId.replaceAll("[^\\d]*(\\d+).*", "$1");
+                    if (dept.length() < 5) {
+                        SysDept dept1 = sysDeptMapper.selectById(dept);
+                        SysDept cityName = sysDeptMapper.selectById(deptId);
+                        stringBuilder.append(dept1.getName()).append(cityName.getName());
+                    } else {
+                        String deptIdTwo = dept.substring(0, 4);
+
+                        SysDept dept1 = sysDeptMapper.selectById(deptIdTwo);
+                        SysDept dept2 = sysDeptMapper.selectById(dept);
+                        stringBuilder.append(dept1.getName()).append(dept2.getName());
+                    }
+                }
+                user.setDeptName(stringBuilder.toString());
+            }
+        }
+    }
 }

+ 2 - 3
src/main/java/com/ydtech/modules/admin/utils/KztGetDeptUtils.java

@@ -100,9 +100,8 @@ public class KztGetDeptUtils {
         ApplicationContext applicationContext = SpringContextUtil.getApplicationContext();
         SysUserMapper sysUserMapper = applicationContext.getBean(SysUserMapper.class);
         sysUserMapper.selectUserById(userId);
-        HashMap<String, Object> params = new HashMap<>();
-        params.put("leaderId", userId);
-        List<SysUser> sysUsers = sysUserMapper.selectByParams(params);
+
+        List<SysUser> sysUsers = sysUserMapper.selectByLeadId(userId);
         if (!sysUsers.isEmpty()) {
             ids.addAll(sysUsers.stream().map(SysUser::getId).collect(Collectors.toList()));
         }

+ 1 - 1
src/main/java/com/ydtech/modules/ins/model/vo/CarInfoVo.java

@@ -80,7 +80,7 @@ public class CarInfoVo {
     @ApiModelProperty(value = "车辆类型(轿车类,特种车类)")
     private String vehicleclass;
 
-    @NotNull(message = "车架号不能为空")
+//    @NotNull(message = "车架号不能为空")
     @ApiModelProperty(value = "车架号")
     private String vinNo;
 

+ 1 - 1
src/main/java/com/ydtech/modules/order/entity/InsOrders.java

@@ -373,7 +373,7 @@ public class InsOrders implements Serializable {
             quoteInfoVo.getInsuredPersonInfo().setOwner(quoteInfoVo.getInsuredPersonInfo().contrastInfo(quoteInfoVo.getOwnerInfo()));
         }
         this.setInsureinfo(JSON.parseObject(JSON.toJSONString(quoteInfoVo.getInsuredPersonInfo())));
-        this.setInsuredname(quoteInfoVo.getPolicyHolderInfo().getName());
+        this.setInsuredname(quoteInfoVo.getInsuredPersonInfo().getName());
 
         List<RiskInfoVo> risks = quoteInfoVo.getRiskList();
         List<KindInfoVo> kinds = quoteInfoVo.getKindList();

+ 3 - 1
src/main/java/com/ydtech/modules/order/entity/vo/OrderQueryVo.java

@@ -112,9 +112,11 @@ public class OrderQueryVo {
     @ApiModelProperty(value = "险种")
     private String product;
 
+    @ApiModelProperty(value = "被保人姓名")
+    private String insuredName;
 
     @ApiModelProperty(value = "投保人姓名")
-    private String insuredName;
+    private String policyholdersName;
 
     @ApiModelProperty(value = "报价开始时间")
     private String quoteStartDateStr;

+ 1 - 0
src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java

@@ -1652,6 +1652,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
         //查费用里的手续费
         InsFeeOrderNew insFeeOrderNewServiceById = insFeeOrderNewService.getById(feeOrderNewRecordVo.getFeeId());
         PtlAgreementProductCostsNew costsNew = ptlAgreementProductCostsNewService.getById(insFeeOrderNewServiceById.getCostsId());
+        costsNew.blank();
         //交强出口费用
         FeeOrderNewVo.ExportFee jqExportFee = feeRuleSchemeService.calcExportFee(
                 insFeeOrderNew.getJqPremium(),

+ 6 - 1
src/main/resources/mapper/modules/admin/SysUserAccountMapper.xml

@@ -26,6 +26,8 @@
             <result property="sumAmountWithdrawal" column="sum_amount_withdrawal" jdbcType="DECIMAL"/>
             <result property="sumAmountAccount" column="sum_amount_account" jdbcType="DECIMAL"/>
             <result property="sumAmountPayment" column="sum_amount_payment" jdbcType="DECIMAL"/>
+            <result property="managementSource" column="managementSource" jdbcType="VARCHAR"/>
+            <result property="roleId" column="roleId" jdbcType="VARCHAR"/>
         <collection property="sysUserAccountCardList" ofType="com.ydtech.modules.admin.model.po.SysUserBankCard"
                     resultMap="sysUserAccountCardList"/>
     </resultMap>
@@ -134,12 +136,15 @@
         a.sum_amount,
         a.sum_amount_withdrawal,
         a.sum_amount_account,
-        a.sum_amount_payment
+        a.sum_amount_payment,
+        sd.management_source  as managementSource,
+        role.role_id  as  roleId
         from
         sys_user_account a
         left join sys_user b on a.user_id = b.id
         left join sys_dept sd on sd.id = b.dept_id
         left join sys_user_bank_card c on c.user_id = a.user_id
+        left join sys_user_role role on role.user_id = a.user_id
         <where>
             1=1
             <if test="sysUserAccountVo.userId != null and sysUserAccountVo.userId != ''">

+ 12 - 1
src/main/resources/mapper/modules/admin/SysUserMapper.xml

@@ -1434,7 +1434,7 @@
     </select>
 
     <select id="getByUserId" resultType="com.ydtech.modules.admin.model.SysUser">
-        select t.id id, t.name name, t.mobile mobile, t2.management_source managementSource,t.operatorCode
+        select t.id id, t.name name, t.mobile mobile, t2.management_source managementSource,t.operatorCode,t2.id  deptId
         from sys_user t
                  left join sys_dept t2 on t.dept_id = t2.id
         where t.id = #{id}
@@ -1763,6 +1763,7 @@
         left join sys_dept sd on sd.id =su.dept_id
         <where>
             su.leader_id is not null
+            AND su.id not LIKE '%M%'
              <if test="leaderId !=null and  leaderId !=''">
                and  su.leader_id =#{leaderId}
              </if>
@@ -1783,4 +1784,14 @@
             t1.`status` = 1
           AND t1.id NOT LIKE '%M%'
     </select>
+
+
+    <select id="selectByLeadId" resultType="com.ydtech.modules.admin.model.SysUser">
+        select *
+        from sys_user su
+        where su.status = 1
+        and  su.leader_id =#{userId}
+    </select>
+
+
 </mapper>

+ 2 - 1
src/main/resources/mapper/modules/admin/TaskStatisticsMapper.xml

@@ -8,6 +8,7 @@
         select
         io.userid as "userId",
         su.name as "userName",
+        sd.id as "deptId",
         sum(IFNULL(jqpremium, 0) + IFNULL(sypremium, 0)+ IFNULL(jypremium, 0)) as "sumpremium",
         IFNULL(sum(jqpremium),0) as "jqpremium",
         IFNULL(sum(sypremium),0) as "sypremium",
@@ -54,7 +55,7 @@
                 and su.name=#{vo.userName}
             </if>
         </where>
-        group by io.userid,su.name,sd.management_source
+        group by io.userid,su.name,sd.management_source,sd.id
     </select>
 
     <select id="getBusinessAgentDataTotal" resultType="java.lang.Long">

+ 1 - 1
src/main/resources/mapper/modules/order/InsOrdersMapper.xml

@@ -1737,7 +1737,7 @@
     </select>
 
     <select id="queryInsured" resultType="java.lang.String">
-        SELECT DISTINCT JSON_EXTRACT(insureinfo, '$.name')
+        SELECT DISTINCT insuredname
         from ins_orders
         WHERE userid = #{userId}
         <if test="queryInsuredInOrderVo.startDate != null and queryInsuredInOrderVo.startDate != '' and queryInsuredInOrderVo.endDate != null and queryInsuredInOrderVo.endDate != ''">