package jnpf.dmsController;
|
|
import cn.dev33.satoken.annotation.SaCheckLogin;
|
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
import jakarta.validation.Valid;
|
import jnpf.base.ActionResult;
|
import jnpf.dmsEntity.recordprint.form.DmsRecordPrintHuishouForm;
|
import jnpf.dmsEntity.recordprint.form.DmsRecordPrintIssueForm;
|
import jnpf.dmsEntity.recordprint.form.DmsRecordPrintPiliangChazhaoForm;
|
import jnpf.dmsEntity.recordprint.vo.DmsRecordPrintSerialVO;
|
import jnpf.dmsService.DmsRecordPrintService;
|
import jnpf.exception.DataException;
|
import lombok.RequiredArgsConstructor;
|
import org.springframework.web.bind.annotation.GetMapping;
|
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.RequestParam;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import java.util.ArrayList;
|
import java.util.List;
|
|
/**
|
* DMS 记录打印流水查询接口。
|
*/
|
@Tag(name = "DMS记录打印流水查询接口", description = "根据流水号查询记录文件信息")
|
@RestController
|
@SaCheckLogin
|
@RequiredArgsConstructor
|
@RequestMapping("/biz/jilu/liushui")
|
public class DmsJiluLiushuiController {
|
|
private final DmsRecordPrintService service;
|
|
/**
|
* 根据流水号查询尚未发放的打印记录和文件信息。
|
*
|
* @param liushuihao 打印流水号
|
* @return 流水号、流水记录主键、文件名称和版本号
|
* @throws DataException 流水号无效或该条码已经签收/发放
|
*/
|
@Operation(summary = "根据流水号查询记录文件信息")
|
@GetMapping("/chazhao")
|
public ActionResult<DmsRecordPrintSerialVO> findBySerialNumber(
|
@RequestParam("liushuihao") String liushuihao, @RequestParam("chazhao_leixing") String chazhao_leixing) throws DataException {
|
return ActionResult.success(service.findBySerialNumber(liushuihao, chazhao_leixing));
|
}
|
|
/**
|
* 根据多个流水号查询尚未发放的打印记录和文件信息。
|
* @param form 请求参数
|
* @return 各流水号对应的流水记录和文件信息
|
* @throws DataException 流水号无效或任一条码已经签收/发放
|
*/
|
@Operation(summary = "根据多个流水号查询记录文件信息")
|
@PostMapping("/piliang-chazhao")
|
public ActionResult<List<DmsRecordPrintSerialVO>> findBySerialNumbers(
|
@Valid @RequestBody DmsRecordPrintPiliangChazhaoForm form) throws DataException {
|
List<DmsRecordPrintSerialVO> result = new ArrayList<>(form.getLiushuihao().size());
|
for (String serialNumber : form.getLiushuihao()) {
|
result.add(service.findBySerialNumber(serialNumber, form.getChazhaoLeixing()));
|
}
|
return ActionResult.success(result);
|
}
|
|
/**
|
* 批量发放记录打印流水,并同时登记接收信息。
|
*
|
* @param form 电子签名及发放明细
|
* @return 发放结果
|
* @throws DataException 参数无效、流水不存在或条码已经发放
|
*/
|
@Operation(summary = "批量发放记录打印流水")
|
@PostMapping("/fafang")
|
public ActionResult<String> issue(
|
@Valid @RequestBody DmsRecordPrintIssueForm form) throws DataException {
|
service.issue(form);
|
return ActionResult.success("发放成功", "发放成功");
|
}
|
|
/**
|
* 批量发放记录打印流水,并同时登记接收信息。
|
*
|
* @param form 电子签名及发放明细
|
* @return 发放结果
|
* @throws DataException 参数无效、流水不存在或条码已经发放
|
*/
|
@Operation(summary = "批量回收记录打印流水")
|
@PostMapping("/huishou")
|
public ActionResult<String> huishou(
|
@Valid @RequestBody DmsRecordPrintHuishouForm form) throws DataException {
|
service.huishou(form);
|
return ActionResult.success("回收成功", "回收成功");
|
}
|
}
|