This commit is contained in:
parent
d25749424e
commit
2c9fe3cbe9
@ -175,7 +175,7 @@ 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.SCAN){
|
if (applyInfo.getAuditType() == AuditTypeEnum.SCAN) {
|
||||||
materials = materialService.listByIds(applyInfo.getIds());
|
materials = materialService.listByIds(applyInfo.getIds());
|
||||||
materials.forEach(material -> applyDetailService.save(ApplyDetail.builder()
|
materials.forEach(material -> applyDetailService.save(ApplyDetail.builder()
|
||||||
.applyId(applyForm.getId())
|
.applyId(applyForm.getId())
|
||||||
@ -185,10 +185,11 @@ public class ApplyFormController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("manual/audit-apply")
|
@PostMapping("manual/audit-apply")
|
||||||
@Operation(summary = "提交人工盘点数据")
|
@Operation(summary = "提交人工盘点数据")
|
||||||
public void submitManualStock(@Validated @Parameter(description = "人工盘点数据") @RequestBody List<ManualStockDetail> details){
|
public void submitManualStock(@Validated @Parameter(description = "人工盘点数据") @RequestBody List<ManualStockDetail> details) {
|
||||||
if(details.isEmpty()){
|
if (details.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
manualStockDetailService.saveBatch(details);
|
manualStockDetailService.saveBatch(details);
|
||||||
@ -197,15 +198,16 @@ public class ApplyFormController {
|
|||||||
.eq(ApplyForm::getId, details.get(0).getApplyId())
|
.eq(ApplyForm::getId, details.get(0).getApplyId())
|
||||||
.set(ApplyForm::getReviewResult, ReviewResultEnum.WAIT_REVIEW));
|
.set(ApplyForm::getReviewResult, ReviewResultEnum.WAIT_REVIEW));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("manual/data/{applyId}")
|
@GetMapping("manual/data/{applyId}")
|
||||||
@Operation(summary = "获取人工盘点数据")
|
@Operation(summary = "获取人工盘点数据")
|
||||||
public List<ManualStockDTO> getManualStock(@Parameter(description = "申请单ID") @PathVariable(name = "applyId") Long applyId){
|
public List<ManualStockDTO> getManualStock(@Parameter(description = "申请单ID") @PathVariable(name = "applyId") Long applyId) {
|
||||||
return materialStockDetailService.getByApplyId(applyId);
|
// TODO
|
||||||
|
return materialStockDetailService.getByApplyId(applyId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@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) {
|
||||||
@ -282,6 +284,18 @@ public class ApplyFormController {
|
|||||||
.set(reviewDTO.getReviewResult() == ReviewResultEnum.PASS, ApplyForm::getConfirm, Boolean.TRUE)
|
.set(reviewDTO.getReviewResult() == ReviewResultEnum.PASS, ApplyForm::getConfirm, Boolean.TRUE)
|
||||||
.set(ApplyForm::getReviewRemark, reviewDTO.getRemark())
|
.set(ApplyForm::getReviewRemark, reviewDTO.getRemark())
|
||||||
.eq(ApplyForm::getId, reviewDTO.getApplyId()));
|
.eq(ApplyForm::getId, reviewDTO.getApplyId()));
|
||||||
|
ApplyForm byId = applyFormService.getById(reviewDTO.getApplyId());
|
||||||
|
if (byId.getAuditType() == AuditTypeEnum.MANUAL) {
|
||||||
|
if (reviewDTO.getReviewResult() != ReviewResultEnum.PASS) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<ManualStockDetail> details = manualStockDetailService.list(Wrappers.<ManualStockDetail>lambdaQuery()
|
||||||
|
.eq(ManualStockDetail::getApplyId, reviewDTO.getApplyId()));
|
||||||
|
details.forEach(detail -> materialService.update(Wrappers.<Material>lambdaUpdate()
|
||||||
|
.set(Material::getStock, detail.getManualStock())
|
||||||
|
.eq(Material::getId, detail.getMaterialId())));
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (reviewDTO.getReviewResult() == ReviewResultEnum.PASS) {
|
if (reviewDTO.getReviewResult() == ReviewResultEnum.PASS) {
|
||||||
//修改库存明细状态和库存数量
|
//修改库存明细状态和库存数量
|
||||||
List<StocktakingScanExceptionalData> list = stocktakingScanExceptionalDataService.list(Wrappers.<StocktakingScanExceptionalData>lambdaQuery()
|
List<StocktakingScanExceptionalData> list = stocktakingScanExceptionalDataService.list(Wrappers.<StocktakingScanExceptionalData>lambdaQuery()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user