| | |
| | | import com.java110.intf.community.IParkingBoxAreaV1InnerServiceSMO; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.slf4j.Logger; |
| | |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | CarInoutPaymentDto carInoutPaymentDto = BeanConvertUtil.covertBean(reqJson, CarInoutPaymentDto.class); |
| | | carInoutPaymentDto.setPaIds(getPaIds(reqJson)); |
| | | if(reqJson.containsKey("boxId")) { |
| | | carInoutPaymentDto.setPaIds(getPaIds(reqJson)); |
| | | }else{ |
| | | carInoutPaymentDto.setPaId(reqJson.getString("paId")); |
| | | } |
| | | |
| | | if(!StringUtil.isEmpty(carInoutPaymentDto.getEndTime())){ |
| | | Date endTime = DateUtil.getDateFromStringB(carInoutPaymentDto.getEndTime()); |
| | | carInoutPaymentDto.setEndTime(DateUtil.getAddDayStringB(endTime,1)); |
| | | } |
| | | |
| | | int count = carInoutPaymentV1InnerServiceSMOImpl.queryCarInoutPaymentsCount(carInoutPaymentDto); |
| | | |
| | | List<CarInoutPaymentDto> carInoutPaymentDtos = null; |
| | |
| | | carInoutPaymentDtos = new ArrayList<>(); |
| | | } |
| | | |
| | | if(carInoutPaymentDtos != null && carInoutPaymentDtos.size()>0){ |
| | | List<CarInoutPaymentDto> tempCarInoutPaymentDtos = carInoutPaymentV1InnerServiceSMOImpl.queryCarInoutPaymentMarjor(carInoutPaymentDto); |
| | | for(CarInoutPaymentDto carInoutPaymentDto1: carInoutPaymentDtos){ |
| | | carInoutPaymentDto1.setPayChargeTotal(tempCarInoutPaymentDtos.get(0).getPayChargeTotal()); |
| | | carInoutPaymentDto1.setRealChargeTotal(tempCarInoutPaymentDtos.get(0).getRealChargeTotal()); |
| | | } |
| | | }else{ |
| | | for(CarInoutPaymentDto carInoutPaymentDto1: carInoutPaymentDtos){ |
| | | carInoutPaymentDto1.setPayChargeTotal("0"); |
| | | carInoutPaymentDto1.setRealChargeTotal("0"); |
| | | } |
| | | } |
| | | |
| | | |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, carInoutPaymentDtos); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |