兴安优化临时访客
This commit is contained in:
@@ -503,6 +503,7 @@ public class VisitorController extends BaseController {
|
||||
@PostMapping("/app/add")
|
||||
@Transactional
|
||||
public AjaxResult appAdd(@RequestBody Visitor visitor) throws Exception {
|
||||
log.info("appAdd-入参:{}", JSON.toJSONString(visitor));
|
||||
if (visitor.getStartTime().getTime() > visitor.getEndTime().getTime()) {
|
||||
throw new ServiceException("您输入的开始时间不能大于结束时间");
|
||||
}
|
||||
@@ -513,8 +514,9 @@ public class VisitorController extends BaseController {
|
||||
phones = visitor.getItemList().stream().map(Visitor::getPhone).collect(Collectors.toList());
|
||||
}
|
||||
phones.add(visitor.getPhone());
|
||||
if (visitorService.addVisitorCheck(phones, visitor.getStartTime()) > 0) {
|
||||
throw new ServiceException("该时间段已有申请,请更换预约时间");
|
||||
List<String> strings = visitorService.addVisitorCheck(phones, visitor.getStartTime());
|
||||
if (CollUtil.isNotEmpty(strings)) {
|
||||
throw new ServiceException("手机号:" + strings.get(0) + "在该时间段已有申请");
|
||||
}
|
||||
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
@@ -545,17 +547,8 @@ public class VisitorController extends BaseController {
|
||||
}
|
||||
|
||||
// 保存附件
|
||||
if (!CollectionUtils.isEmpty(visitor.getInsurancePolicyList())) {
|
||||
int j = 1;
|
||||
List<SysFileVo> files = new ArrayList<>();
|
||||
for (String url : visitor.getInsurancePolicyList()) {
|
||||
SysFileVo sysFileVo = new SysFileVo();
|
||||
sysFileVo.setUrl(url);
|
||||
sysFileVo.setFileName("保险单" + j);
|
||||
files.add(sysFileVo);
|
||||
j++;
|
||||
}
|
||||
saveSysFile(files, String.valueOf(visitor.getId()));
|
||||
if(!CollectionUtils.isEmpty(visitor.getFileList())) {
|
||||
saveSysFile(visitor.getFileList(), String.valueOf(visitor.getId()));
|
||||
}
|
||||
|
||||
// 审核通知企微发送消息(小程序来源)
|
||||
|
||||
@@ -255,5 +255,5 @@ public interface VisitorMapper
|
||||
|
||||
void deleteVisitorReviewProcess(@Param("id") Long id);
|
||||
|
||||
int addVisitorCheck(@Param("phones") List<String> phones,@Param("startTime") Date startTime);
|
||||
List<String> addVisitorCheck(@Param("phones") List<String> phones,@Param("startTime") Date startTime);
|
||||
}
|
||||
|
||||
@@ -267,5 +267,5 @@ public interface IVisitorService
|
||||
|
||||
void cancel(Visitor visitor);
|
||||
|
||||
int addVisitorCheck(List<String> phones, Date startTime);
|
||||
List<String> addVisitorCheck(List<String> phones, Date startTime);
|
||||
}
|
||||
|
||||
@@ -820,7 +820,7 @@ public class VisitorServiceImpl implements IVisitorService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addVisitorCheck(List<String> phones, Date startTime) {
|
||||
public List<String> addVisitorCheck(List<String> phones, Date startTime) {
|
||||
return visitorMapper.addVisitorCheck(phones, startTime);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user