2025-12-16 16:56:14 +08:00
|
|
|
|
package com.klp.hrm.controller;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
|
|
|
import com.klp.common.annotation.Log;
|
|
|
|
|
|
import com.klp.common.core.controller.BaseController;
|
|
|
|
|
|
import com.klp.common.core.domain.PageQuery;
|
|
|
|
|
|
import com.klp.common.core.domain.R;
|
|
|
|
|
|
import com.klp.common.core.page.TableDataInfo;
|
|
|
|
|
|
import com.klp.common.enums.BusinessType;
|
|
|
|
|
|
import com.klp.hrm.domain.bo.HrmSealReqBo;
|
|
|
|
|
|
import com.klp.hrm.domain.bo.HrmSealStampBo;
|
|
|
|
|
|
import com.klp.hrm.domain.vo.HrmSealReqVo;
|
|
|
|
|
|
import com.klp.hrm.service.IHrmSealReqService;
|
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
2025-12-30 13:47:53 +08:00
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
2025-12-16 16:56:14 +08:00
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.validation.constraints.NotEmpty;
|
|
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 用印申请
|
|
|
|
|
|
*/
|
2025-12-30 13:47:53 +08:00
|
|
|
|
@Slf4j
|
2025-12-16 16:56:14 +08:00
|
|
|
|
@Validated
|
|
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
|
|
@RestController
|
|
|
|
|
|
@RequestMapping("/hrm/seal")
|
|
|
|
|
|
public class HrmSealReqController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
private final IHrmSealReqService service;
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/list")
|
|
|
|
|
|
public TableDataInfo<HrmSealReqVo> list(HrmSealReqBo bo, PageQuery pageQuery) {
|
|
|
|
|
|
return service.queryPageList(bo, pageQuery);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/{bizId}")
|
|
|
|
|
|
public R<HrmSealReqVo> getInfo(@PathVariable @NotNull Long bizId) {
|
|
|
|
|
|
return R.ok(service.queryById(bizId));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Log(title = "用印申请", businessType = BusinessType.INSERT)
|
|
|
|
|
|
@PostMapping
|
|
|
|
|
|
public R<Void> add(@Validated @RequestBody HrmSealReqBo bo) {
|
|
|
|
|
|
return toAjax(service.insertByBo(bo));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Log(title = "用印申请", businessType = BusinessType.UPDATE)
|
|
|
|
|
|
@PutMapping
|
|
|
|
|
|
public R<Void> edit(@Validated @RequestBody HrmSealReqBo bo) {
|
|
|
|
|
|
return toAjax(service.updateByBo(bo));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Log(title = "用印申请", businessType = BusinessType.DELETE)
|
|
|
|
|
|
@DeleteMapping("/{bizIds}")
|
|
|
|
|
|
public R<Void> remove(@PathVariable @NotEmpty Long[] bizIds) {
|
|
|
|
|
|
return toAjax(service.deleteWithValidByIds(java.util.Arrays.asList(bizIds), true));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Log(title = "用印申请", businessType = BusinessType.UPDATE)
|
|
|
|
|
|
@PostMapping("/{bizId}/approve")
|
|
|
|
|
|
public R<Void> approve(@PathVariable @NotNull Long bizId) {
|
|
|
|
|
|
return toAjax(service.updateStatus(bizId, "approved"));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Log(title = "用印申请", businessType = BusinessType.UPDATE)
|
|
|
|
|
|
@PostMapping("/{bizId}/reject")
|
|
|
|
|
|
public R<Void> reject(@PathVariable @NotNull Long bizId) {
|
|
|
|
|
|
return toAjax(service.updateStatus(bizId, "rejected"));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Log(title = "用印申请", businessType = BusinessType.UPDATE)
|
|
|
|
|
|
@PostMapping("/{bizId}/cancel")
|
|
|
|
|
|
public R<Void> cancel(@PathVariable @NotNull Long bizId) {
|
|
|
|
|
|
return toAjax(service.updateStatus(bizId, "canceled"));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Log(title = "用印盖章(Java)", businessType = BusinessType.UPDATE)
|
|
|
|
|
|
@PostMapping("/{bizId}/stamp/java")
|
|
|
|
|
|
public R<String> stampJava(@PathVariable @NotNull Long bizId, @Validated @RequestBody HrmSealStampBo bo) {
|
2025-12-30 13:47:53 +08:00
|
|
|
|
// 添加日志,检查接收到的数据
|
|
|
|
|
|
log.info("收到盖章请求 - bizId: {}, yPx: {}, xPx: {}, pageNo: {}, yPx类型: {}",
|
|
|
|
|
|
bizId, bo.getYPx(), bo.getXPx(), bo.getPageNo(),
|
|
|
|
|
|
bo.getYPx() != null ? bo.getYPx().getClass().getName() : "null");
|
|
|
|
|
|
if (bo.getYPx() == null) {
|
|
|
|
|
|
log.error("yPx 为 null!接收到的 bo 对象: {}", bo);
|
|
|
|
|
|
}
|
2025-12-16 16:56:14 +08:00
|
|
|
|
return R.ok(service.stampWithJava(bizId, bo));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Log(title = "用印盖章(Python)", businessType = BusinessType.UPDATE)
|
|
|
|
|
|
@PostMapping("/{bizId}/stamp/python")
|
|
|
|
|
|
public R<String> stampPython(@PathVariable @NotNull Long bizId, @Validated @RequestBody HrmSealStampBo bo) {
|
|
|
|
|
|
return R.ok(service.stampWithPython(bizId, bo));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|