This commit is contained in:
@@ -76,10 +76,10 @@ public class ApplyFormController {
|
|||||||
// 导出excel
|
// 导出excel
|
||||||
String sheetName = "申请单列表";
|
String sheetName = "申请单列表";
|
||||||
String excelName = "申请单列表";
|
String excelName = "申请单列表";
|
||||||
if(applyType == 1){
|
if (applyType == 1) {
|
||||||
excelName = "入库申请单列表";
|
excelName = "入库申请单列表";
|
||||||
sheetName = "入库";
|
sheetName = "入库";
|
||||||
}else if(applyType == 3){
|
} else if (applyType == 3) {
|
||||||
excelName = "出库申请单列表";
|
excelName = "出库申请单列表";
|
||||||
sheetName = "出库";
|
sheetName = "出库";
|
||||||
}
|
}
|
||||||
@@ -108,11 +108,11 @@ public class ApplyFormController {
|
|||||||
|
|
||||||
@GetMapping("apply/audit/download-excel")
|
@GetMapping("apply/audit/download-excel")
|
||||||
@Operation(summary = "导出盘点申请单列表")
|
@Operation(summary = "导出盘点申请单列表")
|
||||||
public void downloadAuditExcel( @Parameter(description = "盘点类型") @RequestParam(name = "auditType", required = false) AuditTypeEnum auditType,
|
public void downloadAuditExcel(@Parameter(description = "盘点类型") @RequestParam(name = "auditType", required = false) AuditTypeEnum auditType,
|
||||||
@Parameter(description = "盘点人") @RequestParam(name = "taker", required = false) String taker,
|
@Parameter(description = "盘点人") @RequestParam(name = "taker", required = false) String taker,
|
||||||
@Parameter(description = "创建日期") @RequestParam(name = "createDate", required = false) LocalDateTime createDate,
|
@Parameter(description = "创建日期") @RequestParam(name = "createDate", required = false) LocalDateTime createDate,
|
||||||
@Parameter(description = "审核状态") @RequestParam(name = "reviewResults", required = false) List<ReviewResultEnum> reviewResults,
|
@Parameter(description = "审核状态") @RequestParam(name = "reviewResults", required = false) List<ReviewResultEnum> reviewResults,
|
||||||
HttpServletResponse response){
|
HttpServletResponse response) {
|
||||||
IPage<ApplyForm> applyFormIPage = searchAuditPage(1, 10000, auditType, taker, createDate, reviewResults);
|
IPage<ApplyForm> applyFormIPage = searchAuditPage(1, 10000, auditType, taker, createDate, reviewResults);
|
||||||
List<ApplyForm> applyFormList = applyFormIPage.getRecords();
|
List<ApplyForm> applyFormList = applyFormIPage.getRecords();
|
||||||
// 导出excel
|
// 导出excel
|
||||||
@@ -156,7 +156,7 @@ public class ApplyFormController {
|
|||||||
for (ApplyDetail applyDetail : applyInfo.getApplyDetails()) {
|
for (ApplyDetail applyDetail : applyInfo.getApplyDetails()) {
|
||||||
applyDetail.setApplyId(applyInfo.getApplyForm().getId());
|
applyDetail.setApplyId(applyInfo.getApplyForm().getId());
|
||||||
// 如果市无须赋码的情况,设置确认数量为申请数量
|
// 如果市无须赋码的情况,设置确认数量为申请数量
|
||||||
if (applyType == ApplyTypeEnum.LOAN_OUT && !applyDetail.getAssignRule()) {
|
if (!applyDetail.getAssignRule()) {
|
||||||
applyDetail.setConfirmQuantity(applyDetail.getQuantity());
|
applyDetail.setConfirmQuantity(applyDetail.getQuantity());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -241,12 +241,23 @@ public class ApplyFormController {
|
|||||||
if (reviewDTO.getReviewResult() == ReviewResultEnum.PASS) {
|
if (reviewDTO.getReviewResult() == ReviewResultEnum.PASS) {
|
||||||
// 修改物料状态
|
// 修改物料状态
|
||||||
List<String> barcodeList = scrapOutCacheMap.get(reviewDTO.getApplyId());
|
List<String> barcodeList = scrapOutCacheMap.get(reviewDTO.getApplyId());
|
||||||
if (barcodeList == null || barcodeList.isEmpty()) {
|
if (barcodeList != null) {
|
||||||
return;
|
barcodeList.forEach(barcode -> materialStockDetailService.update(Wrappers.<MaterialStockDetail>lambdaUpdate()
|
||||||
|
.set(MaterialStockDetail::getStatus, StockStatusEnum.SCRAP_OUT)
|
||||||
|
.eq(MaterialStockDetail::getBarcode, barcode)));
|
||||||
}
|
}
|
||||||
barcodeList.forEach(barcode -> materialStockDetailService.update(Wrappers.<MaterialStockDetail>lambdaUpdate()
|
}
|
||||||
.set(MaterialStockDetail::getStatus, StockStatusEnum.SCRAP_OUT)
|
// 处理报废扣减库存
|
||||||
.eq(MaterialStockDetail::getBarcode, barcode)));
|
List<ApplyDetail> applyDetails = applyDetailService.list(Wrappers.<ApplyDetail>lambdaQuery()
|
||||||
|
.eq(ApplyDetail::getApplyId, reviewDTO.getApplyId()));
|
||||||
|
if (!applyDetails.isEmpty()) {
|
||||||
|
// 直接扣库存
|
||||||
|
applyDetails.forEach(detail ->
|
||||||
|
materialService.update(Wrappers.<Material>lambdaUpdate()
|
||||||
|
.setSql("m_stock = m_stock - " + detail.getQuantity())
|
||||||
|
.eq(Material::getId, detail.getMaterialId())
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
scrapOutCacheMap.remove(reviewDTO.getApplyId());
|
scrapOutCacheMap.remove(reviewDTO.getApplyId());
|
||||||
|
|||||||
@@ -43,7 +43,11 @@ public class ApplyDetail extends IdBaseEntity {
|
|||||||
@ColDefine(notNull = false)
|
@ColDefine(notNull = false)
|
||||||
private Long applyId;
|
private Long applyId;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@Schema(description = "是否需要赋码", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
@TableField("ad_assign_rule")
|
||||||
|
@Column("ad_assign_rule")
|
||||||
|
@Comment("是否需要赋码")
|
||||||
|
@ColDefine(notNull = false)
|
||||||
private Boolean assignRule;
|
private Boolean assignRule;
|
||||||
|
|
||||||
@Schema(description = "物料Id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
@Schema(description = "物料Id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
|||||||
Reference in New Issue
Block a user