develop
hanrenchun 10 months ago
parent 58f3b8815e
commit a09b036dc3

@ -46,29 +46,31 @@ public class DisposalInfoController extends BaseController {
queryWrapper.orderByDesc("warning_time");
List<TransitHuntersUserModelRecord> list1 = transitHuntersUserModelRecordService.list(queryWrapper);
ArrayList<TransitHuntersUserModelRecord> transitHuntersUserModelRecords = new ArrayList<>();
for (TransitHuntersUserModelRecord transitHuntersUserModelRecord :list1){
for (TransitHuntersUserModelRecord transitHuntersUserModelRecord : list1) {
Long id = transitHuntersUserModelRecord.getId();
if (transitHuntersUserModelRecord.getWarningLevel() == 3) {
transitHuntersUserModelRecord.setWarningLevelCn("二级");
}
DisposalInfo one = disposalInfoService.lambdaQuery().eq(DisposalInfo::getHuntersModelRecordId, id).one();
if (one != null){
transitHuntersUserModelRecord.setDisposalResultCn("已处置");
if (one.getSignPoliceman() != null || one.getSignPoliceStation()!=null){
transitHuntersUserModelRecord.setSignStatusCn("已签收");
}else {
if (one != null) {
transitHuntersUserModelRecord.setSignStatus(one.getSignStatus());
transitHuntersUserModelRecord.setSignStatusCn("未签收");
if (one.getSignStatus() == 2) {
transitHuntersUserModelRecord.setSignStatusCn("已签收未反馈");
}
if (one.getRiskDesc()!=null){
transitHuntersUserModelRecord.setRisk("有风险");
}else {
transitHuntersUserModelRecord.setRisk("无风险");
if (one.getSignStatus() == 3) {
transitHuntersUserModelRecord.setSignStatusCn("已签收已反馈");
}
transitHuntersUserModelRecord.setDisposalResult(one.getDisposalResult());
if (one.getDisposalResult() == 1){
transitHuntersUserModelRecord.setDisposalResultCn("无风险");
}
if (one.getDisposalResult() == 2){
transitHuntersUserModelRecord.setDisposalResultCn("有风险");
}
} else {
transitHuntersUserModelRecord.setDisposalResultCn("未处置");
transitHuntersUserModelRecord.setSignStatusCn("未签收");
transitHuntersUserModelRecord.setSignStatus(1);
transitHuntersUserModelRecord.setDisposalResult(1);
}
String warningTime = transitHuntersUserModelRecord.getWarningTime();
LocalDateTime localDateTime = LocalDateTime.parse(warningTime, inputFormatter);
@ -83,20 +85,29 @@ public class DisposalInfoController extends BaseController {
@PostMapping
@ApiOperation("修改或新增预警信息处置表")
public AjaxResult insert(@RequestBody DisposalInfo disposalInfo) {
if (disposalInfo != null){
if (disposalInfo != null) {
if ("无风险".equals(disposalInfo.getDisposalResultCn())) {
disposalInfo.setDisposalResult(1);
}
if ("有风险".equals(disposalInfo.getDisposalResultCn())) {
disposalInfo.setDisposalResult(2);
}
disposalInfo.setSignStatus(1);
if (disposalInfo.getSignPoliceman() != null || disposalInfo.getSignPoliceStation() !=null){
if (disposalInfo.getSignPoliceman() != null && disposalInfo.getSignPoliceStation() != null) {
disposalInfo.setSignStatus(2);
}
if (disposalInfo.getRiskFeedback() != null) {
disposalInfo.setSignStatus(3);
}
}
DisposalInfo one = disposalInfoService.lambdaQuery().eq(DisposalInfo::getHuntersModelRecordId, disposalInfo.getHuntersModelRecordId()).one();
if (one == null){
if (one == null) {
return toAjax(disposalInfoService.save(disposalInfo));
}else {
} else {
UpdateWrapper<DisposalInfo> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("hunters_model_record_id",disposalInfo.getHuntersModelRecordId());
return toAjax(disposalInfoService.update(disposalInfo,updateWrapper));
updateWrapper.eq("hunters_model_record_id", disposalInfo.getHuntersModelRecordId());
return toAjax(disposalInfoService.update(disposalInfo, updateWrapper));
}
}
@ -105,13 +116,8 @@ public class DisposalInfoController extends BaseController {
@ApiOperation("查找处置状态")
public AjaxResult disposalInfo(DisposalInfo disposalInfo) {
QueryWrapper<DisposalInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("hunters_model_record_id",disposalInfo.getHuntersModelRecordId());
queryWrapper.eq("hunters_model_record_id", disposalInfo.getHuntersModelRecordId());
DisposalInfo one = disposalInfoService.getOne(queryWrapper);
if (one.getRiskDesc() == null){
one.setRisk("无风险");
}else {
one.setRisk("有风险");
}
return AjaxResult.success(one);
}
}

Loading…
Cancel
Save