|
@@ -2,6 +2,8 @@ package org.jeecg.modules.smscheck.controller;
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.lang.Dict;
|
|
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.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
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 com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
+import io.swagger.util.Json;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.beanutils.PropertyUtils;
|
|
import org.apache.commons.beanutils.PropertyUtils;
|
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
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.configs.ObjectComparator;
|
|
|
import org.jeecg.modules.smscheck.entity.*;
|
|
import org.jeecg.modules.smscheck.entity.*;
|
|
|
import org.jeecg.modules.smscheck.service.*;
|
|
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.SmsCheckCustomerInfoTaskVo;
|
|
|
import org.jeecg.modules.smscheck.vo.SmsCheckTaskVo;
|
|
import org.jeecg.modules.smscheck.vo.SmsCheckTaskVo;
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
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.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
+import java.lang.reflect.Field;
|
|
|
import java.lang.reflect.InvocationTargetException;
|
|
import java.lang.reflect.InvocationTargetException;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.function.Function;
|
|
import java.util.function.Function;
|
|
@@ -1467,4 +1472,95 @@ public class SmsCheckCustomerInfoController extends JeecgController<SmsCheckCust
|
|
|
throw new RuntimeException(e);
|
|
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);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|