|
|
|
|
@ -1,18 +1,32 @@
|
|
|
|
|
package com.biutag.supervision.controller.api.plugin; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.io.FileUtil; |
|
|
|
|
import cn.hutool.http.HttpResponse; |
|
|
|
|
import cn.hutool.http.HttpUtil; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import com.biutag.supervision.common.UserContextHolder; |
|
|
|
|
import com.biutag.supervision.constants.enums.CaseVerifSource; |
|
|
|
|
import com.biutag.supervision.constants.enums.InspectCaseEnum; |
|
|
|
|
import com.biutag.supervision.pojo.Result; |
|
|
|
|
import com.biutag.supervision.pojo.dto.DataPetitionComplaintDto; |
|
|
|
|
import com.biutag.supervision.pojo.dto.plugin.CaseVerifPluginDto; |
|
|
|
|
import com.biutag.supervision.pojo.dto.plugin.*; |
|
|
|
|
import com.biutag.supervision.pojo.entity.DataCaseVerif; |
|
|
|
|
import com.biutag.supervision.pojo.entity.DataCaseVerifExt; |
|
|
|
|
import com.biutag.supervision.pojo.entity.DataCaseVerifExtFile; |
|
|
|
|
import com.biutag.supervision.service.DataCaseVerifExtFileService; |
|
|
|
|
import com.biutag.supervision.service.DataCaseVerifExtService; |
|
|
|
|
import com.biutag.supervision.service.DataCaseVerifService; |
|
|
|
|
import com.biutag.supervision.service.FileService; |
|
|
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody; |
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
import java.io.InputStream; |
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author wxc |
|
|
|
|
@ -20,12 +34,18 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
*/ |
|
|
|
|
@Tag(name = "案件核查(插件)") |
|
|
|
|
@RequiredArgsConstructor |
|
|
|
|
@RequestMapping("plugin/caseVerif") |
|
|
|
|
@RequestMapping("crx/ajhc") |
|
|
|
|
@RestController |
|
|
|
|
public class CaseVerifController { |
|
|
|
|
|
|
|
|
|
private final DataCaseVerifService dataCaseVerifService; |
|
|
|
|
|
|
|
|
|
private final DataCaseVerifExtService dataCaseVerifExtService; |
|
|
|
|
|
|
|
|
|
private final FileService fileService; |
|
|
|
|
|
|
|
|
|
private final DataCaseVerifExtFileService dataCaseVerifExtFileService; |
|
|
|
|
|
|
|
|
|
@Operation(summary = "推送案件核查数据") |
|
|
|
|
@PostMapping |
|
|
|
|
public Result<Boolean> add(@RequestBody @Validated CaseVerifPluginDto body) { |
|
|
|
|
@ -35,7 +55,79 @@ public class CaseVerifController {
|
|
|
|
|
caseVerif.setResponderPhone(body.getReporterContact()); |
|
|
|
|
caseVerif.setThingDesc(body.getBriefCase()); |
|
|
|
|
caseVerif.setSourceInvolveDepartName(body.getVerifiedObjectUnit()); |
|
|
|
|
caseVerif.setSource(CaseVerifSource.plugin.name()); |
|
|
|
|
caseVerif.setCreator(UserContextHolder.getCurrentUserId()); |
|
|
|
|
caseVerif.setCrxState("1"); |
|
|
|
|
dataCaseVerifService.save(caseVerif); |
|
|
|
|
return Result.success(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Operation(summary = "案件核查数据列表") |
|
|
|
|
@GetMapping |
|
|
|
|
public Result<List<DataCaseVerif>> list() { |
|
|
|
|
LambdaQueryWrapper<DataCaseVerif> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
queryWrapper.eq(DataCaseVerif::getSource, CaseVerifSource.plugin.name()) |
|
|
|
|
.eq(DataCaseVerif::getCreator, UserContextHolder.getCurrentUserId()) |
|
|
|
|
.orderByDesc(DataCaseVerif::getCreateTime); |
|
|
|
|
Page<DataCaseVerif> page = dataCaseVerifService.page(Page.of(1, 10), queryWrapper); |
|
|
|
|
return Result.success(page.getRecords()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Operation(summary = "处置意见上传") |
|
|
|
|
@PostMapping("disposalOpinion") |
|
|
|
|
public Result<Boolean> disposalOpinion(@RequestBody CaseVerifDisposalOpinion body) { |
|
|
|
|
DataCaseVerifExt dataCaseVerifExt = new DataCaseVerifExt(); |
|
|
|
|
dataCaseVerifExt.setOuterId(body.getOuterId()); |
|
|
|
|
if ("属实".equals(body.getTrueSituation())) { |
|
|
|
|
dataCaseVerifExt.setCheckStatus(InspectCaseEnum.TRUE.getValue()); |
|
|
|
|
dataCaseVerifExt.setCheckStatusName(InspectCaseEnum.TRUE.getLabel()); |
|
|
|
|
} |
|
|
|
|
if ("部分属实".equals(body.getTrueSituation()) || "查明其他情况".equals(body.getTrueSituation())) { |
|
|
|
|
dataCaseVerifExt.setCheckStatus(InspectCaseEnum.PARTIALLY_TRUE.getValue()); |
|
|
|
|
dataCaseVerifExt.setCheckStatusName(InspectCaseEnum.PARTIALLY_TRUE.getLabel()); |
|
|
|
|
} |
|
|
|
|
if ("不属实".equals(body.getTrueSituation())) { |
|
|
|
|
dataCaseVerifExt.setCheckStatus(InspectCaseEnum.FALSE.getValue()); |
|
|
|
|
dataCaseVerifExt.setCheckStatusName(InspectCaseEnum.FALSE.getLabel()); |
|
|
|
|
} |
|
|
|
|
// 处置意见
|
|
|
|
|
dataCaseVerifExt.setCheckStatusDesc(body.getHandlingSuggestions()); |
|
|
|
|
dataCaseVerifExt.setCreateTime(LocalDateTime.now()); |
|
|
|
|
dataCaseVerifExtService.saveOrUpdate(dataCaseVerifExt); |
|
|
|
|
return Result.success(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Operation(summary = "ID列表更新") |
|
|
|
|
@PostMapping("outerIds") |
|
|
|
|
public Result<Boolean> outerIds(@RequestBody List<CaseVerifOuterId> outerIds) { |
|
|
|
|
for (CaseVerifOuterId outerId : outerIds) { |
|
|
|
|
dataCaseVerifService.update(new LambdaUpdateWrapper<DataCaseVerif>().eq(DataCaseVerif::getOriginId, outerId.getCaseNumber()) |
|
|
|
|
.set(DataCaseVerif::getOuterId, outerId.getOuterId())); |
|
|
|
|
} |
|
|
|
|
return Result.success(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Operation(summary = "附件上传") |
|
|
|
|
@PostMapping("file") |
|
|
|
|
public Result<Boolean> file(@RequestBody CaseVerifFile caseVerifFile) { |
|
|
|
|
HttpResponse httpResponse = HttpUtil.createGet(caseVerifFile.getFileUrl()).execute(); |
|
|
|
|
InputStream is = httpResponse.bodyStream(); |
|
|
|
|
String filePath = fileService.upload(is, 0L, FileUtil.extName(caseVerifFile.getFileName())); |
|
|
|
|
DataCaseVerifExtFile dataCaseVerifExtFile = new DataCaseVerifExtFile(); |
|
|
|
|
dataCaseVerifExtFile.setOuterId(caseVerifFile.getOuterId()); |
|
|
|
|
dataCaseVerifExtFile.setFilePath(filePath); |
|
|
|
|
dataCaseVerifExtFile.setFileName(caseVerifFile.getFileName()); |
|
|
|
|
dataCaseVerifExtFile.setCreateTime(LocalDateTime.now()); |
|
|
|
|
dataCaseVerifExtFile.setFileClassName(caseVerifFile.getFileType()); |
|
|
|
|
dataCaseVerifExtFileService.save(dataCaseVerifExtFile); |
|
|
|
|
return Result.success(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Operation(summary = "处置明细上传") |
|
|
|
|
@PostMapping("disposalDetails") |
|
|
|
|
public Result<Boolean> disposalDetails(@RequestBody CaseVerifDisposalDetails body) { |
|
|
|
|
DataCaseVerifExt dataCaseVerifExt = new DataCaseVerifExt(); |
|
|
|
|
return Result.success(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|