This commit is contained in:
parent
a96a9e571e
commit
3ccc377c3a
@ -173,19 +173,19 @@ public class ApplyFormController {
|
|||||||
applyForm.setType(ApplyTypeEnum.AUDIT);
|
applyForm.setType(ApplyTypeEnum.AUDIT);
|
||||||
applyFormService.save(applyForm);
|
applyFormService.save(applyForm);
|
||||||
List<Material> materials;
|
List<Material> materials;
|
||||||
if(applyInfo.getAuditType() == AuditTypeEnum.ALL){
|
if(applyInfo.getAuditType() == AuditTypeEnum.SCAN){
|
||||||
materials = materialService.list();
|
|
||||||
}else{
|
|
||||||
materials = materialService.listByIds(applyInfo.getIds());
|
materials = materialService.listByIds(applyInfo.getIds());
|
||||||
|
materials.forEach(material -> applyDetailService.save(ApplyDetail.builder()
|
||||||
|
.applyId(applyForm.getId())
|
||||||
|
.materialId(material.getId())
|
||||||
|
.quantity(material.getStock())
|
||||||
|
.build()));
|
||||||
}
|
}
|
||||||
|
|
||||||
materials.forEach(material -> applyDetailService.save(ApplyDetail.builder()
|
|
||||||
.applyId(applyForm.getId())
|
|
||||||
.materialId(material.getId())
|
|
||||||
.quantity(material.getStock())
|
|
||||||
.build()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("wait-scan-data/{applyId}")
|
@GetMapping("wait-scan-data/{applyId}")
|
||||||
@Operation(summary = "获取盘点的待扫码信息")
|
@Operation(summary = "获取盘点的待扫码信息")
|
||||||
public List<WaitScanInfo> getWaitScanData(@Parameter(description = "申请单ID") @PathVariable(name = "applyId") Long applyId) {
|
public List<WaitScanInfo> getWaitScanData(@Parameter(description = "申请单ID") @PathVariable(name = "applyId") Long applyId) {
|
||||||
|
@ -23,6 +23,9 @@ public class AuditApplyInfo extends ApplyForm {
|
|||||||
@Schema(description = "物料ids")
|
@Schema(description = "物料ids")
|
||||||
private List<String> ids;
|
private List<String> ids;
|
||||||
|
|
||||||
|
@Schema(description = "物料类型")
|
||||||
|
private List<String> types;
|
||||||
|
|
||||||
|
|
||||||
public ApplyForm to(){
|
public ApplyForm to(){
|
||||||
return Json.fromJson(ApplyForm.class, Json.toJson(this));
|
return Json.fromJson(ApplyForm.class, Json.toJson(this));
|
||||||
|
@ -47,7 +47,7 @@ public class ApplyForm extends IdBaseEntity {
|
|||||||
@ColDefine(type = ColType.INT)
|
@ColDefine(type = ColType.INT)
|
||||||
private ApplyTypeEnum type;
|
private ApplyTypeEnum type;
|
||||||
|
|
||||||
@Schema(description = "盘点类型(1: 全盘 2: 部分盘点)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
@Schema(description = "盘点类型(1: 扫码 2: 人工)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
@TableField("af_audit_type")
|
@TableField("af_audit_type")
|
||||||
@Column("af_audit_type")
|
@Column("af_audit_type")
|
||||||
@Comment("盘点类型")
|
@Comment("盘点类型")
|
||||||
|
@ -13,8 +13,8 @@ import lombok.Getter;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum AuditTypeEnum implements ICodeBook {
|
public enum AuditTypeEnum implements ICodeBook {
|
||||||
|
|
||||||
ALL("1", "全部盘点"),
|
SCAN("1", "扫码盘点"),
|
||||||
PARTIAL("2", "部分盘点")
|
PARTIAL("2", "人工盘点"),
|
||||||
;
|
;
|
||||||
|
|
||||||
@EnumValue
|
@EnumValue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user