🆕 盘点列表
This commit is contained in:
parent
43f14ce542
commit
9844c1ec3a
@ -1,41 +1,30 @@
|
||||
package tech.riemann.ims.controller.platform.acl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.nutz.lang.Strings;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PatchMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import club.zhcs.lina.auth.encode.PasswordUtils;
|
||||
import club.zhcs.lina.auth.service.AuthUser.Sex;
|
||||
import club.zhcs.lina.starter.exception.BizException;
|
||||
import club.zhcs.lina.utils.enums.Codebook;
|
||||
import club.zhcs.lina.utils.enums.ICodeBook;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import tech.riemann.ims.dto.response.PermissionInfo;
|
||||
import tech.riemann.ims.dto.response.RoleInfo;
|
||||
import tech.riemann.ims.entity.acl.Permission;
|
||||
import tech.riemann.ims.entity.acl.User;
|
||||
import tech.riemann.ims.service.acl.IUserService;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户 前端控制器
|
||||
@ -52,6 +41,12 @@ public class UserController {
|
||||
|
||||
private final IUserService userService;
|
||||
|
||||
@GetMapping("user-all")
|
||||
@Operation(summary = "所有用户")
|
||||
public List<User> all() {
|
||||
return userService.list();
|
||||
}
|
||||
|
||||
@GetMapping("users")
|
||||
@Operation(summary = "分页查询用户")
|
||||
public IPage<User> users(
|
||||
|
@ -11,6 +11,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import tech.riemann.ims.dto.request.ApplyInfo;
|
||||
import tech.riemann.ims.dto.request.AuditApplyInfo;
|
||||
import tech.riemann.ims.dto.response.ApplyDTO;
|
||||
import tech.riemann.ims.entity.material.ApplyDetail;
|
||||
import tech.riemann.ims.entity.material.ApplyForm;
|
||||
@ -64,6 +65,7 @@ public class ApplyFormController {
|
||||
@Parameter(description = "审核状态") @RequestParam(name = "reviewResult", required = false) ReviewResultEnum reviewResult) {
|
||||
return applyFormService.page(Page.of(page, size), Wrappers.<ApplyForm>lambdaQuery()
|
||||
.eq(auditType != null, ApplyForm::getAuditType, auditType)
|
||||
.eq(ApplyForm::getType, ApplyTypeEnum.AUDIT)
|
||||
.eq(taker != null, ApplyForm::getTaker, taker)
|
||||
.eq(createDate != null, ApplyForm::getCreatedTime, createDate)
|
||||
.eq(reviewResult != null, ApplyForm::getReviewResult, reviewResult)
|
||||
@ -73,7 +75,7 @@ public class ApplyFormController {
|
||||
|
||||
@GetMapping("apply/{applyId}")
|
||||
@Operation(summary = "查询申请单详情")
|
||||
public ApplyInfo detail(@Parameter(description = "类型") @PathVariable(name = "applyId") Integer applyId) {
|
||||
public ApplyInfo detail(@Parameter(description = "申请单ID") @PathVariable(name = "applyId") Integer applyId) {
|
||||
List<ApplyDetail> list = applyDetailService.list(Wrappers.<ApplyDetail>lambdaQuery().eq(ApplyDetail::getApplyId, applyId));
|
||||
return ApplyInfo.builder()
|
||||
.applyForm(applyFormService.getById(applyId))
|
||||
@ -159,4 +161,19 @@ public class ApplyFormController {
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("audit-apply")
|
||||
@Operation(summary = "提交盘点申请单")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void auditApply(@Validated @Parameter(description = "申请单") @RequestBody AuditApplyInfo applyInfo) {
|
||||
ApplyForm applyForm = applyInfo.to();
|
||||
applyForm.setType(ApplyTypeEnum.AUDIT);
|
||||
applyFormService.save(applyForm);
|
||||
List<Material> materials = materialService.listByIds(applyInfo.getIds());
|
||||
|
||||
materials.forEach(material -> applyDetailService.save(ApplyDetail.builder()
|
||||
.applyId(applyForm.getId())
|
||||
.materialId(material.getId())
|
||||
.quantity(material.getStock())
|
||||
.build()));
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,32 @@
|
||||
package tech.riemann.ims.dto.request;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.nutz.json.Json;
|
||||
import tech.riemann.ims.entity.material.ApplyForm;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2024/12/7 12:23
|
||||
*/
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AuditApplyInfo extends ApplyForm {
|
||||
|
||||
@Schema(description = "物料ids")
|
||||
private List<String> ids;
|
||||
|
||||
|
||||
public ApplyForm to(){
|
||||
return Json.fromJson(ApplyForm.class, Json.toJson(this));
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -111,7 +111,7 @@ public class ApplyForm extends IdBaseEntity {
|
||||
@ColDefine(type = ColType.VARCHAR, notNull = false, width = 128, precision = 0)
|
||||
private HandleEnum handle;
|
||||
|
||||
@Schema(description = "审核结果(1-通过 2-不通过 3-待审核 4-退回重新盘点)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@Schema(description = "审核结果(1-通过 2-不通过 3-待审核 4-退回重新盘点 5-待盘点)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@TableField("af_review_result")
|
||||
@Column("af_review_result")
|
||||
@Comment("审核结果(1-通过 2-不通过 3-待审核 4-退回重新盘点)")
|
||||
|
@ -13,10 +13,11 @@ import lombok.Getter;
|
||||
@AllArgsConstructor
|
||||
public enum ReviewResultEnum implements ICodeBook {
|
||||
|
||||
PASS("1", "全部盘点"),
|
||||
UN_PASS("2", "部分盘点"),
|
||||
WAIT("3", "等待审核"),
|
||||
PASS("1", "通过"),
|
||||
UN_PASS("2", "未通过"),
|
||||
WAIT_AUDIT("3", "等待审核"),
|
||||
REJECT("4", "退回"),
|
||||
WAIT_CHECK("5", "待盘点")
|
||||
;
|
||||
|
||||
@EnumValue
|
||||
|
Loading…
x
Reference in New Issue
Block a user