Commit e128e3d64207b35929ceab6b54e1abca2cba5292
1 parent
064cbc20
增加入库单详情、出库单详情物料标签打印
Showing
17 changed files
with
165 additions
and
33 deletions
ant-design-vue-jeecg/src/views/system/shipment/ShipmentDetailList.vue
... | ... | @@ -271,6 +271,18 @@ export default { |
271 | 271 | this.$refs.modalCombineForm.title = "配盘"; |
272 | 272 | this.$refs.modalCombineForm.disableSubmit = false; |
273 | 273 | }, |
274 | + batchPrint() { | |
275 | + if (this.selectedRowKeys.length <= 0) { | |
276 | + this.$message.warning('请选择一条记录!'); | |
277 | + return; | |
278 | + } else { | |
279 | + var ids = '' | |
280 | + for (var a = 0; a < this.selectedRowKeys.length; a++) { | |
281 | + ids += this.selectedRowKeys[a] + ',' | |
282 | + } | |
283 | + window.open(window._CONFIG['domianURL'] + "/jmreport/view/963962951128367104/?id=" + ids, "newWindow", "toolbar=no,scrollbars=no,menubar=no,screenX=100,screenY=100"); | |
284 | + } | |
285 | + }, | |
274 | 286 | edit(record) { |
275 | 287 | this.$refs.modalEditForm.edit(record); |
276 | 288 | this.$refs.modalEditForm.title = "编辑"; |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/erp/service/impl/ErpServiceImpl.java
... | ... | @@ -16,8 +16,12 @@ import org.jeecg.modules.wms.api.erp.service.IErpService; |
16 | 16 | import org.jeecg.modules.wms.config.address.service.IAddressService; |
17 | 17 | import org.jeecg.modules.wms.config.company.entity.Company; |
18 | 18 | import org.jeecg.modules.wms.config.company.service.ICompanyService; |
19 | +import org.jeecg.modules.wms.config.customer.entity.Customer; | |
20 | +import org.jeecg.modules.wms.config.customer.service.ICustomerService; | |
19 | 21 | import org.jeecg.modules.wms.config.material.entity.Material; |
20 | 22 | import org.jeecg.modules.wms.config.material.service.IMaterialService; |
23 | +import org.jeecg.modules.wms.config.supplier.entity.Supplier; | |
24 | +import org.jeecg.modules.wms.config.supplier.service.ISupplierService; | |
21 | 25 | import org.jeecg.modules.wms.config.warehouse.entity.Warehouse; |
22 | 26 | import org.jeecg.modules.wms.config.warehouse.service.IWarehouseService; |
23 | 27 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
... | ... | @@ -68,6 +72,10 @@ public class ErpServiceImpl implements IErpService { |
68 | 72 | private IInventoryDetailService inventoryDetailService; |
69 | 73 | @Resource |
70 | 74 | private IAddressService addressService; |
75 | + @Resource | |
76 | + private ISupplierService supplierService; | |
77 | + @Resource | |
78 | + private ICustomerService customerService; | |
71 | 79 | |
72 | 80 | @Override |
73 | 81 | @Transactional(rollbackFor = Exception.class) |
... | ... | @@ -115,12 +123,20 @@ public class ErpServiceImpl implements IErpService { |
115 | 123 | return Result.error("入库单下发, 没有找到货主"); |
116 | 124 | } |
117 | 125 | } |
126 | + String supplierName = null; | |
127 | + if (StringUtils.isNotEmpty(supplierCode)) { | |
128 | + Supplier supplier = supplierService.getSupplierByCode(supplierCode); | |
129 | + if (supplier != null) { | |
130 | + supplierName = supplier.getName(); | |
131 | + } | |
132 | + } | |
118 | 133 | ReceiptHeader receiptHeader = new ReceiptHeader(); |
119 | 134 | receiptHeader.setWarehouseCode(warehouseCode); |
120 | 135 | receiptHeader.setCompanyCode(companyCode); |
121 | 136 | receiptHeader.setType(receiptType); |
122 | 137 | receiptHeader.setReferCode(referCode); |
123 | 138 | receiptHeader.setSupplierCode(supplierCode); |
139 | + receiptHeader.setSupplierName(supplierName); | |
124 | 140 | receiptHeader.setRemark(remark); |
125 | 141 | Result result = receiptHeaderService.saveReceiptHeader(receiptHeader); |
126 | 142 | if (!result.isSuccess()) { |
... | ... | @@ -253,9 +269,18 @@ public class ErpServiceImpl implements IErpService { |
253 | 269 | return Result.error("出库单下发, 没有找到货主"); |
254 | 270 | } |
255 | 271 | } |
272 | + String customerName = null; | |
273 | + if (StringUtils.isNotEmpty(customerCode)) { | |
274 | + Customer customer = customerService.getCustomerByCode(customerCode); | |
275 | + if (customer == null) { | |
276 | + return Result.error("出库单下发, 没有找到客户信息"); | |
277 | + } | |
278 | + customerName = customer.getName(); | |
279 | + } | |
256 | 280 | ShipmentHeader shipmentHeader = new ShipmentHeader(); |
257 | 281 | shipmentHeader.setWarehouseCode(warehouseCode); |
258 | 282 | shipmentHeader.setCompanyCode(companyCode); |
283 | + shipmentHeader.setCustomerName(customerName); | |
259 | 284 | shipmentHeader.setZoneCode(zoneCode); |
260 | 285 | shipmentHeader.setType(shipmentType); |
261 | 286 | shipmentHeader.setReferCode(referCode); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/customer/service/ICustomerService.java
1 | 1 | package org.jeecg.modules.wms.config.customer.service; |
2 | 2 | |
3 | -import com.baomidou.mybatisplus.extension.service.IService; | |
4 | 3 | import org.jeecg.modules.wms.config.customer.entity.Customer; |
5 | 4 | |
5 | +import com.baomidou.mybatisplus.extension.service.IService; | |
6 | + | |
6 | 7 | /** |
7 | 8 | * @Description: 客户管理 |
8 | 9 | * @Author: jeecg-boot |
... | ... | @@ -11,4 +12,5 @@ import org.jeecg.modules.wms.config.customer.entity.Customer; |
11 | 12 | */ |
12 | 13 | public interface ICustomerService extends IService<Customer> { |
13 | 14 | |
15 | + Customer getCustomerByCode(String code); | |
14 | 16 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/customer/service/impl/CustomerServiceImpl.java
... | ... | @@ -5,6 +5,8 @@ import org.jeecg.modules.wms.config.customer.mapper.CustomerMapper; |
5 | 5 | import org.jeecg.modules.wms.config.customer.service.ICustomerService; |
6 | 6 | import org.springframework.stereotype.Service; |
7 | 7 | |
8 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
9 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
8 | 10 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
9 | 11 | |
10 | 12 | /** |
... | ... | @@ -16,4 +18,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
16 | 18 | @Service |
17 | 19 | public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> implements ICustomerService { |
18 | 20 | |
21 | + @Override | |
22 | + public Customer getCustomerByCode(String code) { | |
23 | + LambdaQueryWrapper<Customer> customerLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
24 | + customerLambdaQueryWrapper.eq(Customer::getCode, code); | |
25 | + return getOne(customerLambdaQueryWrapper); | |
26 | + } | |
19 | 27 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/supplier/service/ISupplierService.java
1 | 1 | package org.jeecg.modules.wms.config.supplier.service; |
2 | 2 | |
3 | -import com.baomidou.mybatisplus.extension.service.IService; | |
4 | 3 | import org.jeecg.modules.wms.config.supplier.entity.Supplier; |
5 | 4 | |
5 | +import com.baomidou.mybatisplus.extension.service.IService; | |
6 | + | |
6 | 7 | /** |
7 | 8 | * @Description: 供应商管理 |
8 | 9 | * @Author: jeecg-boot |
... | ... | @@ -11,4 +12,5 @@ import org.jeecg.modules.wms.config.supplier.entity.Supplier; |
11 | 12 | */ |
12 | 13 | public interface ISupplierService extends IService<Supplier> { |
13 | 14 | |
15 | + Supplier getSupplierByCode(String code); | |
14 | 16 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/supplier/service/impl/SupplierServiceImpl.java
... | ... | @@ -5,6 +5,8 @@ import org.jeecg.modules.wms.config.supplier.mapper.SupplierMapper; |
5 | 5 | import org.jeecg.modules.wms.config.supplier.service.ISupplierService; |
6 | 6 | import org.springframework.stereotype.Service; |
7 | 7 | |
8 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
9 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
8 | 10 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
9 | 11 | |
10 | 12 | /** |
... | ... | @@ -16,4 +18,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
16 | 18 | @Service |
17 | 19 | public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> implements ISupplierService { |
18 | 20 | |
21 | + @Override | |
22 | + public Supplier getSupplierByCode(String code) { | |
23 | + LambdaQueryWrapper<Supplier> supplierLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
24 | + supplierLambdaQueryWrapper.eq(Supplier::getCode, code); | |
25 | + return getOne(supplierLambdaQueryWrapper); | |
26 | + } | |
19 | 27 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/controller/ReceiptHeaderController.java
1 | 1 | package org.jeecg.modules.wms.receipt.receiptHeader.controller; |
2 | 2 | |
3 | 3 | import java.io.IOException; |
4 | -import java.util.*; | |
4 | +import java.util.Arrays; | |
5 | +import java.util.Collections; | |
6 | +import java.util.List; | |
7 | +import java.util.Map; | |
5 | 8 | import java.util.stream.Collectors; |
6 | 9 | |
7 | 10 | import javax.annotation.Resource; |
8 | 11 | import javax.servlet.http.HttpServletRequest; |
9 | 12 | import javax.servlet.http.HttpServletResponse; |
10 | 13 | |
11 | -import cn.hutool.core.util.StrUtil; | |
12 | 14 | import org.apache.shiro.SecurityUtils; |
13 | 15 | import org.apache.shiro.authz.annotation.RequiresPermissions; |
14 | 16 | import org.jeecg.common.api.vo.Result; |
15 | 17 | import org.jeecg.common.aspect.annotation.AutoLog; |
16 | -import org.jeecg.common.exception.JeecgBootException; | |
17 | 18 | import org.jeecg.common.system.base.controller.JeecgController; |
18 | 19 | import org.jeecg.common.system.query.QueryGenerator; |
19 | -import org.jeecg.common.system.vo.DictModel; | |
20 | 20 | import org.jeecg.common.system.vo.LoginUser; |
21 | 21 | import org.jeecg.common.util.oConvertUtils; |
22 | 22 | import org.jeecg.modules.wms.api.erp.service.IErpService; |
... | ... | @@ -29,7 +29,6 @@ import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail; |
29 | 29 | import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader; |
30 | 30 | import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptDetailService; |
31 | 31 | import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptHeaderService; |
32 | -import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail; | |
33 | 32 | import org.jeecg.utils.HuahengJwtUtil; |
34 | 33 | import org.jeecg.utils.StringUtils; |
35 | 34 | import org.jeecg.utils.constant.QuantityConstant; |
... | ... | @@ -131,16 +130,8 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec |
131 | 130 | @RequiresPermissions("receiptHeader:edit") |
132 | 131 | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
133 | 132 | public Result<String> edit(@RequestBody ReceiptHeader receiptHeader) { |
134 | - String companyCode = receiptHeader.getCompanyCode(); | |
135 | - receiptHeaderService.updateById(receiptHeader); | |
136 | - if (StringUtils.isNotEmpty(companyCode)) { | |
137 | - List<ReceiptDetail> receiptDetailList = receiptDetailService.selectByMainId(String.valueOf(receiptHeader.getId())); | |
138 | - for (ReceiptDetail receiptDetail : receiptDetailList) { | |
139 | - receiptDetail.setCompanyCode(companyCode); | |
140 | - receiptDetailService.updateById(receiptDetail); | |
141 | - } | |
142 | - } | |
143 | - return Result.OK("编辑成功!"); | |
133 | + Result result = receiptHeaderService.editReceiptHeader(receiptHeader); | |
134 | + return result; | |
144 | 135 | } |
145 | 136 | |
146 | 137 | /** |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/entity/ReceiptDetail.java
... | ... | @@ -47,6 +47,10 @@ public class ReceiptDetail implements Serializable { |
47 | 47 | @Excel(name = "货主编码", width = 15) |
48 | 48 | @ApiModelProperty(value = "货主编码") |
49 | 49 | private String companyCode; |
50 | + /** 供应商名称 */ | |
51 | + @Excel(name = "供应商名称", width = 15) | |
52 | + @ApiModelProperty(value = "供应商名称") | |
53 | + private String supplierName; | |
50 | 54 | /** 物料编码 */ |
51 | 55 | @Excel(name = "物料编码", width = 15) |
52 | 56 | @ApiModelProperty(value = "物料编码") |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/entity/ReceiptHeader.java
1 | 1 | package org.jeecg.modules.wms.receipt.receiptHeader.entity; |
2 | 2 | |
3 | 3 | import java.io.Serializable; |
4 | -import java.io.UnsupportedEncodingException; | |
5 | 4 | import java.util.Date; |
5 | + | |
6 | +import org.jeecg.common.aspect.annotation.Dict; | |
7 | +import org.jeecgframework.poi.excel.annotation.Excel; | |
8 | + | |
6 | 9 | import com.baomidou.mybatisplus.annotation.IdType; |
7 | 10 | import com.baomidou.mybatisplus.annotation.TableId; |
8 | 11 | import com.baomidou.mybatisplus.annotation.TableName; |
9 | -import org.jeecgframework.poi.excel.annotation.Excel; | |
10 | -import lombok.Data; | |
11 | -import com.fasterxml.jackson.annotation.JsonFormat; | |
12 | 12 | |
13 | 13 | import cn.monitor4all.logRecord.annotation.LogRecordDiffField; |
14 | 14 | import cn.monitor4all.logRecord.annotation.LogRecordDiffObject; |
15 | - | |
16 | -import org.springframework.format.annotation.DateTimeFormat; | |
17 | -import org.jeecg.common.aspect.annotation.Dict; | |
18 | 15 | import io.swagger.annotations.ApiModel; |
19 | 16 | import io.swagger.annotations.ApiModelProperty; |
17 | +import lombok.Data; | |
20 | 18 | |
21 | 19 | /** |
22 | 20 | * @Description: 入库表主表 |
... | ... | @@ -70,6 +68,10 @@ public class ReceiptHeader implements Serializable { |
70 | 68 | @Excel(name = "供应商编码", width = 15) |
71 | 69 | @ApiModelProperty(value = "供应商编码") |
72 | 70 | private String supplierCode; |
71 | + /** 供应商名称 */ | |
72 | + @Excel(name = "供应商名称", width = 15) | |
73 | + @ApiModelProperty(value = "供应商名称") | |
74 | + private String supplierName; | |
73 | 75 | /** 总数量 */ |
74 | 76 | @Excel(name = "总数量", width = 15) |
75 | 77 | @ApiModelProperty(value = "总数量") |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/IReceiptHeaderService.java
... | ... | @@ -31,6 +31,8 @@ public interface IReceiptHeaderService extends IService<ReceiptHeader> { |
31 | 31 | */ |
32 | 32 | Result<ReceiptHeader> saveReceiptHeader(ReceiptHeader receiptHeader); |
33 | 33 | |
34 | + public Result editReceiptHeader(ReceiptHeader receiptHeader); | |
35 | + | |
34 | 36 | boolean updateReceiptHeaderStatus(Integer id); |
35 | 37 | |
36 | 38 | boolean updateReceiptHeader(Integer id); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptDetailServiceImpl.java
... | ... | @@ -4,12 +4,10 @@ import java.math.BigDecimal; |
4 | 4 | import java.util.ArrayList; |
5 | 5 | import java.util.Collections; |
6 | 6 | import java.util.List; |
7 | -import java.util.Map; | |
8 | 7 | |
9 | 8 | import javax.annotation.Resource; |
10 | 9 | import javax.validation.Valid; |
11 | 10 | |
12 | -import cn.hutool.core.util.StrUtil; | |
13 | 11 | import org.jeecg.common.api.vo.Result; |
14 | 12 | import org.jeecg.common.exception.JeecgBootException; |
15 | 13 | import org.jeecg.modules.wms.config.material.entity.Material; |
... | ... | @@ -19,19 +17,18 @@ import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader; |
19 | 17 | import org.jeecg.modules.wms.receipt.receiptHeader.mapper.ReceiptDetailMapper; |
20 | 18 | import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptDetailService; |
21 | 19 | import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptHeaderService; |
22 | -import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail; | |
23 | 20 | import org.jeecg.utils.StringUtils; |
24 | 21 | import org.jeecg.utils.constant.QuantityConstant; |
25 | 22 | import org.springframework.beans.factory.annotation.Autowired; |
26 | 23 | import org.springframework.stereotype.Service; |
27 | 24 | import org.springframework.transaction.annotation.Transactional; |
25 | +import org.springframework.util.CollectionUtils; | |
28 | 26 | |
29 | 27 | import com.alibaba.fastjson.JSON; |
30 | 28 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
31 | 29 | |
32 | 30 | import cn.monitor4all.logRecord.annotation.OperationLog; |
33 | 31 | import cn.monitor4all.logRecord.context.LogRecordContext; |
34 | -import org.springframework.util.CollectionUtils; | |
35 | 32 | |
36 | 33 | /** |
37 | 34 | * @Description: 入库单详情 |
... | ... | @@ -82,6 +79,7 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
82 | 79 | String warehouseCode = receiptHeader.getWarehouseCode(); |
83 | 80 | String companyCode = receiptHeader.getCompanyCode(); |
84 | 81 | String materialCode = receiptDetail.getMaterialCode(); |
82 | + String supplierName = receiptHeader.getSupplierName(); | |
85 | 83 | Material material = materialService.getMaterialByCode(materialCode); |
86 | 84 | if (material == null) { |
87 | 85 | return Result.error("添加失败,没有找到物料信息," + materialCode); |
... | ... | @@ -92,6 +90,7 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
92 | 90 | receiptDetail.setReceiptCode(receiptCode); |
93 | 91 | receiptDetail.setWarehouseCode(warehouseCode); |
94 | 92 | receiptDetail.setCompanyCode(companyCode); |
93 | + receiptDetail.setSupplierName(supplierName); | |
95 | 94 | receiptDetail.setMaterialName(materialName); |
96 | 95 | receiptDetail.setMaterialSpec(materialSpec); |
97 | 96 | receiptDetail.setMaterialUnit(materialUnit); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptHeaderServiceImpl.java
... | ... | @@ -15,6 +15,8 @@ import org.jeecg.common.exception.JeecgBootException; |
15 | 15 | import org.jeecg.modules.wms.audit.service.IAuditService; |
16 | 16 | import org.jeecg.modules.wms.config.receiptType.entity.ReceiptType; |
17 | 17 | import org.jeecg.modules.wms.config.receiptType.service.IReceiptTypeService; |
18 | +import org.jeecg.modules.wms.config.supplier.entity.Supplier; | |
19 | +import org.jeecg.modules.wms.config.supplier.service.ISupplierService; | |
18 | 20 | import org.jeecg.modules.wms.flow.service.IFlowDetailService; |
19 | 21 | import org.jeecg.modules.wms.inventory.inventoryTransaction.entity.InventoryTransaction; |
20 | 22 | import org.jeecg.modules.wms.inventory.inventoryTransaction.service.IInventoryTransactionService; |
... | ... | @@ -66,6 +68,8 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl<ReceiptHeaderMapper, R |
66 | 68 | private IAuditService iAuditService; |
67 | 69 | @Resource |
68 | 70 | private IInventoryTransactionService inventoryTransactionService; |
71 | + @Resource | |
72 | + private ISupplierService supplierService; | |
69 | 73 | |
70 | 74 | /** |
71 | 75 | * @param id 入库单主表id |
... | ... | @@ -120,6 +124,15 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl<ReceiptHeaderMapper, R |
120 | 124 | if (StringUtils.isEmpty(code)) { |
121 | 125 | throw new JeecgBootException("根据入库单据类型" + receiptHeader.getType() + "生成单号失败"); |
122 | 126 | } |
127 | + String supplierCode = receiptHeader.getSupplierCode(); | |
128 | + String supplierName = null; | |
129 | + if (StringUtils.isNotEmpty(supplierCode)) { | |
130 | + Supplier supplier = supplierService.getSupplierByCode(supplierCode); | |
131 | + if (supplier != null) { | |
132 | + supplierName = supplier.getName(); | |
133 | + } | |
134 | + } | |
135 | + receiptHeader.setSupplierName(supplierName); | |
123 | 136 | receiptHeader.setCode(code); |
124 | 137 | receiptHeader.setFirstStatus(QuantityConstant.RECEIPT_HEADER_BUILD); |
125 | 138 | receiptHeader.setLastStatus(QuantityConstant.RECEIPT_HEADER_BUILD); |
... | ... | @@ -132,6 +145,33 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl<ReceiptHeaderMapper, R |
132 | 145 | |
133 | 146 | @Override |
134 | 147 | @Transactional |
148 | + public Result editReceiptHeader(ReceiptHeader receiptHeader) { | |
149 | + String companyCode = receiptHeader.getCompanyCode(); | |
150 | + String supplierCode = receiptHeader.getSupplierCode(); | |
151 | + String supplierName = null; | |
152 | + if (StringUtils.isNotEmpty(supplierCode)) { | |
153 | + Supplier supplier = supplierService.getSupplierByCode(supplierCode); | |
154 | + if (supplier == null) { | |
155 | + return Result.error("编辑失败, 没有找到供应商信息"); | |
156 | + } | |
157 | + supplierName = supplier.getName(); | |
158 | + } | |
159 | + if (!receiptHeaderService.updateById(receiptHeader)) { | |
160 | + throw new JeecgBootException("编辑失败,更新表单头失败"); | |
161 | + } | |
162 | + List<ReceiptDetail> receiptDetailList = receiptDetailService.selectByMainId(String.valueOf(receiptHeader.getId())); | |
163 | + for (ReceiptDetail receiptDetail : receiptDetailList) { | |
164 | + receiptDetail.setCompanyCode(companyCode); | |
165 | + receiptDetail.setSupplierName(supplierName); | |
166 | + if (!receiptDetailService.updateById(receiptDetail)) { | |
167 | + throw new JeecgBootException("编辑失败,更新表单详情失败"); | |
168 | + } | |
169 | + } | |
170 | + return Result.OK("编辑成功!"); | |
171 | + } | |
172 | + | |
173 | + @Override | |
174 | + @Transactional | |
135 | 175 | public String createReceiptCode(String receiptType) { |
136 | 176 | String code = null; |
137 | 177 | Date now = new Date(); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java
... | ... | @@ -1002,12 +1002,16 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
1002 | 1002 | if (!containerService.removeById(container.getId())) { |
1003 | 1003 | throw new JeecgBootException("完成平库出库,删除容器失败"); |
1004 | 1004 | } |
1005 | + } else { | |
1006 | + if (!containerService.updateLocationCodeAndStatus(containerCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_CONTAINER_EMPTY, | |
1007 | + QuantityConstant.STATUS_CONTAINER_FILL_EMPTY, warehouseCode)) { | |
1008 | + throw new JeecgBootException("完成平库出库,更新容器状态失败"); | |
1009 | + } ; | |
1005 | 1010 | } |
1006 | 1011 | // 设置库位容器编码为空值 |
1007 | - Location temp = new Location(); | |
1008 | - temp.setId(fromLocation.getId()); | |
1009 | - temp.setContainerCode(""); | |
1010 | - locationService.updateById(temp); | |
1012 | + if (!locationService.updateContainerCode(fromLocation.getCode(), QuantityConstant.EMPTY_STRING, warehouseCode)) { | |
1013 | + throw new JeecgBootException("完成平库出库,设置库位容器编码为空值失败"); | |
1014 | + } | |
1011 | 1015 | } |
1012 | 1016 | |
1013 | 1017 | if (!inventoryTransactionService.saveBatch(inventoryTransactionList)) { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/entity/ShipmentDetail.java
... | ... | @@ -56,6 +56,10 @@ public class ShipmentDetail implements Serializable { |
56 | 56 | @Excel(name = "货主编码", width = 15) |
57 | 57 | @ApiModelProperty(value = "货主编码") |
58 | 58 | private String companyCode; |
59 | + /** 客户名称 */ | |
60 | + @Excel(name = "客户名称", width = 15) | |
61 | + @ApiModelProperty(value = "客户名称") | |
62 | + private String customerName; | |
59 | 63 | /** 物料编码 */ |
60 | 64 | @Excel(name = "物料编码", width = 15) |
61 | 65 | @ApiModelProperty(value = "物料编码") |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/entity/ShipmentHeader.java
... | ... | @@ -73,6 +73,10 @@ public class ShipmentHeader implements Serializable { |
73 | 73 | @Excel(name = "客户编码", width = 15) |
74 | 74 | @ApiModelProperty(value = "客户编码") |
75 | 75 | private String customerCode; |
76 | + /** 客户名称 */ | |
77 | + @Excel(name = "客户名称", width = 15) | |
78 | + @ApiModelProperty(value = "客户名称") | |
79 | + private String customerName; | |
76 | 80 | /** 总数量 */ |
77 | 81 | @Excel(name = "总数量", width = 15) |
78 | 82 | @ApiModelProperty(value = "总数量") |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentDetailServiceImpl.java
... | ... | @@ -79,6 +79,7 @@ public class ShipmentDetailServiceImpl extends ServiceImpl<ShipmentDetailMapper, |
79 | 79 | String companyCode = shipmentHeader.getCompanyCode(); |
80 | 80 | String materialCode = shipmentDetail.getMaterialCode(); |
81 | 81 | String zoneCode = shipmentHeader.getZoneCode(); |
82 | + String customerName = shipmentHeader.getCustomerName(); | |
82 | 83 | Material material = materialService.getMaterialByCode(materialCode); |
83 | 84 | if (material == null) { |
84 | 85 | return Result.error("添加失败,没有找到物料信息," + materialCode); |
... | ... | @@ -86,6 +87,7 @@ public class ShipmentDetailServiceImpl extends ServiceImpl<ShipmentDetailMapper, |
86 | 87 | String materialName = material.getName(); |
87 | 88 | String materialSpec = material.getSpec(); |
88 | 89 | String materialUnit = material.getUnit(); |
90 | + shipmentDetail.setCustomerName(customerName); | |
89 | 91 | shipmentDetail.setShipmentCode(shipmentCode); |
90 | 92 | shipmentDetail.setWarehouseCode(warehouseCode); |
91 | 93 | shipmentDetail.setCompanyCode(companyCode); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentHeaderServiceImpl.java
... | ... | @@ -14,6 +14,8 @@ import javax.annotation.Resource; |
14 | 14 | import org.jeecg.common.api.vo.Result; |
15 | 15 | import org.jeecg.common.exception.JeecgBootException; |
16 | 16 | import org.jeecg.modules.wms.config.container.service.IContainerService; |
17 | +import org.jeecg.modules.wms.config.customer.entity.Customer; | |
18 | +import org.jeecg.modules.wms.config.customer.service.ICustomerService; | |
17 | 19 | import org.jeecg.modules.wms.config.location.entity.Location; |
18 | 20 | import org.jeecg.modules.wms.config.location.service.ILocationService; |
19 | 21 | import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService; |
... | ... | @@ -125,6 +127,8 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
125 | 127 | |
126 | 128 | @Resource |
127 | 129 | private IShipmentContainerAdviceService shipmentContainerAdviceService; |
130 | + @Resource | |
131 | + private ICustomerService customerService; | |
128 | 132 | |
129 | 133 | @Override |
130 | 134 | @Transactional(rollbackFor = Exception.class) |
... | ... | @@ -165,6 +169,15 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
165 | 169 | public Result editShipmentHeader(ShipmentHeader shipmentHeader) { |
166 | 170 | String companyCode = shipmentHeader.getCompanyCode(); |
167 | 171 | String zoneCode = shipmentHeader.getZoneCode(); |
172 | + String customerCode = shipmentHeader.getCustomerCode(); | |
173 | + String customerName = null; | |
174 | + if (StringUtils.isNotEmpty(customerCode)) { | |
175 | + Customer customer = customerService.getCustomerByCode(customerCode); | |
176 | + if (customer == null) { | |
177 | + return Result.error("编辑失败, 没有找到客户信息"); | |
178 | + } | |
179 | + customerName = customer.getName(); | |
180 | + } | |
168 | 181 | if (!shipmentHeaderService.updateById(shipmentHeader)) { |
169 | 182 | throw new JeecgBootException("编辑失败,更新表单头失败"); |
170 | 183 | } |
... | ... | @@ -172,6 +185,7 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
172 | 185 | for (ShipmentDetail shipmentDetail : shipmentDetailList) { |
173 | 186 | shipmentDetail.setZoneCode(zoneCode); |
174 | 187 | shipmentDetail.setCompanyCode(companyCode); |
188 | + shipmentDetail.setCustomerName(customerName); | |
175 | 189 | if (!shipmentDetailService.updateById(shipmentDetail)) { |
176 | 190 | throw new JeecgBootException("编辑失败,更新表单详情失败"); |
177 | 191 | } |
... | ... | @@ -202,6 +216,16 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
202 | 216 | if (StringUtils.isEmpty(code)) { |
203 | 217 | throw new JeecgBootException("根据出库单类型:" + shipmentHeader.getType() + ",生成单号失败"); |
204 | 218 | } |
219 | + String customerCode = shipmentHeader.getCustomerCode(); | |
220 | + String customerName = null; | |
221 | + if (StringUtils.isNotEmpty(customerCode)) { | |
222 | + Customer customer = customerService.getCustomerByCode(customerCode); | |
223 | + if (customer == null) { | |
224 | + return Result.error("出库单下发, 没有找到客户信息"); | |
225 | + } | |
226 | + customerName = customer.getName(); | |
227 | + } | |
228 | + shipmentHeader.setCustomerName(customerName); | |
205 | 229 | shipmentHeader.setCode(code); |
206 | 230 | shipmentHeader.setFirstStatus(QuantityConstant.RECEIPT_HEADER_BUILD); |
207 | 231 | shipmentHeader.setLastStatus(QuantityConstant.RECEIPT_HEADER_BUILD); |
... | ... | @@ -367,7 +391,6 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
367 | 391 | mergeShipmentHeader.setCustomerCode(mergeShipmentHeaderList.get(0).getCustomerCode()); |
368 | 392 | mergeShipmentHeader.setType(mergeShipmentHeaderList.get(0).getType()); |
369 | 393 | mergeShipmentHeader.setCompanyCode(mergeShipmentHeaderList.get(0).getCompanyCode()); |
370 | - mergeShipmentHeader.setCustomerCode(mergeShipmentHeaderList.get(0).getCustomerCode()); | |
371 | 394 | mergeShipmentHeader.setFirstStatus(QuantityConstant.SHIPMENT_HEADER_BUILD); |
372 | 395 | mergeShipmentHeader.setLastStatus(QuantityConstant.SHIPMENT_HEADER_BUILD); |
373 | 396 | mergeShipmentHeader.setTotalQty(mergeshipmentDetailList.stream().map(ShipmentDetail::getQty).reduce(BigDecimal.ZERO, BigDecimal::add)); |
... | ... |