| | |
| | | **/ |
| | | public class CarBlackWhiteDto extends PageDto implements Serializable { |
| | | |
| | | public static final String BLACK_WHITE_BLACK = "1111"; //黑名单 |
| | | public static final String BLACK_WHITE_WHITE = "2222"; //黑名单 |
| | | |
| | | private String blackWhite; |
| | | private String blackWhiteName; |
| | | private String carNum; |
| | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | |
| | | |
| | | |
| | | public String getBlackWhite() { |
| | |
| | | public void setValidity(String validity) { |
| | | this.validity = validity; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.java110.dto.machine; |
| | | |
| | | import com.java110.dto.PageDto; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | |
| | | private String communityId; |
| | | |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | |
| | | private String state; |
| | | |
| | | private String carType; |
| | | private String carTypeName; |
| | | |
| | | private String configId; |
| | | |
| | |
| | | public void setConfigId(String configId) { |
| | | this.configId = configId; |
| | | } |
| | | |
| | | @Override |
| | | public String getCarTypeName() { |
| | | return carTypeName; |
| | | } |
| | | |
| | | @Override |
| | | public void setCarTypeName(String carTypeName) { |
| | | this.carTypeName = carTypeName; |
| | | } |
| | | } |
| | |
| | | |
| | | private String carType; |
| | | |
| | | private String carTypeName; |
| | | |
| | | public String getDetailId() { |
| | | return detailId; |
| | | } |
| | |
| | | public void setCarType(String carType) { |
| | | this.carType = carType; |
| | | } |
| | | |
| | | public String getCarTypeName() { |
| | | return carTypeName; |
| | | } |
| | | |
| | | public void setCarTypeName(String carTypeName) { |
| | | this.carTypeName = carTypeName; |
| | | } |
| | | } |
| | |
| | | <!-- 保存车辆进出明细信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveCarInoutDetailInfo" parameterType="Map"> |
| | | insert into car_inout_detail( |
| | | inout_id,machine_id,machine_code,car_inout,pa_id,detail_id,car_num,community_id,remark,state,car_type |
| | | inout_id,machine_id,machine_code,car_inout,pa_id,detail_id,car_num,community_id,remark,state,car_type,car_type_name |
| | | ) values ( |
| | | #{inoutId},#{machineId},#{machineCode},#{carInout},#{paId},#{detailId},#{carNum},#{communityId},#{remark},#{state},#{carType} |
| | | #{inoutId},#{machineId},#{machineCode},#{carInout},#{paId},#{detailId},#{carNum},#{communityId},#{remark},#{state},#{carType},#{carTypeName} |
| | | ) |
| | | </insert> |
| | | |
| | |
| | | machineCode,t.car_inout,t.car_inout carInout,t.pa_id,t.pa_id paId,t.detail_id,t.detail_id |
| | | detailId,t.car_num,t.car_num carNum,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId,t.state, |
| | | ci.in_time inTime,ci.out_time outTime,max(cip.real_charge) realCharge,ci.pa_id paId,td.name stateName,t.remark,t.car_type carType |
| | | ,pa.num areaNum,tcfc.fee_name feeName,tcfc.config_id configId,td2.`name` carTypeName |
| | | ,pa.num areaNum,tcfc.fee_name feeName,tcfc.config_id configId,t.car_type_name carTypeName |
| | | from car_inout_detail t |
| | | left join car_inout ci on t.inout_id = ci.inout_id and ci.status_cd = '0' and t.community_id = ci.community_id |
| | | left join car_inout_payment cip on cip.inout_id = ci.inout_id and cip.community_id = ci.community_id |
| | | left join t_dict td on t.state = td.status_cd and td.table_columns='state' and td.table_name = 'car_inout' |
| | | left join parking_area pa on ci.pa_id = pa.pa_id and pa.status_cd = '0' |
| | | left join temp_car_fee_config tcfc on pa.pa_id = tcfc.pa_id and tcfc.status_cd = '0' |
| | | LEFT JOIN t_dict td2 on t.car_type = td2.status_cd and td2.table_name = 'owner_car' and td2.table_columns = 'lease_type' |
| | | where 1 =1 |
| | | <if test="inoutId !=null and inoutId != ''"> |
| | | and t.inout_id= #{inoutId} |
| | |
| | | and t.create_time < #{endTime} |
| | | </if> |
| | | group by t.inout_id,t.machine_id,t.machine_code,t.car_inout,t.pa_id,t.detail_id,t.car_num,t.status_cd,t.community_id, |
| | | ci.in_time ,ci.out_time ,ci.pa_id ,td.name,t.remark,pa.num ,tcfc.fee_name ,tcfc.config_id,t.create_time,td2.name,td.name,t.state,t.car_type |
| | | ci.in_time ,ci.out_time ,ci.pa_id ,td.name,t.remark,pa.num ,tcfc.fee_name ,tcfc.config_id,t.create_time,t.car_type_name,td.name,t.state,t.car_type |
| | | order by t.create_time desc |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | |
| | | <if test="carType !=null and carType != ''"> |
| | | , t.car_type= #{carType} |
| | | </if> |
| | | <if test="carTypeName !=null and carTypeName != ''"> |
| | | , t.car_type_name= #{carTypeName} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | , t.community_id= #{communityId} |
| | | </if> |
| | |
| | | <select id="getCarInoutInfo" parameterType="Map" resultType="Map"> |
| | | select t.in_time,t.in_time inTime,t.inout_id,t.inout_id inoutId,t.pa_id,t.pa_id paId,t.car_num,t.car_num |
| | | carNum,t.status_cd,t.status_cd statusCd,t.state,t.community_id,t.community_id communityId,t.out_time,t.out_time |
| | | outTime,td.`name` stateName,pa.num areaNum,tcfc.fee_name feeName,tcfc.config_id configId,max(cid.car_type) carType,max(td2.`name`) carTypeName |
| | | outTime,td.`name` stateName,pa.num areaNum,tcfc.fee_name feeName,tcfc.config_id configId,max(cid.car_type) carType,max(cid.car_type_name) carTypeName |
| | | from car_inout t |
| | | LEFT JOIN car_inout_detail cid on t.inout_id = cid.inout_id and cid.status_cd = '0' and cid.state in ('100300','100400','100600') |
| | | left join t_dict td on t.state = td.status_cd and td.table_columns='state' and td.table_name = 'car_inout' |
| | | left join parking_area pa on t.pa_id = pa.pa_id and pa.status_cd = '0' |
| | | left join temp_car_fee_config tcfc on pa.pa_id = tcfc.pa_id and tcfc.status_cd = '0' |
| | | LEFT JOIN t_dict td2 on cid.car_type = td2.status_cd and td2.table_name = 'owner_car' and td2.table_columns = 'lease_type' |
| | | where 1 =1 |
| | | <if test="inTime !=null and inTime != ''"> |
| | | and t.in_time= #{inTime} |
| | |
| | | import com.java110.dto.fee.FeeAttrDto; |
| | | import com.java110.dto.fee.FeeConfigDto; |
| | | import com.java110.dto.fee.FeeDto; |
| | | import com.java110.dto.machine.CarBlackWhiteDto; |
| | | import com.java110.dto.machine.CarInoutDetailDto; |
| | | import com.java110.dto.machine.CarInoutDto; |
| | | import com.java110.dto.machine.MachineDto; |
| | |
| | | import com.java110.intf.fee.IFeeInnerServiceSMO; |
| | | import com.java110.intf.fee.ITempCarFeeConfigInnerServiceSMO; |
| | | import com.java110.intf.user.IBuildingOwnerV1InnerServiceSMO; |
| | | import com.java110.intf.user.ICarBlackWhiteV1InnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerCarInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerCarV1InnerServiceSMO; |
| | | import com.java110.po.car.CarInoutDetailPo; |
| | |
| | | @Autowired |
| | | private IParkingBoxAreaV1InnerServiceSMO parkingBoxAreaV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private ICarBlackWhiteV1InnerServiceSMO carBlackWhiteV1InnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | Assert.hasKeyAndValue(reqJson, "machineCode", "必填,请填写设备编码"); |
| | |
| | | |
| | | //是否是临时车 |
| | | String tempCar = OwnerCarDto.LEASE_TYPE_TEMP; |
| | | String tempCarName ="临时车"; |
| | | |
| | | |
| | | //查询设备信息 |
| | |
| | | //说明是临时车 |
| | | if (ownerCarDtos == null || ownerCarDtos.size() == 0) { |
| | | tempCar = CAR_TYPE_NO_DATA; |
| | | tempCarName = "临时车"; |
| | | } else { |
| | | reqJson.put("carId", ownerCarDtos.get(0).getCarId()); |
| | | tempCar = ownerCarDtos.get(0).getLeaseType(); |
| | | tempCarName = ownerCarDtos.get(0).getLeaseTypeName(); |
| | | } |
| | | |
| | | |
| | | //进场处理 |
| | | if (MachineDto.DIRECTION_IN.equals(machineDtos.get(0).getDirection())) { |
| | | carIn(reqJson, machineDtos.get(0), tempCar); |
| | | carIn(reqJson, machineDtos.get(0), tempCar,tempCarName); |
| | | } else { |
| | | carOut(reqJson, machineDtos.get(0), tempCar); |
| | | carOut(reqJson, machineDtos.get(0), tempCar,tempCarName); |
| | | } |
| | | |
| | | } |
| | |
| | | * @param machineDto |
| | | * @param tempCar |
| | | */ |
| | | private void carOut(JSONObject reqJson, MachineDto machineDto, String tempCar) { |
| | | private void carOut(JSONObject reqJson, MachineDto machineDto, String tempCar,String tempCarName) { |
| | | |
| | | String state = CarInoutDto.STATE_OUT; |
| | | //进场失败记录 |
| | |
| | | carInoutDetailPo.setPaId(carInoutDtos.get(0).getPaId()); |
| | | carInoutDetailPo.setRemark(reqJson.getString("remark")); |
| | | carInoutDetailPo.setState(state); |
| | | carInoutDetailPo.setCarType(CAR_TYPE_NO_DATA.equals(tempCar) ? OwnerCarDto.LEASE_TYPE_TEMP : tempCar + ""); |
| | | if(CAR_TYPE_NO_DATA.equals(tempCar)){ |
| | | carInoutDetailPo.setCarType(OwnerCarDto.LEASE_TYPE_TEMP); |
| | | carInoutDetailPo.setCarTypeName(OwnerCarDto.LEASE_TYPE_TEMP); |
| | | //检查是否为黑白名单 |
| | | CarBlackWhiteDto carBlackWhiteDto = new CarBlackWhiteDto(); |
| | | carBlackWhiteDto.setCarNum(reqJson.getString("carNum")); |
| | | carBlackWhiteDto.setPaId(carInoutDtos.get(0).getPaId()); |
| | | carBlackWhiteDto.setValidity("Y"); |
| | | List<CarBlackWhiteDto> carBlackWhiteDtos = carBlackWhiteV1InnerServiceSMOImpl.queryCarBlackWhites(carBlackWhiteDto); |
| | | if(carBlackWhiteDtos != null && carBlackWhiteDtos.size() >0 ){ |
| | | if(CarBlackWhiteDto.BLACK_WHITE_BLACK.equals(carBlackWhiteDtos.get(0).getBlackWhite())){ |
| | | carInoutDetailPo.setCarType("B"); |
| | | carInoutDetailPo.setCarTypeName("黑名单"); |
| | | }else{ |
| | | carInoutDetailPo.setCarType("W"); |
| | | carInoutDetailPo.setCarTypeName("白名单"); |
| | | } |
| | | } |
| | | }else{ |
| | | carInoutDetailPo.setCarType(tempCar); |
| | | carInoutDetailPo.setCarTypeName(tempCarName); |
| | | } |
| | | int flag = carInoutDetailV1InnerServiceSMOImpl.saveCarInoutDetail(carInoutDetailPo); |
| | | |
| | | if (flag < 1) { |
| | |
| | | * @param machineDto |
| | | * @param tempCar |
| | | */ |
| | | private void carIn(JSONObject reqJson, MachineDto machineDto, String tempCar) { |
| | | private void carIn(JSONObject reqJson, MachineDto machineDto, String tempCar,String tempCarName) { |
| | | String state = CarInoutDto.STATE_IN; |
| | | //进场失败记录 |
| | | if (reqJson.containsKey("state") && "5".equals(reqJson.getString("state"))) { |
| | |
| | | carInoutDetailPo.setPaId(paId); |
| | | carInoutDetailPo.setState(state); |
| | | carInoutDetailPo.setRemark(reqJson.getString("remark")); |
| | | carInoutDetailPo.setCarType(CAR_TYPE_NO_DATA.equals(tempCar)?OwnerCarDto.LEASE_TYPE_TEMP:tempCar); |
| | | if(CAR_TYPE_NO_DATA.equals(tempCar)){ |
| | | carInoutDetailPo.setCarType(OwnerCarDto.LEASE_TYPE_TEMP); |
| | | carInoutDetailPo.setCarTypeName(OwnerCarDto.LEASE_TYPE_TEMP); |
| | | //检查是否为黑白名单 |
| | | CarBlackWhiteDto carBlackWhiteDto = new CarBlackWhiteDto(); |
| | | carBlackWhiteDto.setCarNum(reqJson.getString("carNum")); |
| | | carBlackWhiteDto.setPaId(paId); |
| | | carBlackWhiteDto.setValidity("Y"); |
| | | List<CarBlackWhiteDto> carBlackWhiteDtos = carBlackWhiteV1InnerServiceSMOImpl.queryCarBlackWhites(carBlackWhiteDto); |
| | | if(carBlackWhiteDtos != null && carBlackWhiteDtos.size() >0 ){ |
| | | if(CarBlackWhiteDto.BLACK_WHITE_BLACK.equals(carBlackWhiteDtos.get(0).getBlackWhite())){ |
| | | carInoutDetailPo.setCarType("B"); |
| | | carInoutDetailPo.setCarTypeName("黑名单"); |
| | | }else{ |
| | | carInoutDetailPo.setCarType("W"); |
| | | carInoutDetailPo.setCarTypeName("白名单"); |
| | | } |
| | | } |
| | | }else{ |
| | | carInoutDetailPo.setCarType(tempCar); |
| | | carInoutDetailPo.setCarTypeName(tempCarName); |
| | | } |
| | | flag = carInoutDetailV1InnerServiceSMOImpl.saveCarInoutDetail(carInoutDetailPo); |
| | | |
| | | if (flag < 1) { |
| | |
| | | Assert.jsonObjectHaveKey(reqJson, "carColor", "未包含carColor"); |
| | | Assert.jsonObjectHaveKey(reqJson, "psId", "未包含psId"); |
| | | Assert.jsonObjectHaveKey(reqJson, "storeId", "未包含storeId"); |
| | | Assert.jsonObjectHaveKey(reqJson, "carNumType", "未包含carNumType"); |
| | | |
| | | Assert.hasLength(reqJson.getString("communityId"), "小区ID不能为空"); |
| | | Assert.hasLength(reqJson.getString("ownerId"), "ownerId不能为空"); |