Merge branch 'yyhouc'

This commit is contained in:
glj 2023-05-22 10:22:56 +08:00
commit e700b9e004
1 changed files with 11 additions and 5 deletions

View File

@ -20,6 +20,7 @@ import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
@ -333,7 +334,7 @@ public class DisasterInfoController {
return R.data(callForHelp);
}
private final AdministratorService administratorService;
@PostMapping("review")
public R<Boolean> review(@RequestBody DisasterInfo disasterInfo) {
//审批通过 响应状态0未审批1审批未通过2审批通过并正在响应3审批通过并且响应完成
@ -349,16 +350,21 @@ public class DisasterInfoController {
@ApiOperation(value = "提交", notes = "传入Tool")
@PostMapping("/submit")
public R submit(@ApiParam(value = "Tool对象", required = true) @RequestBody DisasterInfo disasterInfo) {
Long chiefId = disasterInfo.getChiefId();
//判断是否是分配
String Allocation = disasterInfo.getAllocation();
LambdaQueryWrapper<GuestManageDisasterRef> qw = new LambdaQueryWrapper<>();
qw.eq(GuestManageDisasterRef::getDisasterId,disasterInfo.getId());
GuestManageDisasterRef one = guestManageDisasterRefService.getOne(qw);
one.setStatus(1);
one.setManagerId(disasterInfo.getChiefId());
one.setManagerId(chiefId);
guestManageDisasterRefService.updateById(one);
//判断是否是分配
String Allocation = disasterInfo.getAllocation();
//获得disasterInfo
disasterInfo = disasterInfoService.getById(disasterInfo.getId());
if(!StringUtil.isEmpty(Allocation)){
GuestInfo user = guestInfoService.getById(disasterInfo.getChiefId());
Administrator user = administratorService.getById(chiefId);
//发送邮件
Email email = new Email();
email.setSubject("You have a new pending disaster");