Explorar el Código

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

Min hace 1 año
padre
commit
3cd54c27f1
Se han modificado 30 ficheros con 11608 adiciones y 14066 borrados
  1. 11396 12912
      fhKeeper/formulahousekeeper/management-crm/crm.log
  2. 18 3
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ClueController.java
  3. 2 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Clue.java
  4. 4 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/ClueMapper.java
  5. 5 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/ClueService.java
  6. 18 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ClueServiceImpl.java
  7. 66 66
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/BusinessOpportunityMapper.xml
  8. 29 3
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/ClueMapper.xml
  9. 2 0
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml
  10. 5 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/ReportController.java
  11. 0 118
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/SimpleFinance.java
  12. 0 45
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/SimpleProjectime.java
  13. 0 105
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/SimpleReport.java
  14. 0 16
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/SimpleFinanceMapper.java
  15. 0 16
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/SimpleProjectimeMapper.java
  16. 0 16
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/SimpleReportMapper.java
  17. 2 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/ReportService.java
  18. 0 16
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/SimpleFinanceService.java
  19. 0 16
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/SimpleProjectimeService.java
  20. 0 29
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/SimpleReportService.java
  21. 58 1
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  22. 0 20
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/SimpleFinanceServiceImpl.java
  23. 0 20
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/SimpleProjectimeServiceImpl.java
  24. 0 591
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/SimpleReportServiceImpl.java
  25. 0 28
      fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/SimpleFinanceMapper.xml
  26. 0 18
      fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/SimpleProjectimeMapper.xml
  27. 0 24
      fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/SimpleReportMapper.xml
  28. BIN
      fhKeeper/formulahousekeeper/management-workshop/workshop_print.2024-06-24.log.gz
  29. 1 1
      fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/workView/fillReport.vue
  30. 2 2
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 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>

+ 2 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml

@@ -218,6 +218,7 @@
         left join project b on b.id=a.project_id
         left join report c on c.sub_project_id=a.id
         where a.company_id=#{companyId}
+        and c.state = 1
         <if test="startDate != null and endDate != null">
             and c.create_date between #{startDate} and #{endDate}
         </if>
@@ -242,6 +243,7 @@
         left join project b on b.id=a.project_id
         left join report c on c.sub_project_id=a.id
         where a.company_id=#{companyId}
+        and c.state = 1
         <if test="startDate != null and endDate != null">
             and c.create_date between #{startDate} and #{endDate}
         </if>

+ 5 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/ReportController.java

@@ -1657,5 +1657,10 @@ public class ReportController {
     public HttpRespMsg getUserCommentPlanResult(String pptIds){
         return reportService.getUserCommentPlanResult(pptIds);
     }
+
+    @RequestMapping("/deleteDuplicateData")
+    public HttpRespMsg deleteDuplicateData(Integer companyId, String createDate){
+        return reportService.deleteDuplicateData(companyId, createDate);
+    }
 }
 

+ 0 - 118
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/SimpleFinance.java

@@ -1,118 +0,0 @@
-package com.management.platform.entity;
-
-import java.math.BigDecimal;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.extension.activerecord.Model;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableField;
-import java.io.Serializable;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author Seyason
- * @since 2021-10-22
- */
-@Data
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-public class SimpleFinance extends Model<SimpleFinance> {
-
-    private static final long serialVersionUID=1L;
-
-    /**
-     * 主键
-     */
-    @TableId(value = "id", type = IdType.AUTO)
-    private Integer id;
-
-    /**
-     * 用户姓名
-     */
-    @TableField("name")
-    private String name;
-
-    /**
-     * 公司id
-     */
-    @TableField("company_id")
-    private Integer companyId;
-
-    /**
-     * 工资
-     */
-    @TableField("month_cost")
-    private BigDecimal monthCost;
-
-    /**
-     * 奖金
-     */
-    @TableField("bonus")
-    private BigDecimal bonus;
-
-    /**
-     * 津贴
-     */
-    @TableField("allowance")
-    private BigDecimal allowance;
-
-    /**
-     * 养老保险
-     */
-    @TableField("insurance_old")
-    private BigDecimal insuranceOld;
-
-    /**
-     * 医疗保险
-     */
-    @TableField("insurance_medical")
-    private BigDecimal insuranceMedical;
-
-    /**
-     * 失业保险
-     */
-    @TableField("insurance_losejob")
-    private BigDecimal insuranceLosejob;
-
-    /**
-     * 住房公积金
-     */
-    @TableField("house_fund")
-    private BigDecimal houseFund;
-
-    /**
-     * 其他
-     */
-    @TableField("others")
-    private BigDecimal others;
-
-    /**
-     * 总成本
-     */
-    @TableField("total_cost")
-    private BigDecimal totalCost;
-
-    /**
-     * 年月
-     */
-    @TableField("ymonth")
-    private String ymonth;
-
-    /**
-     * 该月的时薪
-     */
-    @TableField("hour_cost")
-    private BigDecimal hourCost;
-
-
-    @Override
-    protected Serializable pkVal() {
-        return this.id;
-    }
-
-}

+ 0 - 45
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/SimpleProjectime.java

@@ -1,45 +0,0 @@
-package com.management.platform.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.extension.activerecord.Model;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableField;
-import java.io.Serializable;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author Seyason
- * @since 2021-10-22
- */
-@Data
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-public class SimpleProjectime extends Model<SimpleProjectime> {
-
-    private static final long serialVersionUID=1L;
-
-    @TableId(value = "id", type = IdType.AUTO)
-    private Integer id;
-
-    @TableField("simple_id")
-    private Integer simpleId;
-
-    @TableField("project_name")
-    private String projectName;
-
-    @TableField("time_cost")
-    private Double timeCost;
-
-
-    @Override
-    protected Serializable pkVal() {
-        return this.id;
-    }
-
-}

+ 0 - 105
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/SimpleReport.java

@@ -1,105 +0,0 @@
-package com.management.platform.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.extension.activerecord.Model;
-import java.time.LocalDate;
-import com.baomidou.mybatisplus.annotation.TableId;
-import java.time.LocalDateTime;
-import com.baomidou.mybatisplus.annotation.TableField;
-import java.io.Serializable;
-import java.time.format.DateTimeFormatter;
-import java.util.List;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-import org.springframework.format.annotation.DateTimeFormat;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author Seyason
- * @since 2021-10-22
- */
-@Data
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-public class SimpleReport extends Model<SimpleReport> {
-
-    private static final long serialVersionUID=1L;
-
-    @TableId(value = "id", type = IdType.AUTO)
-    private Integer id;
-
-    /**
-     * 公司id
-     */
-    @TableField("company_id")
-    private Integer companyId;
-
-    /**
-     * 年月
-     */
-    @TableField("ymonth")
-    private String ymonth;
-
-    /**
-     * 日期
-     */
-    @TableField("report_date")
-    @JsonFormat(pattern = "MM/dd")
-    @DateTimeFormat(pattern = "MM/dd")
-    private LocalDate reportDate;
-
-    /**
-     * 姓名
-     */
-    @TableField("username")
-    private String username;
-
-    /**
-     * 工作岗位
-     */
-    @TableField("position")
-    private String position;
-
-    /**
-     * 部门
-     */
-    @TableField("department")
-    private String department;
-
-    /**
-     * 该日累计时长
-     */
-    @TableField("time_cost")
-    private Double timeCost;
-
-    /**
-     * 创建时间
-     */
-    @TableField("indate")
-    private LocalDateTime indate;
-
-    /**
-     * 上传人id
-     */
-    @TableField("creator_id")
-    private String creatorId;
-
-
-    /**
-     * 报告相关的项目时间表
-     */
-    @TableField(exist = false)
-    private List<SimpleProjectime> projectimeList;
-
-    @Override
-    protected Serializable pkVal() {
-        return this.id;
-    }
-
-}

+ 0 - 16
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/SimpleFinanceMapper.java

@@ -1,16 +0,0 @@
-package com.management.platform.mapper;
-
-import com.management.platform.entity.SimpleFinance;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author Seyason
- * @since 2021-10-22
- */
-public interface SimpleFinanceMapper extends BaseMapper<SimpleFinance> {
-
-}

+ 0 - 16
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/SimpleProjectimeMapper.java

@@ -1,16 +0,0 @@
-package com.management.platform.mapper;
-
-import com.management.platform.entity.SimpleProjectime;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author Seyason
- * @since 2021-10-22
- */
-public interface SimpleProjectimeMapper extends BaseMapper<SimpleProjectime> {
-
-}

+ 0 - 16
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/SimpleReportMapper.java

@@ -1,16 +0,0 @@
-package com.management.platform.mapper;
-
-import com.management.platform.entity.SimpleReport;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author Seyason
- * @since 2021-10-22
- */
-public interface SimpleReportMapper extends BaseMapper<SimpleReport> {
-
-}

+ 2 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/ReportService.java

@@ -166,4 +166,6 @@ public interface ReportService extends IService<Report> {
     HttpRespMsg getPersonWorkHoursWagesDetailForTemp(String date, String userId, String startDate, String endDate);
 
     HttpRespMsg updateHasDeleteTeamData();
+
+    HttpRespMsg deleteDuplicateData(Integer companyId, String createDate);
 }

+ 0 - 16
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/SimpleFinanceService.java

@@ -1,16 +0,0 @@
-package com.management.platform.service;
-
-import com.management.platform.entity.SimpleFinance;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author Seyason
- * @since 2021-10-22
- */
-public interface SimpleFinanceService extends IService<SimpleFinance> {
-
-}

+ 0 - 16
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/SimpleProjectimeService.java

@@ -1,16 +0,0 @@
-package com.management.platform.service;
-
-import com.management.platform.entity.SimpleProjectime;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author Seyason
- * @since 2021-10-22
- */
-public interface SimpleProjectimeService extends IService<SimpleProjectime> {
-
-}

+ 0 - 29
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/SimpleReportService.java

@@ -1,29 +0,0 @@
-package com.management.platform.service;
-
-import com.management.platform.entity.SimpleReport;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.management.platform.util.HttpRespMsg;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author Seyason
- * @since 2021-10-22
- */
-public interface SimpleReportService extends IService<SimpleReport> {
-
-    HttpRespMsg getByMonth(Integer companyId, String yearMonth);
-
-    HttpRespMsg importData(Integer companyId, String yearMonth, MultipartFile file, HttpServletRequest request);
-
-    HttpRespMsg exportData(String yearMonth, Integer companyId, String type, HttpServletRequest request);
-
-    HttpRespMsg getTimeCost(String yearMonth, Integer companyId, String type, HttpServletRequest request);
-
-    HttpRespMsg getReportByMonth(Integer companyId, String yearMonth);
-}

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

@@ -12,6 +12,7 @@ import com.management.platform.entity.vo.*;
 import com.management.platform.mapper.*;
 import com.management.platform.service.*;
 import com.management.platform.util.*;
+import lombok.Synchronized;
 import org.apache.poi.hssf.usermodel.*;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.CellRangeAddress;
@@ -146,8 +147,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     //同一个人的重复提交时间,不得超过1秒
     public static volatile HashMap<String, Long>  userSubmitTime = new HashMap();
 
+    @Synchronized
     @Override
-    public synchronized HttpRespMsg submitReport(Report report, HttpServletRequest request) {
+    public HttpRespMsg submitReport(Report report, HttpServletRequest request) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         String token = request.getHeader("TOKEN");
         Long nowTime = System.currentTimeMillis();
@@ -209,6 +211,42 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             httpRespMsg.setError("填报的件数超过了剩余可填报件数:"+(plan.getNum() - allFileProcNum)+", 请联系班组长协调解决");
             return httpRespMsg;
         }
+        //检查钢印号是否已经被同工序里面的其他人报过了
+        if (!StringUtils.isEmpty(report.getSteelNumArray())) {
+            JSONArray steelArray = JSONArray.parseArray(report.getSteelNumArray());
+            List<Report> reports = reportMapper.selectList(new QueryWrapper<Report>().eq("plan_id", plan.getId()).eq("prod_procedure_id", report.getProdProcedureId()).ne("creator_id", token));
+            if (reports.size() > 0) {
+                //循环steelArray;
+                String s = "";
+                for (int j=0;j<steelArray.size();j++) {
+                    String oneSteel = steelArray.getString(j);
+                    boolean find = false;
+                    for (int i = 0; i < reports.size(); i++) {
+                        Report oneReport = reports.get(i);
+                        String steelNumArray = oneReport.getSteelNumArray();
+                        JSONArray oneSteelArray = JSONArray.parseArray(steelNumArray);
+                        for (int p=0;p<oneSteelArray.size();p++) {
+                            if (oneSteelArray.getString(p).equals(oneSteel)) {
+                                find = true;
+                                break;
+                            }
+                        }
+                        if (find) {
+                            break;
+                        }
+                    }
+                    if (find) {
+                        s += oneSteel+",";
+                    }
+                }
+                if (s.length() > 0) {
+                    s = s.substring(0, s.length()-1);
+                    httpRespMsg.setError("钢印号["+s+"]已经被其他人报工, 请选择其他钢印号填报。");
+                    return httpRespMsg;
+                }
+            }
+        }
+
         Integer num = plan.getNum();//总件数
         double addPercent = report.getFinishNum() / num;
         //新版计算报工的工时和价钱;根据填报件数的占比计算工时和价钱
@@ -6251,4 +6289,23 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         reportService.updateBatchById(reportList);
         return msg;
     }
+
+    @Override
+    public HttpRespMsg deleteDuplicateData(Integer companyId, String createDate) {
+        List<Report> dataList = reportMapper.selectList(new QueryWrapper<Report>().eq("create_date", createDate).eq("company_id", companyId).isNotNull("user_procedure_team_id").groupBy("creator_id,user_procedure_team_id").having("count(1) > 1"));
+        HttpRespMsg msg = new HttpRespMsg();
+        if (dataList.size() == 0) {
+            System.out.println(createDate+"无重复报工");
+        }
+        for (Report report : dataList) {
+            List<Report> duplicateData = reportMapper.selectList(new QueryWrapper<Report>().eq("create_date", createDate).eq("company_id", companyId).eq("creator_id", report.getCreatorId()).eq("user_procedure_team_id", report.getUserProcedureTeamId()));
+            System.out.println("找到重复数据,共"+duplicateData.size());
+            if (duplicateData.size() > 1) {
+                for (int i=1; i<duplicateData.size(); i++) {
+                    reportMapper.deleteById(duplicateData.get(i).getId());
+                }
+            }
+        }
+        return msg;
+    }
 }

+ 0 - 20
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/SimpleFinanceServiceImpl.java

@@ -1,20 +0,0 @@
-package com.management.platform.service.impl;
-
-import com.management.platform.entity.SimpleFinance;
-import com.management.platform.mapper.SimpleFinanceMapper;
-import com.management.platform.service.SimpleFinanceService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author Seyason
- * @since 2021-10-22
- */
-@Service
-public class SimpleFinanceServiceImpl extends ServiceImpl<SimpleFinanceMapper, SimpleFinance> implements SimpleFinanceService {
-
-}

+ 0 - 20
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/SimpleProjectimeServiceImpl.java

@@ -1,20 +0,0 @@
-package com.management.platform.service.impl;
-
-import com.management.platform.entity.SimpleProjectime;
-import com.management.platform.mapper.SimpleProjectimeMapper;
-import com.management.platform.service.SimpleProjectimeService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author Seyason
- * @since 2021-10-22
- */
-@Service
-public class SimpleProjectimeServiceImpl extends ServiceImpl<SimpleProjectimeMapper, SimpleProjectime> implements SimpleProjectimeService {
-
-}

+ 0 - 591
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/SimpleReportServiceImpl.java

@@ -1,591 +0,0 @@
-package com.management.platform.service.impl;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.management.platform.entity.*;
-import com.management.platform.mapper.*;
-import com.management.platform.service.ExcelExportService;
-import com.management.platform.service.SimpleFinanceService;
-import com.management.platform.service.SimpleProjectimeService;
-import com.management.platform.service.SimpleReportService;
-import com.management.platform.util.ExcelUtil;
-import com.management.platform.util.HttpRespMsg;
-import com.management.platform.util.MessageUtils;
-import org.apache.log4j.LogManager;
-import org.apache.log4j.Logger;
-import org.apache.poi.EncryptedDocumentException;
-import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
-import org.apache.poi.ss.usermodel.CellType;
-import org.apache.poi.xssf.usermodel.XSSFCell;
-import org.apache.poi.xssf.usermodel.XSSFRow;
-import org.apache.poi.xssf.usermodel.XSSFSheet;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.StringUtils;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import java.io.*;
-import java.math.BigDecimal;
-import java.text.DecimalFormat;
-import java.text.SimpleDateFormat;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author Seyason
- * @since 2021-10-22
- */
-@Service
-@Transactional
-public class SimpleReportServiceImpl extends ServiceImpl<SimpleReportMapper, SimpleReport> implements SimpleReportService {
-    Logger logger = LogManager.getLogger(org.apache.logging.log4j.LogManager.ROOT_LOGGER_NAME);
-    @Resource
-    SimpleFinanceService simpleFinanceService;
-    @Resource
-    SimpleFinanceMapper simpleFinanceMapper;
-    @Resource
-    SimpleReportMapper simpleReportMapper;
-    @Resource
-    SimpleReportService simpleReportService;
-    @Resource
-    SimpleProjectimeMapper simpleProjectimeMapper;
-    @Resource
-    SimpleProjectimeService simpleProjectimeService;
-    @Resource
-    ExcelExportService excelExportService;
-    @Resource
-    UserMapper userMapper;
-    @Resource
-    WxCorpInfoMapper wxCorpInfoMapper;
-    @Value(value = "${upload.path}")
-    private String path;
-
-    @Override
-    public HttpRespMsg getByMonth(Integer companyId, String yearMonth) {
-        HttpRespMsg msg = new HttpRespMsg();
-        List<SimpleFinance> financeList = simpleFinanceMapper.selectList(new QueryWrapper<SimpleFinance>().eq("company_id", companyId).eq("ymonth", yearMonth));
-        msg.data = financeList;
-        return msg;
-    }
-
-    @Override
-    public HttpRespMsg importData(Integer companyId, String yearMonth, MultipartFile multipartFile, HttpServletRequest request) {
-        HttpRespMsg msg = new HttpRespMsg();
-        String token = request.getHeader("TOKEN");
-        //然后处理文件
-        String fileName = multipartFile.getOriginalFilename();
-        File file = new File(fileName == null ? "file" : fileName);
-        InputStream inputStream = null;
-        OutputStream outputStream = null;
-        try {
-            inputStream = multipartFile.getInputStream();
-            outputStream = new FileOutputStream(file);
-            byte[] buffer = new byte[4096];
-            int temp = 0;
-            while ((temp = inputStream.read(buffer, 0, 4096)) != -1) {
-                outputStream.write(buffer, 0, temp);
-            }
-            inputStream.close();
-            outputStream.close();
-            //然后解析表格
-            XSSFWorkbook workbook = new XSSFWorkbook(file);
-
-            //第二个表是员工薪资表
-
-            if (workbook.getNumberOfSheets() < 2) {
-                //msg.setError("表格格式不正确,需要月度工时和月薪薪资两个sheet="+workbook.getNumberOfSheets());
-                msg.setError(MessageUtils.message("report.typeErrorByHourAndSalary",workbook.getNumberOfSheets()));
-            } else {
-                //导入员工薪资表
-                XSSFSheet sheet = workbook.getSheetAt(1);
-                List<SimpleFinance> financeList = new ArrayList<SimpleFinance>();
-
-                //获取月成本列表
-                DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-                String dateStr = yearMonth+"-01 00:00:00";
-                LocalDateTime startDate = LocalDateTime.parse(dateStr,df);
-                LocalDateTime endDate = LocalDateTime.parse(dateStr,df);
-                endDate = endDate.plusMonths(1);
-
-                SimpleDateFormat sdf = new SimpleDateFormat("yyyy/M/d");
-
-                //需要更新成本的人员数据
-                List<User> updateUserList = new ArrayList<>();
-                LocalDate now = LocalDate.now();
-                String startStr = yearMonth + "-01";
-                String endStr = yearMonth + "-31";
-                //获取人员该月份填写的日报的总时长
-                List<Map<String, Object>> userTimeList = null;
-
-                //由于第一行需要指明列对应的标题
-                int rowNum = sheet.getLastRowNum();
-                for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
-
-                    XSSFRow row = sheet.getRow(rowIndex);
-                    if (row == null) {
-                        continue;
-                    }
-                    if (ExcelUtil.isRowEmpty(row)) {
-                        continue;
-                    }
-                    //姓名	工资	奖金	津贴	养老保险	医疗保险	失业保险	住房公积金	其他
-                    XSSFCell nameCell = row.getCell(0);
-                    XSSFCell salaryCell = row.getCell(1);
-                    XSSFCell bonusCell = row.getCell(2);
-                    XSSFCell allowanceCell = row.getCell(3);
-                    XSSFCell inOldCell = row.getCell(4);
-                    XSSFCell inMedicalCell = row.getCell(5);
-                    XSSFCell inJobCell = row.getCell(6);
-                    XSSFCell houseFundCell = row.getCell(7);
-                    XSSFCell otherCell = row.getCell(8);
-
-
-                    nameCell.setCellType(CellType.STRING);
-                    salaryCell.setCellType(CellType.STRING);
-                    bonusCell.setCellType(CellType.STRING);
-                    allowanceCell.setCellType(CellType.STRING);
-                    inOldCell.setCellType(CellType.STRING);
-                    inMedicalCell.setCellType(CellType.STRING);
-                    inJobCell.setCellType(CellType.STRING);
-                    houseFundCell.setCellType(CellType.STRING);
-                    if (otherCell != null)otherCell.setCellType(CellType.STRING);
-
-                    String name = nameCell.getStringCellValue().trim().replaceAll("\\u00a0", "");
-                    SimpleFinance finance = new SimpleFinance();
-                    if ((name.equals("姓名") || name.equals("name")) && rowIndex == 0) {
-                        //跳过第一行标题
-                        continue;
-                    }
-                    finance.setCompanyId(companyId);
-                    finance.setName(name);
-
-                    BigDecimal total = new BigDecimal(0);
-                    if (salaryCell != null) {
-                        salaryCell.setCellType(CellType.STRING);
-                        String item = salaryCell.getStringCellValue();
-                        BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                        finance.setMonthCost(value);
-                        total = total.add(value);
-                    }
-
-                    if (bonusCell != null) {
-                        bonusCell.setCellType(CellType.STRING);
-                        String bonusString = bonusCell.getStringCellValue();
-                        BigDecimal bonus = bonusString != null ? new BigDecimal(bonusString.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                        finance.setBonus(bonus);
-                        total = total.add(bonus);
-                    }
-                    if (allowanceCell != null) {
-                        allowanceCell.setCellType(CellType.STRING);
-                        String item = allowanceCell.getStringCellValue();
-                        BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                        finance.setAllowance(value);
-                        total = total.add(value);
-                    }
-                    if (inJobCell != null) {
-                        inJobCell.setCellType(CellType.STRING);
-                        String item = inJobCell.getStringCellValue();
-                        BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                        finance.setInsuranceLosejob(value);
-                        total = total.add(value);
-                    }
-                    if (inMedicalCell != null) {
-                        inMedicalCell.setCellType(CellType.STRING);
-                        String item = inMedicalCell.getStringCellValue();
-                        BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                        finance.setInsuranceMedical(value);
-                        total = total.add(value);
-                    }
-                    if (inOldCell != null) {
-                        inOldCell.setCellType(CellType.STRING);
-                        String item = inOldCell.getStringCellValue();
-                        BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                        finance.setInsuranceOld(value);
-                        total = total.add(value);
-                    }
-                    if (houseFundCell != null) {
-                        houseFundCell.setCellType(CellType.STRING);
-                        String item = houseFundCell.getStringCellValue();
-                        BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                        finance.setHouseFund(value);
-                        total = total.add(value);
-                    }
-                    if (otherCell != null) {
-                        otherCell.setCellType(CellType.STRING);
-                        String item = otherCell.getStringCellValue();
-                        BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                        finance.setOthers(value);
-                        total = total.add(value);
-                    }
-                    finance.setTotalCost(total);
-
-                    finance.setYmonth(yearMonth);
-                    financeList.add(finance);
-                }
-
-                //获取日报列表
-                sheet = workbook.getSheetAt(0);
-                //由于第一行需要指明列对应的标题
-                rowNum = sheet.getLastRowNum();
-                List<String> projectList = new ArrayList<>();
-                List<SimpleReport> reportList = new ArrayList<>();
-                int projectNameStartIndex = 4;
-                for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
-                    XSSFRow row = sheet.getRow(rowIndex);
-                    if (row == null) {
-                        continue;
-                    }
-                    if (ExcelUtil.isRowEmpty(row)) {
-                        continue;
-                    }
-                    if (rowIndex == 0) {
-                        //第一行是标题,获取项目名称
-                        int pIndex = projectNameStartIndex;
-                        while(pIndex < row.getLastCellNum() && row.getCell(pIndex).getCellTypeEnum() != CellType._NONE &&  row.getCell(pIndex).getCellTypeEnum() != CellType.BLANK) {
-                            row.getCell(pIndex).setCellType(CellType.STRING);
-                            String stringCellValue = row.getCell(pIndex).getStringCellValue();
-                            projectList.add(stringCellValue);
-                            pIndex++;
-                        }
-                    } else {
-                        //数据行
-                        for (int i=1;i<4+projectList.size(); i++) {
-                            row.getCell(i).setCellType(CellType.STRING);
-                        }
-                        String reportDate = sdf.format(row.getCell(0).getDateCellValue());
-                        String username = row.getCell(1).getStringCellValue();
-                        String position = row.getCell(2).getStringCellValue();
-                        String department = row.getCell(3).getStringCellValue();
-                        List<SimpleProjectime> timeCostList = new ArrayList<SimpleProjectime>();
-                        double totalTime = 0;
-                        for (int i=4; i < 4 + projectList.size(); i++) {
-                            String stringCellValue = row.getCell(i).getStringCellValue();
-                            double time = 0;
-                            if (!StringUtils.isEmpty(stringCellValue)) {
-                                time = Double.parseDouble(stringCellValue);
-                                totalTime += time;
-                                SimpleProjectime item = new SimpleProjectime();
-                                item.setProjectName(projectList.get(i-4));
-                                item.setTimeCost(time);
-                                timeCostList.add(item);
-                            }
-                        }
-                        SimpleReport report = new SimpleReport();
-                        report.setYmonth(yearMonth);
-                        report.setUsername(username);
-                        report.setCreatorId(token);
-                        report.setCompanyId(companyId);
-                        report.setDepartment(department);
-                        report.setPosition(position);
-                        report.setReportDate(LocalDate.parse(reportDate, DateTimeFormatter.ofPattern("yyyy/M/d")));
-                        report.setTimeCost(totalTime);
-                        //设置相关的项目时间表
-                        report.setProjectimeList(timeCostList);
-                        //添加到报告列表
-                        reportList.add(report);
-                    }
-                }
-                String[] notFoundNames = reportList.stream().filter(r->{
-                    return !financeList.stream().filter(f->f.getName().equals(r.getUsername())).findAny().isPresent();
-                }).map(SimpleReport::getUsername).collect(Collectors.toList()).toArray(new String[0]);
-                if (notFoundNames.length > 0) {
-                    //msg.setError(convertNameArray(notFoundNames)+" 不存在于薪资表中,请检查后提交");
-                    msg.setError(MessageUtils.message("report.noExist",convertNameArray(notFoundNames)));
-                } else {
-//                    notFoundNames = financeList.stream().filter(r->{
-//                        return !reportList.stream().filter(f->f.getUsername().equals(r.getName())).findAny().isPresent();
-//                    }).map(SimpleFinance::getName).collect(Collectors.toList()).toArray(new String[0]);
-//                    if (notFoundNames.length > 0) {
-//                        msg.setError(convertNameArray(notFoundNames)+" 不存在于工时表中,请检查后提交");
-//                    } else {
-//
-//                    }
-                    //每个人的总工时不能为零
-                    String[] names = reportList.stream().filter(r->r.getTimeCost() == 0).map(SimpleReport::getUsername).collect(Collectors.toList()).toArray(new String[0]);
-                    if (names.length > 0) {
-                        //msg.setError(convertNameArray(names)+" 工时为零,请检查");
-                        msg.setError(MessageUtils.message("report.hoursZero",convertNameArray(names)));
-                    } else {
-                        //人员检查通过,更新finance表中的时薪,方便后续计算
-                        financeList.forEach(f->{
-                            double userTotalTime = reportList.stream().filter(r->r.getUsername().equals(f.getName())).mapToDouble(SimpleReport::getTimeCost).sum();
-                            if (userTotalTime > 0) {
-                                f.setHourCost(f.getTotalCost().divide(new BigDecimal(userTotalTime), 2, BigDecimal.ROUND_UP));
-                            }
-                        });
-
-                        //批量插入
-                        simpleFinanceService.remove(new QueryWrapper<SimpleFinance>().eq("company_id", companyId).eq("ymonth", yearMonth));
-                        simpleFinanceService.saveBatch(financeList);
-                        //插入工时报告表,先删除旧数据
-                        QueryWrapper<SimpleReport> queryWrapper = new QueryWrapper<SimpleReport>().eq("company_id", companyId).eq("ymonth", yearMonth);
-                        simpleReportMapper.delete(queryWrapper);
-                        simpleReportService.saveBatch(reportList);
-                        //再查询出来,进行项目工时存储
-                        List<SimpleReport> queryList = simpleReportMapper.selectList(queryWrapper);
-                        System.out.println("queryList size=="+queryList.size());
-                        List<SimpleProjectime> allTimeList = new ArrayList<>();
-                        reportList.forEach(r->{
-                            Integer id = queryList.stream().filter(q -> q.getUsername().equals(r.getUsername())).findFirst().get().getId();
-                            List<SimpleProjectime> timeList = r.getProjectimeList();
-                            timeList.forEach(t->t.setSimpleId(id));
-                            allTimeList.addAll(timeList);
-                        });
-                        simpleProjectimeService.saveBatch(allTimeList);
-                    }
-                }
-
-            }
-        } catch (IOException e) {
-            e.printStackTrace();
-            //msg.setError("文件处理出错");
-            msg.setError(MessageUtils.message("file.error"));
-            return msg;
-        } catch (NullPointerException e) {
-            e.printStackTrace();
-            //msg.setError("数据格式有误或存在空数据 导入失败");
-            msg.setError(MessageUtils.message("file.dataFormatError"));
-            return msg;
-        }catch (InvalidFormatException e) {
-            e.printStackTrace();
-            //msg.setError("文件格式错误,如果安装了加密软件需要先解密再上传");
-            msg.setError(MessageUtils.message("file.FormatErrorAndDecrypt"));
-            return msg;
-        }catch (EncryptedDocumentException e) {
-            e.printStackTrace();
-            //msg.setError("文件加密状态,需要先解除加密状态再上传");
-            msg.setError(MessageUtils.message("file.encryption"));
-            return msg;
-        } catch (Exception e) {
-            e.printStackTrace();
-            //msg.setError("发生其他错误");
-            msg.setError(MessageUtils.message("other.error"));
-            return msg;
-        } finally {
-            //关闭流
-            try {
-                if (outputStream != null && inputStream != null) {
-                    outputStream.close();
-                    inputStream.close();
-                    System.out.println("流已关闭");
-                }
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-//            file.deleteOnExit();//程序退出时删除临时文件
-            System.out.println(file.delete());
-        }
-        return msg;
-    }
-
-    @Override
-    public HttpRespMsg exportData(String yearMonth, Integer companyId, String type, HttpServletRequest request) {
-        HttpRespMsg timeCost = getTimeCost(yearMonth, companyId, type, request);
-        WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
-        HashMap map = (HashMap)timeCost.data;
-        List<HashMap> costList = (List<HashMap>)map.get("costList");
-        List<List<String>> dataList = new ArrayList<>();
-        List<String> titleList = new ArrayList<>();
-        if ("按项目".equals(type)) {
-            //titleList.add("项目");
-            titleList.add(MessageUtils.message("entry.project"));
-        } else if ("按岗位".equals(type)) {
-            //titleList.add("岗位");
-            titleList.add(MessageUtils.message("excel.post"));
-        } else {
-            //titleList.add("部门");
-            titleList.add(MessageUtils.message("excel.department"));
-        }
-        //titleList.add("工时(h)");
-        titleList.add(MessageUtils.message("entry.workHours")+"(h)");
-        //titleList.add("成本(元)");
-        titleList.add(MessageUtils.message("entry.cost")+"(元)");
-        dataList.add(titleList);
-        //数据
-        double time = 0;
-        BigDecimal cost = new BigDecimal(0);
-        DecimalFormat df = new DecimalFormat("#0.0");
-
-        for (HashMap item : costList) {
-            List<String> data = new ArrayList<>();
-            data.add((String)item.get("name"));
-            data.add(df.format((Double)item.get("workingTime")));
-            time += (double)item.get("workingTime");
-            BigDecimal costItem = (BigDecimal)item.get("cost");
-            costItem.setScale(2, BigDecimal.ROUND_HALF_UP);
-            data.add(costItem.toString());
-            cost = cost.add(costItem);
-            dataList.add(data);
-        }
-        //合计
-        List<String> sumRow = new ArrayList<String>();
-        //sumRow.add("合计");
-        sumRow.add(MessageUtils.message("entry.total"));
-
-        sumRow.add(df.format(time));
-        cost.setScale(2, BigDecimal.ROUND_HALF_UP);
-        sumRow.add(cost.toString());
-
-        dataList.add(sumRow);
-        //生成excel文件导出
-        String fileName = yearMonth+"_"+type+MessageUtils.message("report.report")+"_"+System.currentTimeMillis();
-        try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        HttpRespMsg httpRespMsg = new HttpRespMsg();
-        return  httpRespMsg;
-    }
-
-    @Override
-    public HttpRespMsg getTimeCost(String yearMonth, Integer companyId, String type, HttpServletRequest request) {
-        HttpRespMsg msg = new HttpRespMsg();
-        List<SimpleReport> list = simpleReportService.list(new QueryWrapper<SimpleReport>().eq("company_id", companyId).eq("ymonth", yearMonth));
-        if (list.size() == 0) {
-            HashMap map = new HashMap();
-            map.put("costList", new ArrayList<>());
-            map.put("totalMoneyCost", 0);
-            msg.data = map;
-            return msg;
-        }
-        List<Integer> collect = list.stream().map(SimpleReport::getId).collect(Collectors.toList());
-        List<SimpleProjectime> projectimeList = simpleProjectimeMapper.selectList(new QueryWrapper<SimpleProjectime>().in("simple_id", collect));
-        List<String> projectList = projectimeList.stream().map(SimpleProjectime::getProjectName).distinct().collect(Collectors.toList());
-        for (SimpleReport simpleReport : list) {
-            simpleReport.setProjectimeList(projectimeList.stream().filter(p->p.getSimpleId().equals(simpleReport.getId())).collect(Collectors.toList()));
-        }
-        BigDecimal totalMoneyCost = new BigDecimal(0);
-        //按项目核算工时和成本
-        List<SimpleFinance> financeList = simpleFinanceMapper.selectList(new QueryWrapper<SimpleFinance>().eq("company_id", companyId).eq("ymonth", yearMonth));
-
-        int i=1;
-        List<HashMap> resultList = new ArrayList<>();
-        if ("按项目".equals(type)) {
-            //按项目分组
-            for (String name : projectList) {
-                HashMap<String, Object> item = new HashMap<>();
-                item.put("id", i);
-                item.put("name", name);
-                //工时
-                double workingTime = projectimeList.stream().filter(p->p.getProjectName().equals(name)).mapToDouble(SimpleProjectime::getTimeCost).sum();
-                item.put("workingTime", workingTime);
-                //成本
-                BigDecimal totalCost = new BigDecimal(0);
-                for (SimpleProjectime p : projectimeList) {
-                    if (p.getProjectName().equals(name)) {
-                        String username = list.stream().filter(report -> report.getId().equals(p.getSimpleId())).findFirst().get().getUsername();
-                        BigDecimal hourCost = financeList.stream().filter(f -> f.getName().equals(username)).findFirst().get().getHourCost();
-                        BigDecimal result = hourCost.multiply(new BigDecimal(p.getTimeCost()));
-                        totalCost = totalCost.add(result);
-                    }
-                }
-                item.put("cost", totalCost);
-                totalMoneyCost = totalMoneyCost.add(totalCost);
-                i++;
-                resultList.add(item);
-            }
-        } else if ("按岗位".equals(type)) {
-            //按岗位
-            List<String> posList = list.stream().map(SimpleReport::getPosition).distinct().collect(Collectors.toList());
-            for (String pos:posList) {
-                HashMap<String, Object> item = new HashMap<>();
-                item.put("id", i);
-                item.put("name", pos);
-                //工时
-                double workingTime = list.stream().filter(r->r.getPosition().equals(pos)).mapToDouble(SimpleReport::getTimeCost).sum();
-                item.put("workingTime", workingTime);
-                BigDecimal totalCost = new BigDecimal(0);
-                for (SimpleReport r : list) {
-                    if (r.getPosition().equals(pos)) {
-                        String username = r.getUsername();
-                        BigDecimal hourCost = financeList.stream().filter(f -> f.getName().equals(username)).findFirst().get().getHourCost();
-                        BigDecimal result = hourCost.multiply(new BigDecimal(r.getTimeCost()));
-                        totalCost = totalCost.add(result);
-                    }
-                }
-                item.put("cost", totalCost);
-                totalMoneyCost = totalMoneyCost.add(totalCost);
-                i++;
-                resultList.add(item);
-            }
-        } else {
-            //按部门
-            //按岗位
-            List<String> deptList = list.stream().map(SimpleReport::getDepartment).distinct().collect(Collectors.toList());
-            for (String dept:deptList) {
-                HashMap<String, Object> item = new HashMap<>();
-                item.put("id", i);
-                item.put("name", dept);
-                //工时
-                double workingTime = list.stream().filter(r->r.getDepartment().equals(dept)).mapToDouble(SimpleReport::getTimeCost).sum();
-                item.put("workingTime", workingTime);
-                BigDecimal totalCost = new BigDecimal(0);
-                for (SimpleReport r : list) {
-                    if (r.getDepartment().equals(dept)) {
-                        String username = r.getUsername();
-                        BigDecimal hourCost = financeList.stream().filter(f -> f.getName().equals(username)).findFirst().get().getHourCost();
-                        BigDecimal result = hourCost.multiply(new BigDecimal(r.getTimeCost()));
-                        totalCost = totalCost.add(result);
-                    }
-                }
-                item.put("cost", totalCost);
-                totalMoneyCost = totalMoneyCost.add(totalCost);
-                i++;
-                resultList.add(item);
-            }
-        }
-
-        HashMap map = new HashMap();
-        map.put("costList", resultList);
-        map.put("totalMoneyCost", totalMoneyCost);
-        msg.data = map;
-        return msg;
-    }
-
-    @Override
-    public HttpRespMsg getReportByMonth(Integer companyId, String yearMonth) {
-        List<SimpleReport> list = simpleReportService.list(new QueryWrapper<SimpleReport>().eq("company_id", companyId).eq("ymonth", yearMonth));
-        List<String> projectList = new ArrayList<>();
-        if (list.size() > 0) {
-            List<Integer> collect = list.stream().map(SimpleReport::getId).collect(Collectors.toList());
-            List<SimpleProjectime> projectimeList = simpleProjectimeMapper.selectList(new QueryWrapper<SimpleProjectime>().in("simple_id", collect));
-            projectList = projectimeList.stream().map(SimpleProjectime::getProjectName).distinct().collect(Collectors.toList());
-            for (SimpleReport simpleReport : list) {
-                simpleReport.setProjectimeList(projectimeList.stream().filter(p->p.getSimpleId().equals(simpleReport.getId())).collect(Collectors.toList()));
-            }
-        }
-
-        HashMap map = new HashMap();
-        map.put("records", list);
-        map.put("projectList", projectList);
-        HttpRespMsg msg = new HttpRespMsg();
-        msg.data = map;
-        return msg;
-    }
-
-    String convertNameArray(String[] data) {
-        String s = "";
-        for (int i=0;i<data.length; i++) {
-            s += data[i];
-            if (i < data.length-1) {
-                s += ",";
-            }
-        }
-        return s;
-    }
-}

+ 0 - 28
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/SimpleFinanceMapper.xml

@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.management.platform.mapper.SimpleFinanceMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.management.platform.entity.SimpleFinance">
-        <id column="id" property="id" />
-        <result column="name" property="name" />
-        <result column="company_id" property="companyId" />
-        <result column="month_cost" property="monthCost" />
-        <result column="bonus" property="bonus" />
-        <result column="allowance" property="allowance" />
-        <result column="insurance_old" property="insuranceOld" />
-        <result column="insurance_medical" property="insuranceMedical" />
-        <result column="insurance_losejob" property="insuranceLosejob" />
-        <result column="house_fund" property="houseFund" />
-        <result column="others" property="others" />
-        <result column="total_cost" property="totalCost" />
-        <result column="ymonth" property="ymonth" />
-        <result column="hour_cost" property="hourCost" />
-    </resultMap>
-
-    <!-- 通用查询结果列 -->
-    <sql id="Base_Column_List">
-        id, name, company_id, month_cost, bonus, allowance, insurance_old, insurance_medical, insurance_losejob, house_fund, others, total_cost, ymonth, hour_cost
-    </sql>
-
-</mapper>

+ 0 - 18
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/SimpleProjectimeMapper.xml

@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.management.platform.mapper.SimpleProjectimeMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.management.platform.entity.SimpleProjectime">
-        <id column="id" property="id" />
-        <result column="simple_id" property="simpleId" />
-        <result column="project_name" property="projectName" />
-        <result column="time_cost" property="timeCost" />
-    </resultMap>
-
-    <!-- 通用查询结果列 -->
-    <sql id="Base_Column_List">
-        id, simple_id, project_name, time_cost
-    </sql>
-
-</mapper>

+ 0 - 24
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/SimpleReportMapper.xml

@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.management.platform.mapper.SimpleReportMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.management.platform.entity.SimpleReport">
-        <id column="id" property="id" />
-        <result column="company_id" property="companyId" />
-        <result column="ymonth" property="ymonth" />
-        <result column="report_date" property="reportDate" />
-        <result column="username" property="username" />
-        <result column="position" property="position" />
-        <result column="department" property="department" />
-        <result column="time_cost" property="timeCost" />
-        <result column="indate" property="indate" />
-        <result column="creator_id" property="creatorId" />
-    </resultMap>
-
-    <!-- 通用查询结果列 -->
-    <sql id="Base_Column_List">
-        id, company_id, ymonth, report_date, username, position, department, time_cost, indate, creator_id
-    </sql>
-
-</mapper>

BIN
fhKeeper/formulahousekeeper/management-workshop/workshop_print.2024-06-24.log.gz


+ 1 - 1
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/workView/fillReport.vue

@@ -230,7 +230,7 @@ export default {
           if (res.code == "ok") {
             this.$toast.success('提交成功')
           } else {
-            this.$toast.fail(res.msg);
+            this.$toast.fail({ message: res.msg, duration: 5000});
           }
         }).catch(err => { this.$toast.clear(); });
     },

+ 2 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -1382,7 +1382,7 @@
             <div class="tree" style="height:400px">
                 <el-scrollbar style="height:100%">
                 <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
-                    ref="chooseMembTreePersonnel" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
+                    ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
                     highlight-current :filter-node-method="filterNode" :default-expand-all="expandAlltree">
                     <span class="custom-tree-node" slot-scope="{ node }">
                         <span v-if="user.userNameNeedTranslate == '1'">
@@ -8758,7 +8758,7 @@
                         const userListName = res.data.records.map(item => item.name)
                         this.handleThreeData(userListName)
                         setTimeout(() => {
-                            this.changeTreeNodeStatus(this.$refs.chooseMembTreePersonnel.store.root)
+                            this.changeTreeNodeStatus(this.$refs.chooseMembTree.store.root)
                         }, 200)
                     }else{
                         this.deptMembDataLoading = false