用印
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
package com.klp.controller;
|
||||
|
||||
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.domain.bo.WmsSealReqBo;
|
||||
import com.klp.domain.bo.WmsSealStampBo;
|
||||
import com.klp.domain.vo.WmsSealReqVo;
|
||||
import com.klp.service.IWmsSealReqService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 用印申请
|
||||
*/
|
||||
@Slf4j
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/wms/seal")
|
||||
public class WmsSealReqController extends BaseController {
|
||||
|
||||
private final IWmsSealReqService service;
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<WmsSealReqVo> list(WmsSealReqBo bo, PageQuery pageQuery) {
|
||||
return service.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
@GetMapping("/{bizId}")
|
||||
public R<WmsSealReqVo> getInfo(@PathVariable @NotNull Long bizId) {
|
||||
return R.ok(service.queryById(bizId));
|
||||
}
|
||||
|
||||
@Log(title = "用印申请", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public R<Void> add(@Validated @RequestBody WmsSealReqBo bo) {
|
||||
return toAjax(service.insertByBo(bo));
|
||||
}
|
||||
|
||||
@Log(title = "用印申请", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public R<Void> edit(@Validated @RequestBody WmsSealReqBo 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,
|
||||
@RequestParam(required = false) String approvalOpinion) {
|
||||
return toAjax(service.approveByDeptLeader(bizId, approvalOpinion));
|
||||
}
|
||||
|
||||
@Log(title = "用印申请", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/{bizId}/reject")
|
||||
public R<Void> reject(@PathVariable @NotNull Long bizId,
|
||||
@RequestParam(required = false) String approvalOpinion) {
|
||||
return toAjax(service.rejectByDeptLeader(bizId, approvalOpinion));
|
||||
}
|
||||
|
||||
@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 WmsSealStampBo bo) {
|
||||
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);
|
||||
}
|
||||
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 WmsSealStampBo bo) {
|
||||
return R.ok(service.stampWithPython(bizId, bo));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user