Browse Source

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper

QuYueTing 1 năm trước cách đây
mục cha
commit
574535d320

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 11396 - 12912
fhKeeper/formulahousekeeper/management-crm/crm.log


+ 18 - 3
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ClueController.java

@@ -59,9 +59,24 @@ public class ClueController {
         User user = userMapper.selectById(request.getHeader("Token"));
         HttpRespMsg msg = new HttpRespMsg();
         msg.setMsg("操作成功");
-        msg.setData(
-                clueMapper.selectList(new QueryWrapper<Clue>().eq("company_id", user.getCompanyId()))
-        );
+
+        Clue clue = new Clue();
+        clue.setCompanyId(user.getCompanyId());
+        clue.setUserId(user.getId());
+        boolean isAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看全部线索");
+        boolean isNotAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看负责部门线索");
+        List<Clue> list = new ArrayList<>();
+        if (isAll) {
+            //查看全部线索
+            list = clueService.getAllList(clue);
+        } else if (isNotAll) {
+            //查看负责部门线索 找出所处部门下所有的负责人
+            list = clueService.getAllList1(clue);
+        } else {
+            // 查看负责人为 自己 和 null的数据
+            list = clueService.getAllList2(clue, user);
+        }
+        msg.setData(list);
         return msg;
     }
 

+ 2 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Clue.java

@@ -168,6 +168,8 @@ public class Clue extends Model<Clue> {
     private List<Task> taskList;
     @TableField(exist = false)
     private Integer isDesc;
+    @TableField(exist = false)
+    private String userId;
 
 
     @Override

+ 4 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/ClueMapper.java

@@ -41,4 +41,8 @@ public interface ClueMapper extends BaseMapper<Clue> {
 
     Map<String, Object> getDataSummary(Integer companyId, String startDate, String endDate, String userId,@Param("list") List<String> targetUserIds);
 
+    List<Clue> getAllList(Clue clue);
+    List<Clue> getAlllist1(Clue clue);
+
+    List<Clue> getAllList2(Clue clue);
 }

+ 5 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/ClueService.java

@@ -29,6 +29,7 @@ public interface ClueService extends IService<Clue> {
 
     List<Clue> getList(Clue clue);
     List<Clue> getList1(Clue clue, User user);
+    List<Clue> getAllList1(Clue clue);
     List<Clue> getList2(Clue clue, User user);
 
     Integer getTotal(Clue clue);
@@ -56,4 +57,8 @@ public interface ClueService extends IService<Clue> {
     HttpRespMsg importData(MultipartFile multipartFile);
 
     HttpRespMsg exportData(Clue clue) throws Exception;
+
+    List<Clue> getAllList(Clue clue);
+
+    List<Clue> getAllList2(Clue clue, User user);
 }

+ 18 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ClueServiceImpl.java

@@ -152,6 +152,7 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
             log.setCode("clue");
             log.setUserId(userId);
             log.setCreatTime(new Date());
+            actionLogMapper.insert(log);
         }
         UpdateWrapper<Clue> updateWrapper = new UpdateWrapper<>();
         updateWrapper.in("id", ids);
@@ -173,6 +174,11 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
         return clueMapper.list1(clue, user.getId());
     }
 
+    @Override
+    public List<Clue> getAllList1(Clue clue) {
+         return clueMapper.getAlllist1(clue);
+    }
+
     @Override
     public List<Clue> getList2(Clue clue, User user) {
         return clueMapper.list2(clue, user.getId());
@@ -220,6 +226,7 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
             log.setCode("clue");
             log.setUserId(userId);
             log.setCreatTime(new Date());
+            actionLogMapper.insert(log);
         }
 
         UpdateWrapper<Clue> updateWrapper = new UpdateWrapper<>();
@@ -648,5 +655,16 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
         return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName,dataList,path);
     }
 
+    @Override
+    public List<Clue> getAllList(Clue clue) {
+        return clueMapper.getAllList(clue);
+    }
+
+    @Override
+    public List<Clue> getAllList2(Clue clue, User user) {
+        return clueMapper.getAllList2(clue);
+
+    }
+
 
 }

+ 66 - 66
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/BusinessOpportunityMapper.xml

@@ -104,64 +104,64 @@
         (select `name` from `user` where id = creator_id) creatorName,
         (SELECT sum(total) from business_product WHERE business_id = id)
         from business_opportunity
-        where company_id = #{companyId}
-        and is_delete = #{isDelete}
+        where company_id = #{bo.companyId}
+        and is_delete = #{bo.isDelete}
         and (incharger_id in
         (SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERe id = #{userId}))
         or incharger_id is null)
-        <if test="name != null and name != ''">
-            and `name` LIKE CONCAT('%', #{name}, '%')
+        <if test="bo.name != null and bo.name != ''">
+            and `name` LIKE CONCAT('%', #{bo.name}, '%')
         </if>
-        <if test="inchargerId != null ">
-            and incharger_id = #{inchargerId}
+        <if test="bo.inchargerId != null ">
+            and incharger_id = #{bo.inchargerId}
         </if>
-        <if test="startTime != null and endTime != null ">
-            and create_time BETWEEN  #{startTime} and #{endTime}
+        <if test="bo.startTime != null and bo.endTime != null ">
+            and create_time BETWEEN  #{bo.startTime} and #{bo.endTime}
         </if>
-        <if test="contactsName != null and contactsName != ''">
-            and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{contactsName}, '%'))
+        <if test="bo.contactsName != null and bo.contactsName != ''">
+            and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{bo.contactsName}, '%'))
         </if>
-        <if test="customerName != null and customerName != ''">
-            and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{customerName}, '%'))
+        <if test="bo.customerName != null and bo.customerName != ''">
+            and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{bo.customerName}, '%'))
         </if>
-        <if test="stageId != null ">
-            and stage_id = #{stageId}
+        <if test="bo.stageId != null ">
+            and stage_id = #{bo.stageId}
         </if>
-        <if test="productId != null ">
-            and id in (select business_id from business_product where product_id = #{productId})
+        <if test="bo.productId != null ">
+            and id in (select business_id from business_product where product_id = #{bo.productId})
         </if>
         ORDER BY id DESC
-        limit #{pageIndex},#{pageFrom}
+        limit #{bo.pageIndex},#{bo.pageFrom}
     </select>
     <select id="getTotal1" resultType="java.lang.Integer">
         select
         count(id)
         from business_opportunity
-        where company_id = #{companyId}
-        and is_delete = #{isDelete}
+        where company_id = #{bo.companyId}
+        and is_delete = #{bo.isDelete}
         and (incharger_id in
         (SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERe id = #{userId}))
         or incharger_id is null)
-        <if test="name != null and name != ''">
-            and `name` LIKE CONCAT('%', #{name}, '%')
+        <if test="bo.name != null and bo.name != ''">
+            and `name` LIKE CONCAT('%', #{bo.name}, '%')
         </if>
-        <if test="inchargerId != null ">
-            and incharger_id = #{inchargerId}
+        <if test="bo.inchargerId != null ">
+            and incharger_id = #{bo.inchargerId}
         </if>
-        <if test="startTime != null and endTime != null ">
-            and create_time BETWEEN #{startTime} and #{endTime}
+        <if test="bo.startTime != null and bo.endTime != null ">
+            and create_time BETWEEN #{bo.startTime} and #{bo.endTime}
         </if>
-        <if test="contactsName != null and contactsName != ''">
-            and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{contactsName}, '%'))
+        <if test="bo.contactsName != null and bo.contactsName != ''">
+            and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{bo.contactsName}, '%'))
         </if>
-        <if test="customerName != null and customerName != ''">
-            and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{customerName}, '%'))
+        <if test="bo.customerName != null and bo.customerName != ''">
+            and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{bo.customerName}, '%'))
         </if>
-        <if test="stageId != null ">
-            and stage_id = #{stageId}
+        <if test="bo.stageId != null ">
+            and stage_id = #{bo.stageId}
         </if>
-        <if test="productId != null ">
-            and id in (select business_id from business_product where product_id = #{productId})
+        <if test="bo.productId != null ">
+            and id in (select business_id from business_product where product_id = #{bo.productId})
         </if>
     </select>
     <select id="selectAllList2" resultType="com.management.platform.entity.BusinessOpportunity">
@@ -174,60 +174,60 @@
         (select `name` from `user` where id = creator_id) creatorName,
         (SELECT sum(total) from business_product WHERE business_id = id)
         from business_opportunity
-        where company_id = #{companyId}
-        and is_delete = #{isDelete}
+        where company_id = #{bo.companyId}
+        and is_delete = #{bo.isDelete}
         and (incharger_id = #{userId} or incharger_id is null)
-        <if test="name != null and name != ''">
-            and `name` LIKE CONCAT('%', #{name}, '%')
+        <if test="bo.name != null and bo.name != ''">
+            and `name` LIKE CONCAT('%', #{bo.name}, '%')
         </if>
-        <if test="inchargerId != null ">
-            and incharger_id = #{inchargerId}
+        <if test="bo.inchargerId != null ">
+            and incharger_id = #{bo.inchargerId}
         </if>
-        <if test="startTime != null and endTime != null ">
-            and create_time BETWEEN  #{startTime} and #{endTime}
+        <if test="bo.startTime != null and bo.endTime != null ">
+            and create_time BETWEEN  #{bo.startTime} and #{bo.endTime}
         </if>
-        <if test="contactsName != null and contactsName != ''">
-            and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{contactsName}, '%'))
+        <if test="bo.contactsName != null and bo.contactsName != ''">
+            and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{bo.contactsName}, '%'))
         </if>
-        <if test="customerName != null and customerName != ''">
-            and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{customerName}, '%'))
+        <if test="bo.customerName != null and bo.customerName != ''">
+            and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{bo.customerName}, '%'))
         </if>
-        <if test="stageId != null ">
-            and stage_id = #{stageId}
+        <if test="bo.stageId != null ">
+            and stage_id = #{bo.stageId}
         </if>
-        <if test="productId != null ">
-            and id in (select business_id from business_product where product_id = #{productId})
+        <if test="bo.productId != null ">
+            and id in (select business_id from business_product where product_id =#{bo.productId})
         </if>
         ORDER BY id DESC
-        limit #{pageIndex},#{pageFrom}
+        limit #{bo.pageIndex},#{bo.pageFrom}
     </select>
     <select id="getTotal2" resultType="java.lang.Integer">
         select
         count(id)
         from business_opportunity
-        where company_id = #{companyId}
-        and is_delete = #{isDelete}
+        where company_id = #{bo.companyId}
+        and is_delete = #{bo.isDelete}
         and (incharger_id = #{userId} or incharger_id is null)
-        <if test="name != null and name != ''">
-            and `name` LIKE CONCAT('%', #{name}, '%')
+        <if test="bo.name != null and bo.name != ''">
+            and `name` LIKE CONCAT('%', #{bo.name}, '%')
         </if>
-        <if test="inchargerId != null ">
-            and incharger_id = #{inchargerId}
+        <if test="bo.inchargerId != null ">
+            and incharger_id = #{bo.inchargerId}
         </if>
-        <if test="startTime != null and endTime != null ">
-            and create_time BETWEEN #{startTime} and #{endTime}
+        <if test="bo.startTime != null and bo.endTime != null ">
+            and create_time BETWEEN #{bo.startTime} and #{bo.endTime}
         </if>
-        <if test="contactsName != null and contactsName != ''">
-            and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{contactsName}, '%'))
+        <if test="bo.contactsName != null and bo.contactsName != ''">
+            and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{bo.contactsName}, '%'))
         </if>
-        <if test="customerName != null and customerName != ''">
-            and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{customerName}, '%'))
+        <if test="bo.customerName != null and bo.customerName != ''">
+            and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{bo.customerName}, '%'))
         </if>
-        <if test="stageId != null ">
-            and stage_id = #{stageId}
+        <if test="bo.stageId != null ">
+            and stage_id = #{bo.stageId}
         </if>
-        <if test="productId != null ">
-            and id in (select business_id from business_product where product_id = #{productId})
+        <if test="bo.productId != null ">
+            and id in (select business_id from business_product where product_id = #{bo.productId})
         </if>
     </select>
     <select id="selectByIdToInfo" resultType="com.management.platform.entity.BusinessOpportunity">

+ 29 - 3
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/ClueMapper.xml

@@ -86,7 +86,7 @@
         </if>
         ORDER BY
         <choose>
-            <when test="isDesc == null or isDesc == ''">
+            <when test="isDesc == null ">
                 c.id DESC
             </when>
             <when test="isDesc == 0">
@@ -160,7 +160,7 @@
         </if>
         ORDER BY
         <choose>
-            <when test="isDesc == null or isDesc == ''">
+            <when test="isDesc == null">
                 c.id DESC
             </when>
             <when test="isDesc == 0">
@@ -232,7 +232,7 @@
         </if>
         ORDER BY
         <choose>
-            <when test="clue.isDesc == null or clue.isDesc == ''">
+            <when test="clue.isDesc == null ">
                 c.id DESC
             </when>
             <when test="clue.isDesc == 0">
@@ -362,5 +362,31 @@
             </foreach>
         </if>
     </select>
+    <select id="getAllList" resultType="com.management.platform.entity.Clue">
+        select id,
+               clue_name
+        from clue
+        where company_id =#{companyId}
+    </select>
+    <select id="getAlllist1" resultType="com.management.platform.entity.Clue">
+        select id,
+               clue_name
+        from clue c
+                 left join sys_dict sd on c.customer_level_id = sd.id
+        where
+            c.company_id = #{companyId} and is_delete = #{isDelete}
+          and (c.incharger_id in
+               (SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERe id = #{userId}))
+            or c.incharger_id is null)
+    </select>
+    <select id="getAllList2" resultType="com.management.platform.entity.Clue">
+        select id,
+               clue_name
+        from clue c
+                 left join sys_dict sd on c.customer_level_id = sd.id
+        where
+            c.company_id = #{companyId} and c.is_delete = #{isDelete}
+          and (c.incharger_id = #{userId} or c.incharger_id is null)
+    </select>
 
 </mapper>

+ 4 - 1
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -4379,8 +4379,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         List<LeaveSheet> leaveSheetList = leaveSheetService.list(new LambdaQueryWrapper<LeaveSheet>().le(LeaveSheet::getStartDate, endDate).ge(LeaveSheet::getEndDate, startDate).eq(LeaveSheet::getOwnerId,userId));
         HttpRespMsg httpRespMsg=new HttpRespMsg();
         HashMap map=new HashMap();
+        List<Map<String,Object>> mapList=reportMapper.getPersonWorkHoursWagesDetailForMob(date,userId,user.getCompanyId(),startDate,endDate,checkStatus,detailStatus);
+        map.put("record",mapList);
+        map.put("totalWorkingTime",mapList.stream().filter(i->i.get("working_time")!=null).mapToDouble(mt->Double.valueOf(String.valueOf(mt.get("working_time")))).sum());
+        map.put("totalCost",mapList.stream().filter(i->i.get("cost")!=null).mapToDouble(mt->Double.valueOf(String.valueOf(mt.get("cost")))).sum());
         if(checkStatus!=null && detailStatus==null){
-            List<Map<String,Object>> mapList=reportMapper.getPersonWorkHoursWagesDetailForMob(date,userId,user.getCompanyId(),startDate,endDate,checkStatus,detailStatus);
             DateTimeFormatter dtf=DateTimeFormatter.ofPattern("yyyy-MM-dd");
             DateTimeFormatter dtf1=DateTimeFormatter.ofPattern("yyyyMMdd");
             List<LocalDate> allDateList = getDays(LocalDate.parse(startDate, dtf), LocalDate.parse(endDate, dtf));

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/statisticsView/statisticsDetail.vue

@@ -84,7 +84,7 @@ export default {
         detailStatus:0,
         userId:this.userId,
       };
-      this.$axios.post("/report/getPersonWorkHoursWagesDetail", postData)
+      this.$axios.post("/report/getPersonWorkHoursWagesDetailForMob", postData)
         .then(res => {
           this.saving = false;
             if(res.code == "ok") {