refactor(biz): 重构采购退料和销售发货功能
This commit is contained in:
parent
37fff9c937
commit
df957b5665
@ -116,6 +116,8 @@ public class PurReturnServiceImpl implements PurReturnService {
|
||||
private void processReturn(PurReturnDO purReturnDO) {
|
||||
List<PurReturnDetailDO> purReturnDetailDOS = purReturnDetailMapper.selectListByPurReturnId(purReturnDO.getId());
|
||||
SupplierDO supplier = supplierService.getSupplier(purReturnDO.getSupplierId());
|
||||
String dpstNo = rawStorageLogService.generateOrderNo("1");
|
||||
|
||||
for (PurReturnDetailDO purReturnDetailDO : purReturnDetailDOS) {
|
||||
PurReceiptDetailDO purReceiptDetailDO = purreceiptDetailMapper.selectById(purReturnDetailDO.getPurReceiptDetailId());
|
||||
RawStorageInventoryDO rawStorageInventory = rawStorageInventoryMapper.selectOne(new LambdaQueryWrapper<RawStorageInventoryDO>().eq(RawStorageInventoryDO::getInventBillNo, purReturnDetailDO.getInventBillNo()));
|
||||
@ -157,6 +159,7 @@ public class PurReturnServiceImpl implements PurReturnService {
|
||||
rawStorageLog.setRelarionId(purReturnDO.getId());
|
||||
rawStorageLog.setRelarionDetailId(purReturnDetailDO.getId());
|
||||
rawStorageLog.setInventBillNo(purReturnDetailDO.getInventBillNo());
|
||||
rawStorageLog.setDpstNo(dpstNo);
|
||||
rawStorageLogService.saveRawStorageLog(rawStorageLog);
|
||||
rawStorageInventoryMapper.updateById(rawStorageInventory);
|
||||
purReturnDetailMapper.updateById(purReturnDetailDO);
|
||||
|
||||
@ -97,11 +97,13 @@ public class RawStorageServiceImpl implements RawStorageService {
|
||||
public void process(PurReceiptDO purReceipt) {
|
||||
SupplierDO supplierDO = supplierMapper.selectById(purReceipt.getSupplierId());
|
||||
String supplierNo = supplierDO.getSupplierNo();
|
||||
String dpstNo = rawStorageLogService.generateOrderNo("2");
|
||||
|
||||
saveRawStorage(purReceipt, supplierNo);
|
||||
List<PurReceiptDetailDO> detailDOList = purReceiptDetailMapper.selectListByPurReceiptId(purReceipt.getId());
|
||||
for (PurReceiptDetailDO detail : detailDOList) {
|
||||
String inventoryBillNo = saveRawStorageInventory(purReceipt, detail);
|
||||
saveRwaStorageLog(supplierNo, inventoryBillNo, purReceipt, detail);
|
||||
saveRwaStorageLog(dpstNo, supplierNo, inventoryBillNo, purReceipt, detail);
|
||||
saveRawStorageMat(inventoryBillNo, purReceipt, detail);
|
||||
|
||||
detail.setInventBillNo(inventoryBillNo);
|
||||
@ -154,7 +156,7 @@ public class RawStorageServiceImpl implements RawStorageService {
|
||||
|
||||
}
|
||||
|
||||
private void saveRwaStorageLog(String supplierNo, String inventoryBillNo, PurReceiptDO purReceipt, PurReceiptDetailDO item) {
|
||||
private void saveRwaStorageLog(String dpstNo, String supplierNo, String inventoryBillNo, PurReceiptDO purReceipt, PurReceiptDetailDO item) {
|
||||
RawStorageLogDO rawStorageLog = BeanUtils.toBean(item, RawStorageLogDO.class);
|
||||
// 查询采购订单明细
|
||||
PurOrderItemDO purOrderItem = purOrderItemMapper.selectById(item.getPurOrdDetailId());
|
||||
@ -187,7 +189,7 @@ public class RawStorageServiceImpl implements RawStorageService {
|
||||
rawStorageLog.setOperatorQty(item.getReceiptQty());
|
||||
rawStorageLog.setBusinessType("10");
|
||||
rawStorageLog.setStockItemId(item.getTwmStorageDetailId());
|
||||
rawStorageLog.setDpstNo(purReceipt.getPurReceiptNo());
|
||||
rawStorageLog.setDpstNo(dpstNo);
|
||||
rawStorageLog.setSupplierNo(supplierNo);
|
||||
rawStorageLog.setSupplierName(purReceipt.getSupplierName());
|
||||
rawStorageLog.setSupplierId(purReceipt.getSupplierId());
|
||||
|
||||
@ -54,4 +54,6 @@ public interface RawStorageLogService {
|
||||
|
||||
void saveRawStorageLog(RawStorageLogDO rawStorageLog);
|
||||
|
||||
String generateOrderNo(String operatorType);
|
||||
|
||||
}
|
||||
|
||||
@ -71,12 +71,11 @@ public class RawStorageLogServiceImpl implements RawStorageLogService {
|
||||
|
||||
@Override
|
||||
public void saveRawStorageLog(RawStorageLogDO rawStorageLog) {
|
||||
// 生成订单号
|
||||
rawStorageLog.setDpstNo(generateOrderNo(rawStorageLog.getOperatorType()));
|
||||
rawStorageLogMapper.insert(rawStorageLog);
|
||||
}
|
||||
|
||||
private String generateOrderNo(String operatorType) {
|
||||
@Override
|
||||
public String generateOrderNo(String operatorType) {
|
||||
String prefix = "RK";
|
||||
if ("2".equals(operatorType)) {
|
||||
prefix = "CK";
|
||||
|
||||
@ -31,28 +31,13 @@ declare module 'vue' {
|
||||
DocAlert: typeof import('./../components/DocAlert/index.vue')['default']
|
||||
Echart: typeof import('./../components/Echart/src/Echart.vue')['default']
|
||||
Editor: typeof import('./../components/Editor/src/Editor.vue')['default']
|
||||
ElAlert: typeof import('element-plus/es')['ElAlert']
|
||||
ElAside: typeof import('element-plus/es')['ElAside']
|
||||
ElAutoResizer: typeof import('element-plus/es')['ElAutoResizer']
|
||||
ElAvatar: typeof import('element-plus/es')['ElAvatar']
|
||||
ElBadge: typeof import('element-plus/es')['ElBadge']
|
||||
ElButton: typeof import('element-plus/es')['ElButton']
|
||||
ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
|
||||
ElCard: typeof import('element-plus/es')['ElCard']
|
||||
ElCarousel: typeof import('element-plus/es')['ElCarousel']
|
||||
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
|
||||
ElCascader: typeof import('element-plus/es')['ElCascader']
|
||||
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
|
||||
ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
|
||||
ElCol: typeof import('element-plus/es')['ElCol']
|
||||
ElCollapse: typeof import('element-plus/es')['ElCollapse']
|
||||
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
|
||||
ElCollapseTransition: typeof import('element-plus/es')['ElCollapseTransition']
|
||||
ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
|
||||
ElContainer: typeof import('element-plus/es')['ElContainer']
|
||||
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
||||
ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
|
||||
ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
|
||||
ElDialog: typeof import('element-plus/es')['ElDialog']
|
||||
ElDivider: typeof import('element-plus/es')['ElDivider']
|
||||
ElDrawer: typeof import('element-plus/es')['ElDrawer']
|
||||
@ -68,43 +53,22 @@ declare module 'vue' {
|
||||
ElementTask: typeof import('./../components/bpmnProcessDesigner/package/penal/task/ElementTask.vue')['default']
|
||||
ElForm: typeof import('element-plus/es')['ElForm']
|
||||
ElFormItem: typeof import('element-plus/es')['ElFormItem']
|
||||
ElHeader: typeof import('element-plus/es')['ElHeader']
|
||||
ElIcon: typeof import('element-plus/es')['ElIcon']
|
||||
ElImage: typeof import('element-plus/es')['ElImage']
|
||||
ElImageViewer: typeof import('element-plus/es')['ElImageViewer']
|
||||
ElInput: typeof import('element-plus/es')['ElInput']
|
||||
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
|
||||
ElLink: typeof import('element-plus/es')['ElLink']
|
||||
ElMain: typeof import('element-plus/es')['ElMain']
|
||||
ElOption: typeof import('element-plus/es')['ElOption']
|
||||
ElPagination: typeof import('element-plus/es')['ElPagination']
|
||||
ElPopover: typeof import('element-plus/es')['ElPopover']
|
||||
ElRadio: typeof import('element-plus/es')['ElRadio']
|
||||
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
|
||||
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
||||
ElRate: typeof import('element-plus/es')['ElRate']
|
||||
ElRow: typeof import('element-plus/es')['ElRow']
|
||||
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
||||
ElSelect: typeof import('element-plus/es')['ElSelect']
|
||||
ElSkeleton: typeof import('element-plus/es')['ElSkeleton']
|
||||
ElSlider: typeof import('element-plus/es')['ElSlider']
|
||||
ElSpace: typeof import('element-plus/es')['ElSpace']
|
||||
ElSwitch: typeof import('element-plus/es')['ElSwitch']
|
||||
ElTable: typeof import('element-plus/es')['ElTable']
|
||||
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
|
||||
ElTableV2: typeof import('element-plus/es')['ElTableV2']
|
||||
ElTabPane: typeof import('element-plus/es')['ElTabPane']
|
||||
ElTabs: typeof import('element-plus/es')['ElTabs']
|
||||
ElTag: typeof import('element-plus/es')['ElTag']
|
||||
ElText: typeof import('element-plus/es')['ElText']
|
||||
ElTimeline: typeof import('element-plus/es')['ElTimeline']
|
||||
ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
|
||||
ElTimePicker: typeof import('element-plus/es')['ElTimePicker']
|
||||
ElTimeSelect: typeof import('element-plus/es')['ElTimeSelect']
|
||||
ElTooltip: typeof import('element-plus/es')['ElTooltip']
|
||||
ElTransfer: typeof import('element-plus/es')['ElTransfer']
|
||||
ElTree: typeof import('element-plus/es')['ElTree']
|
||||
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
|
||||
ElUpload: typeof import('element-plus/es')['ElUpload']
|
||||
Error: typeof import('./../components/Error/src/Error.vue')['default']
|
||||
FlowCondition: typeof import('./../components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue')['default']
|
||||
|
||||
@ -20,10 +20,8 @@
|
||||
class="!w-full"
|
||||
:disabled="formType === 'detail' || formType === 'update'"
|
||||
>
|
||||
<el-option label="标准采购" value="1" />
|
||||
<el-option label="设备采购" value="2" />
|
||||
<el-option label="标准采购退料" value="3" />
|
||||
<el-option label="设备采购退料" value="4" />
|
||||
<el-option label="标准采购申请" value="1" />
|
||||
<el-option label="设备采购申请" value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -73,7 +71,8 @@
|
||||
class="!w-full"
|
||||
:disabled="formType === 'detail' || formType === 'update'"
|
||||
@change="handleSupplierChange"
|
||||
>
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in supplierList"
|
||||
:key="item.id"
|
||||
@ -106,7 +105,8 @@
|
||||
class="!w-full"
|
||||
:disabled="formType === 'detail'"
|
||||
@change="handleStoreHouseChange"
|
||||
>
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storeHouseList"
|
||||
:key="item.id"
|
||||
@ -264,7 +264,7 @@ const formData = reactive({
|
||||
storeHouseId: undefined,
|
||||
storeHouseName: undefined,
|
||||
storeHouseCd: undefined,
|
||||
billType: undefined,
|
||||
billType: "1",
|
||||
})
|
||||
|
||||
// 下拉列表
|
||||
@ -650,7 +650,7 @@ const resetForm = () => {
|
||||
formData.storeHouseId = undefined
|
||||
formData.storeHouseName = undefined
|
||||
formData.storeHouseCd = undefined
|
||||
formData.billType = undefined
|
||||
formData.billType = "1"
|
||||
|
||||
detailList.value = []
|
||||
storeAreaList.value = []
|
||||
|
||||
@ -95,8 +95,8 @@
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.billType === '1'">标准采购申请</span>
|
||||
<span v-else-if="scope.row.billType === '2'">设备采购申请</span>
|
||||
<span v-else-if="scope.row.billType === '3'">标准采购退料</span>
|
||||
<span v-else-if="scope.row.billType === '4'">设备采购退料</span>
|
||||
<!-- <span v-else-if="scope.row.billType === '3'">标准采购退料</span> -->
|
||||
<!-- <span v-else-if="scope.row.billType === '4'">设备采购退料</span> -->
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -111,6 +111,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="单据日期" align="center" prop="receiptDate" />
|
||||
<el-table-column label="操作人员" align="center" prop="receiptEmpName" />
|
||||
<el-table-column label="仓储名称" align="center" prop="storeHouseName" />
|
||||
<el-table-column label="操作" align="center" >
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@ -171,9 +172,8 @@
|
||||
<el-table-column label="物料名称" align="center" prop="materialName" />
|
||||
<el-table-column label="规格型号" align="center" prop="spec" />
|
||||
<el-table-column label="采购数量" align="center" prop="purQty" />
|
||||
<el-table-column label="入库数量" align="center" prop="receiptQty" />
|
||||
<el-table-column label="收货数量" align="center" prop="receiptQty" />
|
||||
<el-table-column label="批次号" align="center" prop="lotNo" />
|
||||
<el-table-column label="仓储名称" align="center" prop="storeHouseName" />
|
||||
<el-table-column label="库区名称" align="center" prop="storeAreaName" />
|
||||
<el-table-column label="单位" align="center" prop="unit" :formatter="getUnitName" />
|
||||
</el-table>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user