chengf
2026-01-16 d5b6bebe835f1597f227409feced749dbe811fc1
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
package com.java110.fee.bmo.importFeeDetail.impl;
 
import com.java110.dto.importData.ImportFeeDetailDto;
import com.java110.fee.bmo.importFeeDetail.IGetImportFeeDetailBMO;
import com.java110.intf.fee.IImportFeeDetailInnerServiceSMO;
import com.java110.po.importFee.MaintenancePayment;
import com.java110.po.importFee.MpFifthPaymentRecord;
import com.java110.po.importFee.MpPaymentRecord;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.vo.ResultVo;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
 
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
 
@Service("getImportFeeDetailBMOImpl")
public class GetImportFeeDetailBMOImpl implements IGetImportFeeDetailBMO {
 
    @Autowired
    private IImportFeeDetailInnerServiceSMO importFeeDetailInnerServiceSMOImpl;
 
 
    @Autowired
    private SqlSessionTemplate  sqlSessionTemplate;
    /**
     * @param importFeeDetailDto
     * @return 订单服务能够接受的报文
     */
    public ResponseEntity<String> get(ImportFeeDetailDto importFeeDetailDto) {
 
 
        int count = importFeeDetailInnerServiceSMOImpl.queryImportFeeDetailsCount(importFeeDetailDto);
 
        List<ImportFeeDetailDto> importFeeDetailDtos = null;
        if (count > 0) {
            importFeeDetailDtos = importFeeDetailInnerServiceSMOImpl.queryImportFeeDetails(importFeeDetailDto);
        } else {
            importFeeDetailDtos = new ArrayList<>();
        }
 
        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) importFeeDetailDto.getRow()), count, importFeeDetailDtos);
 
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
 
        return responseEntity;
    }
 
    @Override
    public ResponseEntity<String> get(MaintenancePayment importFeeDetailDto) {
 
 
        int count = importFeeDetailInnerServiceSMOImpl.queryImportFeeDetailsCount(importFeeDetailDto);
 
        List<MaintenancePayment> importFeeDetailDtos = null;
        if (count > 0) {
            importFeeDetailDtos = importFeeDetailInnerServiceSMOImpl.queryImportFeeDetails(importFeeDetailDto);
        } else {
            importFeeDetailDtos = new ArrayList<>();
        }
 
        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) importFeeDetailDto.getRow()), count, importFeeDetailDtos);
 
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
 
        return responseEntity;
    }
 
    @Override
    public ResponseEntity<String> get(MpPaymentRecord importFeeDetailDto) {
 
 
        int count = importFeeDetailInnerServiceSMOImpl.queryImportFeeDetailsCount(importFeeDetailDto);
 
        List<MpPaymentRecord> importFeeDetailDtos = null;
        if (count > 0) {
            importFeeDetailDtos = importFeeDetailInnerServiceSMOImpl.queryImportFeeDetails(importFeeDetailDto);
        } else {
            importFeeDetailDtos = new ArrayList<>();
        }
 
        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) importFeeDetailDto.getRow()), count, importFeeDetailDtos);
 
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
 
        return responseEntity;
    }
 
    @Override
    public ResponseEntity<String> get(MpFifthPaymentRecord importFeeDetailDto) {
 
 
        int count = importFeeDetailInnerServiceSMOImpl.queryImportFeeDetailsCount(importFeeDetailDto);
 
        List<MpFifthPaymentRecord> importFeeDetailDtos = null;
        if (count > 0) {
            importFeeDetailDtos = importFeeDetailInnerServiceSMOImpl.queryImportFeeDetails(importFeeDetailDto);
        } else {
            importFeeDetailDtos = new ArrayList<>();
        }
 
        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) importFeeDetailDto.getRow()), count, importFeeDetailDtos);
 
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
 
        return responseEntity;
    }
 
    @Override
    public ResponseEntity<String> queryMpPaymentRecordAll(MpPaymentRecord mpPaymentRecordDto) {
        // 1. 把 MpPaymentRecord 的 mpId(String)转成 Long,封装成 MaintenancePayment
        MaintenancePayment maintenancePayment = new MaintenancePayment();
        maintenancePayment.setId(mpPaymentRecordDto.getMpId());
 
        // 2. 调用服务层统计方法(参数是 MaintenancePayment)
        int count = importFeeDetailInnerServiceSMOImpl.queryImportFeeDetailsCount(maintenancePayment);
 
        Object importFeeDetailDtos = null;
        if (count > 0) {
            // 3. 核心错误点:调用服务层 queryMpPaymentRecordAll 时传入了 MaintenancePayment
            //    但服务层接口定义的该方法参数可能不是 MaintenancePayment,导致找不到方法(404)
 
            importFeeDetailDtos = sqlSessionTemplate.selectList("mpFifthPaymentRecordServiceDaoImpl.queryMpPaymentRecordAll", BeanConvertUtil.beanCovertMap(maintenancePayment));
        } else {
            importFeeDetailDtos = new Object();
        }
 
        // 4. 潜在问题:mpPaymentRecordDto.getRow() 可能为 null/0,导致分页计算异常
        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) mpPaymentRecordDto.getRow()), count, importFeeDetailDtos);
 
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
        return responseEntity;
    }
 
}