Blame view

src/main/java/com/huaheng/pc/u8/service/ICSShipmentHeaderServiceImpl.java 6.56 KB
1
2
package com.huaheng.pc.u8.service;
周鸿 authored
3
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
import com.huaheng.common.utils.DateUtils;
周鸿 authored
6
7
import com.huaheng.common.utils.StringUtils;
import com.huaheng.common.utils.Wrappers;
8
9
import com.huaheng.pc.config.company.domain.CompanyU8;
import com.huaheng.pc.config.company.service.CompanyU8Service;
周鸿 authored
10
import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader;
11
12
13
14
import com.huaheng.pc.u8.domain.ICSShipmentHeader;
import com.huaheng.pc.u8.mapper.ICSShipmentHeaderMapper;
import org.springframework.stereotype.Service;
15
16
import javax.annotation.Resource;
17
18
19
20
21
22
23
24
25
/**
 * 出库下发或回传单主 服务层实现
 *
 * @author huaheng
 * @date 2018-12-17
 */
@Service
public class ICSShipmentHeaderServiceImpl extends ServiceImpl<ICSShipmentHeaderMapper,ICSShipmentHeader> implements ICSShipmentHeaderService {
26
27
28
    @Resource
    private CompanyU8Service companyU8Service;
周鸿 authored
29
30
31
32
33
34
35
36
    @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);
    }
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

    @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()));
tongzhonghao authored
54
        sh.setCMaker(header.getLastUpdatedBy());
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
        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()));
tongzhonghao authored
77
        sh.setCMaker(header.getLastUpdatedBy());
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
        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());
93
        sh.setCVenCode(header.getSupplierCode());
94
        sh.setCBusType("普通采购");
95
        sh.setType(header.getShipmentType());
96
97
98
99
100
        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");
tongzhonghao authored
101
        sh.setCMemo(header.getLastUpdatedBy());
102
        sh.setCDepCode(header.getDeptCode());
103
104
105
106
107
108
109
110
111
112
113
114
115
116
        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());
117
118
119
120
121
122
123
124
        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());
125
        sh.setDPODate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,DateUtils.getNowDate()));
126
        sh.setDDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,DateUtils.getNowDate()));
127
        sh.setCModifyDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,DateUtils.getNowDate()));
tongzhonghao authored
128
        sh.setCMaker(header.getLastUpdatedBy());
129
130
131
132
133
134
135
136
137
138
        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");
139
140
141
        sh.setVoucherType("CreateICSRdRecord_32");
        return sh;
    }
142
}