Jelajahi Sumber

1.控制台任务统计渠道代理人添加门店

wuhp 2 tahun lalu
induk
melakukan
a813a1538a

+ 12 - 0
src/main/java/com/ydtech/modules/admin/model/dto/TaskStatisticsDto.java

@@ -112,4 +112,16 @@ public class TaskStatisticsDto {
     @ApiModelProperty(value = "省级机构名称")
     private String provinceName;
 
+    @ApiModelProperty(value = "门店机构名称")
+    private String storeDeptName;
+
+    @ApiModelProperty(value = "对接人")
+    private String dockingPerson;
+
+    @ApiModelProperty(value = "联系方式(对接人)")
+    private String dockingPhone;
+
+    @ApiModelProperty(value = "协议类型")
+    private String agreementtype;
+
 }

+ 3 - 0
src/main/java/com/ydtech/modules/admin/model/report/company/CompanyQutationCountDataQueryDto.java

@@ -49,5 +49,8 @@ public class CompanyQutationCountDataQueryDto {
     @ApiModelProperty("天数")
     private String  days;
 
+    @ApiModelProperty("员工工号")
+    private String  userId;
+
 
 }

+ 5 - 0
src/main/java/com/ydtech/modules/admin/service/impl/TaskStatisticsServiceImpl.java

@@ -106,9 +106,11 @@ public class TaskStatisticsServiceImpl  implements TaskStatisticsService {
                                 SysDept cityName = sysDeptService.getById(substring);
                                 SysDept districtName = sysDeptService.getById(substring1);
                                 SysDept provinceName = sysDeptService.getById(province);
+                                SysDept storeDeptName = sysDeptService.getById(deptId);
                                 record.setCityName(cityName.getName());
                                 record.setDistrictName(districtName.getName());
                                 record.setProvinceName(provinceName.getName());
+                                record.setStoreDeptName(storeDeptName.getName());
                             }
                         }
                     }
@@ -167,9 +169,12 @@ public class TaskStatisticsServiceImpl  implements TaskStatisticsService {
                                 SysDept cityName = sysDeptService.getById(substring);
                                 SysDept districtName = sysDeptService.getById(substring1);
                                 SysDept provinceName = sysDeptService.getById(province);
+                                SysDept storeDeptName = sysDeptService.getById(deptId);
+
                                 record.setCityName(cityName.getName());
                                 record.setDistrictName(districtName.getName());
                                 record.setProvinceName(provinceName.getName());
+                                record.setStoreDeptName(storeDeptName.getName());
                             }
                         }
                     }

+ 4 - 2
src/main/java/com/ydtech/modules/admin/service/impl/UserReportServiceImpl.java

@@ -296,8 +296,9 @@ public class UserReportServiceImpl implements UserReportService {
                         SysDept cityName = sysDeptService.getById(substring);
                         SysDept districtName = sysDeptService.getById(substring1);
                         SysDept provinceName = sysDeptService.getById(province);
+                        SysDept storeDept = sysDeptService.getById(deptId);
                         String deptName = userItem.getDeptName();
-                        String a = provinceName.getName()+"-"+cityName.getName()+"-"+districtName.getName()+"-"+deptName;
+                        String a = provinceName.getName()+"-"+cityName.getName()+"-"+districtName.getName()+"-"+storeDept+"-"+deptName;
                         userItem.setDeptName(a);
                     }
                 }
@@ -343,8 +344,9 @@ public class UserReportServiceImpl implements UserReportService {
                         SysDept cityName = sysDeptService.getById(substring);
                         SysDept districtName = sysDeptService.getById(substring1);
                         SysDept provinceName = sysDeptService.getById(province);
+                        SysDept storeDept = sysDeptService.getById(deptId);
                         String deptName = item.getDeptName();
-                        String a = provinceName.getName()+"-"+cityName.getName()+"-"+districtName.getName()+"-"+deptName;
+                        String a = provinceName.getName()+"-"+cityName.getName()+"-"+districtName.getName()+"-"+storeDept+"-"+deptName;
                         item.setDeptName(a);
 
                     }

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

@@ -1304,7 +1304,11 @@
             IFNULL(sum(case when info.is_speciality ='1'  THEN 1 ELSE 0 END),0) as "computerSpecialityPersion",
             IFNULL(sum(case when info.is_speciality ='0'  THEN 1 ELSE 0 END),0) as "otherSpecialityPersion",
             IFNULL(sum(case when info.is_speciality ='1'  THEN 1 ELSE 0 END) / (sum(case when info.is_speciality ='1'  THEN 1 ELSE 0 END) + sum(case when info.is_speciality ='0'  THEN 1 ELSE 0 END)),0) as "computerSpecialityProportion",
-            IFNULL(sum(case when info.is_speciality ='0'  THEN 1 ELSE 0 END) / (sum(case when info.is_speciality ='1'  THEN 1 ELSE 0 END) + sum(case when info.is_speciality ='0'  THEN 1 ELSE 0 END)),0)  as "otherSpecialityProportion"
+            IFNULL(sum(case when info.is_speciality ='0'  THEN 1 ELSE 0 END) / (sum(case when info.is_speciality ='1'  THEN 1 ELSE 0 END) + sum(case when info.is_speciality ='0'  THEN 1 ELSE 0 END)),0)  as "otherSpecialityProportion",
+            IFNULL(sum(case when su.status ='1' THEN 1 Else 0 END),0)  as " onJobUser",
+            IFNULL(sum(case when su.status ='0' THEN 1 Else 0 END),0)  as " departUser",
+            IFNULL(sum(case when su.status ='1' THEN 1 Else 0 END),0)  / (IFNULL(sum(case when su.status ='1' THEN 1 Else 0 END),0) +IFNULL(sum(case when su.status ='0' THEN 1 Else 0 END),0)) as "onJobUserProportion",
+            IFNULL(sum(case when su.status ='0' THEN 1 Else 0 END),0)  / (IFNULL(sum(case when su.status ='1' THEN 1 Else 0 END),0) +IFNULL(sum(case when su.status ='0' THEN 1 Else 0 END),0)) as "departUserProportion"
         FROM
             sys_user su
                 LEFT JOIN sys_dept sd ON su.dept_id = sd.id

+ 30 - 4
src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml

@@ -884,6 +884,9 @@
         <if test="vo.managementSource  != null  and  vo.managementSource!=''">
             AND sd.management_source =#{vo.managementSource}
         </if>
+        <if test="vo.userId  != null  and vo.userId !=''">
+            AND  io.userid  =#{vo.userId}
+        </if>
         GROUP BY
         agree.insurance_company,
         iac.company_id,
@@ -906,6 +909,9 @@
             <if test="vo.parterCompanyId  != null  and  vo.parterCompanyId!='' ">
                 AND agree.partner_companies_id = #{vo.parterCompanyId}
             </if>
+            <if test="vo.userId != null  and  vo.userId!=''">
+                AND iace.user_id  =#{vo.userId}
+            </if>
         </where>
 
     </select>
@@ -937,6 +943,9 @@
         <if test="vo.managementSource  != null  and  vo.managementSource!=''">
             AND  sd.management_source  =#{vo.managementSource}
         </if>
+        <if test="vo.userId  != null  and vo.userId !=''">
+            AND  io.userid  =#{vo.userId}
+        </if>
         GROUP BY
         agree.partner_companies_id
         ) a
@@ -1008,6 +1017,10 @@
                 and io.deptid like "${taskStatisticsVo.houseId}%"
             </if>
 
+            <if test="taskStatisticsVo.userId != null and taskStatisticsVo.userId != ''">
+                and io.userid =#{taskStatisticsVo.userId}
+            </if>
+
             <if test="taskStatisticsVo.createtimeStart !=null and taskStatisticsVo.createtimeStart != '' and taskStatisticsVo.createtimeEnd !=null and taskStatisticsVo.createtimeEnd != ''">
                 AND   DATE_FORMAT( io.createtime, '%Y-%m-%d')   BETWEEN #{taskStatisticsVo.createtimeStart} AND #{taskStatisticsVo.createtimeEnd}
             </if>
@@ -1073,6 +1086,10 @@
                 and iac.createtime >= DATE_SUB(NOW(), INTERVAL #{taskStatisticsVo.days} DAY)
             </if>
 
+            <if test="taskStatisticsVo.userId != null and taskStatisticsVo.userId != ''">
+                and io.userid =#{taskStatisticsVo.userId}
+            </if>
+
             <if test="taskStatisticsVo.days !=null  and taskStatisticsVo.days !='' ">
                 <choose>
                     <when test="taskStatisticsVo.days =='1'">
@@ -1232,6 +1249,9 @@
             <if test="taskStatisticsVo.houseId != null and taskStatisticsVo.houseId != ''">
                 and io.deptid like "${taskStatisticsVo.houseId}%"
             </if>
+            <if test="taskStatisticsVo.userId !=null  and  taskStatisticsVo.userId!='' ">
+                and io.userid =#{taskStatisticsVo.userId}
+            </if>
 
             <if test="taskStatisticsVo.createtimeStart !=null and taskStatisticsVo.createtimeStart != '' and taskStatisticsVo.createtimeEnd !=null and taskStatisticsVo.createtimeEnd != ''">
                 AND   DATE_FORMAT( io.createtime, '%Y-%m-%d')   BETWEEN #{taskStatisticsVo.createtimeStart} AND #{taskStatisticsVo.createtimeEnd}
@@ -1562,6 +1582,9 @@
             a.averagePremium as "averagePremium",
             a.userNumber as "userNumber",
             a.perCapitaAmount as "perCapitaAmount",
+            c.docking_person as "dockingPerson",
+            c.docking_phone as "dockingPhone",
+            c.agreement_type as "agreementType",
             b.logo  as "logo"
         from  (
         SELECT
@@ -1569,6 +1592,7 @@
         agree.insurance_company AS "insuranceCompanyName",
         agree.partner_companies_id AS "parterCompanyId",
         ins.namesimple AS "partnerCompaniesName",
+        agree.id as "agreeId",
         IFNULL(sum(iac.jqpremium),0) + IFNULL(sum(iac.sypremium),0) +IFNULL(sum(iac.jypremium),0) as "totalPremium",
         COUNT(0 ) AS "qutationInsureCount",
         IFNULL(sum(iac.jqpremium),0) + IFNULL(sum(iac.sypremium),0) +IFNULL(sum(iac.jypremium),0) / COUNT(0 )  AS "averagePremium",
@@ -1609,7 +1633,8 @@
         GROUP BY
         agree.insurance_company_id,
         agree.insurance_company,
-        agree.partner_companies_id
+        agree.partner_companies_id,
+        agree.id
         <choose>
             <when test="vo.orderSort != null and vo.orderSort != '' and  vo.userNumberSort == null ">
                 order by
@@ -1626,6 +1651,7 @@
         </choose>
         )  a
         left join  esm_ins_company  b on b.id =a.companyId
+        left join ptl_agreement  c on c.id =a.agreeId
     </select>
 
 
@@ -1742,7 +1768,7 @@
             </if>
 
             <if test="vo.userId  != null  and  vo.userId!=''  ">
-                AND io.userId =#{vo.userId}
+                AND io.userid =#{vo.userId}
             </if>
 
             <if test="vo.userName  != null  and  vo.userName!=''  ">
@@ -1831,7 +1857,7 @@
             </if>
 
             <if test="vo.userId  != null  and  vo.userId!=''  ">
-                AND io.userId =#{vo.userId}
+                AND io.userid =#{vo.userId}
             </if>
 
             <if test="vo.userName  != null  and  vo.userName!=''  ">
@@ -1874,7 +1900,7 @@
             </if>
 
             <if test="vo.userId  != null  and  vo.userId!=''  ">
-                AND io.userId =#{vo.userId}
+                AND io.userid =#{vo.userId}
             </if>
 
             <if test="vo.userName  != null  and  vo.userName!=''  ">