Browse Source

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

hfxc226 2 năm trước cách đây
mục cha
commit
70e9ae7b51
23 tập tin đã thay đổi với 753 bổ sung1 xóa
  1. 5 0
      platform-common/src/main/java/com/platform/common/constant/CommonConstants.java
  2. 2 0
      platform-dao/src/main/java/com/platform/dao/dto/fill/FillGatherTaskDTO.java
  3. 9 0
      platform-dao/src/main/java/com/platform/dao/dto/repair/RepairApplicationFormDTO.java
  4. 5 0
      platform-dao/src/main/java/com/platform/dao/dto/sb/SbInfoDTO.java
  5. 7 0
      platform-dao/src/main/java/com/platform/dao/dto/store/OutStoreFormDTO.java
  6. 5 0
      platform-dao/src/main/java/com/platform/dao/entity/repair/RepairApplicationForm.java
  7. 5 0
      platform-dao/src/main/java/com/platform/dao/entity/store/OutStoreForm.java
  8. 122 0
      platform-dao/src/main/java/com/platform/dao/enums/RepairApplicationFormStatusNameEnum.java
  9. 2 0
      platform-dao/src/main/java/com/platform/dao/mapper/fill/FillGatherTaskMapper.java
  10. 6 0
      platform-dao/src/main/java/com/platform/dao/mapper/repair/RepairApplicationFormMapper.java
  11. 6 1
      platform-dao/src/main/java/com/platform/dao/mapper/store/OutStoreFormMapper.java
  12. 9 0
      platform-dao/src/main/java/com/platform/dao/vo/query/store/OutStoreFormVO.java
  13. 7 0
      platform-dao/src/main/java/com/platform/dao/vo/repair/RepairApplicationFormVO.java
  14. 46 0
      platform-dao/src/main/java/com/platform/dao/vo/repair/WorkPlaceStatisticVO.java
  15. 22 0
      platform-dao/src/main/resources/mapper/fill/FillGatherTaskMapper.xml
  16. 28 0
      platform-dao/src/main/resources/mapper/repair/RepairApplicationFormMapper.xml
  17. 16 0
      platform-dao/src/main/resources/mapper/sb/SbInfoMapper.xml
  18. 44 0
      platform-dao/src/main/resources/mapper/store/OutStoreFormMapper.xml
  19. 37 0
      platform-rest/src/main/java/com/platform/rest/controller/index/IndexController.java
  20. 8 0
      platform-service/src/main/java/com/platform/service/repair/RepairApplicationFormService.java
  21. 10 0
      platform-service/src/main/java/com/platform/service/repair/impl/RepairApplicationFormServiceImpl.java
  22. 25 0
      platform-service/src/main/java/com/platform/service/workplace/IndexService.java
  23. 327 0
      platform-service/src/main/java/com/platform/service/workplace/impl/IndexServiceImpl.java

+ 5 - 0
platform-common/src/main/java/com/platform/common/constant/CommonConstants.java

@@ -325,4 +325,9 @@ public interface CommonConstants {
     int NO_PLAN_FLAG = 2; // 非计划性维修
     int OTHER = 3; // 其他
     int NORMAL = 4; // 日常维修
+
+
+    // 打印类型
+    String REPAIR_TICKET_PRINT = "1"; //票证维修打印
+    String OUT_STORE_PRINT = "2";  // 出库单打印
 }

+ 2 - 0
platform-dao/src/main/java/com/platform/dao/dto/fill/FillGatherTaskDTO.java

@@ -159,4 +159,6 @@ public class FillGatherTaskDTO extends BaseDTO implements Serializable {
      */
     private Integer generateNum;
 
+    private List<Integer> statusList;
+
 }

+ 9 - 0
platform-dao/src/main/java/com/platform/dao/dto/repair/RepairApplicationFormDTO.java

@@ -345,6 +345,10 @@ public class RepairApplicationFormDTO extends BaseDTO implements Serializable {
 
     private LocalDateTime repairStartTimeEnd;
 
+    private LocalDateTime applyStartTime;
+
+    private LocalDateTime applyEndTime;
+
     /**
      * 维修人员ID,原有的被用在特殊地方,详见.xml
      */
@@ -483,4 +487,9 @@ public class RepairApplicationFormDTO extends BaseDTO implements Serializable {
      */
     private String positionId;
 
+    /**
+     * 是否已打印 0 否 1 是
+     */
+    private Integer printFlag;
+
 }

+ 5 - 0
platform-dao/src/main/java/com/platform/dao/dto/sb/SbInfoDTO.java

@@ -609,4 +609,9 @@ public class SbInfoDTO extends BaseDTO implements Serializable {
      * 前端勾选的ID
      */
     private List<String> ids;
+
+    /**
+     * 完善标识 1 位号 2 设备型号  3 资产编码 4 设备类型
+     */
+    private Integer replenishFlag;
 }

+ 7 - 0
platform-dao/src/main/java/com/platform/dao/dto/store/OutStoreFormDTO.java

@@ -161,4 +161,11 @@ public class OutStoreFormDTO extends BaseDTO implements Serializable {
     private Integer outFlag;
 
     private String feeFrom;
+
+    /**
+     * 是否已打印 0 否 1 是
+     */
+    private Integer printFlag;
+
+    private List<Integer> statusList;
 }

+ 5 - 0
platform-dao/src/main/java/com/platform/dao/entity/repair/RepairApplicationForm.java

@@ -345,4 +345,9 @@ public class RepairApplicationForm implements Serializable {
      */
     @Transient
     private LocalDateTime planEndTime;
+
+    /**
+     * 是否已打印 0 否 1 是
+     */
+    private Integer printFlag;
 }

+ 5 - 0
platform-dao/src/main/java/com/platform/dao/entity/store/OutStoreForm.java

@@ -117,4 +117,9 @@ public class OutStoreForm implements Serializable{
      * 成本归属
      */
     private String feeFrom;
+
+    /**
+     * 是否已打印 0 否 1 是
+     */
+    private Integer printFlag;
 }

+ 122 - 0
platform-dao/src/main/java/com/platform/dao/enums/RepairApplicationFormStatusNameEnum.java

@@ -0,0 +1,122 @@
+package com.platform.dao.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @Description 报修单状态枚举
+ * @Author liuyu
+ * @Date 2020/05/05
+ * @Version Copyright (c) 2020,合肥乾元坤合科技有限公司 All rights reserved.
+ */
+@Getter
+@AllArgsConstructor
+public enum RepairApplicationFormStatusNameEnum {
+    /**
+     * 待接收
+     */
+    NOT_ALLOCATED(1,"待接单"),
+    /**
+     * 维修中
+     */
+    PROCESSING(2,"维修中"),
+    /**
+     * 待审核
+     * 龙岩-待工程师审核
+     */
+    WAIT_SUBMIT(3,"待审核"),
+    /**
+     * 审核中
+     * 龙岩-待生产审核
+     */
+    NOT_ACCEPTANCE(4,"生产审核"),
+    /**
+     * 已驳回
+     * 生产驳回
+     */
+    REBACK(5,"已驳回"),
+    /**
+     * 	已完成/生产审核通过
+     */
+    FINISHED(6,"已完成"),
+    /**
+     * 	报修被拒
+     */
+    REFUSED_REPAIR(7,"报修被拒"),
+    /**
+     * 维修上报-自己无法处理
+     */
+    REPAIR_FAIL(8,"维修上报"),
+    /**
+     * 	(工程师或维修主管)已接单
+     */
+    RECEIVED(9,"已接单"),
+    /**
+     * 维修挂起
+     */
+    HANG_UP(10,"维修挂起"),
+    /**
+     * 转派维修
+     */
+    DISPATCH_REPAIR(11,"转派维修"),
+    /**
+     * 主管派单
+     */
+    MM_DISPATCH(12,"主管派单"),
+    /**
+     * 维修主管-维修上报
+     */
+    MM_REPAIR_FAIL(13,"工程师上报"),
+    /**
+     * 工单关闭
+     */
+    MM_REPAIR_CLOSE(14,"已关闭"),
+    /**
+     * 报修一审中
+     */
+    CALLER_REPAIR_VERIFYING_ONE(15,"报修一审中"),
+    /**
+     * 报修一审被拒
+     */
+    CALLER_REPAIR_VERIFY_FAIL_ONE(16,"报修一审被拒"),
+    /**
+     * 报修二审中
+     */
+    CALLER_REPAIR_VERIFYING_TWO(17,"报修二审中"),
+    /**
+     * 报修二审审被拒
+     */
+    CALLER_REPAIR_VERIFY_FAIL_TWO(18,"报修二审审被拒"),
+    /**
+     * 报修三审被中
+     */
+    CALLER_REPAIR_VERIFYING_THREE(19,"报修三审中"),
+    /**
+     * 报修三审审被拒
+     */
+    CALLER_REPAIR_VERIFY_FAIL_THREE(20,"报修三审审被拒"),
+    /**
+     * 大修审核中
+     */
+    BIG_REPAIR_VERIFYING(21,"大修审核中"),
+    /**
+     * 计划性维修报修成功
+     */
+    CALLER_REPAIR_VERIFY_SUCCESS_THREE(22,"计划性维修报修成功"),
+    ;
+    private final Integer value;
+    private final String name;
+
+    public static Map<Integer,String> getMapData(){
+        Map<Integer,String> maps = new HashMap<>();
+        RepairApplicationFormStatusNameEnum.values();
+        for (RepairApplicationFormStatusNameEnum obj : RepairApplicationFormStatusNameEnum.values()) {
+            maps.put(obj.getValue(), obj.getName());
+        }
+        return maps;
+    }
+
+}

+ 2 - 0
platform-dao/src/main/java/com/platform/dao/mapper/fill/FillGatherTaskMapper.java

@@ -23,4 +23,6 @@ public interface FillGatherTaskMapper extends MyMapper<FillGatherTask> {
      */
     List<FillGatherTaskVO> selectList(FillGatherTaskDTO dto);
 
+    Integer countTaskNum(FillGatherTaskDTO dto);
+
 }

+ 6 - 0
platform-dao/src/main/java/com/platform/dao/mapper/repair/RepairApplicationFormMapper.java

@@ -90,4 +90,10 @@ public interface RepairApplicationFormMapper extends MyMapper<RepairApplicationF
      * @return
      */
     Integer countRepair(RepairApplicationFormDTO model);
+
+    /**
+     * 获取维修状态分布集合
+     * @return
+     */
+    List<RepairApplicationFormVO> selectCountByStatus();
 }

+ 6 - 1
platform-dao/src/main/java/com/platform/dao/mapper/store/OutStoreFormMapper.java

@@ -45,6 +45,11 @@ public interface OutStoreFormMapper extends MyMapper<OutStoreForm> {
 
     BigDecimal getOutStoreFormCount(String storeId);
 
-
+    /**
+     * 统计一段时间的出库领料数据
+     * @param outStoreFormDTO
+     * @return
+     */
+    List<OutStoreFormVO> getCurrentlyList(OutStoreFormDTO outStoreFormDTO);
 
 }

+ 9 - 0
platform-dao/src/main/java/com/platform/dao/vo/query/store/OutStoreFormVO.java

@@ -124,4 +124,13 @@ public class OutStoreFormVO extends BaseVO implements Serializable {
     private Integer outFlag;
 
     private String feeFrom; // 成本归属
+
+    /**
+     * 是否已打印 0 否 1 是
+     */
+    private Integer printFlag;
+
+    private String weekDayName; // 日期
+
+    private Integer totalNum; // 出库总数
 }

+ 7 - 0
platform-dao/src/main/java/com/platform/dao/vo/repair/RepairApplicationFormVO.java

@@ -454,4 +454,11 @@ public class RepairApplicationFormVO extends BaseVO implements Serializable {
 
     private String positionId;
 
+    /**
+     * 是否已打印 0 否 1 是
+     */
+    private Integer printFlag;
+
+    private String statusName;
+
 }

+ 46 - 0
platform-dao/src/main/java/com/platform/dao/vo/repair/WorkPlaceStatisticVO.java

@@ -0,0 +1,46 @@
+package com.platform.dao.vo.repair;
+
+import com.platform.dao.vo.query.store.OutStoreFormVO;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.List;
+
+@Data
+public class WorkPlaceStatisticVO implements Serializable {
+
+    private int repairTicketPrintNum; // 票证待打印数量
+
+    private int outStorePrintNum; // 出库待打印数量
+
+    private int repairNum; // 维修中数量
+
+    private int fillCheckNum; // 巡检任务数量
+
+    private int verifyRepairNum; // 维修审批数量
+
+    private BigDecimal verifyOutStoreNum; // 出库审批数量
+
+    private int jljdNum; // 计量待检定数量
+
+    private int specialNum; // 特种待检定数量
+
+    private int repairCloseNum; // 待关闭工单数量
+
+    private int positionNoNum; // 待完善位号设备数量
+
+    private int xinhaoNum; // 待完善型号设备数量
+
+    private int financingNoNum; // 待完善资产编码设备数量
+
+    private int sbTypeNum; // 待完善设备类型数量
+
+    private List<RepairApplicationFormVO> repairStatusList; // 维修状态饼状图数据
+
+    private List<RepairApplicationFormVO> factoryRoomList; // 十大车间饼状图数据
+
+    private List<RepairApplicationFormVO> weekRepairList; // 近一周报修柱状图数据统计
+
+    private List<OutStoreFormVO> weekOutStoreList; // 近一周出库柱状图数据统计
+}

+ 22 - 0
platform-dao/src/main/resources/mapper/fill/FillGatherTaskMapper.xml

@@ -109,4 +109,26 @@
             <include refid="List_Condition"/>
         </where>
     </select>
+
+    <select id="countTaskNum" parameterType="com.platform.dao.dto.fill.FillGatherTaskDTO"
+            resultType="java.lang.Integer">
+        select count(1) from t_fill_gather_task
+        <where>
+            <if test="statusList != null and statusList.size > 0">
+                AND status in
+                <foreach item="item" index="index" collection="statusList" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="status != null">
+                AND status = #{status}
+            </if>
+            <if test="checkLeader != null and checkLeader != ''">
+                and check_leader = #{checkLeader}
+            </if>
+            <if test="checker != null and checker != ''">
+                and checker = #{checker}
+            </if>
+        </where>
+    </select>
 </mapper>

+ 28 - 0
platform-dao/src/main/resources/mapper/repair/RepairApplicationFormMapper.xml

@@ -164,9 +164,21 @@
             <if test="searchEndTime != null">
                 and repair_start_time <![CDATA[<]]> #{searchEndTime}
             </if>
+            <if test="applyStartTime != null">
+                and apply_time <![CDATA[>]]> #{applyStartTime}
+            </if>
+            <if test="applyEndTime != null">
+                and apply_time <![CDATA[<]]> #{applyEndTime}
+            </if>
             <if test="repairUserId != null">
                 and repair_user_id = #{repairUserId}
             </if>
+            <if test="printFlag != null">
+                and print_flag = #{printFlag}
+            </if>
+            <if test="status != null">
+                and status = #{status}
+            </if>
         </where>
     </select>
     <!-- 近月统计单数和费用 -->
@@ -445,9 +457,25 @@
                     #{item}
                 </foreach>
             </if>
+            <if test="status != null">
+                AND form.status = #{status}
+            </if>
             <if test="positionId != null and positionId != ''">
                 and sb.position_id = #{positionId}
             </if>
+            <if test="reportLeaderId != null and reportLeaderId != ''">
+                and form.report_leader_id = #{reportLeaderId}
+            </if>
+            <if test="dispatchUserId != null and dispatchUserId != ''">
+                and form.dispatch_user_id = #{dispatchUserId}
+            </if>
+            <if test="printFlag != null">
+                and form.print_flag = #{printFlag}
+            </if>
         </where>
     </select>
+
+    <select id="selectCountByStatus" resultType="com.platform.dao.vo.repair.RepairApplicationFormVO">
+        select count(1) as repairNum,status from t_repair_application_form GROUP BY status
+    </select>
 </mapper>

+ 16 - 0
platform-dao/src/main/resources/mapper/sb/SbInfoMapper.xml

@@ -878,6 +878,22 @@ sb.scrap_user_name,sb.repair_dept_id
             <if test="measureStatus != null">
                 and measure_status = #{measureStatus}
             </if>
+            <choose>
+                <when test="replenishFlag != null">
+                    <if test="replenishFlag == 1">
+                        and (position_no is null or position_no = '' or position_no = '暂无')
+                    </if>
+                    <if test="replenishFlag == 2">
+                        and (model is null or model = '' or model = '暂无')
+                    </if>
+                    <if test="replenishFlag == 3">
+                        and (financing_no is null or financing_no = '')
+                    </if>
+                    <if test="replenishFlag == 4">
+                        and (type_id is null or type_id = '' or type_id = '暂无')
+                    </if>
+                </when>
+            </choose>
         </where>
     </select>
 </mapper>

+ 44 - 0
platform-dao/src/main/resources/mapper/store/OutStoreFormMapper.xml

@@ -231,12 +231,56 @@ outstoreform.process_instance_id,
             <if test="userId != null and userId != ''">
                 and form.update_user_id = #{userId}
             </if>
+            <if test="createdUserId != null and createdUserId != ''">
+                and form.created_user_id = #{createdUserId}
+            </if>
             <if test="status !=null ">
                 and form.status = #{status}
             </if>
             <if test="outFlag != null">
                 and form.out_flag = #{outFlag}
             </if>
+            <if test="printFlag != null">
+                and form.print_flag = #{printFlag}
+            </if>
+            <if test="statusList != null and statusList.size > 0">
+                and form.status in
+                <foreach item="item" index="index" collection="statusList" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+    </select>
+
+    <!-- 出库统计数据 -->
+    <select id="getCurrentlyList" parameterType="com.platform.dao.dto.store.OutStoreFormDTO"
+            resultType="com.platform.dao.vo.query.store.OutStoreFormVO">
+        select * from t_out_store_form
+        <where>
+            <if test="createdTimeStart != null">
+                and created_time <![CDATA[>]]> #{createdTimeStart}
+            </if>
+            <if test="createdTimeEnd != null">
+                and created_time <![CDATA[<]]> #{createdTimeEnd}
+            </if>
+            <if test="status != null">
+                and status = #{status}
+            </if>
+            <if test="outFlag != null">
+                and out_flag = #{outFlag}
+            </if>
+            <if test="printFlag != null">
+                and print_flag = #{printFlag}
+            </if>
+            <if test="statusList != null and statusList.size > 0">
+                and status in
+                <foreach item="item" index="index" collection="statusList" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="createdUserId != null and createdUserId != ''">
+                and created_user_id = #{createdUserId}
+            </if>
         </where>
     </select>
 

+ 37 - 0
platform-rest/src/main/java/com/platform/rest/controller/index/IndexController.java

@@ -149,4 +149,41 @@ public class IndexController {
         return indexService.getStatisticRepairNum();
     }
 
+    /**
+     * 工作台数据
+     * @return R
+     */
+    @GetMapping("/workPlace/data")
+    public R workPlaceData() {
+        return new R(indexService.getWorkPlaceData());
+    }
+
+    /**
+     * 维修票证打印列表
+     * @return R
+     */
+    @GetMapping("/workPlace/repair/ticket/list")
+    public R repairTicketList() {
+        return new R(indexService.getRepairPrintList());
+    }
+
+    /**
+     * 出库单打印列表
+     * @return R
+     */
+    @GetMapping("/workPlace/outStore/ticket/list")
+    public R outStoreTicketList() {
+        return new R(indexService.getOutStorePrintList());
+    }
+
+    /**
+     * 维修票证打印列表
+     * @return R
+     */
+    @PutMapping("/ticket/print/{type}/{id}")
+    public R outStoreTicketList(@PathVariable("id") String id,@PathVariable("type") String type) {
+        indexService.printedTicket(type,id);
+        return new R();
+    }
+
 }

+ 8 - 0
platform-service/src/main/java/com/platform/service/repair/RepairApplicationFormService.java

@@ -177,4 +177,12 @@ public interface RepairApplicationFormService extends IBaseService<RepairApplica
      * @return
      */
     Integer countRepair(RepairApplicationFormDTO model);
+
+    /**
+     * 获取维修状态分布集合
+     * @return
+     */
+    List<RepairApplicationFormVO> selectCountByStatus();
+
+    List<RepairApplicationFormVO> getCurrentlyListByDTO(RepairApplicationFormDTO model);
 }

+ 10 - 0
platform-service/src/main/java/com/platform/service/repair/impl/RepairApplicationFormServiceImpl.java

@@ -653,6 +653,16 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
         return mapper.countRepair(model);
     }
 
+    @Override
+    public List<RepairApplicationFormVO> selectCountByStatus() {
+        return mapper.selectCountByStatus();
+    }
+
+    @Override
+    public List<RepairApplicationFormVO> getCurrentlyListByDTO(RepairApplicationFormDTO model) {
+        return mapper.getCurrentlyList(model);
+    }
+
     @Override
     public R getStoreForm(UserInfo userInfo) {
         InStoreFormDTO inStoreFormDTO=new InStoreFormDTO();

+ 25 - 0
platform-service/src/main/java/com/platform/service/workplace/IndexService.java

@@ -1,6 +1,11 @@
 package com.platform.service.workplace;
 
 import com.platform.common.util.R;
+import com.platform.dao.vo.query.store.OutStoreFormVO;
+import com.platform.dao.vo.repair.RepairApplicationFormVO;
+import com.platform.dao.vo.repair.WorkPlaceStatisticVO;
+
+import java.util.List;
 
 public interface IndexService {
 
@@ -45,4 +50,24 @@ public interface IndexService {
      */
     R getStatisticRepairNum();
 
+    /**
+     * 获取工作台数据
+     * @return
+     */
+    WorkPlaceStatisticVO getWorkPlaceData();
+
+    /**
+     * 获取票证打印列表
+     * @return
+     */
+    List<RepairApplicationFormVO> getRepairPrintList();
+
+    /**
+     * 获取出库单打印列表
+     * @return
+     */
+    List<OutStoreFormVO> getOutStorePrintList();
+
+    void printedTicket(String type,String id);
+
 }

+ 327 - 0
platform-service/src/main/java/com/platform/service/workplace/impl/IndexServiceImpl.java

@@ -1,26 +1,37 @@
 package com.platform.service.workplace.impl;
 
 import com.platform.common.constant.CommonConstants;
+import com.platform.common.model.UserInfo;
 import com.platform.common.util.*;
+import com.platform.dao.dto.fill.FillGatherTaskDTO;
 import com.platform.dao.dto.hidden.HiddenDangerDTO;
 import com.platform.dao.dto.repair.RepairApplicationFormDTO;
 import com.platform.dao.dto.sb.SbInfoDTO;
+import com.platform.dao.dto.store.OutStoreFormDTO;
+import com.platform.dao.entity.repair.RepairApplicationForm;
+import com.platform.dao.entity.store.OutStoreForm;
 import com.platform.dao.enums.*;
+import com.platform.dao.mapper.fill.FillGatherTaskMapper;
 import com.platform.dao.mapper.hidden.HiddenDangerMapper;
 import com.platform.dao.mapper.sb.SbInfoMapper;
 import com.platform.dao.mapper.sb.SbPositionMapper;
+import com.platform.dao.mapper.store.OutStoreFormMapper;
+import com.platform.dao.vo.query.store.OutStoreFormVO;
 import com.platform.dao.vo.repair.IndexStatisticVO;
 import com.platform.dao.vo.repair.RepairApplicationFormVO;
+import com.platform.dao.vo.repair.WorkPlaceStatisticVO;
 import com.platform.service.repair.RepairApplicationFormService;
 import com.platform.service.repair.RepairFeeService;
 import com.platform.service.sqarepartmanage.SparePartInfoService;
 import com.platform.service.store.InStoreFormService;
+import com.platform.service.upms.SysUserRoleService;
 import com.platform.service.workplace.IndexService;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -40,6 +51,12 @@ public class IndexServiceImpl implements IndexService {
     private HiddenDangerMapper hiddenDangerMapper;
     @Resource
     private SbPositionMapper sbPositionMapper;
+    @Resource
+    private SysUserRoleService sysUserRoleService;
+    @Resource
+    private OutStoreFormMapper outStoreFormMapper;
+    @Resource
+    private FillGatherTaskMapper fillGatherTaskMapper;
 
 
     @Override
@@ -210,6 +227,221 @@ public class IndexServiceImpl implements IndexService {
         return r;
     }
 
+    @Override
+    public WorkPlaceStatisticVO getWorkPlaceData() {
+        WorkPlaceStatisticVO result = new WorkPlaceStatisticVO();
+        // 班组长&维修人  工程师  区域负责人  报修生产(超级管理员)
+        UserInfo userInfo = SecurityUtils.getUserInfo();
+        if(userInfo.getSuperAdmin() == 0){
+            String roles = sysUserRoleService.getRoleCodesByUserId(); // 获取角色集合
+            if(roles.contains(SysRoleCodeEnum.MM.name())){ // 区域负责人
+                handleMM(result,1);
+            }else if(roles.contains(SysRoleCodeEnum.REPAIR_MANAGE.name())){ // 工程师
+                handleRepairManage(result);
+            }else if(roles.contains(SysRoleCodeEnum.Maintenance.name()) || roles.contains(SysRoleCodeEnum.Maintenance_Leader.name())){
+                // 班组长&维修人
+                handleMaintenance(result);
+            }else{
+                handleMM(result,0);
+            }
+        }else{
+            handleMM(result,0);
+        }
+        // 处理公共数据
+        handleCommon(result);
+        return result;
+    }
+
+    @Override
+    public List<RepairApplicationFormVO> getRepairPrintList() {
+        RepairApplicationFormDTO queryDTO = new RepairApplicationFormDTO();
+        queryDTO.setRepairUserId(SecurityUtils.getUserInfo().getUserId());
+        queryDTO.setStatus(RepairApplicationFormStatusEnum.PROCESSING.getValue());
+        queryDTO.setPrintFlag(YesNoEnum.NO.getValue());
+        return repairApplicationFormService.getCurrentlyListByDTO(queryDTO);
+    }
+
+    @Override
+    public List<OutStoreFormVO> getOutStorePrintList() {
+        OutStoreFormDTO queryOutSotre = new OutStoreFormDTO();
+        List<Integer> statusList = ListUtils.newArrayList();
+        statusList.add(OutStoreStatusEnum.PUSH_OK.getValue());
+        statusList.add(OutStoreStatusEnum.FINISH.getValue());
+        queryOutSotre.setStatusList(statusList);
+        queryOutSotre.setPrintFlag(YesNoEnum.NO.getValue());
+        queryOutSotre.setCreatedUserId(SecurityUtils.getUserInfo().getUserId());
+        return outStoreFormMapper.getCurrentlyList(queryOutSotre);
+    }
+
+    @Override
+    public void printedTicket(String type, String id) {
+        switch (type){
+            case CommonConstants.REPAIR_TICKET_PRINT:
+                RepairApplicationForm updForm = new RepairApplicationForm();
+                updForm.setId(id);
+                updForm.setPrintFlag(YesNoEnum.YES.getValue());
+                repairApplicationFormService.modModelByPrimaryKey(updForm);
+                break;
+            case CommonConstants.OUT_STORE_PRINT:
+                OutStoreForm form = new OutStoreForm();
+                form.setId(id);
+                form.setPrintFlag(YesNoEnum.YES.getValue());
+                outStoreFormMapper.updateByPrimaryKeySelective(form);
+                break;
+        }
+    }
+
+    /**
+     * 处理区域负责人,超级,普通其他人员
+     * @param result
+     * @param mmFlag 1 负责人 0 否
+     */
+    private void handleMM(WorkPlaceStatisticVO result,Integer mmFlag){
+        // 区域负责人多一个维修审批
+        RepairApplicationFormDTO queryDTO = new RepairApplicationFormDTO();
+        if(mmFlag == 1){
+            queryDTO.setStatus(RepairApplicationFormStatusEnum.CALLER_REPAIR_VERIFYING_TWO.getValue());
+            queryDTO.setReportLeaderId(SecurityUtils.getUserInfo().getUserId());
+        }else{
+            // 计划维修生产审核
+            queryDTO.setStatus(RepairApplicationFormStatusEnum.CALLER_REPAIR_VERIFYING_THREE.getValue());
+            queryDTO.setProduceVerifyUserId(SecurityUtils.getUserInfo().getUserId());
+        }
+        Integer verifyNum = repairApplicationFormService.countRepair(queryDTO);
+        result.setVerifyRepairNum(verifyNum == null ? 0 : verifyNum);
+        // 维修状态数据
+        List<RepairApplicationFormVO> statusList = repairApplicationFormService.selectCountByStatus();
+        Map<Integer,String> statusMap = RepairApplicationFormStatusNameEnum.getMapData();
+        statusList.forEach(item -> {
+            item.setStatusName(statusMap.get(item.getStatus()));
+        });
+        result.setRepairStatusList(statusList);
+        // 十大车间维修数
+        List<RepairApplicationFormVO> factoryRoom = repairApplicationFormService.selectCountByPosition(queryDTO);
+        if(factoryRoom != null && factoryRoom.size() > 0){
+            for(int i=0;i<factoryRoom.size();i++){
+                RepairApplicationFormVO vo = factoryRoom.get(i);
+                if(i <= 9){
+                    vo.setSbPositionName(sbPositionMapper.selectNameById(vo.getPositionId()));
+                }
+            }
+        }
+        result.setFactoryRoomList(factoryRoom);
+        LocalDateTime now = LocalDateTime.now();
+        LocalDateTime startTime = now.plusDays(-6).withHour(0).withMinute(0).withSecond(0);
+        LocalDateTime endTime = now.withHour(23).withMinute(59).withSecond(59);
+        // 近一周报修统计
+        getCurrentlyRepairNum(startTime,endTime,result);
+        // 近一周领料出库统计
+        getCurrentlyOutStoreNum(startTime,endTime,result);
+    }
+
+    /**
+     * 处理工程师数据
+     * @param result
+     */
+    private void handleRepairManage(WorkPlaceStatisticVO result){
+        RepairApplicationFormDTO queryDTO = new RepairApplicationFormDTO();
+        queryDTO.setDispatchUserId(SecurityUtils.getUserInfo().getUserId());
+        // 维修审核
+        List<Integer> statusList = new ArrayList<>();
+        statusList.add(RepairApplicationFormStatusEnum.WAIT_SUBMIT.getValue());
+        statusList.add(RepairApplicationFormStatusEnum.CALLER_REPAIR_VERIFYING_ONE.getValue());
+        queryDTO.setStatusList(statusList);
+        Integer num = repairApplicationFormService.countRepair(queryDTO);
+        result.setVerifyRepairNum(num == null ? 0 : num);
+        queryDTO.setStatus(RepairApplicationFormStatusEnum.FINISHED.getValue());
+        queryDTO.setStatusList(null);
+        // 待关闭工单
+        num = repairApplicationFormService.countRepair(queryDTO);
+        result.setRepairCloseNum(num == null ? 0 : num);
+        // 巡检审核
+        FillGatherTaskDTO taskDTO = new FillGatherTaskDTO();
+        taskDTO.setCheckLeader(SecurityUtils.getUserInfo().getUserId());
+        taskDTO.setStatus(FillGatherTaskStatusEnum.COMPLETED.getValue());
+        num = fillGatherTaskMapper.countTaskNum(taskDTO);
+        result.setFillCheckNum(num == null ? 0 : num);
+        // 出库审批
+        OutStoreFormDTO outStoreFormDTO = new OutStoreFormDTO();
+        outStoreFormDTO.setUserId(SecurityUtils.getUserInfo().getUserId());
+        outStoreFormDTO.setStatus(OutStoreStatusEnum.NOT_EXECUTE.getValue());
+        BigDecimal outVerifyNum = outStoreFormMapper.getOutStoreFormCount1(outStoreFormDTO);
+        result.setVerifyOutStoreNum(outVerifyNum == null ? new BigDecimal(0) : outVerifyNum);
+        // 计量待检定
+        SbInfoDTO sbInfoDTO = new SbInfoDTO();
+        sbInfoDTO.setUseType(SbUseType.BGCL.getValue());
+        sbInfoDTO.setIsMeasure(YesNoEnum.YES.getValue());
+        sbInfoDTO.setMeasureStatus(YesNoEnum.YES.getValue());
+        num = sbInfoMapper.countNum(sbInfoDTO);
+        result.setJljdNum(num == null ? 0 : num);
+        // 特种待检定
+        sbInfoDTO.setUseType(SbUseType.TZSB.getValue());
+        num = sbInfoMapper.countNum(sbInfoDTO);
+        result.setSpecialNum(num == null ? 0 : num);
+    }
+
+    /**
+     * 班组长数据
+     * @param result
+     */
+    private void handleMaintenance(WorkPlaceStatisticVO result){
+        // 维修中
+        RepairApplicationFormDTO queryDTO = new RepairApplicationFormDTO();
+        queryDTO.setRepairUserId(SecurityUtils.getUserInfo().getUserId());
+        queryDTO.setStatus(RepairApplicationFormStatusEnum.PROCESSING.getValue());
+        Integer num = repairApplicationFormService.countRepair(queryDTO);
+        result.setRepairNum(num == null ? 0 : num);
+        // 出库打印
+        OutStoreFormDTO outStoreFormDTO = new OutStoreFormDTO();
+        List<Integer> statusList = ListUtils.newArrayList();
+        statusList.add(OutStoreStatusEnum.PUSH_OK.getValue());
+        statusList.add(OutStoreStatusEnum.FINISH.getValue());
+        outStoreFormDTO.setStatusList(statusList);
+        outStoreFormDTO.setPrintFlag(YesNoEnum.NO.getValue());
+        outStoreFormDTO.setCreatedUserId(SecurityUtils.getUserInfo().getUserId());
+        BigDecimal outNum = outStoreFormMapper.getOutStoreFormCount1(outStoreFormDTO);
+        result.setOutStorePrintNum(outNum == null ? 0 : outNum.intValue());
+        // 票证打印
+        queryDTO.setPrintFlag(YesNoEnum.NO.getValue());
+        num = repairApplicationFormService.countRepair(queryDTO);
+        result.setRepairTicketPrintNum(num == null ? 0 : num);
+        // 巡检任务
+        FillGatherTaskDTO taskDTO = new FillGatherTaskDTO();
+        statusList = ListUtils.newArrayList();
+        statusList.add(FillGatherTaskStatusEnum.LATE.getValue());
+        statusList.add(FillGatherTaskStatusEnum.PAUSE.getValue());
+        statusList.add(FillGatherTaskStatusEnum.PROCESSING.getValue());
+        statusList.add(FillGatherTaskStatusEnum.OVER_TIME.getValue());
+        statusList.add(FillGatherTaskStatusEnum.REFUSED.getValue());
+        taskDTO.setStatusList(statusList);
+        taskDTO.setChecker(SecurityUtils.getUserInfo().getUserId());
+        num = fillGatherTaskMapper.countTaskNum(taskDTO);
+        result.setFillCheckNum(num == null ? 0 : num);
+    }
+
+    /**
+     * 公共模块数据
+     * @param result
+     */
+    private void handleCommon(WorkPlaceStatisticVO result){
+        // 位号待完善
+        SbInfoDTO queryDTO = new SbInfoDTO();
+        queryDTO.setReplenishFlag(1);
+        Integer num = sbInfoMapper.countNum(queryDTO);
+        result.setPositionNoNum(num == null ? 0 : num);
+        // 设备型号待完善
+        queryDTO.setReplenishFlag(2);
+        num = sbInfoMapper.countNum(queryDTO);
+        result.setXinhaoNum(num == null ? 0 : num);
+        // 资产编号待完善
+        queryDTO.setReplenishFlag(3);
+        num = sbInfoMapper.countNum(queryDTO);
+        result.setFinancingNoNum(num == null ? 0 : num);
+        // 设备类型待完善
+        queryDTO.setReplenishFlag(4);
+        num = sbInfoMapper.countNum(queryDTO);
+        result.setSbTypeNum(num == null ? 0 : num);
+    }
     /**
      * 计算车间维修占比
      * @param result
@@ -222,4 +454,99 @@ public class IndexServiceImpl implements IndexService {
         });
     }
 
+    private void getCurrentlyRepairNum(LocalDateTime startTime,LocalDateTime endTime,WorkPlaceStatisticVO result){
+        RepairApplicationFormDTO queryDTO = new RepairApplicationFormDTO();
+        queryDTO.setSearchStartTime(startTime);
+        queryDTO.setSearchEndTime(endTime);
+        // 一周报修总数
+        List<RepairApplicationFormVO> list = repairApplicationFormService.getCurrentlyListByDTO(queryDTO);
+        if(list == null){
+            list = new ArrayList<>();
+        }
+        List<RepairApplicationFormVO> weekRepairList = ListUtils.newArrayList();
+        List<LocalDateTime> currentWeekStartAndEndList = DateUtils.currentWeek();
+        for(LocalDateTime tempDate: currentWeekStartAndEndList){
+            RepairApplicationFormVO vo = new RepairApplicationFormVO();
+            int tempTotalNum = 0;
+            vo.setWeekDayName(DateUtils.dateToString(tempDate,DateUtils.PATTERN_YMD).substring(4));
+            for(RepairApplicationFormVO useVO: list){
+                if(useVO.getApplyTime().toLocalDate().isEqual(tempDate.toLocalDate())){
+                    tempTotalNum+=1;
+                }
+            }
+            vo.setTempTotalNum(new BigDecimal(tempTotalNum));
+            weekRepairList.add(vo);
+        }
+        result.setWeekRepairList(weekRepairList);
+    }
+
+    private void getCurrentlyOutStoreNum(LocalDateTime startTime,LocalDateTime endTime,WorkPlaceStatisticVO result){
+        OutStoreFormDTO queryDTO = new OutStoreFormDTO();
+        queryDTO.setCreatedTimeStart(startTime);
+        queryDTO.setCreatedTimeEnd(endTime);
+        queryDTO.setStatus(OutStoreStatusEnum.FINISH.getValue());
+        // 一周出库领料总数
+        List<OutStoreFormVO> listOut = outStoreFormMapper.getCurrentlyList(queryDTO);
+        if(listOut == null){
+            listOut = new ArrayList<>();
+        }
+        List<OutStoreFormVO> weekStoreList = ListUtils.newArrayList();
+        for(LocalDateTime tempDate: DateUtils.currentWeek()){
+            OutStoreFormVO vo = new OutStoreFormVO();
+            int tempTotalNum = 0;
+            vo.setWeekDayName(DateUtils.dateToString(tempDate,DateUtils.PATTERN_YMD).substring(4));
+            for(OutStoreFormVO useVO: listOut){
+                if(useVO.getCreatedTime().toLocalDate().isEqual(tempDate.toLocalDate())){
+                    tempTotalNum+=1;
+                }
+            }
+            vo.setTotalNum(tempTotalNum);
+            weekStoreList.add(vo);
+        }
+        result.setWeekOutStoreList(weekStoreList);
+    }
+
+    public static void main(String[] args) {
+        // 新海家园
+        double wkje = 751.1;
+        int weikeNum = 70;
+        double tianshanbai = 183.2+1002.8+1060.2+338.16+737.16+1302+579.54+819.92+124.4+216+1328.18+279+806.46+278.72+822+87.2+496.8+607.2+189.52;
+        int tianshanbaiNum = 14+92+90+32+56+120+74+56+12+20+72+38+78+42+86+4+46+44+20;
+        double quanchen = 588.6+487.2+155+1093.12;
+        int quanchenNum = 54+34+10+92;
+        double v3weik = 235.14+484.16+412.96;
+        int v3weikNum = 20+36+36;
+        int total = weikeNum + tianshanbaiNum + quanchenNum + v3weikNum;
+        double totalD = wkje + tianshanbai + quanchen + v3weik;
+        System.out.println("联家恒通店:");
+        System.out.println("   总包数:"+total);
+        System.out.println("   总金额:"+BigDecimalUtil.round(totalD,2));
+        System.out.println("   未可总销管包数:"+weikeNum);
+        System.out.println("   总销售金额:" + wkje);
+        System.out.println("   未可V3销售包数:"+v3weikNum);
+        System.out.println("   总销售金额:" + v3weik);
+        System.out.println("   新全程包数:"+quanchenNum);
+        System.out.println("   新全程销售金额:"+ quanchen);
+        System.out.println("   天山白包数:"+tianshanbaiNum);
+        System.out.println("   天山白销售金额:"+ BigDecimalUtil.round(tianshanbai,2));
+        // 新站广场
+        double wkje2 = 8.90+82.50+39.60+119.90+610.40+63.60+56.80+89.60+538.20+135.50;
+        int weikeNum2 = 1+5+2+11+56+4+4+7+52+12;
+        double tianshanbai2 = 42.90+32.30+71.40+226.10+149.00+360.80+233.60+316.80+119.20+174.30+124.90+37.80+154.60;
+        int tianshanbaiNum2 = 3+2+6+19+10+28+16+12+8+13+7+2+13;
+        double quanchen2 = 74.40+17.50+16.50+76.30;
+        int quanchenNum2 = 5+1+1+7;
+        total = weikeNum2 + tianshanbaiNum2 + quanchenNum2;
+        totalD = wkje2 + tianshanbai2 + quanchen2;
+        System.out.println("华联新站广场店:");
+        System.out.println("   总包数:"+total);
+        System.out.println("   总销售金额:"+ BigDecimalUtil.round(totalD,2));
+        System.out.println("   未可总包数(含V3):"+weikeNum2);
+        System.out.println("   未可总销售金额(含V3):" + wkje2);
+        System.out.println("   天山白总包数:"+tianshanbaiNum2 );
+        System.out.println("   天山白总销售金额:"+ BigDecimalUtil.round(tianshanbai2,2));
+        System.out.println("   新全程总包数:"+quanchenNum2);
+        System.out.println("   新全程总销售金额:"+ quanchen2);
+    }
+
 }