| | |
| | | import com.java110.dto.community.CommunityDto; |
| | | import com.java110.intf.community.ICommunityInnerServiceSMO; |
| | | import com.java110.intf.fee.IReportFeeInnerServiceSMO; |
| | | import com.java110.po.fee.PayFeePo; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.vo.FeeQueryParams; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | int startYear = 2020; |
| | | CommunityDto communityDto = new CommunityDto(); |
| | | communityDto.setCommunityId(reqJson.getString("communityId")); |
| | | List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto); |
| | | FeeQueryParams feeQueryParams = new FeeQueryParams(); |
| | | feeQueryParams.setCommunityId(reqJson.getString("communityId")); |
| | | feeQueryParams.setStartYear(communityDtos.get(0).getCreateTime().getYear()); |
| | | feeQueryParams.setStartYear(startYear); |
| | | int currentYear = java.time.Year.now().getValue(); |
| | | feeQueryParams.setEndYear(currentYear + 2); |
| | | List<Map> result = reportFeeInnerServiceSMOImpl.repostPaidInFee(feeQueryParams); |
| | | context.setResponseEntity(new ResponseEntity<>(result, HttpStatus.OK)); |
| | | |
| | | int endYear = feeQueryParams.getEndYear(); |
| | | double[][] reports = new double[22 * (endYear - startYear)][endYear - startYear + 1]; |
| | | for(int j = 0 ; j < result.size() ; j++){ |
| | | for (int i = startYear; i <= endYear; i++) { |
| | | reports[j][i-startYear] = (double) result.get(j).get(i+"年收费金额(元)"); |
| | | } |
| | | } |
| | | ResultVo resultVo = new ResultVo(reports); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | } |