ICSShipmentHeaderServiceImpl.java
6.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
package com.huaheng.pc.u8.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huaheng.common.utils.DateUtils;
import com.huaheng.common.utils.StringUtils;
import com.huaheng.common.utils.Wrappers;
import com.huaheng.pc.config.company.domain.CompanyU8;
import com.huaheng.pc.config.company.service.CompanyU8Service;
import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader;
import com.huaheng.pc.u8.domain.ICSShipmentHeader;
import com.huaheng.pc.u8.mapper.ICSShipmentHeaderMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* 出库下发或回传单主 服务层实现
*
* @author huaheng
* @date 2018-12-17
*/
@Service
public class ICSShipmentHeaderServiceImpl extends ServiceImpl<ICSShipmentHeaderMapper,ICSShipmentHeader> implements ICSShipmentHeaderService {
@Resource
private CompanyU8Service companyU8Service;
@Override
public ICSShipmentHeader selectModel(ICSShipmentHeader condition) {
LambdaQueryWrapper<ICSShipmentHeader> lambdaQueryWrapper = Wrappers.lambdaQuery();
lambdaQueryWrapper.eq(StringUtils.isNotEmpty(condition.getCDLCode()),ICSShipmentHeader::getCDLCode,condition.getCDLCode());
lambdaQueryWrapper.eq(StringUtils.isNotEmpty(condition.getCSCName()),ICSShipmentHeader::getCSCName,condition.getCSCName());
lambdaQueryWrapper.last("limit 1");
return this.getOne(lambdaQueryWrapper);
}
@Override
public ICSShipmentHeader getHeaderByMO(ShipmentHeader header) {
String warehouseCode = header.getWarehouseCode();
header.getCompanyCode();
CompanyU8 companyU8 = companyU8Service.getCompanyU8ByCode(header.getCompanyCode(), header.getWarehouseCode());
ICSShipmentHeader sh = new ICSShipmentHeader();
sh.setReferCode(header.getReferCode());
sh.setReferId(header.getReferId());
sh.setCCode(header.getReferCode());
sh.setCompanyCode(companyU8.getUCompanyCode());
sh.setCWHCode(header.getUWarehouseCode());
sh.setCRDName("生产领料");
sh.setCBusType("领料");
sh.setID(header.getReferId());
sh.setDDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,DateUtils.getNowDate()));
sh.setCModifyDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,DateUtils.getNowDate()));
sh.setCMaker(header.getLastUpdatedBy());
sh.setType("MO");
// sh.setCMemo();
sh.setVoucherType("UpdateICSRdRecord_11_Confirm");
return sh;
}
@Override
public ICSShipmentHeader getHeaderByOO(ShipmentHeader header) {
String warehouseCode = header.getWarehouseCode();
header.getCompanyCode();
CompanyU8 companyU8 = companyU8Service.getCompanyU8ByCode(header.getCompanyCode(), header.getWarehouseCode());
ICSShipmentHeader sh = new ICSShipmentHeader();
sh.setReferCode(header.getReferCode());
sh.setReferId(header.getReferId());
sh.setCCode(header.getReferCode());
sh.setCompanyCode(companyU8.getUCompanyCode());
sh.setCWHCode(header.getUWarehouseCode());
sh.setCWHCode(header.getUWarehouseCode());
sh.setCBusType("普通采购");
sh.setID(header.getId());
sh.setDPODate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,DateUtils.getNowDate()));
sh.setCModifyDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,DateUtils.getNowDate()));
sh.setCMaker(header.getLastUpdatedBy());
sh.setVoucherType("CreateICSRdRecord_01");
return sh;
}
@Override
public ICSShipmentHeader getHeaderByPRO(ShipmentHeader header) {
String warehouseCode = header.getWarehouseCode();
header.getCompanyCode();
CompanyU8 companyU8 = companyU8Service.getCompanyU8ByCode(header.getCompanyCode(), header.getWarehouseCode());
ICSShipmentHeader sh = new ICSShipmentHeader();
sh.setReferCode(header.getReferCode());
sh.setReferId(header.getReferId());
sh.setCCode(header.getReferCode());
sh.setCompanyCode(companyU8.getUCompanyCode());
sh.setCWHCode(header.getUWarehouseCode());
sh.setCVenCode(header.getSupplierCode());
sh.setCBusType("普通采购");
sh.setType(header.getShipmentType());
sh.setID(header.getId());
sh.setDPODate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,DateUtils.getNowDate()));
sh.setCModifyDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,DateUtils.getNowDate()));
sh.setCMaker(header.getCreatedBy());
sh.setVoucherType("CreateICSRdRecord_01_Return");
sh.setCMemo(header.getLastUpdatedBy());
sh.setCDepCode(header.getDeptCode());
return sh;
}
@Override
public ICSShipmentHeader getHeaderBySO(ShipmentHeader header) {
String warehouseCode = header.getWarehouseCode();
header.getCompanyCode();
CompanyU8 companyU8 = companyU8Service.getCompanyU8ByCode(header.getCompanyCode(), header.getWarehouseCode());
ICSShipmentHeader sh = new ICSShipmentHeader();
sh.setReferCode(header.getReferCode());
sh.setReferId(header.getReferId());
sh.setCCode(header.getReferCode());
sh.setCompanyCode(companyU8.getUCompanyCode());
sh.setCWHCode(header.getUWarehouseCode());
sh.setCCusCode(header.getCustomerCode());
sh.setCCusName(header.getCustomerName());
sh.setCDLCode(header.getReferCode());
sh.setCDepCode(header.getDeptCode());
sh.setCMemo(header.getShipmentNote());
sh.setCBusType("普通销售");
sh.setCSTName("普通销售");
sh.setID(header.getReferId());
sh.setDPODate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,DateUtils.getNowDate()));
sh.setDDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,DateUtils.getNowDate()));
sh.setCModifyDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,DateUtils.getNowDate()));
sh.setCMaker(header.getLastUpdatedBy());
sh.setDLID(header.getReferId());
sh.setSendName(header.getSendName());
sh.setSendMobile(header.getSendMobile());
sh.setSendCompany(header.getSendCompany());
sh.setSendAddr(header.getSendAddr());
sh.setRecName(header.getRecName());
sh.setRecMobile(header.getRecMobile());
sh.setRecCompany(header.getRecCompany());
sh.setRecAddr(header.getRecAddr());
sh.setType("SO");
sh.setVoucherType("CreateICSRdRecord_32");
return sh;
}
}