java110
2021-09-03 cddcf22a61489ee9c2dfee169d817ccd66f95430
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
package com.java110.report.bmo.reportInfoAnswerValue.impl;
 
import com.java110.intf.report.IReportInfoAnswerValueInnerServiceSMO;
import com.java110.report.bmo.reportInfoAnswerValue.IGetReportInfoAnswerValueBMO;
import com.java110.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import com.java110.dto.reportInfoAnswerValue.ReportInfoAnswerValueDto;
 
import java.util.ArrayList;
import java.util.List;
 
@Service("getReportInfoAnswerValueBMOImpl")
public class GetReportInfoAnswerValueBMOImpl implements IGetReportInfoAnswerValueBMO {
 
    @Autowired
    private IReportInfoAnswerValueInnerServiceSMO reportInfoAnswerValueInnerServiceSMOImpl;
 
    /**
     *
     *
     * @param  reportInfoAnswerValueDto
     * @return 订单服务能够接受的报文
     */
    public ResponseEntity<String> get(ReportInfoAnswerValueDto reportInfoAnswerValueDto) {
 
 
        int count = reportInfoAnswerValueInnerServiceSMOImpl.queryReportInfoAnswerValuesCount(reportInfoAnswerValueDto);
 
        List<ReportInfoAnswerValueDto> reportInfoAnswerValueDtos = null;
        if (count > 0) {
            reportInfoAnswerValueDtos = reportInfoAnswerValueInnerServiceSMOImpl.queryReportInfoAnswerValues(reportInfoAnswerValueDto);
        } else {
            reportInfoAnswerValueDtos = new ArrayList<>();
        }
 
        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reportInfoAnswerValueDto.getRow()), count, reportInfoAnswerValueDtos);
 
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
 
        return responseEntity;
    }
 
}