Commit 4c36124793a7d162e42a589f61707cbb9953c0d2

Authored by 谭毅彬
1 parent a6026a5f

删除入库,出库单据移动到历史表

Signed-off-by: TanYibin <5491541@qq.com>
ant-design-vue-jeecg/src/views/system/inventory/InventoryDetailList.vue
... ... @@ -24,6 +24,7 @@
24 24 size="middle"
25 25 bordered
26 26 rowKey="id"
  27 + class="j-table-force-nowrap"
27 28 :scroll="{ x: true }"
28 29 :columns="columns"
29 30 :dataSource="dataSource"
... ... @@ -129,8 +130,8 @@ export default {
129 130 title: '库存详情ID',
130 131 align: 'center',
131 132 dataIndex: 'id',
132   - fixed: "left",
133   - width: 100,
  133 + // fixed: "left",
  134 + // width: 100,
134 135 },
135 136 {
136 137 title: '货主',
... ...
ant-design-vue-jeecg/src/views/system/inventory/InventoryHeaderList.vue
... ... @@ -6,7 +6,7 @@
6 6 <a-row :gutter="24">
7 7 <a-col :xl="6" :lg="7" :md="8" :sm="24">
8 8 <a-form-item label="库区">
9   - <a-form-model-item prop="zoneOptions">
  9 + <a-form-model-item prop="zoneOptions">
10 10 <j-multi-select-tag
11 11 v-model="queryParam.zoneCode"
12 12 :options="zoneOptions"
... ... @@ -179,8 +179,8 @@ export default {
179 179 {
180 180 title: '库存ID',
181 181 align: "center",
182   - fixed: "left",
183   - width: 100,
  182 + // fixed: "left",
  183 + // width: 100,
184 184 dataIndex: 'id'
185 185 },
186 186 {
... ...
ant-design-vue-jeecg/src/views/system/inventory/InventoryMaterialSummaryList.vue
... ... @@ -84,6 +84,7 @@
84 84 size="middle"
85 85 :scroll="{ x: true }"
86 86 bordered
  87 + class="j-table-force-nowrap"
87 88 :rowKey="(record,index) => {return record.zoneCode + '_' + record.materialCode}"
88 89 :columns="columns"
89 90 :dataSource="dataSource"
... ... @@ -91,7 +92,6 @@
91 92 :loading="loading"
92 93 :customRow="clickThenSelect"
93 94 :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: 'radio' }"
94   - class="j-table-force-nowrap"
95 95 @change="handleTableChange"
96 96 >
97 97 <span slot="companyCode" slot-scope="companyCode">
... ...
ant-design-vue-jeecg/src/views/system/inventory/InventoryTransactionList.vue
... ... @@ -225,8 +225,8 @@ export default {
225 225 title: '库存交易ID',
226 226 align: "center",
227 227 dataIndex: 'id',
228   - fixed: 'left',
229   - width: 100,
  228 + // fixed: 'left',
  229 + // width: 100,
230 230 },
231 231 {
232 232 title: '库区',
... ...
ant-design-vue-jeecg/src/views/system/inventory/SimpleInventoryDetailList.vue
... ... @@ -167,12 +167,12 @@
167 167 :scroll="{ x: true }"
168 168 bordered
169 169 rowKey="id"
  170 + class="j-table-force-nowrap"
170 171 :columns="columns"
171 172 :dataSource="dataSource"
172 173 :pagination="ipagination"
173 174 :loading="loading"
174 175 :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
175   - class="j-table-force-nowrap"
176 176 @change="handleTableChange"
177 177 >
178 178 <span slot="containerStatus_dictText" slot-scope="containerStatus_dictText">
... ... @@ -265,8 +265,8 @@ export default {
265 265 title: '库存详情ID',
266 266 align: 'center',
267 267 dataIndex: 'id',
268   - fixed: "left",
269   - width: 100,
  268 + // fixed: "left",
  269 + // width: 100,
270 270 },
271 271 {
272 272 title: '货主',
... ...
ant-design-vue-jeecg/src/views/system/inventory/subTables/InventoryDetailSubTable.vue
... ... @@ -13,6 +13,7 @@
13 13 size="middle"
14 14 bordered
15 15 rowKey="id"
  16 + class="j-table-force-nowrap"
16 17 :scroll="{x:true}"
17 18 :columns="columns"
18 19 :dataSource="dataSource"
... ... @@ -27,7 +28,6 @@
27 28 </span>
28 29  
29 30 <span slot="companyCode" slot-scope="companyCode">
30   -
31 31 <a-tag :key="companyCode" color="blue">
32 32 {{ solutionCompany(companyCode) }}
33 33 </a-tag>
... ... @@ -72,7 +72,6 @@ export default {
72 72 if (!this.mainId) {
73 73 this.clearList()
74 74 } else {
75   -
76 75 this.queryParam['zoneCode'] = val.split("_")[0];
77 76 this.queryParam['materialCode'] = val.split("_")[1];
78 77 this.loadData(1)
... ... @@ -93,8 +92,8 @@ export default {
93 92 title: '库存详情ID',
94 93 align: 'center',
95 94 dataIndex: 'id',
96   - fixed: 'left',
97   - width: 100,
  95 + // fixed: 'left',
  96 + // width: 100,
98 97 },
99 98 {
100 99 title: '货主',
... ...
ant-design-vue-jeecg/src/views/system/receipt/ReceiptDetailHistoryList.vue
... ... @@ -15,6 +15,18 @@
15 15 :loading="loading"
16 16 @change="handleTableChange">
17 17  
  18 + <span slot="status_dictText" slot-scope="status_dictText">
  19 + <a-tag :key="status_dictText" :color="getStatusColor(status_dictText)">
  20 + {{ status_dictText }}
  21 + </a-tag>
  22 + </span>
  23 +
  24 + <span slot="inventoryStatus_dictText" slot-scope="inventoryStatus_dictText">
  25 + <a-tag :key="inventoryStatus_dictText" :color="getStatusColor(inventoryStatus_dictText)">
  26 + {{ inventoryStatus_dictText }}
  27 + </a-tag>
  28 + </span>
  29 +
18 30 <template slot="htmlSlot" slot-scope="text">
19 31 <div v-html="text"></div>
20 32 </template>
... ... @@ -87,21 +99,21 @@ export default {
87 99 // return parseInt(index)+1;
88 100 // }
89 101 // },
90   - // {
91   - // title:'单据详情ID',
92   - // align:"center",
93   - // dataIndex: 'id'
94   - // },
  102 + {
  103 + title:'单据详情ID',
  104 + align:"center",
  105 + dataIndex: 'id'
  106 + },
95 107 // {
96 108 // title:'入库单ID',
97 109 // align:"center",
98 110 // dataIndex: 'receiptId'
99 111 // },
100   - {
101   - title: '入库单编码',
102   - align: "center",
103   - dataIndex: 'receiptCode'
104   - },
  112 + // {
  113 + // title: '入库单编码',
  114 + // align: "center",
  115 + // dataIndex: 'receiptCode'
  116 + // },
105 117 // {
106 118 // title:'货主编码',
107 119 // align:"center",
... ... @@ -141,6 +153,7 @@ export default {
141 153 title: '库存状态',
142 154 align: "center",
143 155 dataIndex: 'inventoryStatus_dictText',
  156 + scopedSlots: {customRender: 'inventoryStatus_dictText'}
144 157 },
145 158 {
146 159 title: '批次',
... ... @@ -150,7 +163,8 @@ export default {
150 163 {
151 164 title: '单据状态',
152 165 align: "center",
153   - dataIndex: 'status_dictText'
  166 + dataIndex: 'status_dictText',
  167 + scopedSlots: {customRender: 'status_dictText'}
154 168 },
155 169 {
156 170 title: '上游单号',
... ... @@ -199,6 +213,23 @@ export default {
199 213 }
200 214 },
201 215 methods: {
  216 + getStatusColor(status) {
  217 + const colors = {
  218 + '良品': 'green',
  219 + '报废品': 'purple',
  220 + '待确认 ': 'grey',
  221 + '次品': 'red',
  222 + '新建': 'green',
  223 + '收货': 'Skyblue',
  224 + '等待上架': 'blue',
  225 + '上架': 'darkorange',
  226 + '过账': 'purple',
  227 + '回传': 'grey',
  228 + '回传失败': 'red',
  229 + default: 'blue'
  230 + };
  231 + return colors[status] || colors.default;
  232 + },
202 233 clearList() {
203 234 this.dataSource = []
204 235 this.selectedRowKeys = []
... ...
ant-design-vue-jeecg/src/views/system/receipt/ReceiptDetailList.vue
... ... @@ -56,7 +56,7 @@
56 56 </span>
57 57  
58 58 <span slot="inventoryStatus_dictText" slot-scope="inventoryStatus_dictText">
59   - <a-tag :key="inventoryStatus_dictText" :color="getInventoryStatusColor(inventoryStatus_dictText)">
  59 + <a-tag :key="inventoryStatus_dictText" :color="getStatusColor(inventoryStatus_dictText)">
60 60 {{ inventoryStatus_dictText }}
61 61 </a-tag>
62 62 </span>
... ... @@ -236,6 +236,10 @@ export default {
236 236 methods: {
237 237 getStatusColor(status) {
238 238 const colors = {
  239 + '良品': 'green',
  240 + '报废品': 'purple',
  241 + '待确认 ': 'grey',
  242 + '次品': 'red',
239 243 '新建': 'green',
240 244 '收货': 'Skyblue',
241 245 '等待上架': 'blue',
... ... @@ -247,16 +251,6 @@ export default {
247 251 };
248 252 return colors[status] || colors.default;
249 253 },
250   - getInventoryStatusColor(status) {
251   - const colors = {
252   - '良品': 'green',
253   - '报废品': 'purple',
254   - '待确认 ': 'grey',
255   - '次品': 'red',
256   - default: 'blue'
257   - };
258   - return colors[status] || colors.default;
259   - },
260 254 clearList() {
261 255 this.dataSource = []
262 256 this.selectedRowKeys = []
... ...
ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderHistoryList.vue
... ... @@ -212,11 +212,11 @@ export default {
212 212 supplierList: [],
213 213 // 表头
214 214 columns: [
215   - // {
216   - // title: '单据ID',
217   - // align: 'center',
218   - // dataIndex: 'id'
219   - // },
  215 + {
  216 + title: '单据ID',
  217 + align: 'center',
  218 + dataIndex: 'id'
  219 + },
220 220 {
221 221 title: '入库单编码',
222 222 align: 'center',
... ...
ant-design-vue-jeecg/src/views/system/shipment/ShipmentDetailHistoryList.vue
1 1 <template>
2 2 <a-card :bordered="false" :class="'cust-erp-sub-tab'">
3 3 <!-- 操作按钮区域 -->
4   - <div class="table-operator" v-if="mainId">
  4 + <!-- <div class="table-operator" v-if="mainId"> -->
5 5 <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>-->
6 6 <!-- <a-button type="primary" icon="download" @click="handleExportXls('历史出库单明细')">导出</a-button>-->
7   - <a-upload
  7 + <!-- <a-upload
8 8 name="file"
9 9 :showUploadList="false"
10 10 :multiple="false"
11 11 :headers="tokenHeader"
12 12 :action="importExcelUrl"
13 13 @change="handleImportExcel">
14   - <!-- <a-button type="primary" icon="import">导入</a-button>-->
15   - </a-upload>
16   - <a-dropdown v-if="selectedRowKeys.length > 0">
  14 + <a-button type="primary" icon="import">导入</a-button>
  15 + </a-upload> -->
  16 + <!-- <a-dropdown v-if="selectedRowKeys.length > 0">
17 17 <a-menu slot="overlay">
18 18 <a-menu-item key="1" @click="batchDel">
19 19 <a-icon type="delete"/>
... ... @@ -23,22 +23,23 @@
23 23 <a-button style="margin-left: 8px"> 批量操作
24 24 <a-icon type="down"/>
25 25 </a-button>
26   - </a-dropdown>
27   - </div>
  26 + </a-dropdown> -->
  27 + <!-- </div> -->
28 28  
29 29 <!-- table区域-begin -->
30 30 <div>
31   - <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  31 + <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
32 32 <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
33 33 style="font-weight: 600">{{ selectedRowKeys.length }}</a> 项
34 34 <a style="margin-left: 24px" @click="onClearSelected">清空</a>
35   - </div>
  35 + </div> -->
36 36  
37 37 <a-table
38 38 ref="table"
39 39 size="middle"
40 40 bordered
41 41 rowKey="id"
  42 + class='j-table-force-nowrap'
42 43 :scroll="{x:true}"
43 44 :columns="columns"
44 45 :dataSource="dataSource"
... ... @@ -47,35 +48,17 @@
47 48 :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
48 49 @change="handleTableChange">
49 50  
50   - <template slot="htmlSlot" slot-scope="text">
51   - <div v-html="text"></div>
52   - </template>
53   - <template slot="imgSlot" slot-scope="text">
54   - <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
55   - <img v-else :src="getImgView(text)" height="25px" alt=""
56   - style="max-width:80px;font-size: 12px;font-style: italic;"/>
57   - </template>
58   - <template slot="fileSlot" slot-scope="text">
59   - <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
60   - <a-button
61   - v-else
62   - :ghost="true"
63   - type="primary"
64   - icon="download"
65   - size="small"
66   - @click="downloadFile(text)">
67   - 下载
68   - </a-button>
69   - </template>
70   -
71   - <span slot="action" slot-scope="text, record">
72   - <a @click="handleEdit(record)">编辑</a>
73   - <a-divider type="vertical"/>
74   - <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
75   - <a>删除</a>
76   - </a-popconfirm>
  51 + <span slot="status_dictText" slot-scope="status_dictText">
  52 + <a-tag :key="status_dictText" :color="getStatusColor(status_dictText)">
  53 + {{ status_dictText }}
  54 + </a-tag>
77 55 </span>
78 56  
  57 + <span slot="inventoryStatus_dictText" slot-scope="inventoryStatus_dictText">
  58 + <a-tag :key="inventoryStatus_dictText" :color="getStatusColor(inventoryStatus_dictText)">
  59 + {{ inventoryStatus_dictText }}
  60 + </a-tag>
  61 + </span>
79 62 </a-table>
80 63 </div>
81 64  
... ... @@ -128,17 +111,19 @@ export default {
128 111 // return parseInt(index)+1;
129 112 // }
130 113 // },
131   - // {
132   - // title:'出库单ID',
133   - // align:"center",
134   - // dataIndex: 'shipmentId'
135   - // },
136 114 {
137   - title: '出库单编码',
138   - align: "center",
139   - dataIndex: 'shipmentCode'
  115 + title:'单据详情ID',
  116 + align:"center",
  117 + dataIndex: 'id',
  118 + // fixed: "left",
  119 + // width: 100,
140 120 },
141 121 // {
  122 + // title: '出库单编码',
  123 + // align: "center",
  124 + // dataIndex: 'shipmentCode'
  125 + // },
  126 + // {
142 127 // title:'货主编码',
143 128 // align:"center",
144 129 // dataIndex: 'companyCode'
... ... @@ -176,7 +161,8 @@ export default {
176 161 {
177 162 title: '库存状态',
178 163 align: "center",
179   - dataIndex: 'inventoryStatus_dictText'
  164 + dataIndex: 'inventoryStatus_dictText',
  165 + scopedSlots: {customRender: 'inventoryStatus_dictText'}
180 166 },
181 167 {
182 168 title: '批次',
... ... @@ -186,18 +172,19 @@ export default {
186 172 {
187 173 title: '单据状态',
188 174 align: "center",
189   - dataIndex: 'status_dictText'
  175 + dataIndex: 'status_dictText',
  176 + scopedSlots: {customRender: 'status_dictText'}
190 177 },
191 178 {
192 179 title: '上游单号',
193 180 align: "center",
194 181 dataIndex: 'referCode'
195 182 },
196   - {
197   - title: '上游行号',
198   - align: "center",
199   - dataIndex: 'referLineNum'
200   - },
  183 + // {
  184 + // title: '上游行号',
  185 + // align: "center",
  186 + // dataIndex: 'referLineNum'
  187 + // },
201 188 {
202 189 title: '创建人',
203 190 align: "center",
... ... @@ -224,14 +211,14 @@ export default {
224 211 return !text ? "" : (text.length > 10 ? text.substr(0, 10) : text)
225 212 }
226 213 },
227   - {
228   - title: '操作',
229   - dataIndex: 'action',
230   - align: "center",
231   - fixed: "right",
232   - width: 147,
233   - scopedSlots: {customRender: 'action'},
234   - }
  214 + // {
  215 + // title: '操作',
  216 + // dataIndex: 'action',
  217 + // align: "center",
  218 + // fixed: "right",
  219 + // width: 147,
  220 + // scopedSlots: {customRender: 'action'},
  221 + // }
235 222 ],
236 223 url: {
237 224 list: "/shipment/shipmentHeaderHistory/listShipmentDetailHistoryByMainId",
... ... @@ -254,6 +241,23 @@ export default {
254 241 }
255 242 },
256 243 methods: {
  244 + getStatusColor(status) {
  245 + const colors = {
  246 + '新建': 'green',
  247 + '出库组盘': 'Skyblue',
  248 + '等待下架': 'blue',
  249 + '下架': 'darkorange',
  250 + '过账': 'purple',
  251 + '回传': 'grey',
  252 + '回传失败': 'red',
  253 + '良品': 'green',
  254 + '报废品': 'purple',
  255 + '待确认 ': 'grey',
  256 + '次品': 'red',
  257 + default: 'blue'
  258 + };
  259 + return colors[status] || colors.default;
  260 + },
257 261 clearList() {
258 262 this.dataSource = []
259 263 this.selectedRowKeys = []
... ...
ant-design-vue-jeecg/src/views/system/shipment/ShipmentDetailList.vue
... ... @@ -55,7 +55,7 @@
55 55 </span>
56 56  
57 57 <span slot="inventoryStatus_dictText" slot-scope="inventoryStatus_dictText">
58   - <a-tag :key="inventoryStatus_dictText" :color="getInventoryStatusColor(inventoryStatus_dictText)">
  58 + <a-tag :key="inventoryStatus_dictText" :color="getStatusColor(inventoryStatus_dictText)">
59 59 {{ inventoryStatus_dictText }}
60 60 </a-tag>
61 61 </span>
... ... @@ -248,12 +248,6 @@ export default {
248 248 '过账': 'purple',
249 249 '回传': 'grey',
250 250 '回传失败': 'red',
251   - default: 'blue'
252   - };
253   - return colors[status] || colors.default;
254   - },
255   - getInventoryStatusColor(status) {
256   - const colors = {
257 251 '良品': 'green',
258 252 '报废品': 'purple',
259 253 '待确认 ': 'grey',
... ...
ant-design-vue-jeecg/src/views/system/shipment/ShipmentHeaderHistoryList.vue
... ... @@ -110,11 +110,11 @@
110 110  
111 111 <!-- table区域-begin -->
112 112 <div>
113   - <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  113 + <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
114 114 <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
115 115 style="font-weight: 600">{{ selectedRowKeys.length }}</a> 项
116 116 <a style="margin-left: 24px" @click="onClearSelected">清空</a>
117   - </div>
  117 + </div> -->
118 118  
119 119 <a-table
120 120 ref="table"
... ... @@ -182,7 +182,7 @@
182 182 </a-button>
183 183 </template>
184 184  
185   - <span slot="action" slot-scope="text, record">
  185 + <!-- <span slot="action" slot-scope="text, record">
186 186 <a @click="handleEdit(record)">编辑</a>
187 187  
188 188 <a-divider type="vertical"/>
... ... @@ -196,7 +196,7 @@
196 196 </a-menu-item>
197 197 </a-menu>
198 198 </a-dropdown>
199   - </span>
  199 + </span> -->
200 200  
201 201 </a-table>
202 202 </div>
... ... @@ -236,11 +236,13 @@ export default {
236 236 customerList: [],
237 237 // 表头
238 238 columns: [
239   - // {
240   - // title: '单据ID',
241   - // align: 'center',
242   - // dataIndex: 'id'
243   - // },
  239 + {
  240 + title: '单据ID',
  241 + align: 'center',
  242 + // fixed: "left",
  243 + // width: 100,
  244 + dataIndex: 'id'
  245 + },
244 246 {
245 247 title: '出库单编码',
246 248 align: "center",
... ... @@ -327,14 +329,14 @@ export default {
327 329 return !text ? "" : (text.length > 10 ? text.substr(0, 10) : text)
328 330 }
329 331 },
330   - {
331   - title: '操作',
332   - dataIndex: 'action',
333   - align: "center",
334   - fixed: "right",
335   - width: 147,
336   - scopedSlots: {customRender: 'action'},
337   - }
  332 + // {
  333 + // title: '操作',
  334 + // dataIndex: 'action',
  335 + // align: "center",
  336 + // fixed: "right",
  337 + // width: 147,
  338 + // scopedSlots: {customRender: 'action'},
  339 + // }
338 340 ],
339 341 url: {
340 342 list: "/shipment/shipmentHeaderHistory/list",
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/mapper/ReceiptHeaderMapper.java
... ... @@ -14,8 +14,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
14 14 */
15 15 public interface ReceiptHeaderMapper extends BaseMapper<ReceiptHeader> {
16 16  
17   - @Select("select code from (select r.id, r.code from receipt_header r where r.type = #{receiptType} "
18   - + "union all select h.id, h.code from receipt_header_history h where h.type = #{receiptType}) t order by t.id desc limit 1")
  17 + @Select("select code from (select r.code from receipt_header r where r.type = #{receiptType} "
  18 + + "union all select h.code from receipt_header_history h where h.type = #{receiptType}) t order by t.code desc limit 1")
19 19 ReceiptHeader getMaxReceiptHeaderCode(@Param("receiptType") String receiptType);
20 20  
21 21 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeaderHistory/service/impl/ReceiptHeaderHistoryServiceImpl.java
... ... @@ -79,38 +79,18 @@ public class ReceiptHeaderHistoryServiceImpl extends ServiceImpl&lt;ReceiptHeaderHi
79 79 public void saveById(String id, String reason) {
80 80 ReceiptHeader receiptHeader = receiptHeaderService.getById(id);
81 81 ReceiptHeaderHistory receiptHeaderHistory = new ReceiptHeaderHistory();
82   - receiptHeaderHistory.setCode(receiptHeader.getCode());
83   - receiptHeaderHistory.setWarehouseCode(receiptHeader.getWarehouseCode());
84   - receiptHeaderHistory.setCompanyCode(receiptHeader.getCompanyCode());
85   - receiptHeaderHistory.setType(receiptHeader.getType());
86   - receiptHeaderHistory.setFirstStatus(receiptHeader.getFirstStatus());
87   - receiptHeaderHistory.setLastStatus(receiptHeader.getLastStatus());
88   - receiptHeaderHistory.setReferCode(receiptHeader.getReferCode());
89   - receiptHeaderHistory.setSupplierCode(receiptHeader.getSupplierCode());
90   - receiptHeaderHistory.setTotalqty(receiptHeader.getTotalqty());
91   - receiptHeaderHistory.setTotallines(receiptHeader.getTotallines());
92   - receiptHeaderHistory.setRemark(receiptHeader.getRemark());
  82 + BeanUtils.copyProperties(receiptHeader, receiptHeaderHistory);
93 83 receiptHeaderHistory.setReason(reason);
94   - receiptHeaderHistory.setUserdef1(receiptHeader.getUserdef1());
95   - receiptHeaderHistory.setUserdef2(receiptHeader.getUserdef2());
96   - receiptHeaderHistory.setUserdef3(receiptHeader.getUserdef3());
97   - receiptHeaderHistory.setCreateBy(receiptHeader.getCreateBy());
98   - receiptHeaderHistory.setCreateTime(receiptHeader.getCreateTime());
99   - receiptHeaderHistory.setUpdateBy(receiptHeader.getUpdateBy());
100   - receiptHeaderHistory.setUpdateTime(receiptHeader.getUpdateTime());
101 84 receiptHeaderHistoryMapper.insert(receiptHeaderHistory);
102 85 List<ReceiptDetail> receiptDetailList =
103 86 receiptDetailService.list(new LambdaQueryWrapper<ReceiptDetail>().eq(ReceiptDetail::getReceiptId, receiptHeader.getId()));
104 87 if (!CollectionUtils.isEmpty(receiptDetailList)) {
105   - List<ReceiptDetailHistory> receiptDetailHistoryList = new ArrayList<>();
106 88 for (ReceiptDetail detail : receiptDetailList) {
107 89 ReceiptDetailHistory receiptDetailHistory = new ReceiptDetailHistory();
108 90 BeanUtils.copyProperties(detail, receiptDetailHistory);
109   - detail.setReceiptId(receiptHeaderHistory.getId());
110   - receiptDetailHistoryList.add(receiptDetailHistory);
111   - }
112   - if (!receiptDetailHistoryService.saveBatch(receiptDetailHistoryList)) {
113   - throw new JeecgBootException("批量新增失败");
  91 + if (!receiptDetailHistoryService.save(receiptDetailHistory)) {
  92 + throw new JeecgBootException("批量新增失败");
  93 + }
114 94 }
115 95 }
116 96 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentHeaderServiceImpl.java
... ... @@ -94,6 +94,7 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl&lt;ShipmentHeaderMapper,
94 94 if (shipmentHeader.getFirstStatus().intValue() > QuantityConstant.RECEIPT_HEADER_BUILD) {
95 95 throw new JeecgBootException("不能删除非新建状态单据");
96 96 }
  97 + shipmentHeaderHistoryService.saveById(id);
97 98 shipmentDetailMapper.deleteByMainId(id.toString());
98 99 shipmentHeaderMapper.deleteById(id);
99 100 return true;
... ... @@ -103,12 +104,7 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl&lt;ShipmentHeaderMapper,
103 104 @Transactional
104 105 public void delBatchMain(Collection<? extends Serializable> idList) {
105 106 for (Serializable id : idList) {
106   - ShipmentHeader shipmentHeader = getById(id);
107   - if (shipmentHeader.getFirstStatus().intValue() > QuantityConstant.RECEIPT_HEADER_BUILD) {
108   - throw new JeecgBootException("不能删除非新建状态单据");
109   - }
110   - shipmentDetailMapper.deleteByMainId(id.toString());
111   - shipmentHeaderMapper.deleteById(id);
  107 + this.delMain(id.toString());
112 108 }
113 109 }
114 110  
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeaderHistory/service/impl/ShipmentHeaderHistoryServiceImpl.java
1 1 package org.jeecg.modules.wms.shipment.shipmentHeaderHistory.service.impl;
2 2  
3   -import java.math.BigDecimal;
4   -import java.util.Date;
  3 +import java.io.Serializable;
  4 +import java.util.Collection;
  5 +import java.util.List;
5 6  
6 7 import org.jeecg.common.exception.JeecgBootException;
7   -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
8   -import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail;
9   -import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader;
10   -import org.jeecg.modules.wms.receipt.receiptHeaderHistory.entity.ReceiptDetailHistory;
11   -import org.jeecg.modules.wms.receipt.receiptHeaderHistory.entity.ReceiptHeaderHistory;
12 8 import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail;
13 9 import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentHeader;
14 10 import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentDetailService;
15 11 import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentHeaderService;
16   -import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.entity.ShipmentHeaderHistory;
17 12 import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.entity.ShipmentDetailHistory;
  13 +import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.entity.ShipmentHeaderHistory;
18 14 import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.mapper.ShipmentDetailHistoryMapper;
19 15 import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.mapper.ShipmentHeaderHistoryMapper;
20 16 import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.service.IShipmentDetailHistoryService;
21 17 import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.service.IShipmentHeaderHistoryService;
22 18 import org.springframework.beans.BeanUtils;
23   -import org.springframework.stereotype.Service;
24   -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
25 19 import org.springframework.beans.factory.annotation.Autowired;
  20 +import org.springframework.stereotype.Service;
26 21 import org.springframework.transaction.annotation.Transactional;
27   -import java.io.Serializable;
28   -import java.util.ArrayList;
29   -import java.util.List;
30   -import java.util.Collection;
31   -import java.util.stream.Collectors;
  22 +import org.springframework.util.CollectionUtils;
  23 +
  24 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  25 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
32 26  
33 27 /**
34 28 * @Description: 历史出库单
... ... @@ -41,13 +35,16 @@ public class ShipmentHeaderHistoryServiceImpl extends ServiceImpl&lt;ShipmentHeader
41 35  
42 36 @Autowired
43 37 private ShipmentHeaderHistoryMapper shipmentHeaderHistoryMapper;
  38 +
44 39 @Autowired
45 40 private ShipmentDetailHistoryMapper shipmentDetailHistoryMapper;
46 41  
47 42 @Autowired
48 43 private IShipmentHeaderService shipmentHeaderService;
  44 +
49 45 @Autowired
50 46 private IShipmentDetailService shipmentDetailService;
  47 +
51 48 @Autowired
52 49 private IShipmentDetailHistoryService shipmentDetailHistoryService;
53 50  
... ... @@ -75,38 +72,18 @@ public class ShipmentHeaderHistoryServiceImpl extends ServiceImpl&lt;ShipmentHeader
75 72 public void saveById(String id) {
76 73 ShipmentHeader shipmentHeader = shipmentHeaderService.getById(id);
77 74 ShipmentHeaderHistory shipmentHeaderHistory = new ShipmentHeaderHistory();
78   - shipmentHeaderHistory.setCode(shipmentHeader.getCode());
79   - shipmentHeaderHistory.setWarehouseCode(shipmentHeader.getWarehouseCode());
80   - shipmentHeaderHistory.setCompanyCode(shipmentHeader.getCompanyCode());
81   - shipmentHeaderHistory.setType(shipmentHeader.getType());
82   - shipmentHeaderHistory.setFirstStatus(shipmentHeader.getFirstStatus());
83   - shipmentHeaderHistory.setLastStatus(shipmentHeader.getLastStatus());
84   - shipmentHeaderHistory.setReferCode(shipmentHeader.getReferCode());
85   - shipmentHeaderHistory.setCustomerCode(shipmentHeader.getCompanyCode());
86   - shipmentHeaderHistory.setTotalQty(shipmentHeader.getTotalQty());
87   - shipmentHeaderHistory.setTotalLines(shipmentHeader.getTotalLines());
88   - shipmentHeaderHistory.setRemark(shipmentHeader.getRemark());
89   - shipmentHeaderHistory.setUserdef1(shipmentHeader.getUserdef1());
90   - shipmentHeaderHistory.setUserdef2(shipmentHeader.getUserdef2());
91   - shipmentHeaderHistory.setUserdef3(shipmentHeader.getUserdef3());
92   - shipmentHeaderHistory.setCreateBy(shipmentHeader.getCreateBy());
93   - shipmentHeaderHistory.setCreateTime(shipmentHeader.getCreateTime());
94   - shipmentHeaderHistory.setUpdateBy(shipmentHeader.getUpdateBy());
95   - shipmentHeaderHistory.setUpdateTime(shipmentHeader.getUpdateTime());
96   -
  75 + BeanUtils.copyProperties(shipmentHeader, shipmentHeaderHistory);
97 76 shipmentHeaderHistoryMapper.insert(shipmentHeaderHistory);
98   - List<ShipmentDetailHistory> shipmentDetailHistoryList = new ArrayList<>();
99 77 List<ShipmentDetail> shipmentDetailList =
100 78 shipmentDetailService.list(new LambdaQueryWrapper<ShipmentDetail>().eq(ShipmentDetail::getShipmentId, shipmentHeader.getId()));
101   - for (ShipmentDetail detail : shipmentDetailList) {
102   - ShipmentDetailHistory shipmentDetailHistory = new ShipmentDetailHistory();
103   - BeanUtils.copyProperties(detail, shipmentDetailHistory);
104   - shipmentDetailHistoryList.add(shipmentDetailHistory);
105   - }
106   - List<ShipmentDetailHistory> newList =
107   - shipmentDetailHistoryList.stream().peek(detail -> detail.setShipmentId(shipmentHeaderHistory.getId())).collect(Collectors.toList());
108   - if (!shipmentDetailHistoryService.saveBatch(newList)) {
109   - throw new JeecgBootException("批量新增失败");
  79 + if (!CollectionUtils.isEmpty(shipmentDetailList)) {
  80 + for (ShipmentDetail detail : shipmentDetailList) {
  81 + ShipmentDetailHistory shipmentDetailHistory = new ShipmentDetailHistory();
  82 + BeanUtils.copyProperties(detail, shipmentDetailHistory);
  83 + if (!shipmentDetailHistoryService.save(shipmentDetailHistory)) {
  84 + throw new JeecgBootException("批量新增失败");
  85 + }
  86 + }
110 87 }
111 88 }
112 89  
... ...