sunyize 2 سال پیش
والد
کامیت
e3474eb389

+ 96 - 0
tnc-sms/src/main/java/org/jeecg/modules/smscheck/controller/SmsCheckCustomerInfoController.java

@@ -2,6 +2,8 @@ package org.jeecg.modules.smscheck.controller;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.lang.Dict;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
@@ -10,6 +12,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import io.swagger.util.Json;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.beanutils.PropertyUtils;
 import org.apache.poi.ss.formula.functions.T;
@@ -30,6 +33,7 @@ import org.jeecg.modules.smscheck.configs.CheckTypeCode;
 import org.jeecg.modules.smscheck.configs.ObjectComparator;
 import org.jeecg.modules.smscheck.entity.*;
 import org.jeecg.modules.smscheck.service.*;
+import org.jeecg.modules.smscheck.service.impl.TransferServiceImpl;
 import org.jeecg.modules.smscheck.vo.SmsCheckCustomerInfoTaskVo;
 import org.jeecg.modules.smscheck.vo.SmsCheckTaskVo;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
@@ -42,6 +46,7 @@ import org.springframework.web.servlet.ModelAndView;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.lang.reflect.Field;
 import java.lang.reflect.InvocationTargetException;
 import java.util.*;
 import java.util.function.Function;
@@ -1467,4 +1472,95 @@ public class SmsCheckCustomerInfoController extends JeecgController<SmsCheckCust
             throw new RuntimeException(e);
         }
     }
+
+
+    @GetMapping(value = "/phone/customerPhone")
+    public Result<?> customerPhone(@RequestParam Map<String, String> parameterMap) {
+        String customerNo = parameterMap.get("customerNo");
+        try {
+
+            LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+
+            LambdaQueryWrapper<SmsCheckCustomerInfo> checkCustomerInfoLambdaQueryWrapper = new LambdaQueryWrapper<SmsCheckCustomerInfo>()
+                    //.eq(SmsCheckCustomerInfo::getCustomerNo, customerNo).eq(SmsCheckCustomerInfo::getStaffNo,sysUser.getWorkNo());
+                    .eq(SmsCheckCustomerInfo::getCustomerNo, customerNo);
+            List<SmsCheckCustomerInfo> list = customerInfoService.list(checkCustomerInfoLambdaQueryWrapper);
+
+            List<String> ids = list.stream().map(SmsCheckCustomerInfo::getId).collect(Collectors.toList());
+
+            LambdaQueryWrapper<SmsLotCustomerData> lambdaQueryWrapper = new LambdaQueryWrapper<SmsLotCustomerData>()
+                    .in(SmsLotCustomerData::getInfoId, ids);
+            List<SmsLotCustomerData> smsLotCustomerDataList = smsLotCustomerService.list(lambdaQueryWrapper);
+
+            LambdaQueryWrapper<SmsTruckCustomerData> truckCustomerDataLambdaQueryWrapper = new LambdaQueryWrapper<SmsTruckCustomerData>()
+                    .in(SmsTruckCustomerData::getInfoId, ids);
+            List<SmsTruckCustomerData> truckCustomerData = smsTruckCustomerDataService.list(truckCustomerDataLambdaQueryWrapper);
+
+            LambdaQueryWrapper<SmsCheckCustomerData> smsCustomerInfoGroupByCheckStates = new LambdaQueryWrapper<SmsCheckCustomerData>()
+                    .in(SmsCheckCustomerData::getInfoId, ids);
+            List<SmsCheckCustomerData> checkCustomerData = customerDataService.list(smsCustomerInfoGroupByCheckStates);
+
+            LambdaQueryWrapper<SpecialExamination> specialExaminationLambdaQueryWrapper = new LambdaQueryWrapper<SpecialExamination>()
+                    .in(SpecialExamination::getInfoId, ids);
+            List<SpecialExamination> specialExaminations = specialExaminationService.list(specialExaminationLambdaQueryWrapper);
+
+            List<FilesDataVo> filesDataVos =new ArrayList<>();
+            for (SmsLotCustomerData lotCustomerData : smsLotCustomerDataList) {
+                Class<? extends SmsLotCustomerData> aClass = lotCustomerData.getClass();
+                Field[] declaredFields = aClass.getDeclaredFields();
+                for (Field declaredField : declaredFields) {
+                    declaredField.setAccessible(true);
+                    Object value = declaredField.get(lotCustomerData);
+                    if (declaredField.isAnnotationPresent(MyCustomAnnotation.class)&& value!=null && !value.toString().equals("[{}]")) {
+                        List<FilesDataVo> filesDataVos1 = JSONArray.parseArray(value.toString(), FilesDataVo.class);
+                        filesDataVos.addAll(filesDataVos1);
+                    }
+                }
+            }
+            for (SmsTruckCustomerData smsTruckCustomerData : truckCustomerData) {
+                Class<? extends SmsTruckCustomerData> aClass = smsTruckCustomerData.getClass();
+                Field[] declaredFields = aClass.getDeclaredFields();
+                for (Field declaredField : declaredFields) {
+                    declaredField.setAccessible(true);
+                    Object value = declaredField.get(smsTruckCustomerData);
+                    if (declaredField.isAnnotationPresent(MyCustomAnnotation.class)&& value!=null && !value.toString().equals("[{}]")) {
+                        List<FilesDataVo> filesDataVos1 = JSONArray.parseArray(value.toString(), FilesDataVo.class);
+                        filesDataVos.addAll(filesDataVos1);
+                    }
+                }
+            }
+            for (SmsCheckCustomerData customerData : checkCustomerData) {
+                Class<? extends SmsCheckCustomerData> aClass = customerData.getClass();
+                Field[] declaredFields = aClass.getDeclaredFields();
+                for (Field declaredField : declaredFields) {
+                    declaredField.setAccessible(true);
+                    Object value = declaredField.get(customerData);
+                    if (declaredField.isAnnotationPresent(MyCustomAnnotation.class)&& value!=null && !value.toString().equals("[{}]")&& !value.toString().isEmpty()) {
+                        List<FilesDataVo> filesDataVos1 = JSONArray.parseArray(value.toString(), FilesDataVo.class);
+                        filesDataVos.addAll(filesDataVos1);
+                    }
+                }
+            }
+            for (SpecialExamination specialExamination : specialExaminations) {
+                Class<? extends SpecialExamination> aClass = specialExamination.getClass();
+                Field[] declaredFields = aClass.getDeclaredFields();
+                for (Field declaredField : declaredFields) {
+                    declaredField.setAccessible(true);
+                    Object value = declaredField.get(specialExamination);
+                    if (declaredField.isAnnotationPresent(MyCustomAnnotation.class)&& value!=null && !value.toString().equals("[{}]")) {
+                        List<FilesDataVo> filesDataVos1 = JSONArray.parseArray(value.toString(), FilesDataVo.class);
+                        filesDataVos.addAll(filesDataVos1);
+                    }
+                }
+            }
+            for (FilesDataVo filesDataVo : filesDataVos) {
+                filesDataVo.setUid(filesDataVo.getId());
+            }
+
+            return Result.ok(JSON.toJSONString(filesDataVos));
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
 }

+ 17 - 0
tnc-sms/src/main/java/org/jeecg/modules/smscheck/entity/FilesDataVo.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.smscheck.entity;
+
+import lombok.Data;
+
+@Data
+public class FilesDataVo {
+
+    private String id;
+    private String uid;
+
+    private String urlBase;
+
+    private String url;
+
+    private String fileName;
+
+}

+ 2 - 0
tnc-sms/src/main/java/org/jeecg/modules/smscheck/entity/ImportCustomerDataTask.java

@@ -119,6 +119,8 @@ public class ImportCustomerDataTask implements Callable {
             info.setDelFlag(CommonConstant.DEL_FLAG_0);
             // 0:未处理;1:未完善;2:待稽核;3:待整改;4:已整改;5:稽核通过 6 未上传;
             info.setCheckState(CheckStateCode.CHECK_STSTE_0);
+            SmsCheckTask byId = taskService.getById(taskId);
+            info.setType(byId.getType());
             //dataList.add(info);
             info.setTaskId(taskId);
             long count = customerInfoService.count(

+ 1 - 1
tnc-sms/src/main/java/org/jeecg/modules/smscheck/entity/SmsTruckCheckCustomerDataAndLog.java

@@ -128,7 +128,7 @@ public class SmsTruckCheckCustomerDataAndLog {
     @Excel(name = "账户编码", width = 15)
     private String accountCode;
     //楼宇编号
-    @Excel(name = "楼宇编号", width = 15)
+   // @Excel(name = "楼宇编号", width = 15)
     private String floorCode;
     //用户号码
     @Excel(name = "用户号码", width = 15)