|
|
@@ -11,24 +11,26 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
+import org.jeecg.common.api.dto.message.MessageDTO;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
import org.jeecg.common.constant.CommonConstant;
|
|
|
+import org.jeecg.common.system.api.ISysBaseAPI;
|
|
|
import org.jeecg.common.system.base.controller.JeecgController;
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
|
-import org.jeecg.common.system.vo.SysUserCacheInfo;
|
|
|
import org.jeecg.config.shiro.ShiroRealm;
|
|
|
import org.jeecg.modules.smscheck.configs.CheckStateCode;
|
|
|
import org.jeecg.modules.smscheck.entity.SmsCheckCustomerInfo;
|
|
|
+import org.jeecg.modules.smscheck.entity.SmsCheckCustomerInfoLog;
|
|
|
import org.jeecg.modules.smscheck.entity.SmsCheckWorkLog;
|
|
|
+import org.jeecg.modules.smscheck.service.ISmsCheckCustomerInfoLogService;
|
|
|
import org.jeecg.modules.smscheck.service.ISmsCheckCustomerInfoService;
|
|
|
import org.jeecg.modules.smscheck.service.ISmsCheckWorkLogService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
-import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.util.Arrays;
|
|
|
@@ -46,12 +48,14 @@ import java.util.List;
|
|
|
@Slf4j
|
|
|
public class SmsCheckCustomerInfoController extends JeecgController<SmsCheckCustomerInfo, ISmsCheckCustomerInfoService> {
|
|
|
@Autowired
|
|
|
- private ISmsCheckCustomerInfoService smsCheckCustomerInfoService;
|
|
|
- @Autowired
|
|
|
- private ShiroRealm shiroRealm;
|
|
|
+ private ISmsCheckCustomerInfoService customerInfoService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private ISmsCheckWorkLogService workLogService;
|
|
|
+ @Autowired
|
|
|
+ private ISmsCheckWorkLogService workLogService;
|
|
|
+ @Autowired
|
|
|
+ private ISmsCheckCustomerInfoLogService infoLogService;
|
|
|
+ @Autowired
|
|
|
+ private ISysBaseAPI sysBaseAPI;
|
|
|
|
|
|
/**
|
|
|
* 分页列表查询
|
|
|
@@ -72,7 +76,7 @@ public class SmsCheckCustomerInfoController extends JeecgController<SmsCheckCust
|
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
QueryWrapper<SmsCheckCustomerInfo> queryWrapper = QueryGenerator.initQueryWrapper(smsCheckCustomerInfo, request.getParameterMap());
|
|
|
Page<SmsCheckCustomerInfo> page = new Page<>(pageNo, pageSize);
|
|
|
- IPage<SmsCheckCustomerInfo> pageList = smsCheckCustomerInfoService.page(page, queryWrapper);
|
|
|
+ IPage<SmsCheckCustomerInfo> pageList = customerInfoService.page(page, queryWrapper);
|
|
|
return Result.OK(pageList);
|
|
|
}
|
|
|
|
|
|
@@ -101,7 +105,7 @@ public class SmsCheckCustomerInfoController extends JeecgController<SmsCheckCust
|
|
|
QueryWrapper<SmsCheckCustomerInfo> queryWrapper = QueryGenerator.initQueryWrapper(smsCheckCustomerInfo, request.getParameterMap());
|
|
|
Page<SmsCheckCustomerInfo> page = new Page<>(pageNo, pageSize);
|
|
|
queryWrapper.orderByAsc("create_time");
|
|
|
- IPage<SmsCheckCustomerInfo> pageList = smsCheckCustomerInfoService.page(page, queryWrapper);
|
|
|
+ IPage<SmsCheckCustomerInfo> pageList = customerInfoService.page(page, queryWrapper);
|
|
|
return Result.OK(pageList);
|
|
|
}
|
|
|
|
|
|
@@ -115,7 +119,7 @@ public class SmsCheckCustomerInfoController extends JeecgController<SmsCheckCust
|
|
|
@ApiOperation(value = "客户信息-添加", notes = "客户信息-添加")
|
|
|
@PostMapping(value = "/add")
|
|
|
public Result<String> add(@RequestBody SmsCheckCustomerInfo smsCheckCustomerInfo) {
|
|
|
- smsCheckCustomerInfoService.save(smsCheckCustomerInfo);
|
|
|
+ customerInfoService.save(smsCheckCustomerInfo);
|
|
|
return Result.OK("添加成功!");
|
|
|
}
|
|
|
|
|
|
@@ -141,7 +145,7 @@ public class SmsCheckCustomerInfoController extends JeecgController<SmsCheckCust
|
|
|
}
|
|
|
LambdaQueryWrapper<SmsCheckCustomerInfo> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(SmsCheckCustomerInfo::getUserNo,smsCheckCustomerInfo.getUserNo());
|
|
|
- List<SmsCheckCustomerInfo> list = smsCheckCustomerInfoService.list(queryWrapper);
|
|
|
+ List<SmsCheckCustomerInfo> list = customerInfoService.list(queryWrapper);
|
|
|
if (list.size()>0){
|
|
|
return Result.error("该用户已经存在");
|
|
|
}
|
|
|
@@ -149,7 +153,7 @@ public class SmsCheckCustomerInfoController extends JeecgController<SmsCheckCust
|
|
|
smsCheckCustomerInfo.setStaffNo(workNo);
|
|
|
smsCheckCustomerInfo.setStaffName(realname);
|
|
|
smsCheckCustomerInfo.setCheckState(CheckStateCode.CHECK_STSTE_1);
|
|
|
- smsCheckCustomerInfoService.save(smsCheckCustomerInfo);
|
|
|
+ customerInfoService.save(smsCheckCustomerInfo);
|
|
|
return Result.OK("添加成功!");
|
|
|
}
|
|
|
|
|
|
@@ -158,19 +162,45 @@ public class SmsCheckCustomerInfoController extends JeecgController<SmsCheckCust
|
|
|
@ApiOperation(value = "客户信息-编辑", notes = "客户信息-编辑")
|
|
|
@RequestMapping(value = "/edit/", method = {RequestMethod.PUT, RequestMethod.POST})
|
|
|
public Result<String> edit(@RequestBody SmsCheckCustomerInfo smsCheckCustomerInfo) {
|
|
|
- smsCheckCustomerInfoService.updateById(smsCheckCustomerInfo);
|
|
|
+ customerInfoService.updateById(smsCheckCustomerInfo);
|
|
|
return Result.OK("编辑成功!");
|
|
|
}
|
|
|
|
|
|
@AutoLog(value = "客户信息-提交稽核")
|
|
|
@ApiOperation(value = "客户信息-提交稽核", notes = "客户信息-提交稽核")
|
|
|
@RequestMapping(value = "/edit/check/state", method = {RequestMethod.PUT, RequestMethod.POST})
|
|
|
- public Result<String> editCheckState(@RequestBody SmsCheckCustomerInfo smsCheckCustomerInfo) {
|
|
|
- if (StringUtils.isEmpty(smsCheckCustomerInfo.getId())){
|
|
|
+ public Result<String> editCheckState(@RequestBody SmsCheckCustomerInfo info) {
|
|
|
+ LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
+
|
|
|
+ if (StringUtils.isEmpty(info.getId())){
|
|
|
return Result.error("提交失败");
|
|
|
}
|
|
|
- smsCheckCustomerInfo.setCheckState(CheckStateCode.CHECK_STSTE_2);
|
|
|
- smsCheckCustomerInfoService.updateById(smsCheckCustomerInfo);
|
|
|
+ info.setCheckState(CheckStateCode.CHECK_STSTE_2);
|
|
|
+ customerInfoService.updateById(info);
|
|
|
+
|
|
|
+ String infoId = info.getId();
|
|
|
+ SmsCheckCustomerInfo infoPo = customerInfoService.getById(infoId);
|
|
|
+
|
|
|
+ // 客户资料日志
|
|
|
+ SmsCheckCustomerInfoLog infoLog = new SmsCheckCustomerInfoLog();
|
|
|
+ infoLog.setTaskId(infoPo.getTaskId());
|
|
|
+ infoLog.setInfoId(infoPo.getId());
|
|
|
+ infoLog.setCustomerNo(infoPo.getCustomerNo());
|
|
|
+ infoLog.setCustomerName(infoPo.getCustomerName());
|
|
|
+ infoLog.setSmsNumber(infoPo.getSmsNumber());
|
|
|
+ infoLog.setUserNo(infoPo.getUserNo());
|
|
|
+
|
|
|
+ // 此处是领导用户名
|
|
|
+ infoLog.setTargetUsername(infoPo.getCreateBy());
|
|
|
+ infoLog.setStaffName(sysUser.getRealname());
|
|
|
+
|
|
|
+ // TODO 是否需要?
|
|
|
+ infoLog.setStaffId(sysUser.getId());
|
|
|
+ infoLog.setStaffNo(infoPo.getStaffNo());
|
|
|
+ infoLog.setStaffUsername(sysUser.getUsername());
|
|
|
+
|
|
|
+ infoLogService.save(infoLog);
|
|
|
+
|
|
|
return Result.OK("提交成功!");
|
|
|
}
|
|
|
|
|
|
@@ -185,7 +215,7 @@ public class SmsCheckCustomerInfoController extends JeecgController<SmsCheckCust
|
|
|
@ApiOperation(value = "客户信息-通过id删除", notes = "客户信息-通过id删除")
|
|
|
@DeleteMapping(value = "/delete")
|
|
|
public Result<String> delete(@RequestParam(name = "id") String id) {
|
|
|
- smsCheckCustomerInfoService.removeById(id);
|
|
|
+ customerInfoService.removeById(id);
|
|
|
return Result.OK("删除成功!");
|
|
|
}
|
|
|
|
|
|
@@ -199,7 +229,7 @@ public class SmsCheckCustomerInfoController extends JeecgController<SmsCheckCust
|
|
|
@ApiOperation(value = "客户信息-批量删除", notes = "客户信息-批量删除")
|
|
|
@DeleteMapping(value = "/deleteBatch")
|
|
|
public Result<String> deleteBatch(@RequestParam(name = "ids") String ids) {
|
|
|
- this.smsCheckCustomerInfoService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
+ this.customerInfoService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
return Result.OK("批量删除成功!");
|
|
|
}
|
|
|
|
|
|
@@ -213,7 +243,7 @@ public class SmsCheckCustomerInfoController extends JeecgController<SmsCheckCust
|
|
|
@ApiOperation(value = "客户信息-通过id查询", notes = "客户信息-通过id查询")
|
|
|
@GetMapping(value = "/queryById")
|
|
|
public Result<SmsCheckCustomerInfo> queryById(@RequestParam(name = "id") String id) {
|
|
|
- SmsCheckCustomerInfo smsCheckCustomerInfo = smsCheckCustomerInfoService.getById(id);
|
|
|
+ SmsCheckCustomerInfo smsCheckCustomerInfo = customerInfoService.getById(id);
|
|
|
if (smsCheckCustomerInfo == null) {
|
|
|
return Result.error("未找到对应数据");
|
|
|
}
|
|
|
@@ -256,27 +286,27 @@ public class SmsCheckCustomerInfoController extends JeecgController<SmsCheckCust
|
|
|
public Result<Dict> count(@RequestParam(name = "id") String id) {
|
|
|
Dict dict = Dict.create();
|
|
|
// 客户总数
|
|
|
- long count = smsCheckCustomerInfoService.count(new LambdaQueryWrapper<SmsCheckCustomerInfo>()
|
|
|
+ long count = customerInfoService.count(new LambdaQueryWrapper<SmsCheckCustomerInfo>()
|
|
|
.eq(SmsCheckCustomerInfo::getTaskId, id)
|
|
|
.eq(SmsCheckCustomerInfo::getDelFlag, CommonConstant.DEL_FLAG_0));
|
|
|
// 未处理数
|
|
|
- long undoCount = smsCheckCustomerInfoService.count(new LambdaQueryWrapper<SmsCheckCustomerInfo>()
|
|
|
+ long undoCount = customerInfoService.count(new LambdaQueryWrapper<SmsCheckCustomerInfo>()
|
|
|
.eq(SmsCheckCustomerInfo::getTaskId, id)
|
|
|
.in(SmsCheckCustomerInfo::getCheckState, Arrays.asList(0, 1))
|
|
|
.eq(SmsCheckCustomerInfo::getDelFlag, CommonConstant.DEL_FLAG_0));
|
|
|
|
|
|
// 待稽核数
|
|
|
- long uncheckCount = smsCheckCustomerInfoService.count(new LambdaQueryWrapper<SmsCheckCustomerInfo>()
|
|
|
+ long uncheckCount = customerInfoService.count(new LambdaQueryWrapper<SmsCheckCustomerInfo>()
|
|
|
.eq(SmsCheckCustomerInfo::getTaskId, id)
|
|
|
.in(SmsCheckCustomerInfo::getCheckState, Arrays.asList(2, 3))
|
|
|
.eq(SmsCheckCustomerInfo::getDelFlag, CommonConstant.DEL_FLAG_0));
|
|
|
// 待整改数
|
|
|
- long checkedCount = smsCheckCustomerInfoService.count(new LambdaQueryWrapper<SmsCheckCustomerInfo>()
|
|
|
+ long checkedCount = customerInfoService.count(new LambdaQueryWrapper<SmsCheckCustomerInfo>()
|
|
|
.eq(SmsCheckCustomerInfo::getTaskId, id)
|
|
|
.eq(SmsCheckCustomerInfo::getCheckState, 4)
|
|
|
.eq(SmsCheckCustomerInfo::getDelFlag, CommonConstant.DEL_FLAG_0));
|
|
|
// 稽核完成数
|
|
|
- long passedCount = smsCheckCustomerInfoService.count(new LambdaQueryWrapper<SmsCheckCustomerInfo>()
|
|
|
+ long passedCount = customerInfoService.count(new LambdaQueryWrapper<SmsCheckCustomerInfo>()
|
|
|
.eq(SmsCheckCustomerInfo::getTaskId, id)
|
|
|
.eq(SmsCheckCustomerInfo::getCheckState, 5)
|
|
|
.eq(SmsCheckCustomerInfo::getDelFlag, CommonConstant.DEL_FLAG_0));
|
|
|
@@ -301,15 +331,19 @@ public class SmsCheckCustomerInfoController extends JeecgController<SmsCheckCust
|
|
|
@PostMapping(value = "/checkInfo")
|
|
|
public Result<String> checkInfo(@RequestBody SmsCheckWorkLog workLog) {
|
|
|
|
|
|
- // 0:未处理;1:未完善;2:待稽核;3:待整改;4:已整改;5:稽核通过;
|
|
|
- int checkState = 3;
|
|
|
+ String staffNo = workLog.getStaffNo();
|
|
|
+ LoginUser staff = sysBaseAPI.getUserByWorkNo(staffNo);
|
|
|
+ workLog.setTargetUsername(staff.getUsername());
|
|
|
+ workLog.setTargetRealname(staff.getRealname());
|
|
|
+ // 0:未处理;1:未完善;2:待稽核;3:已整改;4:待整改;5:稽核通过;
|
|
|
+ int checkState = 4;
|
|
|
// 1:未通过;2:通过
|
|
|
if (workLog.getBasicCheckState() == 2 && workLog.getStandardCheckState() == 2
|
|
|
&& workLog.getDataCheckState() == 2) {
|
|
|
checkState = 5;
|
|
|
}
|
|
|
// 更新客户信息
|
|
|
- boolean flag = smsCheckCustomerInfoService.update(new LambdaUpdateWrapper<SmsCheckCustomerInfo>()
|
|
|
+ boolean flag = customerInfoService.update(new LambdaUpdateWrapper<SmsCheckCustomerInfo>()
|
|
|
.eq(SmsCheckCustomerInfo::getId, workLog.getInfoId())
|
|
|
.set(SmsCheckCustomerInfo::getCheckState, checkState));
|
|
|
|
|
|
@@ -320,7 +354,28 @@ public class SmsCheckCustomerInfoController extends JeecgController<SmsCheckCust
|
|
|
return Result.error("稽核失败!");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 通知客户经理
|
|
|
+ *
|
|
|
+ * @param info 对象
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
+ @AutoLog(value = "通知客户经理")
|
|
|
+ @ApiOperation(value = "通知客户经理", notes = "通知客户经理")
|
|
|
+ @PostMapping(value = "/notice")
|
|
|
+ public Result<String> notice(@RequestBody SmsCheckCustomerInfo info) {
|
|
|
+ LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
+ String workNo = info.getStaffNo();
|
|
|
+ LoginUser toUser = sysBaseAPI.getUserByWorkNo(workNo);
|
|
|
+ MessageDTO message = new MessageDTO();
|
|
|
+ message.setTitle("稽核代办,用户编号:【" + info.getUserNo() + "】");
|
|
|
+ message.setContent("客户名称:【" + info.getCustomerName() + "】,服务号码:【" + info.getSmsNumber()
|
|
|
+ + "】,用户编号:【" + info.getUserNo() + "】的客户资料请尽快完善。");
|
|
|
+ message.setFromUser(sysUser.getUsername());
|
|
|
+ message.setToUser(toUser.getUsername());
|
|
|
+ sysBaseAPI.sendSysAnnouncement(message);
|
|
|
+ return Result.OK("添加成功!");
|
|
|
+ }
|
|
|
|
|
|
|
|
|
}
|