| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.AbstractServiceCmdListener; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.dto.carInoutPayment.CarInoutPaymentDto; |
| | | import com.java110.dto.parkingBoxArea.ParkingBoxAreaDto; |
| | |
| | | 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.slf4j.LoggerFactory; |
| | | import com.java110.core.log.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | |
| | | * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行 |
| | | */ |
| | | @Java110Cmd(serviceCode = "carInoutPayment.listCarInoutPayment") |
| | | public class ListCarInoutPaymentCmd extends AbstractServiceCmdListener { |
| | | public class ListCarInoutPaymentCmd extends Cmd { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(ListCarInoutPaymentCmd.class); |
| | | @Autowired |
| | |
| | | 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); |