| | |
| | | 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.common.ICarInoutPaymentV1InnerServiceSMO; |
| | | import com.java110.intf.community.IParkingBoxAreaV1InnerServiceSMO; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | 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; |
| | |
| | | * // 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 |
| | | private ICarInoutPaymentV1InnerServiceSMO carInoutPaymentV1InnerServiceSMOImpl; |
| | | @Autowired |
| | | private IParkingBoxAreaV1InnerServiceSMO parkingBoxAreaV1InnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | CarInoutPaymentDto carInoutPaymentDto = BeanConvertUtil.covertBean(reqJson, CarInoutPaymentDto.class); |
| | | |
| | | carInoutPaymentDto.setPaIds(getPaIds(reqJson)); |
| | | int count = carInoutPaymentV1InnerServiceSMOImpl.queryCarInoutPaymentsCount(carInoutPaymentDto); |
| | | |
| | | List<CarInoutPaymentDto> carInoutPaymentDtos = null; |
| | |
| | | |
| | | cmdDataFlowContext.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | |
| | | private String[] getPaIds(JSONObject reqJson) { |
| | | if (reqJson.containsKey("boxId") && !StringUtil.isEmpty(reqJson.getString("boxId"))) { |
| | | ParkingBoxAreaDto parkingBoxAreaDto = new ParkingBoxAreaDto(); |
| | | parkingBoxAreaDto.setBoxId(reqJson.getString("boxId")); |
| | | parkingBoxAreaDto.setCommunityId(reqJson.getString("communityId")); |
| | | List<ParkingBoxAreaDto> parkingBoxAreaDtos = parkingBoxAreaV1InnerServiceSMOImpl.queryParkingBoxAreas(parkingBoxAreaDto); |
| | | |
| | | if (parkingBoxAreaDtos == null || parkingBoxAreaDtos.size() < 1) { |
| | | throw new CmdException("未查到停车场信息"); |
| | | } |
| | | List<String> paIds = new ArrayList<>(); |
| | | for (ParkingBoxAreaDto parkingBoxAreaDto1 : parkingBoxAreaDtos) { |
| | | paIds.add(parkingBoxAreaDto1.getPaId()); |
| | | } |
| | | String[] paIdss = paIds.toArray(new String[paIds.size()]); |
| | | return paIdss; |
| | | } |
| | | return null; |
| | | } |
| | | } |