فهرست منبع

Accept Merge Request #34: (develop-wxl -> master)

Merge Request: 合并

Created By: @万新亮
Accepted By: @万新亮
URL: https://chuanghaikeji.coding.net/p/smarCampus/d/repair_backend/git/merge/34?initial=true
万新亮 1 سال پیش
والد
کامیت
b5acd49bbe
34فایلهای تغییر یافته به همراه529 افزوده شده و 267 حذف شده
  1. 3 0
      .gitignore
  2. 1 0
      src/main/java/com/repair/api/RepairUserControllerAPI.java
  3. 1 1
      src/main/java/com/repair/config/MyBatisPlusConfig.java
  4. 20 28
      src/main/java/com/repair/controller/LoginController.java
  5. 2 17
      src/main/java/com/repair/controller/RepairClassesSettingsController.java
  6. 3 17
      src/main/java/com/repair/controller/RepairConsumablesController.java
  7. 1 1
      src/main/java/com/repair/controller/RepairLeaveMessageController.java
  8. 98 53
      src/main/java/com/repair/controller/RepairRecordController.java
  9. 6 7
      src/main/java/com/repair/controller/RepairUserController.java
  10. 3 0
      src/main/java/com/repair/mapper/RepairUserMapper.java
  11. 1 1
      src/main/java/com/repair/model/enumModel/eRecordStatu.java
  12. 1 1
      src/main/java/com/repair/model/pojo/RepairRecord.java
  13. 2 2
      src/main/java/com/repair/model/request/insertRepairUserRequest.java
  14. 2 2
      src/main/java/com/repair/model/request/updateUserDataRequest.java
  15. 1 1
      src/main/java/com/repair/model/vo/AddressBookVo.java
  16. 11 0
      src/main/java/com/repair/model/vo/AutoDispatchUserVo.java
  17. 1 1
      src/main/java/com/repair/model/vo/MaintenanceTechnicianVo.java
  18. 3 3
      src/main/java/com/repair/model/vo/MaintenanceWorkerVo.java
  19. 1 1
      src/main/java/com/repair/model/vo/MasterHomepageVo.java
  20. 6 0
      src/main/java/com/repair/model/vo/ProsperityRepairPayRecordsVo.java
  21. 1 1
      src/main/java/com/repair/model/vo/RepairAnalysisVo.java
  22. 10 2
      src/main/java/com/repair/model/vo/RepairManageCountVo.java
  23. 4 0
      src/main/java/com/repair/model/vo/RepairRecordPageVo.java
  24. 3 1
      src/main/java/com/repair/model/vo/RepairTotalDataVo.java
  25. 2 2
      src/main/java/com/repair/model/vo/RepairUserVo.java
  26. 29 0
      src/main/java/com/repair/model/vo/ReportExportVo.java
  27. 1 1
      src/main/java/com/repair/model/vo/TeamWorkCountVo.java
  28. 1 1
      src/main/java/com/repair/model/vo/TrackDetailsVo.java
  29. 3 0
      src/main/java/com/repair/services/RepairUserService.java
  30. 27 5
      src/main/java/com/repair/services/impl/RepairUserServiceImpl.java
  31. 1 1
      src/main/resources/mapper/repair/RepairClassesSettingsMapper.xml
  32. 6 2
      src/main/resources/mapper/repair/RepairPayRecordMapper.xml
  33. 225 96
      src/main/resources/mapper/repair/RepairRecordMapper.xml
  34. 49 19
      src/main/resources/mapper/repair/RepairUserMapper.xml

+ 3 - 0
.gitignore

@@ -21,3 +21,6 @@
 
 # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
 hs_err_pid*
+
+# 项目排除路径
+/target/

+ 1 - 0
src/main/java/com/repair/api/RepairUserControllerAPI.java

@@ -42,6 +42,7 @@ public interface RepairUserControllerAPI {
     @ApiOperation(value = "获取线下的人员分页数据", notes = "获取线下的人员分页数据", httpMethod = "GET")
     CommonResult queryPageOfflineUsers(Integer currentPage, Integer pageCount, Integer recordId, String keyWord);
 
+
     @GetMapping(value = "/getAddressBook")
     @ApiOperation(value = "获取通讯录列表数据", notes = "获取通讯录列表数据", httpMethod = "GET")
     CommonResult getAddressBook(@RequestParam Integer schoolId,@RequestParam Integer userId, String keyWord);

+ 1 - 1
src/main/java/com/repair/config/MyBatisPlusConfig.java

@@ -44,7 +44,7 @@ public class MyBatisPlusConfig {
     @Profile({"dev","test","prod"})// 设置 dev test 环境开启,保证我们的效率
     public PerformanceInterceptor performanceInterceptor() {
         PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor();
-        performanceInterceptor.setMaxTime(3000); //ms 设置sql执行的最大时间,如果超过了则不执行
+        performanceInterceptor.setMaxTime(30000); //ms 设置sql执行的最大时间,如果超过了则不执行
         performanceInterceptor.setFormat(true);
         return performanceInterceptor;
     }

+ 20 - 28
src/main/java/com/repair/controller/LoginController.java

@@ -195,7 +195,7 @@ public class LoginController implements LoginControllerAPI {
     @PassToken
     @Transactional(rollbackFor = {Exception.class})
     public CommonResult Openid(String wxcode) throws Exception {
-        System.out.println("微校授权:" + wxcode);
+        System.out.println("微校授权:"+wxcode);
         Gson gson = new Gson();
         String tokenUrl = "https://open.wecard.qq.com/connect/oauth2/token";
         Map<String, String> tokenParams = new HashMap<>();
@@ -205,7 +205,7 @@ public class LoginController implements LoginControllerAPI {
         tokenParams.put("app_secret", wxOpenidConfig.getAppkey());
         tokenParams.put("grant_type", wxOpenidConfig.getGranttype());
         tokenParams.put("redirect_uri", url); // 小程序为 mnp:// + 小程序app id
-        System.out.println("微校授权1:");
+
         // wecode换取token
         String respon = HttpsClient.post(tokenUrl, tokenParams);
         System.out.println("微校授权2:" + respon);
@@ -215,18 +215,12 @@ public class LoginController implements LoginControllerAPI {
         }
         HashMap<String, Object> tokenMap = gson.fromJson(respon, new TypeToken<HashMap<String, Object>>() {
         }.getType());
-        System.out.println("微校授权3");
         String accessToken = (String) tokenMap.get("access_token");
-        System.out.println("微校授权4");
         // token换取用户信息
         String userInfoUrl = "https://open.wecard.qq.com/connect/oauth/get-user-info";
-        System.out.println("微校授权5");
         Map<String, String> userInfoParam = new HashMap<>();
-        System.out.println("微校授权6");
         userInfoParam.put("access_token", accessToken);
-        System.out.println("微校授权7");
         String userinfo = HttpsClient.post(userInfoUrl, userInfoParam);
-        System.out.println("微校授权8");
         String card_number = null;
         String user_name = null;
         String phone = null;
@@ -237,9 +231,8 @@ public class LoginController implements LoginControllerAPI {
         String campus = null;
         Wx_user userinfos = gson.fromJson(userinfo, new TypeToken<Wx_user>() {
         }.getType());
-        System.out.println("微校授权9");
-        System.out.println("微校授权获取用户信息:" + userinfo);
-        System.out.println("微校授权获取用户信息类别:" + userinfos.getIdentity_type());
+        System.out.println("微校授权获取用户信息:"+userinfo);
+        System.out.println("微校授权获取用户信息类别:"+userinfos.getIdentity_type());
         try {
             card_number = userinfos.getCard_number();
             user_name = userinfos.getName();
@@ -251,7 +244,7 @@ public class LoginController implements LoginControllerAPI {
             campus = userinfos.getCampus();
 
         } catch (Exception e) {
-            System.out.println("微校授权异常信息:" + e.getMessage());
+            System.out.println("微校授权异常信息:"+e.getMessage());
             return CommonResult.fail(e.getMessage());
         }
 
@@ -265,11 +258,11 @@ public class LoginController implements LoginControllerAPI {
         //   return CommonResult.fail("非法权限,授权失败");
         //}
 
-        System.out.println("微校授权校区:" + campus);
-        System.out.println("微校授权校区ID:" + eSchool.integerOf(campus));
+        System.out.println("微校授权校区:"+campus);
+        System.out.println("微校授权校区ID:"+eSchool.integerOf(campus));
 
         if (user == null) {
-            try {
+            try{
                 user = new RepairUser();
                 user.setCardNumber(card_number);
                 user.setUserName(user_name);
@@ -283,15 +276,15 @@ public class LoginController implements LoginControllerAPI {
                 user.setIsChange(0);
                 int num = repairUserService.insertRepairUser(user);
                 if (num <= 0) {
-                    System.out.println("微校授权失败,用户信息新增异常:" + user_name + "" + card_number);
+                    System.out.println("微校授权失败,用户信息新增异常:"+user_name+""+card_number);
                     throw new Exception("微校授权失败!");
                 }
 
-            } catch (Exception e) {
-                System.out.println("微校授权异常信息:" + e.getMessage());
+            }catch (Exception e){
+                System.out.println("微校授权异常信息:"+e.getMessage());
                 throw new Exception("微校授权失败!");
             }
-        } else {
+        }else{
             //更新微校获取的年纪信息
             user.setCollege(college);
             user.setGrade(grade);
@@ -299,14 +292,14 @@ public class LoginController implements LoginControllerAPI {
 
             int num = repairUserService.updateRepairUser(user);
             if (num <= 0) {
-                System.out.println("微校授权失败,用户信息新增异常:" + user_name + "" + card_number);
+                System.out.println("微校授权失败,用户信息新增异常:"+user_name+""+card_number);
                 throw new Exception("微校授权失败!");
             }
         }
 
         RepairAdmin admin = repairAdminService.getRepairByCardnumber(card_number);
-        if (admin == null) {
-            try {
+        if(admin == null){
+            try{
                 admin = new RepairAdmin();
                 admin.setAccount(card_number);
                 admin.setPassword("974264710");
@@ -319,11 +312,11 @@ public class LoginController implements LoginControllerAPI {
                 admin.setIsMobile(1);
                 int adminNum = repairAdminService.insertRepairAdmin(admin);
                 if (adminNum <= 0) {
-                    System.out.println("微校授权失败,管理端信息新增异常:" + user_name);
+                    System.out.println("微校授权失败,管理端信息新增异常:"+user_name);
                     return CommonResult.fail("无法记录账号信息,授权失败");
                 }
-            } catch (Exception e) {
-                System.out.println("微校授权异常信息:" + e.getMessage());
+            }catch (Exception e){
+                System.out.println("微校授权异常信息:"+e.getMessage());
                 throw new Exception("微校授权失败!");
             }
         }
@@ -334,7 +327,7 @@ public class LoginController implements LoginControllerAPI {
         wlv.setRoutes(data == null ? new ArrayList<>() : data.getRoutes());
         wlv.setBtns(data == null ? new ArrayList<>() : data.getBtns());
         wlv.setUserName(user.getUserName());
-        wlv.setUserPhone(user.getUserPhone().replace("(+86)", ""));
+        wlv.setUserPhone(user.getUserPhone().replace("(+86)",""));
         wlv.setUserZZid(user.getUserZzid());
         wlv.setUserZZName(eUserZZ.stringOf(user.getUserZzid()));
         wlv.setSchoolId(user.getSchoolId());
@@ -344,7 +337,7 @@ public class LoginController implements LoginControllerAPI {
         String token = JWTUtil.getToken(admin, expired);
         wlv.setToken(token);
         wlv.setUserhead(AesUtils.encrypt(admin.getId()));
-        System.out.println("微校授权成功:" + user_name + "" + card_number);
+        System.out.println("微校授权成功:"+user_name+""+card_number);
         return CommonResult.ok(wlv);
     }
 
@@ -450,7 +443,6 @@ public class LoginController implements LoginControllerAPI {
 
     /**
      * 获取移动端路由
-     *
      * @param userZZid 用户身份ID
      * @return
      */

+ 2 - 17
src/main/java/com/repair/controller/RepairClassesSettingsController.java

@@ -1,7 +1,6 @@
 package com.repair.controller;
 
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
-import com.repair.annotation.PassToken;
 import com.repair.api.RepairClassesSettingsControllerAPI;
 import com.repair.common.utils.ExcelExportUtil;
 import com.repair.common.utils.ExcelUtils;
@@ -25,7 +24,6 @@ import org.apache.poi.hssf.usermodel.HSSFRow;
 import org.apache.poi.hssf.usermodel.HSSFSheet;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.ss.usermodel.CellType;
-import org.apache.poi.ss.usermodel.DataFormatter;
 import org.apache.poi.xssf.usermodel.XSSFRow;
 import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
@@ -476,7 +474,7 @@ public class RepairClassesSettingsController implements RepairClassesSettingsCon
         List<RepairClassesSettings> result = new ArrayList<>();
         //读取第一张sheet
         HSSFSheet sheetAt = sheets.getSheetAt(0);
-        DataFormatter dataFormatter = new DataFormatter();
+
         List<String> UserNames = new ArrayList<>();
         List<Integer> userZZs = new ArrayList<>();
         userZZs.add(1);
@@ -513,11 +511,6 @@ public class RepairClassesSettingsController implements RepairClassesSettingsCon
                         datas.add(stringCellValue);
                     }
                 } else if (rowNum >= 4) {
-                    String value = dataFormatter.formatCellValue(row.getCell(0));
-                    if (ObjectUtils.isEmpty(value)) {
-                        continue;
-                    }
-
                     row.getCell(0).setCellType(CellType.STRING);
                     String UserName = row.getCell(0).getStringCellValue();
                     if(ObjectUtils.isEmpty(UserName)){
@@ -605,7 +598,7 @@ public class RepairClassesSettingsController implements RepairClassesSettingsCon
         List<RepairClassesSettings> result = new ArrayList<>();
         //读取第一张sheet
         XSSFSheet sheetAt = sheets.getSheetAt(0);
-        DataFormatter dataFormatter = new DataFormatter();
+
         List<String> UserNames = new ArrayList<>();
         List<Integer> userZZs = new ArrayList<>();
         userZZs.add(1);
@@ -615,7 +608,6 @@ public class RepairClassesSettingsController implements RepairClassesSettingsCon
         List<RepairClassesSettings> clssses = new ArrayList<>();
         //rowNum = 3 从第三行开始获取值
         //sheetAt.getLastRowNum():从0开始统计数量 所以得+1
-        int rowNums = sheetAt.getLastRowNum();
         for (int rowNum = 0; rowNum < sheetAt.getLastRowNum() + 1; rowNum++) {
 
             XSSFRow row = sheetAt.getRow(rowNum);
@@ -643,13 +635,6 @@ public class RepairClassesSettingsController implements RepairClassesSettingsCon
                         datas.add(stringCellValue);
                     }
                 } else if (rowNum >= 4) {
-                    String value = dataFormatter.formatCellValue(row.getCell(0));
-                    if (ObjectUtils.isEmpty(value)) {
-                        continue;
-                    }
-
-                    row.getCell(0);
-
                     row.getCell(0).setCellType(CellType.STRING);
                     String UserName = row.getCell(0).getStringCellValue();
                     if(ObjectUtils.isEmpty(UserName)){

+ 3 - 17
src/main/java/com/repair/controller/RepairConsumablesController.java

@@ -2,8 +2,6 @@ package com.repair.controller;
 
 
 import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.repair.api.RepairConsumablesControllerAPI;
 import com.repair.common.utils.*;
 import com.repair.model.enumModel.eIsSuper;
@@ -22,7 +20,6 @@ import com.repair.services.*;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.StringUtils;
 import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.RequestHeader;
 import org.springframework.web.bind.annotation.RestController;
@@ -162,19 +159,8 @@ public class RepairConsumablesController implements RepairConsumablesControllerA
             //当返回值大于0时,表示BigDecimal对象大于指定的数值。
             data.setStatu(data.getTotalPrice().compareTo(BigDecimal.ZERO) > 0 ? "有偿" : "无偿");
         }
-        JSONObject jsonObject=(JSONObject) JSONObject.toJSON(result);
-        QueryWrapper<RepairConsumables> ew = new QueryWrapper<>();
-        if(StringUtils.hasText(endTime)&&StringUtils.hasText(startTime)){
-            ew.between("update_time",startTime,endTime);
-        }
-        if (StringUtils.hasText(keyWord)) {
-            String str ="record_id  in (select id from   repair_record rr where  rr.deleted = 0 and rr.record_no like '%" + keyWord + "%')";
-            ew.and(w -> w.like("consume_name", keyWord).or().apply(str));
-        }
-        ew.select("IFNULL(sum(number),0) tcont,IFNULL(sum(total_price),0) tprice");
-        Map<String,Object> map=repairConsumablesService.getMap(ew);
-        jsonObject.putAll(map);
-        return CommonResult.ok(jsonObject);
+
+        return CommonResult.ok(result);
     }
 
     /**
@@ -336,7 +322,7 @@ public class RepairConsumablesController implements RepairConsumablesControllerA
             RepairTrackRecord rtr = new RepairTrackRecord();
             rtr.setRecordId(data.getRecordId());
             rtr.setMaintenanceState(eRecordStatu.ToConfirmed.getValue());
-            rtr.setContent("待确认");
+            rtr.setContent("待支付");
             rtr.setUserId(senderId);
             rtr.setUserZzstr("维修师傅");
             int insertRtr = repairTrackRecordService.insertRepairTrackRecord(rtr);

+ 1 - 1
src/main/java/com/repair/controller/RepairLeaveMessageController.java

@@ -114,7 +114,7 @@ public class RepairLeaveMessageController implements RepairLeaveMessageControlle
         }
 
         if (rr.getMaintenanceState() != eRecordStatu.ToConfirmed.getValue()) {
-            return CommonResult.fail("待确认的报修单才能进行转后勤操作");
+            return CommonResult.fail("待支付的报修单才能进行转后勤操作");
         }
 
         /**

+ 98 - 53
src/main/java/com/repair/controller/RepairRecordController.java

@@ -708,7 +708,7 @@ public class RepairRecordController implements RepairRecordControllerAPI {
         }
 
         if (data.getMaintenanceState() != eRecordStatu.Dispatch.getValue() && data.getMaintenanceState() != eRecordStatu.ToConfirmed.getValue()) {
-            return CommonResult.fail("待接单或待确认才能进行撤销操作!");
+            return CommonResult.fail("待接单或待支付才能进行撤销操作!");
         }
 
         try {
@@ -1060,11 +1060,13 @@ public class RepairRecordController implements RepairRecordControllerAPI {
                     } else if (r.getMaintenanceState() == 2) {
                         r.setState("维修中");
                         r.setDelayed(1);
+                        r.setClose(1);
                     } else if (r.getMaintenanceState() == 3) {
                         r.setState("待处理");
                         r.setDelayed(1);
+                        r.setClose(1);
                     } else if (r.getMaintenanceState() == 4) {
-                        r.setState("待确认");
+                        r.setState("待支付");
                         r.setDelayed(1);
                     } else if (r.getMaintenanceState() == 5 || r.getMaintenanceState() == 6) {
                         r.setState(r.getMaintenanceState() == 5 ? "转单待审核" : "协作待审核");
@@ -1095,6 +1097,7 @@ public class RepairRecordController implements RepairRecordControllerAPI {
                 result = repairRecordService.queryNotTimeout(currentPage, pageCount, stateStr, keyWord, startTime, endTime, schoolId, maintenanceName);
                 for (RepairRecordPageVo r : result.getList()) {
                     r.setState("维修中");
+                    r.setClose(1);
                     r.setDelayed(1);
                 }
                 break;
@@ -1103,6 +1106,7 @@ public class RepairRecordController implements RepairRecordControllerAPI {
                 result = repairRecordService.queryNotTimeout(currentPage, pageCount, stateStr, keyWord, startTime, endTime, schoolId, maintenanceName);
                 for (RepairRecordPageVo r : result.getList()) {
                     r.setState("待处理");
+                    r.setClose(1);
                     r.setDelayed(1);
                 }
                 break;
@@ -1171,6 +1175,12 @@ public class RepairRecordController implements RepairRecordControllerAPI {
                     r.setState("转线下");
                 }
                 break;
+            case 10:
+                stateStr = "=4)";
+                result = repairRecordService.queryNotTimeout(currentPage, pageCount, stateStr, keyWord, startTime, endTime, schoolId, maintenanceName);
+                for (RepairRecordPageVo r : result.getList()) {
+                    r.setState("待支付");
+                }
             default:
                 break;
         }
@@ -1240,6 +1250,7 @@ public class RepairRecordController implements RepairRecordControllerAPI {
                 List<RepairLeaveMessage> alls = messages.stream().filter(e -> e.getRecordId() == r.getId()).collect(Collectors.toList());
                 List<RepairLeaveMessage> owns = alls.stream().filter(e -> e.getRecordId() == r.getId() && e.getSenderId().equals(r.getUserId())).collect(Collectors.toList());
                 r.setReply(owns.size() > alls.size() / 2 ? 1 : 0);
+                r.setAreaName(r.getAreaName()+":"+r.getAddressName());
             }
 
         }
@@ -1507,13 +1518,16 @@ public class RepairRecordController implements RepairRecordControllerAPI {
                 return CommonResult.fail("当天未排班,无法接单!");
             }
 
-            if (result.getArticleId() == null) {
+            /**
+             * 接单种类不受到限制
+             */
+/*            if (result.getArticleId() == null) {
                 return CommonResult.fail("无法维修该种类物品!");
             }
             long count = Arrays.asList(result.getArticleId().split(",")).stream().filter(e -> e.equals(recordData.getArticleId().toString())).count();
             if (count <= 0) {
                 return CommonResult.fail("无法维修该种类物品!");
-            }
+            }*/
 
             List<String> shifts = Arrays.asList(result.getShiftId().split(","));
             List<RepairShiftSettings> shiftDatas = repairShiftSettingsService.getRepairsByShiftIds(shifts, dateHour);
@@ -1608,7 +1622,7 @@ public class RepairRecordController implements RepairRecordControllerAPI {
                 //更新派单记录
                 dispatch = new RepairDispatchRecord();
                 dispatch.setAssignedTime(new Date());
-                dispatch.setAcceptanceAssessTime(result.getAcceptanceAssessTime());
+                //dispatch.setAcceptanceAssessTime(result.getAcceptanceAssessTime());
                 dispatch.setOrderType(0);
                 dispatch.setIsLoseEfficacy(0);
                 dispatch.setUsersId(userId);
@@ -1687,6 +1701,9 @@ public class RepairRecordController implements RepairRecordControllerAPI {
             return CommonResult.fail(st);
         }
 
+        //在添加和修改的部分__待修改部分
+        RepairUser ru= repairUserService.getRepairById(rsor.getRecordId());//根据派单号进行获取维修师父
+
         RepairRecord rr = repairRecordService.getById(rsor.getRecordId());
         if (rr == null) {
             return CommonResult.fail("维修单数据失效,派单失败");
@@ -1879,12 +1896,13 @@ public class RepairRecordController implements RepairRecordControllerAPI {
 
         List<AutoDispatchUserVo> autoDispatchUserVos = repairUserService.dropDown(buildId, articleId, schoolId, tdata.getUserId());
 
-        ////将可以接单的师傅显示到协作下拉框中(员工状态 正常接单:1)
-        // LambdaQueryWrapper<RepairUser> wrapper = new LambdaQueryWrapper<>();
-        // wrapper.eq(RepairUser::getState, eUserStatu.Received.getValue())
-        //         .like(RepairUser::getArticle_id,articleId);
-        //
-        // List<RepairUser> repairUsers = repairUserService.list(wrapper);
+//        //将可以接单的师傅显示到协作下拉框中(员工状态 正常接单:1)
+//        LambdaQueryWrapper<RepairUser> wrapper = new LambdaQueryWrapper<>();
+//        wrapper.eq(RepairUser::getState, eUserStatu.Received.getValue())
+//                .like(RepairUser::getArticleId, articleId);
+//
+//        List<RepairUser> repairUsers = repairUserService.list(wrapper);
+
 
         return CommonResult.ok(autoDispatchUserVos);
     }
@@ -1975,7 +1993,7 @@ public class RepairRecordController implements RepairRecordControllerAPI {
                 repairDispatchRecord.setRecordId(rr.getId());
                 repairDispatchRecord.setUsersId(tr.getUserId());
                 repairDispatchRecord.setAssignedTime(new Date());
-                repairDispatchRecord.setAcceptanceAssessTime(repairUser.getAcceptanceAssessTime());
+                //repairDispatchRecord.setAcceptanceAssessTime(repairUser.getAcceptanceAssessTime());
                 repairDispatchRecord.setOrderType(eDispatchType.Transfer.getValue());
                 repairDispatchRecord.setIsLoseEfficacy(eDispatchResult.NotExpired.getValue());
                 int insertDispatch = repairDispatchRecordService.insertRepairDispatchRecord(repairDispatchRecord);
@@ -2300,7 +2318,7 @@ public class RepairRecordController implements RepairRecordControllerAPI {
                     rdr.setRecordId(rr.getId());
                     rdr.setUsersId(ru.getId());
                     rdr.setAssignedTime(new Date());
-                    rdr.setAcceptanceAssessTime(ru.getAcceptanceAssessTime());
+//                    rdr.setAcceptanceAssessTime(ru.getAcceptanceAssessTime());
                     rdr.setOrderType(eDispatchType.Cooperation.getValue());
                     rdr.setIsLoseEfficacy(eDispatchResult.NotExpired.getValue());
                     rdrs.add(rdr);
@@ -2817,6 +2835,8 @@ public class RepairRecordController implements RepairRecordControllerAPI {
                         r.setState("维修中");
                     } else if (r.getMaintenanceState() == 3) {
                         r.setState("待处理");
+                    } else if (r.getMaintenanceState() == 4) {
+                        r.setState("待支付");
                     } else if (r.getMaintenanceState() == 5 || r.getMaintenanceState() == 6) {
                         r.setState("待审核");
                     } else if (r.getMaintenanceState() == 7) {
@@ -2895,37 +2915,62 @@ public class RepairRecordController implements RepairRecordControllerAPI {
                     r.setState("转线下");
                 }
                 break;
+            case 10:
+                stateStr = "=4)";
+                result = repairRecordService.queryNotTimeoutReportExport(stateStr, keyWord, startTime, endTime, schoolId);
+                for (ReportExportVo r : result) {
+                    r.setState("待支付");
+                }
             default:
                 break;
         }
 
         //导出
-
         Workbook workbook = new XSSFWorkbook();
         Sheet sheet = workbook.createSheet("报修记录表");
         Row headerRow = sheet.createRow(0);
         headerRow.createCell(0).setCellValue("工单编号");
-        headerRow.createCell(1).setCellValue("报修区域");
+        headerRow.createCell(1).setCellValue("报修区域+详细地址");
         headerRow.createCell(2).setCellValue("姓名");
         headerRow.createCell(3).setCellValue("电话");
         headerRow.createCell(4).setCellValue("报修物品");
-        headerRow.createCell(5).setCellValue("故障描述");
-        headerRow.createCell(6).setCellValue("状态");
-        headerRow.createCell(7).setCellValue("报修时间");
-        headerRow.createCell(8).setCellValue("维修师傅");
+        headerRow.createCell(5).setCellValue("维修类别");
+        headerRow.createCell(6).setCellValue("故障描述");
+        headerRow.createCell(7).setCellValue("品名(耗材)");
+        headerRow.createCell(8).setCellValue("数量");
+        headerRow.createCell(9).setCellValue("实收金额");
+        headerRow.createCell(10).setCellValue("是否有偿");
+        headerRow.createCell(11).setCellValue("状态");
+        headerRow.createCell(12).setCellValue("报修时间");
+        headerRow.createCell(13).setCellValue("维修师傅");
 
         for (int i = 0; i < result.size(); i++) {
             ReportExportVo reportExportVo = result.get(i);
             Row dataRow1 = sheet.createRow(i + 1);
             dataRow1.createCell(0).setCellValue(reportExportVo.getRecordNo());
-            dataRow1.createCell(1).setCellValue(reportExportVo.getAreaName());
+            dataRow1.createCell(1).setCellValue(reportExportVo.getAreaName()+reportExportVo.getAddress());
             dataRow1.createCell(2).setCellValue(reportExportVo.getUserName());
             dataRow1.createCell(3).setCellValue(reportExportVo.getUserPhone());
             dataRow1.createCell(4).setCellValue(reportExportVo.getArticleName());
-            dataRow1.createCell(5).setCellValue(reportExportVo.getDescription());
-            dataRow1.createCell(6).setCellValue(reportExportVo.getState());
-            dataRow1.createCell(7).setCellValue(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(reportExportVo.getReportTime()));
-            dataRow1.createCell(8).setCellValue(reportExportVo.getMaintenancerName());
+            dataRow1.createCell(5).setCellValue(reportExportVo.getRepairType());
+            dataRow1.createCell(6).setCellValue(reportExportVo.getDescription());
+            dataRow1.createCell(7).setCellValue(reportExportVo.getArticleName());
+            dataRow1.createCell(8).setCellValue(reportExportVo.getNumber()==null?0:reportExportVo.getNumber());
+            dataRow1.createCell(9).setCellValue(reportExportVo.getTotalPrice());
+            dataRow1.createCell(10).setCellValue(reportExportVo.getTotalPrice() !=null && Float.parseFloat(reportExportVo.getTotalPrice()) > 0.0  ? "是":"否");
+
+            Integer is_paid = reportExportVo.getIsPaid();
+            if(is_paid!=null && is_paid==1) reportExportVo.setState("待支付");
+            else if (is_paid!=null && is_paid==2) reportExportVo.setState("已支付");
+
+
+            Integer is_refund = reportExportVo.getIsRefund();
+            if (is_refund!=null && is_refund==0) reportExportVo.setState("退款中");
+            else if (is_refund!=null && is_refund==1) reportExportVo.setState("已退款");
+
+            dataRow1.createCell(11).setCellValue(reportExportVo.getState());
+            dataRow1.createCell(12).setCellValue(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(reportExportVo.getReportTime()));
+            dataRow1.createCell(13).setCellValue(reportExportVo.getMaintenancerName());
 
         }
 
@@ -3253,11 +3298,11 @@ public class RepairRecordController implements RepairRecordControllerAPI {
         wrapperReceiving.between(ObjectUtils.isNotEmpty(startTime), RepairReceiving::getReceivingTime, startTime, endTime);
         wrapperReceiving.isNotNull(RepairReceiving::getFinishTime);
         wrapperReceiving.groupBy(RepairReceiving::getUserId);
-        IPage<RepairReceiving> repairReceivingListPage = repairReceivingService.page(new Page<RepairReceiving>(currentPage, pageCount), wrapperReceiving);
+        //IPage<RepairReceiving> repairReceivingListPage = repairReceivingService.page(new Page<RepairReceiving>(currentPage, pageCount), wrapperReceiving);
 
         IPage<MaintenanceWorkerVo> page = new Page();
 
-        List<RepairReceiving> records = repairReceivingListPage.getRecords();
+        //List<RepairReceiving> records = repairReceivingListPage.getRecords();
 
         ArrayList<Integer> usersList = new ArrayList<>();
         for (RepairUser user : userPages.getList()) {
@@ -3440,7 +3485,7 @@ public class RepairRecordController implements RepairRecordControllerAPI {
             // 工单总数
             maintenanceWorkerVo.setWorkOrderTotal(size);
 
-            // 超时率
+            // 超时率--待消除
             if (maintainTimeOutMap.containsKey(id)) {
                 Integer integer = maintainTimeOutMap.get(id);
                 BigDecimal a = new BigDecimal(integer);
@@ -3460,17 +3505,17 @@ public class RepairRecordController implements RepairRecordControllerAPI {
 
                 BigDecimal bigDecimal = a.divide(c, 2, BigDecimal.ROUND_HALF_UP);
                 BigDecimal multiply = bigDecimal.multiply(new BigDecimal(100));
-                maintenanceWorkerVo.setTimeOut(multiply + "%");
+                //maintenanceWorkerVo.setTimeOut(multiply + "%");
             }
 
-            // 平均维修时间
+            // 平均维修时间--带消除
             Long aLong = maintainMap.get(id) == null ? 0L : maintainMap.get(id);
             BigDecimal bigDecimal = new BigDecimal(aLong);
             BigDecimal maintain = b.compareTo(BigDecimal.ZERO) == 0 ? BigDecimal.ZERO : bigDecimal.divide(b, 2, BigDecimal.ROUND_HALF_UP);
-            maintenanceWorkerVo.setMaintain(maintain);
+            //maintenanceWorkerVo.setMaintain(maintain);
 
-            // 平均响应时长
-            if (sendMap.containsKey(id)) {
+            // 平均响应时长-----待消除
+/*            if (sendMap.containsKey(id)) {
                 Long aLong1 = sendMap.get(id);
                 BigDecimal bigDecimal1 = new BigDecimal(aLong1);
                 List<Integer> integers = sendCountMap.get(id);
@@ -3481,7 +3526,7 @@ public class RepairRecordController implements RepairRecordControllerAPI {
                     BigDecimal send = bigDecimal1.divide(bigDecimal2, 2, BigDecimal.ROUND_HALF_UP);
                     maintenanceWorkerVo.setAnswer(send);
                 }
-            }
+            }*/
             // 总费用
             LambdaQueryWrapper<RepairRecord> recordWrapper = new LambdaQueryWrapper<>();
             recordWrapper.in(RepairRecord::getId, recordsList);
@@ -3554,10 +3599,10 @@ public class RepairRecordController implements RepairRecordControllerAPI {
         headerRow.createCell(2).setCellValue("姓名");
         headerRow.createCell(3).setCellValue("工单总数");
         headerRow.createCell(4).setCellValue("好评数");
-        headerRow.createCell(5).setCellValue("超时率");
-        headerRow.createCell(6).setCellValue("平均响应时长(分)");
-        headerRow.createCell(7).setCellValue("平均维修时长(分)");
-        headerRow.createCell(8).setCellValue("耗材总费用(元)");
+        //headerRow.createCell(5).setCellValue("超时率");//待去除
+        //headerRow.createCell(6).setCellValue("平均响应时长(分)");//待去除
+        //headerRow.createCell(7).setCellValue("平均维修时长(分)");//待去除
+        headerRow.createCell(5).setCellValue("耗材总费用(元)");
 
 
         LambdaQueryWrapper<RepairReceiving> wrapperReceiving = new LambdaQueryWrapper<>();
@@ -3576,7 +3621,7 @@ public class RepairRecordController implements RepairRecordControllerAPI {
             // 接单总次数
             HashMap<Integer, List<Integer>> receivingCountMap = new HashMap<>();
 
-            // 维修超时次数
+            // 维修超时次数--待去除
             Map<Integer, Integer> maintainTimeOutMap = new HashMap<>();
 
             // 维修总时长
@@ -3618,7 +3663,7 @@ public class RepairRecordController implements RepairRecordControllerAPI {
                 // 完成时间
                 long finishTimeTime = finishTime.getTime();
 
-                // 实际完成时间大于接单时间加考核时间为超时
+                // 实际完成时间大于接单时间加考核时间为超时--计算超时次数
                 if (finishTimeTime > time) {
                     if (maintainTimeOutMap.containsKey(userId)) {
                         // 次数
@@ -3738,7 +3783,7 @@ public class RepairRecordController implements RepairRecordControllerAPI {
                 // 工单总数
                 maintenanceWorkerVo.setWorkOrderTotal(size);
 
-                // 超时率
+                // 超时率--被移除
                 if (maintainTimeOutMap.containsKey(id)) {
                     Integer integer = maintainTimeOutMap.get(id);
                     BigDecimal a = new BigDecimal(integer);
@@ -3754,26 +3799,26 @@ public class RepairRecordController implements RepairRecordControllerAPI {
 
                     BigDecimal bigDecimal = a.divide(c, 2, BigDecimal.ROUND_HALF_UP);
                     BigDecimal multiply = bigDecimal.multiply(new BigDecimal(100));
-                    maintenanceWorkerVo.setTimeOut(multiply + "%");
+                    //maintenanceWorkerVo.setTimeOut(multiply + "%");
                 }
 
-                // 平均维修时间
+                // 平均维修时间--被移除
                 Long aLong = maintainMap.get(id) == null ? 0L : maintainMap.get(id);
                 BigDecimal bigDecimal = new BigDecimal(aLong);
                 BigDecimal maintain = b.compareTo(BigDecimal.ZERO) == 0 ? BigDecimal.ZERO : bigDecimal.divide(b, 2, BigDecimal.ROUND_HALF_UP);
-                maintenanceWorkerVo.setMaintain(maintain);
+                //maintenanceWorkerVo.setMaintain(maintain);
 
-                // 平均响应时长
+                // 平均响应时长--被移除
                 if (sendMap.containsKey(id)) {
                     Long aLong1 = sendMap.get(id);
                     BigDecimal bigDecimal1 = new BigDecimal(aLong1);
                     List<Integer> integers = sendCountMap.get(id);
                     if (integers.size() <= 0) {
-                        maintenanceWorkerVo.setAnswer(null);
+                        //maintenanceWorkerVo.setAnswer(null);
                     } else {
                         BigDecimal bigDecimal2 = new BigDecimal(integers.size());
                         BigDecimal send = bigDecimal1.divide(bigDecimal2, 2, BigDecimal.ROUND_HALF_UP);
-                        maintenanceWorkerVo.setAnswer(send);
+                        //maintenanceWorkerVo.setAnswer(send);
                     }
                 }
 
@@ -3822,24 +3867,24 @@ public class RepairRecordController implements RepairRecordControllerAPI {
                 dataRow1.createCell(2).setCellValue(vo.getName());
                 dataRow1.createCell(3).setCellValue(vo.getWorkOrderTotal());
                 dataRow1.createCell(4).setCellValue(vo.getDegreePraise());
-                dataRow1.createCell(5).setCellValue(vo.getTimeOut());
-                BigDecimal answer = vo.getAnswer();
+                //dataRow1.createCell(5).setCellValue(vo.getTimeOut());
+/*                BigDecimal answer = vo.getAnswer();
                 if (ObjectUtils.isEmpty(answer)) {
                     answer = new BigDecimal(0);
                 }
-                dataRow1.createCell(6).setCellValue(answer.toString());
-                BigDecimal maintain = vo.getMaintain();
+                dataRow1.createCell(6).setCellValue(answer.toString());*/
+/*                BigDecimal maintain = vo.getMaintain();
                 if (ObjectUtils.isEmpty(maintain)) {
                     maintain = new BigDecimal(0);
                 }
 
-                dataRow1.createCell(7).setCellValue(maintain.toString());
+                dataRow1.createCell(7).setCellValue(maintain.toString());*/
 
                 BigDecimal totalPrice = vo.getTotalPrice();
                 if (ObjectUtils.isEmpty(totalPrice)) {
                     totalPrice = new BigDecimal(0);
                 }
-                dataRow1.createCell(8).setCellValue(totalPrice.toString());
+                dataRow1.createCell(5).setCellValue(totalPrice.toString());
 
             }
         }
@@ -3869,7 +3914,7 @@ public class RepairRecordController implements RepairRecordControllerAPI {
 
         Integer timeOutCount = repairRecordService.queryTimeOut(startTime, endTime);
 
-        vo.setTimeOutCount(timeOutCount);
+       /* vo.setTimeOutCount(timeOutCount);*/
 
         return CommonResult.ok(vo);
     }

+ 6 - 7
src/main/java/com/repair/controller/RepairUserController.java

@@ -20,7 +20,6 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.lang.reflect.Array;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -159,8 +158,8 @@ public class RepairUserController implements RepairUserControllerAPI {
             if (irur.getUserZzid().intValue() != eUserZZ.Offline.getValue()) {
                 ru.setCardNumber(irur.getCardNumber());
                 ru.setUserPhone(irur.getUserPhone());
-                ru.setAcceptanceAssessTime(irur.getAcceptanceAssessTime());
-                ru.setMaintenanceAssessTime(irur.getMaintenanceAssessTime());
+//                ru.setAcceptanceAssessTime(irur.getAcceptanceAssessTime());//待取消--创建添加中的接单
+//                ru.setMaintenanceAssessTime(irur.getMaintenanceAssessTime());//待取消--创建添加中的考核
             }
 
             int result = 0;
@@ -220,8 +219,8 @@ public class RepairUserController implements RepairUserControllerAPI {
         data.setWorkType(ra.getWorkType());
         data.setTeamId(ra.getTeamId());
         data.setIsChange(ra.getIsChange());
-        data.setAcceptanceAssessTime(ra.getAcceptanceAssessTime());
-        data.setMaintenanceAssessTime(ra.getMaintenanceAssessTime());
+//        data.setAcceptanceAssessTime(ra.getAcceptanceAssessTime());//待取消--不参与设计
+//        data.setMaintenanceAssessTime(ra.getMaintenanceAssessTime());//待取消--不参与设计
 
         try {
             if (ra.getArticleBuilds() != null && ra.getArticleBuilds().size() > 0) {
@@ -512,8 +511,8 @@ public class RepairUserController implements RepairUserControllerAPI {
         data.setUserPhone(uabp.getPhone());
         data.setState(uabp.getState());
         data.setWorkType(uabp.getWorkType());
-        data.setAcceptanceAssessTime(uabp.getAcceptanceTime());
-        data.setMaintenanceAssessTime(uabp.getMaintenanceTime());
+        //data.setAcceptanceAssessTime(uabp.getAcceptanceTime());
+        //data.setMaintenanceAssessTime(uabp.getMaintenanceTime());
         int result = repairUserService.updateRepairUser(data);
 
         return result <= 0 ? CommonResult.fail("更新失败") : CommonResult.ok("更新成功");

+ 3 - 0
src/main/java/com/repair/mapper/RepairUserMapper.java

@@ -35,6 +35,7 @@ public interface RepairUserMapper extends BaseMapper<RepairUser> {
 
     IPage<AutoDispatchUserVo> autoDispatchUser(IPage<AutoDispatchUserVo> page, @Param("schoolId") Integer schoolId, @Param("dateNow") String dateNow, @Param("articleId") Integer articleId, @Param("buildId") Integer buildId, @Param("keyWord") String keyWord);
 
+    IPage<AutoDispatchUserVo>autoOfflineRepairUser1(IPage<AutoDispatchUserVo>page, @Param("schoolId") Integer schoolId, @Param("keyWord") String keyWord);
     IPage<AutoOfflineUserVo> autoOfflineRepairUser(IPage<AutoOfflineUserVo> page, @Param("schoolId") Integer schoolId, @Param("keyWord") String keyWord);
 
     IPage<RepairWorkTypeVo> queryCollaboratorUser(IPage<RepairWorkTypeVo> page, @Param("schoolId") Integer schoolId, @Param("userId") Integer userId, @Param("dateNow") String dateNow, @Param("keyWord") String keyWord);
@@ -44,4 +45,6 @@ public interface RepairUserMapper extends BaseMapper<RepairUser> {
     List<AutoDispatchUserVo> dropDown(Integer buildId, Integer articleId, Integer schoolId, Integer userId);
 
     List<ArticleBuildVo> queryArticleBuilds(@Param("userIds") List<Integer> userIds);
+
+
 }

+ 1 - 1
src/main/java/com/repair/model/enumModel/eRecordStatu.java

@@ -67,7 +67,7 @@ public enum eRecordStatu {
             case 3:
                 return "转后勤";
             case 4:
-                return "待确认";
+                return "待支付";
             case 5:
                 return "转单待审核";
             case 6:

+ 1 - 1
src/main/java/com/repair/model/pojo/RepairRecord.java

@@ -97,7 +97,7 @@ public class RepairRecord implements Serializable {
     @ApiModelProperty(value = "维修人联系电话(用协作、改派操作之前第一个师傅的电话)")
     private String maintenancerPhone;
 
-    @ApiModelProperty(value = "维修状态(派单中,维修中,转后勤,已完成,待确认,转单待审核,协作待审核,已取消,已关单)")
+    @ApiModelProperty(value = "维修状态(派单中,维修中,转后勤,已完成,待支付,转单待审核,协作待审核,已取消,已关单)")
     private Integer maintenanceState;
 
     @ApiModelProperty(value = "是否是值班单 不是值班单0 是值班单1  定时到正常班次时间重新分配")

+ 2 - 2
src/main/java/com/repair/model/request/insertRepairUserRequest.java

@@ -60,11 +60,11 @@ public class insertRepairUserRequest {
     /**
      * 接单考核时间
      */
-    private Integer acceptanceAssessTime;
+    //private Integer acceptanceAssessTime;//待取消
 
     /**
      * 维修考核时间
      */
-    private Integer maintenanceAssessTime;
+    //private Integer maintenanceAssessTime;//待取消
 
 }

+ 2 - 2
src/main/java/com/repair/model/request/updateUserDataRequest.java

@@ -71,11 +71,11 @@ public class updateUserDataRequest {
     /**
      * 接单考核时间
      */
-    private Integer acceptanceAssessTime;
+    private Integer acceptanceAssessTime;//待取消__是否要取消
 
     /**
      * 维修考核时间
      */
-    private Integer maintenanceAssessTime;
+    private Integer maintenanceAssessTime;//待取消————是否要取消
 
 }

+ 1 - 1
src/main/java/com/repair/model/vo/AddressBookVo.java

@@ -45,7 +45,7 @@ public class AddressBookVo {
 
     public String getStateStr() {
         return state == 1 ? "正常接单" : "停止接单";
-    }
+    }//考虑不再停止接单
 
     public void setStateStr(String stateStr) {
         this.stateStr = stateStr;

+ 11 - 0
src/main/java/com/repair/model/vo/AutoDispatchUserVo.java

@@ -72,4 +72,15 @@ public class AutoDispatchUserVo {
      */
     private String shiftId;
 
+    /**
+     * 维修班
+     */
+    private String teamName;
+
+    /**
+     * 用户身份
+     */
+    private String userZzName;
+
 }
+

+ 1 - 1
src/main/java/com/repair/model/vo/MaintenanceTechnicianVo.java

@@ -23,7 +23,7 @@ public class MaintenanceTechnicianVo {
     /**
      * 已超时
      */
-    private int timeoutCount;
+   // private int timeoutCount;//待取消
 
     /**
      * 待审核

+ 3 - 3
src/main/java/com/repair/model/vo/MaintenanceWorkerVo.java

@@ -21,11 +21,11 @@ public class MaintenanceWorkerVo {
 //    好评数
     private Integer degreePraise;
 //    超时率
-    private String timeOut;
+    //private String timeOut;//待取消
 //    平均响应时长
-    private BigDecimal answer;
+    //private BigDecimal answer;//待取消
 //    平均维修时长
-    private BigDecimal maintain;
+    //private BigDecimal maintain;//待取消
 //    总费用
     private BigDecimal totalPrice;
 

+ 1 - 1
src/main/java/com/repair/model/vo/MasterHomepageVo.java

@@ -25,7 +25,7 @@ public class MasterHomepageVo {
     /**
      * 已超时
      */
-    private int timeoutCount;
+    /*private int timeoutCount;*///待去除
     /**
      * 转线下数量
       */

+ 6 - 0
src/main/java/com/repair/model/vo/ProsperityRepairPayRecordsVo.java

@@ -69,4 +69,10 @@ public class ProsperityRepairPayRecordsVo {
      * 显示:1
      */
     private Integer isApprove;
+    /**
+     * 区域地名
+     */
+    private String areaId;
+
+    private String address;
 }

+ 1 - 1
src/main/java/com/repair/model/vo/RepairAnalysisVo.java

@@ -27,7 +27,7 @@ public class RepairAnalysisVo {
     //    已关单
     private Integer shutCount;
     //    已超时
-    private Integer timeOutCount;
+/*    private Integer timeOutCount;*/
     //    已取消
     private Integer cancelCount;
     //    待处理

+ 10 - 2
src/main/java/com/repair/model/vo/RepairManageCountVo.java

@@ -16,7 +16,8 @@ public class RepairManageCountVo {
     private int allCount;
 
     public int getAllCount() {
-        return dispatchCount + maintenanceCount + logisticsCount + examineCount + finishedCount + canceledCount + closedCount;
+        return dispatchCount + maintenanceCount + logisticsCount + examineCount + finishedCount
+                + canceledCount + closedCount + offlineCount + paidCount;
     }
 
     public void setAllCount(int allCount) {
@@ -61,10 +62,17 @@ public class RepairManageCountVo {
     /**
      * 已超时
      */
-    private int timeoutCount;
+//    private int timeoutCount;
 
     /**
      * 转线下
      */
     private int offlineCount;
+
+    /**
+     * 待支付
+     */
+    private int paidCount;
+
+
 }

+ 4 - 0
src/main/java/com/repair/model/vo/RepairRecordPageVo.java

@@ -28,6 +28,10 @@ public class RepairRecordPageVo {
      */
     private String areaName;
     /**
+     * 详细地址
+     */
+    private String addressName;
+    /**
      * 用户ID
      */
     @JsonIgnore

+ 3 - 1
src/main/java/com/repair/model/vo/RepairTotalDataVo.java

@@ -42,8 +42,10 @@ public class RepairTotalDataVo {
     //    总单数
     private Integer totalCount;
 
+    private Integer offlineCount;
+
     public Integer getTotalCount() {
-        return checkCount + receivingCount + disposeCount + affirmCount + maintainCount + accomplishCount + cancelCount + shutCount;
+        return checkCount + receivingCount + disposeCount + affirmCount + maintainCount + accomplishCount + cancelCount + shutCount+offlineCount;
     }
 
     public void setTotalCount(Integer totalCount) {

+ 2 - 2
src/main/java/com/repair/model/vo/RepairUserVo.java

@@ -90,10 +90,10 @@ public class RepairUserVo {
     /**
      * 接单考核时间
      */
-    private int acceptanceTime;
+    //private int acceptanceTime;//待取消--待确定
 
     /**
      * 维修考核时间
      */
-    private int maintenanceTime;
+//    private int maintenanceTime;//待取消--待确定
 }

+ 29 - 0
src/main/java/com/repair/model/vo/ReportExportVo.java

@@ -17,6 +17,11 @@ public class ReportExportVo {
     private String areaName;
 
     /**
+     * 详细地址
+     */
+    private String address;
+
+    /**
      * 姓名
      */
     private String userName;
@@ -32,11 +37,35 @@ public class ReportExportVo {
     private String articleName;
 
     /**
+     * 维修类别
+     */
+    private String repairType;
+    /**
      * 故障描述
      */
     private String description;
 
     /**
+     * 耗材数量
+     */
+    private Integer number;
+
+    /**
+     * 实收金额
+     */
+    private String totalPrice;
+
+    /**
+     * 是否支付成功(未支付/等待支付:1;支付成功:2;支付失败:3)
+     */
+    private Integer isPaid;
+
+    /**
+     * 是否退款成功(退款中0;退款成功1;退款失败2)
+     */
+    private Integer isRefund;
+
+    /**
      * 订单维修状态
      */
     @JsonIgnore

+ 1 - 1
src/main/java/com/repair/model/vo/TeamWorkCountVo.java

@@ -39,7 +39,7 @@ public class TeamWorkCountVo {
     /**
      * 已超时
      */
-    private int timeoutCount;
+  /*  private int timeoutCount;*/
 
     /**
      * 已关单

+ 1 - 1
src/main/java/com/repair/model/vo/TrackDetailsVo.java

@@ -33,7 +33,7 @@ public class TrackDetailsVo {
                 state = "转后勤";
                 break;
             case 4:
-                state = content.contains("回复") ? "回复" : "待确认";
+                state = content.contains("回复") ? "回复" : "待支付";
                 break;
             case 9:
                 state = "已关单";

+ 3 - 0
src/main/java/com/repair/services/RepairUserService.java

@@ -54,6 +54,8 @@ public interface RepairUserService extends IService<RepairUser> {
 
     PageUtils<AutoDispatchUserVo> autoDispatchUser(int currentPage, int pageCount, Integer schoolId, String dateNow, Integer articleId, Integer buildId, String keyWord);
 
+    PageUtils<AutoDispatchUserVo> autoOfflineRepairUser1(int currentPage, int pageCount, Integer schoolId, String keyWord);
+
     PageUtils<AutoOfflineUserVo> autoOfflineRepairUser(int currentPage, int pageCount, Integer schoolId, String keyWord);
 
     PageUtils<RepairWorkTypeVo> queryCollaboratorUser(int currentPage, int pageCount, Integer schoolId, Integer userId, String dateNow,String keyWord);
@@ -67,5 +69,6 @@ public interface RepairUserService extends IService<RepairUser> {
     List<ArticleBuildVo> queryArticleBuilds(List<Integer> userIds);
 
     PageUtils<RepairUser> queryUserPage(int currentPage, int pageCount, Integer schoolId, String keyWord);
+
 }
 

+ 27 - 5
src/main/java/com/repair/services/impl/RepairUserServiceImpl.java

@@ -1,12 +1,10 @@
 package com.repair.services.impl;
 
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.repair.mapper.RepairUserMapper;
-import com.repair.model.pojo.RepairPayRecord;
 import com.repair.model.pojo.RepairUser;
 import com.repair.model.result.PageUtils;
 import com.repair.model.vo.*;
@@ -184,7 +182,29 @@ public class RepairUserServiceImpl extends ServiceImpl<RepairUserMapper, RepairU
         Page<AutoDispatchUserVo> page = new Page<>();
         page.setCurrent(currentPage);
         page.setSize(pageCount);
-        IPage<AutoDispatchUserVo> result = repairUserMapper.autoDispatchUser(page, schoolId, dateNow, articleId, buildId, keyWord);
+        IPage<AutoDispatchUserVo> result1 = repairUserMapper.autoDispatchUser(page, schoolId, dateNow, articleId, buildId, keyWord);
+        Page<AutoDispatchUserVo> page1 = new Page<>();
+        page.setCurrent(currentPage);
+        page.setSize(pageCount);
+        IPage<AutoDispatchUserVo> result2 = repairUserMapper.autoOfflineRepairUser1(page1, schoolId, keyWord);
+        List<AutoDispatchUserVo> combinedList = new ArrayList<>();
+        combinedList.addAll(result1.getRecords());
+        combinedList.addAll(result2.getRecords());
+        long total = result1.getTotal() + result2.getTotal();
+        int newSize = (int) Math.min(combinedList.size(), result1.getSize()); // 假设使用第一个结果集的每页大小
+        int newPageNum = 1;
+        IPage<AutoDispatchUserVo> newPage = new Page<>(newPageNum, newSize, total);
+        newPage.setRecords(combinedList);
+
+        return new PageUtils<>(newPage);
+    }
+
+    @Override
+    public PageUtils<AutoDispatchUserVo> autoOfflineRepairUser1(int currentPage, int pageCount, Integer schoolId, String keyWord) {
+        Page<AutoDispatchUserVo> page = new Page<>();
+        page.setCurrent(currentPage);
+        page.setSize(pageCount);
+        IPage<AutoDispatchUserVo> result = repairUserMapper.autoOfflineRepairUser1(page, schoolId, keyWord);
         return new PageUtils(result);
     }
 
@@ -215,10 +235,11 @@ public class RepairUserServiceImpl extends ServiceImpl<RepairUserMapper, RepairU
         return new PageUtils(result);
     }
 
+
     @Override
-    public List<AutoDispatchUserVo> dropDown(Integer buildId, Integer articleId, Integer schoolId, Integer userId) {
+    public List<AutoDispatchUserVo> dropDown(Integer buildId, Integer articleId,Integer schoolId, Integer userId) {
 
-        List<AutoDispatchUserVo> vos = repairUserMapper.dropDown(buildId, articleId, schoolId, userId);
+        List<AutoDispatchUserVo> vos = repairUserMapper.dropDown(buildId,articleId,schoolId, userId);
         return vos;
     }
 
@@ -252,4 +273,5 @@ public class RepairUserServiceImpl extends ServiceImpl<RepairUserMapper, RepairU
         return new PageUtils(users);
     }
 
+
 }

+ 1 - 1
src/main/resources/mapper/repair/RepairClassesSettingsMapper.xml

@@ -35,7 +35,7 @@
         <result property="userId" column="user_id"/>
         <result property="shiftId" column="shift_id"/>
         <result property="shiftName" column="shift_name"/>
-        <result property="shiftColor" column="shift_color"/>
+        <!--<result property="shiftColor" column="shift_color"/>-->
     </resultMap>
     <select id="queryClassesDatas" resultType="com.repair.model.vo.ClassesDataVo" resultMap="repairClassesDataMap">
         SELECT rcs.id,rcs.user_id,rcs.shift_id,(select GROUP_CONCAT(name) from repair_shift_settings where find_in_set(id,rcs.shift_id) and deleted = 0) as shift_name

+ 6 - 2
src/main/resources/mapper/repair/RepairPayRecordMapper.xml

@@ -57,13 +57,17 @@
     </resultMap>
 
     <select id="queryPayPage" resultType="com.repair.model.vo.ProsperityRepairPayRecordsVo" resultMap="repairPayPage">
-        select rpr.id,rpr.create_time as pay_time,rpr.record_id,rr.record_no,rpr.pay_no,ru.user_name,rpr.pay_price,rpr.is_success as state from repair_pay_record rpr
+        select rpr.id,rpr.create_time as pay_time,rpr.record_id,rr.record_no,rr.address,rr.area_id,rpr.pay_no,ru.user_name,rpr.pay_price,rpr.is_success as state from repair_pay_record rpr
         left join repair_record rr on rr.deleted = 0 and rr.id = rpr.record_id
         left join repair_user ru on ru.deleted = 0  and ru.id = rpr.user_id
         where rpr.deleted = 0 and rpr.is_success = 2
         <if test="keyWord != null and keyWord !='' ">
+
             and (rpr.user_id in (select id from repair_user where deleted = 0 and user_name like '%' #{keyWord} '%')
-            or rpr.record_id in (select id from repair_record where deleted = 0 and record_no like '%' #{keyWord} '%'))
+            or rpr.record_id in (select id from repair_record where deleted = 0 and record_no like '%' #{keyWord} '%')
+            or rpr.record_id in (select id from repair_record where deleted = 0 and area_id like '%' #{keyWord} '%')
+            or rpr.record_id in (select id from repair_record where deleted =0 and address like '%' #{keyWord} '%')
+            or rpr.record_id in (select id from repair_record where deleted =0 and concat(area_id,address)like concat('%',#{keyWord),'%'))
         </if>
         <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
             and rpr.create_time between #{startTime} and #{endTime}

+ 225 - 96
src/main/resources/mapper/repair/RepairRecordMapper.xml

@@ -79,7 +79,7 @@
     <resultMap type="com.repair.model.vo.MaintenanceTechnicianVo" id="repairRecordTechnicianMap">
         <result property="receivingCount" column="receiving_count"/>
         <result property="maintenanceCount" column="maintenance_count"/>
-        <result property="timeoutCount" column="timeout_count"/>
+        <!--<result property="timeoutCount" column="timeout_count"/>-->
         <result property="examineCount" column="examine_count"/>
     </resultMap>
 
@@ -229,8 +229,9 @@
         <result property="finishedCount" column="finished_count"/>
         <result property="canceledCount" column="canceled_count"/>
         <result property="closedCount" column="closed_count"/>
-        <result property="timeoutCount" column="timeout_count"/>
+       <!-- <result property="timeoutCount" column="timeout_count"/>-->
         <result property="offlineCount" column="offline_count"/>
+        <result property="paidCount" column="paid_count"/>
     </resultMap>
 
     <select id="queryManageCount" resultType="com.repair.model.vo.RepairManageCountVo" resultMap="repairManageCountMap">
@@ -240,9 +241,9 @@
         and rr.maintenance_state = 1
         where rr.deleted = 0 and rr.maintenance_state = 1
         <if test="keyWord != null and keyWord != ''">
-            and (rr.record_no like '%' #{keyWord} '%' or rr.area_id like '%' #{keyWord} '%' or rr.user_name like '%'
-            #{keyWord} '%' or rr.user_phone like '%'
-            #{keyWord} '%')
+            and (rr.record_no like '%' #{keyWord} '%' or rr.area_id like '%' #{keyWord} '%' or rr.address like '%' #{keyWord} '%'
+                     or concat(rr.area_id,rr.address) like concat('%',#{keyWord},'%')
+                     or rr.user_name like '%'#{keyWord} '%' or rr.user_phone like '%' #{keyWord} '%')
         </if>
         <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
             and rr.report_time between #{startTime} and #{endTime}
@@ -260,9 +261,9 @@
         rr.maintenance_state = 2
         where rr.deleted = 0 and rr.maintenance_state = 2
         <if test="keyWord != null and keyWord != ''">
-            and (rr.record_no like '%' #{keyWord} '%' or rr.area_id like '%' #{keyWord} '%' or rr.user_name like '%'
-            #{keyWord} '%' or rr.user_phone like '%'
-            #{keyWord} '%')
+            and (rr.record_no like '%' #{keyWord} '%' or rr.area_id like '%' #{keyWord} '%' or rr.address like '%' #{keyWord} '%'
+                     or concat(rr.area_id,rr.address) like concat('%',#{keyWord},'%')
+                     or rr.user_name like '%' #{keyWord} '%' or rr.user_phone like '%' #{keyWord} '%')
         </if>
         <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
             and rr.report_time between #{startTime} and #{endTime}
@@ -283,9 +284,9 @@
         </if>
         where rr.deleted = 0 and rr.maintenance_state = 3
         <if test="keyWord != null and keyWord != ''">
-            and (rr.record_no like '%' #{keyWord} '%' or rr.area_id like '%' #{keyWord} '%' or rr.user_name like '%'
-            #{keyWord} '%' or rr.user_phone like '%' #{keyWord}
-            '%')
+            and (rr.record_no like '%' #{keyWord} '%' or rr.area_id like '%' #{keyWord} '%' or rr.address like '%' #{keyWord} '%'
+                     or concat(rr.area_id,rr.address) like concat('%',#{keyWord},'%')
+                     or rr.user_name like '%' #{keyWord} '%' or rr.user_phone like '%' #{keyWord}'%')
         </if>
         <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
             and rr.report_time between #{startTime} and #{endTime}
@@ -297,8 +298,9 @@
         (select Count(*) from repair_record where deleted = 0 and (maintenance_state = 5 or maintenance_state = 6 or
         maintenance_state = 11)
         <if test="keyWord != null and keyWord != ''">
-            and (area_id like '%' #{keyWord} '%' or user_name like '%' #{keyWord} '%' or user_phone like '%' #{keyWord}
-            '%')
+            and (area_id like '%' #{keyWord} '%' or address like '%' #{keyWord} '%'
+                     or concat(area_id,address) like concat('%',#{keyWord},'%')
+                     or user_name like '%' #{keyWord} '%' or user_phone like '%' #{keyWord}'%')
         </if>
         <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
             and report_time between #{startTime} and #{endTime}
@@ -312,9 +314,9 @@
         (select Count(*) from repair_record rr
         where rr.deleted = 0 and rr.maintenance_state = 7
         <if test="keyWord != null and keyWord != ''">
-            and (rr.record_no like '%' #{keyWord} '%' or rr.area_id like '%' #{keyWord} '%' or rr.user_name like '%'
-            #{keyWord} '%' or rr.user_phone like '%' #{keyWord}
-            '%')
+            and (rr.record_no like '%' #{keyWord} '%' or rr.area_id like '%' #{keyWord} '%' or rr.address like '%' #{keyWord} '%'
+                     or concat(rr.area_id,rr.address) like concat('%',#{keyWord},'%')
+                     or rr.user_name like '%' #{keyWord} '%' or rr.user_phone like '%' #{keyWord}'%')
         </if>
         <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
             and rr.report_time between #{startTime} and #{endTime}
@@ -329,8 +331,9 @@
         (select Count(*) from repair_record rr
         where rr.deleted = 0 and rr.maintenance_state = 8
         <if test="keyWord != null and keyWord != ''">
-            and (rr.record_no like '%' #{keyWord} '%' or rr.area_id like '%' #{keyWord} '%' or rr.user_name like '%'
-            #{keyWord} '%' or rr.user_phone like '%' #{keyWord}
+            and (rr.record_no like '%' #{keyWord} '%' or rr.area_id like '%' #{keyWord} '%' or rr.address like '%' #{keyWord} '%'
+                     or concat(rr.area_id,rr.address) like concat('%',#{keyWord},'%')
+                     or rr.user_name like '%' #{keyWord} '%' or rr.user_phone like '%' #{keyWord}
             '%')
         </if>
         <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
@@ -346,8 +349,9 @@
         (select Count(*) from repair_record rr
         where rr.deleted = 0 and rr.maintenance_state = 9
         <if test="keyWord != null and keyWord != ''">
-            and (rr.record_no like '%' #{keyWord} '%' or rr.area_id like '%' #{keyWord} '%' or rr.user_name like '%'
-            #{keyWord} '%' or rr.user_phone like '%' #{keyWord}
+            and (rr.record_no like '%' #{keyWord} '%' or rr.area_id like '%' #{keyWord} '%' or rr.address like '%' #{keyWord} '%'
+                    or concat(rr.area_id,rr.address) like concat('%',#{keyWord},'%')
+                    or rr.user_name like '%' #{keyWord} '%' or rr.user_phone like '%' #{keyWord}
             '%')
         </if>
         <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
@@ -359,41 +363,61 @@
         <if test="maintenanceName != null and maintenanceName != ''">
             and rr.maintenancer_name like '%' #{maintenanceName} '%'
         </if>) as closed_count,
-        (SELECT count(*) as cs FROM (
-        select rdr.users_id as
-        user_id,rr.maintenance_state,rr.article_id,rr.id,rr.record_no,rr.report_time,rr.user_name,rr.user_phone,rr.area_id
-        as area_name,rr.address,rr.description,rr.image,rr.maintenancer_name,rr.maintenancer_phone,rr.price from
-        repair_record rr
-        inner join repair_dispatch_record rdr on rdr.deleted = 0 and rdr.record_id = rr.id and rdr.is_lose_efficacy = 0
-        and ((date_add(rdr.assigned_time , interval rdr.acceptance_assess_time minute) &lt;= NOW() and
-        rdr.receiving_time is null) or date_add(rdr.assigned_time , interval rdr.acceptance_assess_time minute) &lt;=
-        rdr.receiving_time)
-        where rr.is_duty = 0 and rr.maintenance_state &lt;= 7 and rr.deleted = 0
-        <if test="keyWord != null and keyWord != ''">
-            and (rr.record_no like '%' #{keyWord} '%' or rr.area_id like '%' #{keyWord} '%' or rr.user_name like '%'
-            #{keyWord} '%' or rr.user_phone like '%'
-            #{keyWord} '%')
-        </if>
-        <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
-            and rr.report_time between #{startTime} and #{endTime}
-        </if>
-        <if test="schoolId != null and schoolId != ''">
-            and rr.school_id = #{schoolId}
-        </if>
-        UNION
-        select
-        rdv.user_id,rr.maintenance_state,rr.article_id,rr.id,rr.record_no,rr.report_time,rr.user_name,rr.user_phone,rr.area_id
-        as area_name,rr.address,rr.description,rr.image,rr.maintenancer_name,rr.maintenancer_phone,rr.price from
-        repair_record rr
-        inner join repair_receiving rdv on rdv.deleted = 0 and rdv.record_id = rr.id and rdv.is_lose_efficacy = 0
-        and ((date_add(rdv.receiving_time , interval rdv.maintenance_assess_time minute) &lt;= NOW() and
-        rdv.maintenance_assess_time is null) or date_add(rdv.receiving_time , interval rdv.maintenance_assess_time
-        minute) &lt;= rdv.finish_time)
-        where rr.is_duty = 0 and rr.maintenance_state &lt;= 7 and rr.deleted = 0
+<!--        (SELECT count(*) as cs FROM (-->
+<!--        select rdr.users_id as-->
+<!--        user_id,rr.maintenance_state,rr.article_id,rr.id,rr.record_no,rr.report_time,rr.user_name,rr.user_phone,rr.area_id-->
+<!--        as area_name,rr.address,rr.description,rr.image,rr.maintenancer_name,rr.maintenancer_phone,rr.price from-->
+<!--        repair_record rr-->
+<!--        inner join repair_dispatch_record rdr on rdr.deleted = 0 and rdr.record_id = rr.id and rdr.is_lose_efficacy = 0-->
+<!--        and ((date_add(rdr.assigned_time , interval rdr.acceptance_assess_time minute) &lt;= NOW() and-->
+<!--        rdr.receiving_time is null) or date_add(rdr.assigned_time , interval rdr.acceptance_assess_time minute) &lt;=-->
+<!--        rdr.receiving_time)-->
+<!--        where rr.is_duty = 0 and rr.maintenance_state &lt;= 7 and rr.deleted = 0-->
+<!--        <if test="keyWord != null and keyWord != ''">-->
+<!--            and (rr.record_no like '%' #{keyWord} '%' or rr.area_id like '%' #{keyWord} '%' or rr.address like '%' #{keyWord} '%'-->
+<!--                    or concat(rr.area_id,rr.address) like concat('%',#{keyWord},'%')-->
+<!--                    or rr.user_name like '%' #{keyWord} '%' or rr.user_phone like '%' #{keyWord} '%')-->
+<!--        </if>-->
+<!--        <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">-->
+<!--            and rr.report_time between #{startTime} and #{endTime}-->
+<!--        </if>-->
+<!--        <if test="schoolId != null and schoolId != ''">-->
+<!--            and rr.school_id = #{schoolId}-->
+<!--        </if>-->
+<!--        UNION-->
+<!--        select-->
+<!--        rdv.user_id,rr.maintenance_state,rr.article_id,rr.id,rr.record_no,rr.report_time,rr.user_name,rr.user_phone,rr.area_id-->
+<!--        as area_name,rr.address,rr.description,rr.image,rr.maintenancer_name,rr.maintenancer_phone,rr.price from-->
+<!--        repair_record rr-->
+<!--        inner join repair_receiving rdv on rdv.deleted = 0 and rdv.record_id = rr.id and rdv.is_lose_efficacy = 0-->
+<!--        and ((date_add(rdv.receiving_time , interval rdv.maintenance_assess_time minute) &lt;= NOW() and-->
+<!--        rdv.maintenance_assess_time is null) or date_add(rdv.receiving_time , interval rdv.maintenance_assess_time-->
+<!--        minute) &lt;= rdv.finish_time)-->
+<!--        where rr.is_duty = 0 and rr.maintenance_state &lt;= 7 and rr.deleted = 0-->
+<!--        <if test="keyWord != null and keyWord != ''">-->
+<!--            and (rr.record_no like '%' #{keyWord} '%' or rr.area_id like '%' #{keyWord} '%' or rr.address like '%' #{keyWord} '%'-->
+<!--                    or concat(rr.area_id,rr.address) like concat('%',#{keyWord},'%')-->
+<!--                    or rr.user_name like '%' #{keyWord} '%' or rr.user_phone like '%' #{keyWord} '%')-->
+<!--        </if>-->
+<!--        <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">-->
+<!--            and rr.report_time between #{startTime} and #{endTime}-->
+<!--        </if>-->
+<!--        <if test="schoolId != null and schoolId != ''">-->
+<!--            and rr.school_id = #{schoolId}-->
+<!--        </if>-->
+<!--        ) t-->
+<!--        <if test="maintenanceName != null and maintenanceName != ''">-->
+<!--            where t.user_id in (select id from repair_user where user_name like '%' #{maintenanceName} '%' and deleted =-->
+<!--            0)-->
+<!--        </if>-->
+<!--        ) as timeout_count,-->
+        (select Count(*) from repair_record rr
+        where rr.deleted = 0 and rr.maintenance_state = 10
         <if test="keyWord != null and keyWord != ''">
-            and (rr.record_no like '%' #{keyWord} '%' or rr.area_id like '%' #{keyWord} '%' or rr.user_name like '%'
-            #{keyWord} '%' or rr.user_phone like '%'
-            #{keyWord} '%')
+            and (rr.record_no like '%' #{keyWord} '%' or rr.area_id like '%' #{keyWord} '%' or rr.address like '%' #{keyWord} '%'
+            or concat(rr.area_id,rr.address) like concat('%',#{keyWord},'%')
+            or rr.user_name like '%' #{keyWord} '%' or rr.user_phone like '%' #{keyWord}
+            '%')
         </if>
         <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
             and rr.report_time between #{startTime} and #{endTime}
@@ -401,17 +425,16 @@
         <if test="schoolId != null and schoolId != ''">
             and rr.school_id = #{schoolId}
         </if>
-        ) t
         <if test="maintenanceName != null and maintenanceName != ''">
-            where t.user_id in (select id from repair_user where user_name like '%' #{maintenanceName} '%' and deleted =
-            0)
+            and rr.maintenancer_name like '%' #{maintenanceName} '%'
         </if>
-        ) as timeout_count,
+        ) as offline_count,
         (select Count(*) from repair_record rr
-        where rr.deleted = 0 and rr.maintenance_state = 10
+        where rr.deleted = 0 and rr.maintenance_state = 4
         <if test="keyWord != null and keyWord != ''">
-            and (rr.record_no like '%' #{keyWord} '%' or rr.area_id like '%' #{keyWord} '%' or rr.user_name like '%'
-            #{keyWord} '%' or rr.user_phone like '%' #{keyWord}
+            and (rr.record_no like '%' #{keyWord} '%' or rr.area_id like '%' #{keyWord} '%' or rr.address like '%' #{keyWord} '%'
+            or concat(rr.area_id,rr.address) like concat('%',#{keyWord},'%')
+            or rr.user_name like '%' #{keyWord} '%' or rr.user_phone like '%' #{keyWord}
             '%')
         </if>
         <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
@@ -423,7 +446,7 @@
         <if test="maintenanceName != null and maintenanceName != ''">
             and rr.maintenancer_name like '%' #{maintenanceName} '%'
         </if>
-        ) as offline_count
+        ) as paid_count
     </select>
 
     <!--管理端工单分页数据-->
@@ -435,6 +458,7 @@
         <result property="userPhone" column="user_phone"/>
         <result property="articleName" column="article_name"/>
         <result property="areaName" column="area_name"/>
+        <result property="addressName" column="address"/>
         <result property="description" column="description"/>
         <result property="reportTime" column="report_time"/>
         <result property="maintenancerName" column="maintenancer_name"/>
@@ -447,13 +471,13 @@
 
     <!--除已超时外的其他数据获取方式-->
     <select id="queryNotTimeout" resultType="com.repair.model.vo.RepairRecordPageVo" resultMap="repairRecordPageMap">
-        select * from (select rr.school_id,rr.user_id,1 as details,rr.id,rr.record_no,rr.area_id as
-        area_name,rr.user_name,rr.user_phone,rat.name as
-        article_name,
-        rr.description,rr.report_time,rr.maintenancer_name,rr.maintenance_state,(select user_name from repair_user where
-        id = rdv.user_id and deleted = 0) as rdvName,(select user_name from repair_user where id = rdr.users_id and
-        deleted = 0) as rdrName,(select user_name from repair_user where id = ror.user_id and
-        deleted = 0) as rorName
+        select * from (select rr.school_id,rr.user_id,1 as details,rr.id,rr.record_no,
+                              rr.area_id as area_name,rr.address,
+                              rr.user_name,rr.user_phone,rat.name as article_name,rr.description,rr.report_time,
+                              rr.maintenancer_name,rr.maintenance_state,
+                              (select user_name from repair_user where id = rdv.user_id and deleted = 0) as rdvName,
+                              (select user_name from repair_user where id = rdr.users_id and deleted = 0) as rdrName,
+                              (select user_name from repair_user where id = ror.user_id and deleted = 0) as rorName
         from repair_record rr
         left join repair_receiving rdv on rdv.deleted = 0 and rdv.record_id = rr.id and rdv.is_lose_efficacy = 0 and
         rdv.finish_time is null and rr.maintenance_state = 2
@@ -472,13 +496,16 @@
             <if test="stateStr != null and stateStr != ''">
                 and (rr.maintenance_state ${stateStr}
             </if>
-            <if test="stateStr == null or stateStr == ''">
-                and rr.maintenance_state != 4
-            </if>
+<!--            <if test="stateStr == null or stateStr == ''">-->
+<!--                and rr.maintenance_state != 4-->
+<!--            </if>-->
             <if test="keyWord != null and keyWord != ''">
-                and (rr.record_no like '%' #{keyWord} '%' or rr.area_id like '%' #{keyWord} '%' or rr.user_name like '%'
-                #{keyWord} '%' or rr.user_phone like
-                '%' #{keyWord} '%')
+                and (rr.record_no like '%' #{keyWord} '%'
+                or rr.area_id like '%' #{keyWord} '%'
+                or rr.address like '%' #{keyWord} '%'
+                or concat(rr.area_id,rr.address) like concat('%',#{keyWord},'%')
+                or rr.user_name like '%' #{keyWord} '%'
+                or rr.user_phone like '%' #{keyWord} '%')
             </if>
             <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
                 and rr.report_time between #{startTime} and #{endTime}
@@ -617,7 +644,7 @@
         <result property="maintenanceCount" column="maintenance_count"/>
         <result property="finishedCount" column="finished_count"/>
         <result property="logisticsCount" column="logistics_count"/>
-        <result property="timeoutCount" column="timeout_count"/>
+       <!-- <result property="timeoutCount" column="timeout_count"/>-->
         <result property="closedCount" column="closed_count"/>
         <result property="offlineCount" column="offline_count"/>
     </resultMap>
@@ -781,11 +808,16 @@
 
     <!-- 报表导出获取除已超时外的其他数据获取方式-->
     <select id="queryNotTimeoutReportExport" resultType="com.repair.model.vo.ReportExportVo">
-        select rr.user_id,1 as details,rr.id,rr.record_no,rr.area_id as area_name,rr.user_name,rr.user_phone,rat.name as
-        article_name,
+        select rr.user_id,1 as details,rr.id,rr.record_no,rr.area_id as area_name,rr.address,
+               rr.user_name,rr.user_phone,rat.name as article_name,
+               (select name from repair_article_type where id = rat.parent_id) as repair_type,
+               rc.number,rc.total_price,rpr.is_success as is_paid,rrr.is_success as is_refund,
         rr.description,rr.report_time,rr.maintenancer_name,rr.maintenance_state
         from repair_record rr
         left join repair_article_type rat on rat.deleted = 0 and rat.id = rr.article_id
+        left join repair_consumables rc on rc.deleted = 0 and rr.id = rc.record_id
+        left join repair_pay_record rpr on rpr.deleted = 0 and rr.id = rpr.record_id
+        left join repair_refund_record rrr on rrr.deleted = 0 and rr.id = rrr.record_id
         <where>
             and rr.deleted = 0
             <if test="schoolId != null and schoolId != ''">
@@ -795,9 +827,9 @@
                 and (rr.maintenance_state ${stateStr}
             </if>
             <if test="keyWord != null and keyWord != ''">
-                and (rr.record_no like '%' #{keyWord} '%' or rr.area_id like '%' #{keyWord} '%' or rr.user_name like '%'
-                #{keyWord} '%' or rr.user_phone like
-                '%' #{keyWord} '%')
+                and (rr.record_no like '%' #{keyWord} '%' or rr.area_id like '%' #{keyWord} '%' or rr.address like '%' #{keyWord} '%'
+                or concat(rr.area_id,rr.address) like concat('%',#{keyWord},'%')
+                or rr.user_name like '%' #{keyWord} '%' or rr.user_phone like '%' #{keyWord} '%')
             </if>
             <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
                 and rr.report_time between #{startTime} and #{endTime}
@@ -870,7 +902,7 @@
         <result property="workCount" column="work_count"/>
         <result property="processCount" column="process_count"/>
         <result property="finishCount" column="finish_count"/>
-        <result property="timeoutCount" column="timeout_count"/>
+        <!--<result property="timeoutCount" column="timeout_count"/>-->
         <result property="offlineCount" column="offline_count"/>
     </resultMap>
     <!--说明:-->
@@ -998,8 +1030,16 @@
         FROM (SELECT count(rr.area_id)   AS orders_total,
                      rs.`name`           AS school_name,
                      rr.area_id          AS area_name,
-                     SUM(case when rr.price > 0 then 1 else 0 end) AS orders_compensation,
-                     SUM(case when rr.price IS NULL OR rr.price = 0 then 1 else 0 end) AS orders_gratis,
+                     (SELECT COUNT(area_id)
+                      FROM `repair_record`
+                      WHERE price > 0
+                        AND rr.area_id = area_id
+                        AND deleted = 0) AS orders_compensation,
+                     (SELECT COUNT(area_id)
+                      FROM `repair_record`
+                      WHERE (price IS NULL OR price = 0)
+                        AND rr.area_id = area_id
+                        AND deleted = 0) AS orders_gratis,
                      SUM(rr.price)       AS total_price
               FROM `repair_record` rr
                        LEFT JOIN repair_school rs ON rs.deleted = 0
@@ -1013,8 +1053,28 @@
         FROM (SELECT count(rr.area_id) AS orders_total,
         rs.`name` AS school_name,
         rr.area_id AS area_name,
-        SUM(case when rr.price > 0 then 1 else 0 end) AS orders_compensation,
-        SUM(case when rr.price IS NULL OR rr.price = 0 then 1 else 0 end) AS orders_gratis,
+        (SELECT COUNT(area_id)
+        FROM `repair_record`
+        <where>
+            AND price > 0
+            AND rr.area_id = area_id
+            AND deleted = 0
+            <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+                and report_time between #{startTime} and #{endTime}
+            </if>
+        </where>
+        ) AS orders_compensation,
+        (SELECT COUNT(area_id)
+        FROM `repair_record`
+        <where>
+            AND (price IS NULL OR price = 0)
+            AND rr.area_id = area_id
+            AND deleted = 0
+            <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+                and report_time between #{startTime} and #{endTime}
+            </if>
+        </where>
+        ) AS orders_gratis,
         SUM(rr.price) AS total_price
         FROM `repair_record` rr
         LEFT JOIN repair_school rs ON rs.deleted = 0
@@ -1022,7 +1082,7 @@
         <where>
             AND rr.deleted=0
             <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
-                and rr.report_time between #{startTime} and #{endTime}
+                and report_time between #{startTime} and #{endTime}
             </if>
         </where>
         GROUP BY rr.area_id) ra
@@ -1032,8 +1092,16 @@
         FROM (SELECT rat.`name`           AS article_name,
                      rat.school_id as school_id,
                      count(rr.article_id) AS orders_total,
-                     SUM(case when rr.price > 0 then 1 else 0 end) AS orders_compensation,
-                     SUM(case when rr.price IS NULL OR rr.price = 0 then 1 else 0 end) AS orders_gratis,
+                     (SELECT COUNT(article_id)
+                      FROM `repair_record`
+                      WHERE price > 0
+                        AND rr.article_id = article_id
+                        AND deleted = 0)  AS orders_compensation,
+                     (SELECT COUNT(article_id)
+                      FROM `repair_record`
+                      WHERE (price IS NULL OR price = 0)
+                        AND rr.article_id = article_id
+                        AND deleted = 0)  AS orders_gratis,
                      SUM(rr.price)        AS total_price
               FROM `repair_record` rr
                        LEFT JOIN repair_article_type rat ON rr.article_id = rat.id
@@ -1046,8 +1114,26 @@
         FROM (SELECT rat.`name` AS article_name,
         rat.school_id as school_id,
         count(rr.article_id) AS orders_total,
-        SUM(case when rr.price > 0 then 1 else 0 end) AS orders_compensation,
-        SUM(case when rr.price IS NULL OR rr.price = 0 then 1 else 0 end) AS orders_gratis,
+        (SELECT COUNT(article_id)
+        FROM `repair_record`
+        <where>
+            and price > 0 AND rr.article_id = article_id AND deleted = 0
+            <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+                and report_time between #{startTime} and #{endTime}
+            </if>
+        </where>
+        ) AS orders_compensation,
+        (SELECT COUNT(article_id)
+        FROM `repair_record`
+        <where>
+            and (price IS NULL OR price = 0)
+            AND rr.article_id = article_id
+            AND deleted = 0
+            <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+                and report_time between #{startTime} and #{endTime}
+            </if>
+        </where>
+        ) AS orders_gratis,
         SUM(rr.price) AS total_price
         FROM `repair_record` rr
         LEFT JOIN repair_article_type rat ON rr.article_id = rat.id
@@ -1064,8 +1150,28 @@
         FROM (SELECT count(rr.area_id) AS orders_total,
         rs.`name` AS school_name,
         rr.area_id AS area_name,
-        SUM(case when rr.price > 0 then 1 else 0 end) AS orders_compensation,
-        SUM(case when rr.price IS NULL OR rr.price = 0 then 1 else 0 end) AS orders_gratis,
+        (SELECT COUNT(area_id)
+        FROM `repair_record`
+        <where>
+            AND price > 0
+            AND rr.area_id = area_id
+            AND deleted = 0
+            <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+                and report_time between #{startTime} and #{endTime}
+            </if>
+        </where>
+        ) AS orders_compensation,
+        (SELECT COUNT(area_id)
+        FROM `repair_record`
+        <where>
+            AND (price IS NULL OR price = 0)
+            AND rr.area_id = area_id
+            AND deleted = 0
+            <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+                and report_time between #{startTime} and #{endTime}
+            </if>
+        </where>
+        ) AS orders_gratis,
         SUM(rr.price) AS total_price
         FROM `repair_record` rr
         LEFT JOIN repair_school rs ON rs.deleted = 0
@@ -1084,8 +1190,26 @@
         FROM (SELECT rat.`name` AS article_name,
         rat.school_id as school_id,
         count(rr.article_id) AS orders_total,
-        SUM(case when rr.price > 0 then 1 else 0 end) AS orders_compensation,
-        SUM(case when rr.price IS NULL OR rr.price = 0 then 1 else 0 end) AS orders_gratis,
+        (SELECT COUNT(article_id)
+        FROM `repair_record`
+        <where>
+            and price > 0 AND rr.article_id = article_id AND deleted = 0
+            <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+                and report_time between #{startTime} and #{endTime}
+            </if>
+        </where>
+        ) AS orders_compensation,
+        (SELECT COUNT(article_id)
+        FROM `repair_record`
+        <where>
+            and (price IS NULL OR price = 0)
+            AND rr.article_id = article_id
+            AND deleted = 0
+            <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+                and report_time between #{startTime} and #{endTime}
+            </if>
+        </where>
+        ) AS orders_gratis,
         SUM(rr.price) AS total_price
         FROM `repair_record` rr
         LEFT JOIN repair_article_type rat ON rat.deleted = 0
@@ -1362,7 +1486,12 @@
                       FROM repair_record
                       where deleted = 0
                         and maintenance_state = 4)
-                                                           as affirm_count
+                                                           as affirm_count,
+                    (SELECT COUNT(*)
+                     FROM  repair_record
+                     where deleted =0
+                      and maintenance_state = 10)
+                                                           as offlineCount;
     </select>
 
     <!--打印-->

+ 49 - 19
src/main/resources/mapper/repair/RepairUserMapper.xml

@@ -15,12 +15,12 @@
         <result property="userZzname" column="user_zzname"/>
         <result property="workType" column="work_type"/>
         <result property="workTypeName" column="work_type_name"/>
-        <result property="acceptanceTime" column="acceptance_assess_time"/>
-        <result property="maintenanceTime" column="maintenance_assess_time"/>
+<!--        <result property="acceptanceTime" column="acceptance_assess_time"/>-->
+<!--        <result property="maintenanceTime" column="maintenance_assess_time"/>-->
     </resultMap>
 
     <select id="queryUserPageList" resultType="com.repair.model.vo.RepairUserVo" resultMap="repairUserPageMap">
-        select ru.card_number,ru.acceptance_assess_time,ru.maintenance_assess_time,ru.id,ru.user_name, ru.user_phone, ru.team_id, case ru.team_id when 0 then '校方人员' else '第三方人员' end as team_name, ru.school_id,ra.name as school_name,
+        select ru.card_number,ru.id,ru.user_name, ru.user_phone, ru.team_id, case ru.team_id when 0 then '校方人员' else '第三方人员' end as team_name, ru.school_id,ra.name as school_name,
         ru.user_zzid,ru.work_type,rwt.name as work_type_name from repair_user ru
         left join repair_area ra on ra.id = ru.school_id and ra.deleted = 0
         left join repair_work_type rwt on rwt.id = ru.work_type and ra.deleted = 0
@@ -168,12 +168,17 @@
         <result property="acceptanceTime" column="acceptance_assess_time"/>
         <result property="maintenanceTime" column="maintenance_assess_time"/>
         <result property="startDate" column="start_date"/>
-        <result property="shiftId" column="shift_id"/>
+        <result property="shiftId" column="shift_Id"/>
+        <result property="teamName" column="team_Name"/>
+        <result property="userZzName" column="userZz_Name"/>
+
     </resultMap>
 
     <select id="autoDispatchUser" resultType="com.repair.model.vo.AutoDispatchUserVo" resultMap="AutoDispatchUserMap">
         select * from (
-        select ru.user_zzid,wt.name as work_type,'正常接单' as state,(select count(*) from repair_dispatch_record where deleted = 0 and is_lose_efficacy = 0 and assigned_time like '%' #{dateNow} '%' and users_id = ru.id) as rdr_count,ru.user_phone,ru.acceptance_assess_time,ru.maintenance_assess_time,ru.id,ru.user_name,rcs.start_date,rcs.shift_id
+            select ru.user_zzid,wt.name as work_type,'正常接单' as state,
+            (select count(*) from repair_dispatch_record where deleted = 0 and is_lose_efficacy = 0 and assigned_time like '%' #{dateNow} '%' and users_id = ru.id) as rdr_count,
+            ru.user_phone,ru.acceptance_assess_time,ru.maintenance_assess_time,ru.id,ru.user_name,rcs.start_date,rcs.shift_id
         from repair_user ru
         inner join repair_classes_settings rcs on rcs.deleted = 0 and rcs.user_id = ru.id and start_date = #{dateNow}
         left join repair_work_type wt on wt.deleted = 0 and wt.id = ru.work_type
@@ -190,6 +195,30 @@
         order by t.rdr_count
     </select>
 
+    <resultMap type="com.repair.model.vo.AutoDispatchUserVo" id="AutoOfflineUserMap1">
+        <result property="id" column="id"/>
+        <result property="state" column="state"/>
+        <result property="workType" column="work_type"/>
+        <result property="rdrCount" column="rdr_count"/>
+        <result property="userName" column="user_name"/>
+        <result property="userPhone" column="user_phone"/>
+        <result property="acceptanceTime" column="acceptance_assess_time"/>
+        <result property="maintenanceTime" column="maintenance_assess_time"/>
+        <result property="startDate" column="start_date"/>
+        <result property="shiftId" column="shift_Id"/>
+        <result property="teamName" column="team_Name"/>
+        <result property="userZzName" column="userZz_Name"/>
+    </resultMap>
+    <select id="autoOfflineRepairUser1" resultType="com.repair.model.vo.AutoOfflineUserVo" resultMap="AutoOfflineUserMap1">
+        select ru.id,ru.user_zzid,ru.user_name,case team_id when 0 then '校方人员' else '第三方人员' end as team_name,'线下' as userZz_name,wt.name as work_type
+        from repair_user ru
+        left join repair_work_type wt on wt.deleted = 0 and wt.id = ru.work_type
+        where ru.school_id = #{schoolId} and ru.deleted = 0 and ru.user_zzid = 4 and ru.state = 1
+        <if test="keyWord != null and keyWord != ''">
+            and ru.user_name like '%' #{keyWord} '%'
+        </if>
+    </select>
+
 
     <resultMap type="com.repair.model.vo.AutoOfflineUserVo" id="AutoOfflineUserMap">
         <result property="id" column="id"/>
@@ -198,12 +227,11 @@
         <result property="userZzName" column="userZz_name"/>
         <result property="workType" column="work_type"/>
     </resultMap>
-
     <select id="autoOfflineRepairUser" resultType="com.repair.model.vo.AutoOfflineUserVo" resultMap="AutoOfflineUserMap">
         select ru.id,ru.user_name,case team_id when 0 then '校方人员' else '第三方人员' end as team_name,'线下' as userZz_name,wt.name as work_type
         from repair_user ru
         left join repair_work_type wt on wt.deleted = 0 and wt.id = ru.work_type
-        where ru.school_id = #{schoolId} and ru.deleted = 0 and ru.user_zzid = 4 and ru.state = 1
+        where ru.school_id = #{schoolId} and ru.deleted = 0 and (ru.user_zzid = 4 or ru.user_zzid = 1) and ru.state = 1
         <if test="keyWord != null and keyWord != ''">
             and ru.user_name like '%' #{keyWord} '%'
         </if>
@@ -243,20 +271,22 @@
         where ru.deleted = 0 and (ru.user_zzid = 1 or ru.user_zzid = 2) and ru.school_id = #{schoolId}
     </select>
 
+
     <select id="dropDown" resultType="com.repair.model.vo.AutoDispatchUserVo">
         select * from (
-    select wt.name as work_type,'正常接单' as state,(select count(*) from repair_dispatch_record where deleted = 0 and is_lose_efficacy = 0  and users_id = ru.id) as rdr_count,ru.build_id,ru.user_phone,ru.acceptance_assess_time,ru.maintenance_assess_time,ru.id,ru.user_name,rcs.start_date,rcs.shift_id
-    from repair_user ru
-    inner join repair_classes_settings rcs on rcs.deleted = 0 and rcs.user_id = ru.id and rcs.start_date = CURRENT_DATE()
-    left join repair_work_type wt on wt.deleted = 0 and wt.id = ru.work_type
-    where
-    ru.id in (select user_id from
-        (select user_id,(select GROUP_CONCAT(id) from repair_article_type where (id = repair_article_build.article_id or parent_id = repair_article_build.article_id) and deleted = 0) as article_id,build_id
-        from repair_article_build
-        where deleted = 0) d
-        where FIND_IN_SET(${articleId},d.article_id) and FIND_IN_SET(${buildId},d.build_id)) and
-    ru.school_id = #{schoolId} and ru.deleted = 0 and (ru.user_zzid = 1 or ru.user_zzid = 2) and ru.state = 1 and ru.id != ${userId}) t
-    order by t.rdr_count
+          select wt.name as work_type,'正常接单' as state,(select count(*) from repair_dispatch_record where deleted = 0 and is_lose_efficacy = 0  and users_id = ru.id) as rdr_count,ru.build_id,ru.user_phone,ru.acceptance_assess_time,ru.maintenance_assess_time,ru.id,ru.user_name,rcs.start_date,rcs.shift_id
+          from repair_user ru
+                   inner join repair_classes_settings rcs on rcs.deleted = 0 and rcs.user_id = ru.id and rcs.start_date = CURRENT_DATE()
+                   left join repair_work_type wt on wt.deleted = 0 and wt.id = ru.work_type
+          where
+                  ru.id in (select user_id from
+                  (select user_id,(select GROUP_CONCAT(id) from repair_article_type where (id = repair_article_build.article_id or parent_id = repair_article_build.article_id) and deleted = 0) as article_id,build_id
+                   from repair_article_build
+                   where deleted = 0) d
+                            where FIND_IN_SET(${articleId},d.article_id) and FIND_IN_SET(${buildId},d.build_id)) and
+              ru.school_id = #{schoolId} and ru.deleted = 0 and (ru.user_zzid = 1 or ru.user_zzid = 2) and ru.state = 1 and ru.id != ${userId}) t
+        order by t.rdr_count
     </select>
 
+
 </mapper>