guarantee-lsq пре 2 година
родитељ
комит
0afea2009a

+ 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";  // 出库单打印
 }

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

@@ -173,6 +173,12 @@
             <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>
     <!-- 近月统计单数和费用 -->

+ 13 - 1
platform-dao/src/main/resources/mapper/store/OutStoreFormMapper.xml

@@ -267,7 +267,19 @@ outstoreform.process_instance_id,
                 and status = #{status}
             </if>
             <if test="outFlag != null">
-                and form.out_flag = #{outFlag}
+                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>

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

@@ -158,4 +158,32 @@ public class IndexController {
         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();
+    }
+
 }

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

@@ -1,8 +1,12 @@
 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 {
 
     /**
@@ -52,4 +56,18 @@ public interface IndexService {
      */
     WorkPlaceStatisticVO getWorkPlaceData();
 
+    /**
+     * 获取票证打印列表
+     * @return
+     */
+    List<RepairApplicationFormVO> getRepairPrintList();
+
+    /**
+     * 获取出库单打印列表
+     * @return
+     */
+    List<OutStoreFormVO> getOutStorePrintList();
+
+    void printedTicket(String type,String id);
+
 }

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

@@ -8,6 +8,8 @@ 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;
@@ -250,6 +252,45 @@ public class IndexServiceImpl implements IndexService {
         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
@@ -357,6 +398,7 @@ public class IndexServiceImpl implements IndexService {
         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());
         // 票证打印