| | |
| | | private long min; |
| | | |
| | | private String carType; |
| | | private String carTypeName; |
| | | |
| | | |
| | | private Date createTime; |
| | |
| | | public void setOldCarNum(String oldCarNum) { |
| | | this.oldCarNum = oldCarNum; |
| | | } |
| | | |
| | | public String getCarTypeName() { |
| | | return carTypeName; |
| | | } |
| | | |
| | | public void setCarTypeName(String carTypeName) { |
| | | this.carTypeName = carTypeName; |
| | | } |
| | | } |
| | |
| | | public static final String LEASE_TYPE_INNER = "I"; //内部车 |
| | | public static final String LEASE_TYPE_NO_MONEY = "NM"; //免费车 |
| | | |
| | | public static final String LEASE_TYPE_TEMP = "T";//临时车 |
| | | |
| | | private String carColor; |
| | | private String carBrand; |
| | | private String carType; |
| | |
| | | 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 |
| | | ,pa.num areaNum,tcfc.fee_name feeName,tcfc.config_id configId,td2.`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 |
| | | 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 |
| | | order by t.create_time desc |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | |
| | | <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 |
| | | outTime,td.`name` stateName,pa.num areaNum,tcfc.fee_name feeName,tcfc.config_id configId,max(cid.car_type) carType,max(td2.`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} |
| | |
| | | <if test="endTime !=null and endTime != ''"> |
| | | and t.in_time < #{endTime} |
| | | </if> |
| | | group by t.in_time,t.inout_id,t.pa_id,t.car_num,t.status_cd,t.state,t.community_id,t.out_time,td.`name`,pa.num,tcfc.fee_name,tcfc.config_id |
| | | group by t.in_time,t.inout_id,t.pa_id,t.car_num,t.status_cd,t.state,t.community_id,t.out_time,td.`name`,pa.num,tcfc.fee_name,tcfc.config_id,t.create_time |
| | | order by t.create_time desc |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | |
| | | public static final int CAR_TYPE_MONTH = 1001; //月租车 |
| | | public static final int CAR_TYPE_SUB = 1; //成员车辆 |
| | | public static final int CAR_TYPE_TEMP = 1003; //临时车辆 |
| | | public static final int CAR_TYPE_NO_DATA = 3; //没有数据 |
| | | public static final String CAR_TYPE_NO_DATA = "3"; //没有数据 |
| | | |
| | | public static final String TEMP_CAR_OWNER = "临时车车主"; |
| | | |
| | |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | //是否是临时车 |
| | | int tempCar = CAR_TYPE_MONTH; |
| | | String tempCar = OwnerCarDto.LEASE_TYPE_TEMP; |
| | | |
| | | |
| | | //查询设备信息 |
| | |
| | | tempCar = CAR_TYPE_NO_DATA; |
| | | } else { |
| | | reqJson.put("carId", ownerCarDtos.get(0).getCarId()); |
| | | if (OwnerCarDto.CAR_TYPE_TEMP.equals(ownerCarDtos.get(0).getCarTypeCd())) { |
| | | tempCar = CAR_TYPE_TEMP; |
| | | } |
| | | // 月租车过期 后就是临时车 |
| | | if (ownerCarDtos.get(0).getEndTime().before(DateUtil.getCurrentDate())) { |
| | | tempCar = CAR_TYPE_TEMP; |
| | | } |
| | | tempCar = ownerCarDtos.get(0).getLeaseType(); |
| | | } |
| | | |
| | | |
| | |
| | | * @param machineDto |
| | | * @param tempCar |
| | | */ |
| | | private void carOut(JSONObject reqJson, MachineDto machineDto, int tempCar) { |
| | | private void carOut(JSONObject reqJson, MachineDto machineDto, String tempCar) { |
| | | |
| | | String state = CarInoutDto.STATE_OUT; |
| | | //进场失败记录 |
| | |
| | | carInoutDetailPo.setPaId(paId); |
| | | carInoutDetailPo.setRemark(reqJson.getString("remark")); |
| | | carInoutDetailPo.setState(state); |
| | | carInoutDetailPo.setCarType(tempCar == CAR_TYPE_NO_DATA ? CAR_TYPE_TEMP + "" : tempCar + ""); |
| | | carInoutDetailPo.setCarType(CAR_TYPE_NO_DATA.equals(tempCar) ? OwnerCarDto.LEASE_TYPE_TEMP + "" : tempCar + ""); |
| | | int flag = carInoutDetailV1InnerServiceSMOImpl.saveCarInoutDetail(carInoutDetailPo); |
| | | if (flag < 1) { |
| | | throw new CmdException("保存出记录明细失败"); |
| | |
| | | carInoutDetailPo.setPaId(carInoutDtos.get(0).getPaId()); |
| | | carInoutDetailPo.setRemark(reqJson.getString("remark")); |
| | | carInoutDetailPo.setState(state); |
| | | carInoutDetailPo.setCarType(tempCar == CAR_TYPE_NO_DATA ? CAR_TYPE_TEMP + "" : tempCar + ""); |
| | | carInoutDetailPo.setCarType(CAR_TYPE_NO_DATA.equals(tempCar) ? OwnerCarDto.LEASE_TYPE_TEMP : tempCar + ""); |
| | | int flag = carInoutDetailV1InnerServiceSMOImpl.saveCarInoutDetail(carInoutDetailPo); |
| | | |
| | | if (flag < 1) { |
| | |
| | | * @param machineDto |
| | | * @param tempCar |
| | | */ |
| | | private void carIn(JSONObject reqJson, MachineDto machineDto, int tempCar) { |
| | | private void carIn(JSONObject reqJson, MachineDto machineDto, String tempCar) { |
| | | 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(tempCar == CAR_TYPE_NO_DATA ? CAR_TYPE_TEMP + "" : tempCar + ""); |
| | | carInoutDetailPo.setCarType(CAR_TYPE_NO_DATA.equals(tempCar)?OwnerCarDto.LEASE_TYPE_TEMP:tempCar); |
| | | flag = carInoutDetailV1InnerServiceSMOImpl.saveCarInoutDetail(carInoutDetailPo); |
| | | |
| | | if (flag < 1) { |
| | | throw new CmdException("保存入记录明细失败"); |
| | | } |
| | | //月租车 |
| | | if (tempCar != CAR_TYPE_NO_DATA && tempCar != CAR_TYPE_TEMP) { |
| | | if (!OwnerCarDto.LEASE_TYPE_TEMP.equals(tempCar)) { |
| | | return; |
| | | } |
| | | |
| | |
| | | } else { |
| | | reqJson.put("ownerId", ownerDtos.get(0).getMemberId()); |
| | | } |
| | | if (tempCar == CAR_TYPE_NO_DATA) { |
| | | if (CAR_TYPE_NO_DATA.equals(tempCar)) { |
| | | saveTempCar(reqJson, machineDto); |
| | | } |
| | | |
| | |
| | | ownerCarPo.setRemark("临时车 物联网同步"); |
| | | ownerCarPo.setStartTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A)); |
| | | ownerCarPo.setUserId("-1"); |
| | | ownerCarPo.setLeaseType(OwnerCarDto.LEASE_TYPE_TEMP); |
| | | int flag = ownerCarV1InnerServiceSMOImpl.saveOwnerCar(ownerCarPo); |
| | | |
| | | if (flag < 1) { |
| | |
| | | reqJson.put("leaseType", OwnerCarDto.LEASE_TYPE_MONTH); |
| | | } |
| | | |
| | | if (OwnerCarDto.LEASE_TYPE_SALE.equals(reqJson.getString("leaseType"))) { |
| | | if (!OwnerCarDto.LEASE_TYPE_MONTH.equals(reqJson.getString("leaseType"))) { |
| | | reqJson.put("startTime", DateUtil.getFormatTimeString(new Date(), DateUtil.DATE_FORMATE_STRING_B)); |
| | | reqJson.put("endTime", "2037-01-01"); |
| | | } |
| | |
| | | reqJson.put("leaseType", OwnerCarDto.LEASE_TYPE_MONTH); |
| | | } |
| | | |
| | | if (OwnerCarDto.LEASE_TYPE_SALE.equals(reqJson.getString("leaseType"))) { |
| | | if (!OwnerCarDto.LEASE_TYPE_MONTH.equals(reqJson.getString("leaseType"))) { |
| | | reqJson.put("startTime", DateUtil.getFormatTimeString(new Date(), DateUtil.DATE_FORMATE_STRING_B)); |
| | | reqJson.put("endTime", "2037-01-01"); |
| | | } |