| New file |
| | |
| | | package com.java110.api.listener.carBlackWhite; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.constant.ServiceCodeConstant; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.utils.constant.ServiceCodeCarBlackWhiteConstant; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 保存小区侦听 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("deleteCarBlackWhiteListener") |
| | | public class DeleteCarBlackWhiteListener extends AbstractServiceApiListener { |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | //Assert.hasKeyAndValue(reqJson, "xxx", "xxx"); |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "必填,请填写车牌号"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "bwId", "黑白名单ID不能为空"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | HttpHeaders header = new HttpHeaders(); |
| | | context.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D"); |
| | | JSONArray businesses = new JSONArray(); |
| | | |
| | | AppService service = event.getAppService(); |
| | | |
| | | //添加单元信息 |
| | | businesses.add(deleteCarBlackWhite(reqJson, context)); |
| | | |
| | | JSONObject paramInObj = super.restToCenterProtocol(businesses, context.getRequestCurrentHeaders()); |
| | | |
| | | //将 rest header 信息传递到下层服务中去 |
| | | super.freshHttpHeader(header, context.getRequestCurrentHeaders()); |
| | | |
| | | ResponseEntity<String> responseEntity = this.callService(context, service.getServiceCode(), paramInObj); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeCarBlackWhiteConstant.DELETE_CARBLACKWHITE; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | private JSONObject deleteCarBlackWhite(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_DELETE_CAR_BLACK_WHITE); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessCarBlackWhite = new JSONObject(); |
| | | businessCarBlackWhite.putAll(paramInJson); |
| | | //计算 应收金额 |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessCarBlackWhite", businessCarBlackWhite); |
| | | return business; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.carBlackWhite; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.smo.hardwareAdapation.ICarBlackWhiteInnerServiceSMO; |
| | | import com.java110.dto.hardwareAdapation.CarBlackWhiteDto; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.ServiceCodeCarBlackWhiteConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.vo.api.carBlackWhite.ApiCarBlackWhiteDataVo; |
| | | import com.java110.vo.api.carBlackWhite.ApiCarBlackWhiteVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 查询小区侦听类 |
| | | */ |
| | | @Java110Listener("listCarBlackWhitesListener") |
| | | public class ListCarBlackWhitesListener extends AbstractServiceApiListener { |
| | | |
| | | @Autowired |
| | | private ICarBlackWhiteInnerServiceSMO carBlackWhiteInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeCarBlackWhiteConstant.LIST_CARBLACKWHITES; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.GET; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | public ICarBlackWhiteInnerServiceSMO getCarBlackWhiteInnerServiceSMOImpl() { |
| | | return carBlackWhiteInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setCarBlackWhiteInnerServiceSMOImpl(ICarBlackWhiteInnerServiceSMO carBlackWhiteInnerServiceSMOImpl) { |
| | | this.carBlackWhiteInnerServiceSMOImpl = carBlackWhiteInnerServiceSMOImpl; |
| | | } |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "必填,请填写小区ID"); |
| | | |
| | | super.validatePageInfo(reqJson); |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | CarBlackWhiteDto carBlackWhiteDto = BeanConvertUtil.covertBean(reqJson, CarBlackWhiteDto.class); |
| | | |
| | | int count = carBlackWhiteInnerServiceSMOImpl.queryCarBlackWhitesCount(carBlackWhiteDto); |
| | | |
| | | List<ApiCarBlackWhiteDataVo> carBlackWhites = null; |
| | | |
| | | if (count > 0) { |
| | | carBlackWhites = BeanConvertUtil.covertBeanList(carBlackWhiteInnerServiceSMOImpl.queryCarBlackWhites(carBlackWhiteDto), ApiCarBlackWhiteDataVo.class); |
| | | } else { |
| | | carBlackWhites = new ArrayList<>(); |
| | | } |
| | | |
| | | ApiCarBlackWhiteVo apiCarBlackWhiteVo = new ApiCarBlackWhiteVo(); |
| | | |
| | | apiCarBlackWhiteVo.setTotal(count); |
| | | apiCarBlackWhiteVo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row"))); |
| | | apiCarBlackWhiteVo.setCarBlackWhites(carBlackWhites); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiCarBlackWhiteVo), HttpStatus.OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.carBlackWhite; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.constant.ServiceCodeConstant; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.ServiceCodeCarBlackWhiteConstant; |
| | | |
| | | |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 保存小区侦听 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("saveCarBlackWhiteListener") |
| | | public class SaveCarBlackWhiteListener extends AbstractServiceApiListener { |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | //Assert.hasKeyAndValue(reqJson, "xxx", "xxx"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "blackWhite", "必填,请填写名单类型"); |
| | | Assert.hasKeyAndValue(reqJson, "carNum", "必填,请填写车牌号"); |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "必填,请填写小区ID"); |
| | | Assert.hasKeyAndValue(reqJson, "startTime", "必填,请选择开始时间"); |
| | | Assert.hasKeyAndValue(reqJson, "endTime", "必填,请选择结束时间"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | HttpHeaders header = new HttpHeaders(); |
| | | context.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D"); |
| | | JSONArray businesses = new JSONArray(); |
| | | |
| | | AppService service = event.getAppService(); |
| | | |
| | | //添加单元信息 |
| | | businesses.add(addCarBlackWhite(reqJson, context)); |
| | | |
| | | JSONObject paramInObj = super.restToCenterProtocol(businesses, context.getRequestCurrentHeaders()); |
| | | |
| | | //将 rest header 信息传递到下层服务中去 |
| | | super.freshHttpHeader(header, context.getRequestCurrentHeaders()); |
| | | |
| | | ResponseEntity<String> responseEntity = this.callService(context, service.getServiceCode(), paramInObj); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeCarBlackWhiteConstant.ADD_CARBLACKWHITE; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | private JSONObject addCarBlackWhite(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_CAR_BLACK_WHITE); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessCarBlackWhite = new JSONObject(); |
| | | businessCarBlackWhite.putAll(paramInJson); |
| | | businessCarBlackWhite.put("bwId", "-1"); |
| | | //计算 应收金额 |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessCarBlackWhite", businessCarBlackWhite); |
| | | return business; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.carBlackWhite; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.constant.ServiceCodeConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.ServiceCodeCarBlackWhiteConstant; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 保存黑白名单侦听 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("updateCarBlackWhiteListener") |
| | | public class UpdateCarBlackWhiteListener extends AbstractServiceApiListener { |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "bwId", "黑白名单ID不能为空"); |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "必填,请填写小区ID"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "blackWhite", "必填,请填写名单类型"); |
| | | Assert.hasKeyAndValue(reqJson, "carNum", "必填,请填写车牌号"); |
| | | Assert.hasKeyAndValue(reqJson, "startTime", "必填,请选择开始时间"); |
| | | Assert.hasKeyAndValue(reqJson, "endTime", "必填,请选择结束时间"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | HttpHeaders header = new HttpHeaders(); |
| | | context.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D"); |
| | | JSONArray businesses = new JSONArray(); |
| | | |
| | | AppService service = event.getAppService(); |
| | | |
| | | //添加单元信息 |
| | | businesses.add(updateCarBlackWhite(reqJson, context)); |
| | | |
| | | JSONObject paramInObj = super.restToCenterProtocol(businesses, context.getRequestCurrentHeaders()); |
| | | |
| | | //将 rest header 信息传递到下层服务中去 |
| | | super.freshHttpHeader(header, context.getRequestCurrentHeaders()); |
| | | |
| | | ResponseEntity<String> responseEntity = this.callService(context, service.getServiceCode(), paramInObj); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeCarBlackWhiteConstant.UPDATE_CARBLACKWHITE; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加黑白名单信息 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | private JSONObject updateCarBlackWhite(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_CAR_BLACK_WHITE); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessCarBlackWhite = new JSONObject(); |
| | | businessCarBlackWhite.putAll(paramInJson); |
| | | //计算 应收金额 |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessCarBlackWhite", businessCarBlackWhite); |
| | | return business; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.hardwareAdapation.dao; |
| | | |
| | | |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.entity.merchant.BoMerchant; |
| | | import com.java110.entity.merchant.BoMerchantAttr; |
| | | import com.java110.entity.merchant.Merchant; |
| | | import com.java110.entity.merchant.MerchantAttr; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 黑白名单组件内部之间使用,没有给外围系统提供服务能力 |
| | | * 黑白名单服务接口类,要求全部以字符串传输,方便微服务化 |
| | | * 新建客户,修改客户,删除客户,查询客户等功能 |
| | | * |
| | | * Created by wuxw on 2016/12/27. |
| | | */ |
| | | public interface ICarBlackWhiteServiceDao { |
| | | |
| | | /** |
| | | * 保存 黑白名单信息 |
| | | * @param businessCarBlackWhiteInfo 黑白名单信息 封装 |
| | | * @throws DAOException 操作数据库异常 |
| | | */ |
| | | void saveBusinessCarBlackWhiteInfo(Map businessCarBlackWhiteInfo) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询黑白名单信息(business过程) |
| | | * 根据bId 查询黑白名单信息 |
| | | * @param info bId 信息 |
| | | * @return 黑白名单信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getBusinessCarBlackWhiteInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存 黑白名单信息 Business数据到 Instance中 |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void saveCarBlackWhiteInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询黑白名单信息(instance过程) |
| | | * 根据bId 查询黑白名单信息 |
| | | * @param info bId 信息 |
| | | * @return 黑白名单信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getCarBlackWhiteInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改黑白名单信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void updateCarBlackWhiteInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询黑白名单总数 |
| | | * |
| | | * @param info 黑白名单信息 |
| | | * @return 黑白名单数量 |
| | | */ |
| | | int queryCarBlackWhitesCount(Map info); |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.hardwareAdapation.dao.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.base.dao.BaseServiceDao; |
| | | import com.java110.hardwareAdapation.dao.ICarBlackWhiteServiceDao; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.utils.util.DateUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 黑白名单服务 与数据库交互 |
| | | * Created by wuxw on 2017/4/5. |
| | | */ |
| | | @Service("carBlackWhiteServiceDaoImpl") |
| | | //@Transactional |
| | | public class CarBlackWhiteServiceDaoImpl extends BaseServiceDao implements ICarBlackWhiteServiceDao { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(CarBlackWhiteServiceDaoImpl.class); |
| | | |
| | | /** |
| | | * 黑白名单信息封装 |
| | | * |
| | | * @param businessCarBlackWhiteInfo 黑白名单信息 封装 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveBusinessCarBlackWhiteInfo(Map businessCarBlackWhiteInfo) throws DAOException { |
| | | businessCarBlackWhiteInfo.put("month", DateUtil.getCurrentMonth()); |
| | | // 查询business_user 数据是否已经存在 |
| | | logger.debug("保存黑白名单信息 入参 businessCarBlackWhiteInfo : {}", businessCarBlackWhiteInfo); |
| | | int saveFlag = sqlSessionTemplate.insert("carBlackWhiteServiceDaoImpl.saveBusinessCarBlackWhiteInfo", businessCarBlackWhiteInfo); |
| | | |
| | | if (saveFlag < 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存黑白名单数据失败:" + JSONObject.toJSONString(businessCarBlackWhiteInfo)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询黑白名单信息 |
| | | * |
| | | * @param info bId 信息 |
| | | * @return 黑白名单信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getBusinessCarBlackWhiteInfo(Map info) throws DAOException { |
| | | |
| | | logger.debug("查询黑白名单信息 入参 info : {}", info); |
| | | |
| | | List<Map> businessCarBlackWhiteInfos = sqlSessionTemplate.selectList("carBlackWhiteServiceDaoImpl.getBusinessCarBlackWhiteInfo", info); |
| | | |
| | | return businessCarBlackWhiteInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存黑白名单信息 到 instance |
| | | * |
| | | * @param info bId 信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveCarBlackWhiteInfoInstance(Map info) throws DAOException { |
| | | logger.debug("保存黑白名单信息Instance 入参 info : {}", info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("carBlackWhiteServiceDaoImpl.saveCarBlackWhiteInfoInstance", info); |
| | | |
| | | if (saveFlag < 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存黑白名单信息Instance数据失败:" + JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询黑白名单信息(instance) |
| | | * |
| | | * @param info bId 信息 |
| | | * @return List<Map> |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getCarBlackWhiteInfo(Map info) throws DAOException { |
| | | logger.debug("查询黑白名单信息 入参 info : {}", info); |
| | | |
| | | List<Map> businessCarBlackWhiteInfos = sqlSessionTemplate.selectList("carBlackWhiteServiceDaoImpl.getCarBlackWhiteInfo", info); |
| | | |
| | | return businessCarBlackWhiteInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改黑白名单信息 |
| | | * |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void updateCarBlackWhiteInfoInstance(Map info) throws DAOException { |
| | | logger.debug("修改黑白名单信息Instance 入参 info : {}", info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("carBlackWhiteServiceDaoImpl.updateCarBlackWhiteInfoInstance", info); |
| | | |
| | | if (saveFlag < 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改黑白名单信息Instance数据失败:" + JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询黑白名单数量 |
| | | * |
| | | * @param info 黑白名单信息 |
| | | * @return 黑白名单数量 |
| | | */ |
| | | @Override |
| | | public int queryCarBlackWhitesCount(Map info) { |
| | | logger.debug("查询黑白名单数据 入参 info : {}", info); |
| | | |
| | | List<Map> businessCarBlackWhiteInfos = sqlSessionTemplate.selectList("carBlackWhiteServiceDaoImpl.queryCarBlackWhitesCount", info); |
| | | if (businessCarBlackWhiteInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessCarBlackWhiteInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.hardwareAdapation.listener.carBlackWhite; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.event.service.AbstractBusinessServiceDataFlowListener; |
| | | import com.java110.hardwareAdapation.dao.ICarBlackWhiteServiceDao; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.constant.StatusConstant; |
| | | import com.java110.utils.exception.ListenerExecuteException; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 黑白名单 服务侦听 父类 |
| | | * Created by wuxw on 2018/7/4. |
| | | */ |
| | | public abstract class AbstractCarBlackWhiteBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener { |
| | | private static Logger logger = LoggerFactory.getLogger(AbstractCarBlackWhiteBusinessServiceDataFlowListener.class); |
| | | |
| | | |
| | | /** |
| | | * 获取 DAO工具类 |
| | | * |
| | | * @return |
| | | */ |
| | | public abstract ICarBlackWhiteServiceDao getCarBlackWhiteServiceDaoImpl(); |
| | | |
| | | /** |
| | | * 刷新 businessCarBlackWhiteInfo 数据 |
| | | * 主要将 数据库 中字段和 接口传递字段建立关系 |
| | | * |
| | | * @param businessCarBlackWhiteInfo |
| | | */ |
| | | protected void flushBusinessCarBlackWhiteInfo(Map businessCarBlackWhiteInfo, String statusCd) { |
| | | businessCarBlackWhiteInfo.put("newBId", businessCarBlackWhiteInfo.get("b_id")); |
| | | businessCarBlackWhiteInfo.put("blackWhite", businessCarBlackWhiteInfo.get("black_white")); |
| | | businessCarBlackWhiteInfo.put("operate", businessCarBlackWhiteInfo.get("operate")); |
| | | businessCarBlackWhiteInfo.put("carNum", businessCarBlackWhiteInfo.get("car_num")); |
| | | businessCarBlackWhiteInfo.put("startTime", businessCarBlackWhiteInfo.get("start_time")); |
| | | businessCarBlackWhiteInfo.put("endTime", businessCarBlackWhiteInfo.get("end_time")); |
| | | businessCarBlackWhiteInfo.put("communityId", businessCarBlackWhiteInfo.get("community_id")); |
| | | businessCarBlackWhiteInfo.put("bwId", businessCarBlackWhiteInfo.get("bw_id")); |
| | | businessCarBlackWhiteInfo.remove("bId"); |
| | | businessCarBlackWhiteInfo.put("statusCd", statusCd); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中 |
| | | * |
| | | * @param businessCarBlackWhite 黑白名单信息 |
| | | */ |
| | | protected void autoSaveDelBusinessCarBlackWhite(Business business, JSONObject businessCarBlackWhite) { |
| | | //自动插入DEL |
| | | Map info = new HashMap(); |
| | | info.put("bwId", businessCarBlackWhite.getString("bwId")); |
| | | info.put("statusCd", StatusConstant.STATUS_CD_VALID); |
| | | List<Map> currentCarBlackWhiteInfos = getCarBlackWhiteServiceDaoImpl().getCarBlackWhiteInfo(info); |
| | | if (currentCarBlackWhiteInfos == null || currentCarBlackWhiteInfos.size() != 1) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "未找到需要修改数据信息,入参错误或数据有问题,请检查" + info); |
| | | } |
| | | |
| | | Map currentCarBlackWhiteInfo = currentCarBlackWhiteInfos.get(0); |
| | | |
| | | currentCarBlackWhiteInfo.put("bId", business.getbId()); |
| | | |
| | | currentCarBlackWhiteInfo.put("blackWhite", currentCarBlackWhiteInfo.get("black_white")); |
| | | currentCarBlackWhiteInfo.put("operate", currentCarBlackWhiteInfo.get("operate")); |
| | | currentCarBlackWhiteInfo.put("carNum", currentCarBlackWhiteInfo.get("car_num")); |
| | | currentCarBlackWhiteInfo.put("startTime", currentCarBlackWhiteInfo.get("start_time")); |
| | | currentCarBlackWhiteInfo.put("endTime", currentCarBlackWhiteInfo.get("end_time")); |
| | | currentCarBlackWhiteInfo.put("communityId", currentCarBlackWhiteInfo.get("community_id")); |
| | | currentCarBlackWhiteInfo.put("bwId", currentCarBlackWhiteInfo.get("bw_id")); |
| | | |
| | | |
| | | currentCarBlackWhiteInfo.put("operate", StatusConstant.OPERATE_DEL); |
| | | getCarBlackWhiteServiceDaoImpl().saveBusinessCarBlackWhiteInfo(currentCarBlackWhiteInfo); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.hardwareAdapation.listener.carBlackWhite; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.hardwareAdapation.dao.ICarBlackWhiteServiceDao; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.constant.StatusConstant; |
| | | import com.java110.utils.exception.ListenerExecuteException; |
| | | import com.java110.utils.util.Assert; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 删除黑白名单信息 侦听 |
| | | * <p> |
| | | * 处理节点 |
| | | * 1、businessCarBlackWhite:{} 黑白名单基本信息节点 |
| | | * 2、businessCarBlackWhiteAttr:[{}] 黑白名单属性信息节点 |
| | | * 3、businessCarBlackWhitePhoto:[{}] 黑白名单照片信息节点 |
| | | * 4、businessCarBlackWhiteCerdentials:[{}] 黑白名单证件信息节点 |
| | | * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E5%88%A0%E9%99%A4%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE |
| | | * Created by wuxw on 2018/5/18. |
| | | */ |
| | | @Java110Listener("deleteCarBlackWhiteInfoListener") |
| | | @Transactional |
| | | public class DeleteCarBlackWhiteInfoListener extends AbstractCarBlackWhiteBusinessServiceDataFlowListener { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(DeleteCarBlackWhiteInfoListener.class); |
| | | @Autowired |
| | | ICarBlackWhiteServiceDao carBlackWhiteServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 3; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_DELETE_CAR_BLACK_WHITE; |
| | | } |
| | | |
| | | /** |
| | | * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去 |
| | | * |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | JSONObject data = business.getDatas(); |
| | | |
| | | Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessCarBlackWhite 节点 |
| | | if (data.containsKey("businessCarBlackWhite")) { |
| | | //处理 businessCarBlackWhite 节点 |
| | | if (data.containsKey("businessCarBlackWhite")) { |
| | | Object _obj = data.get("businessCarBlackWhite"); |
| | | JSONArray businessCarBlackWhites = null; |
| | | if (_obj instanceof JSONObject) { |
| | | businessCarBlackWhites = new JSONArray(); |
| | | businessCarBlackWhites.add(_obj); |
| | | } else { |
| | | businessCarBlackWhites = (JSONArray) _obj; |
| | | } |
| | | //JSONObject businessCarBlackWhite = data.getJSONObject("businessCarBlackWhite"); |
| | | for (int _carBlackWhiteIndex = 0; _carBlackWhiteIndex < businessCarBlackWhites.size(); _carBlackWhiteIndex++) { |
| | | JSONObject businessCarBlackWhite = businessCarBlackWhites.getJSONObject(_carBlackWhiteIndex); |
| | | doBusinessCarBlackWhite(business, businessCarBlackWhite); |
| | | if (_obj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("bwId", businessCarBlackWhite.getString("bwId")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 删除 instance数据 |
| | | * |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) { |
| | | String bId = business.getbId(); |
| | | //Assert.hasLength(bId,"请求报文中没有包含 bId"); |
| | | |
| | | //黑白名单信息 |
| | | Map info = new HashMap(); |
| | | info.put("bId", business.getbId()); |
| | | info.put("operate", StatusConstant.OPERATE_DEL); |
| | | |
| | | //黑白名单信息 |
| | | List<Map> businessCarBlackWhiteInfos = carBlackWhiteServiceDaoImpl.getBusinessCarBlackWhiteInfo(info); |
| | | if (businessCarBlackWhiteInfos != null && businessCarBlackWhiteInfos.size() > 0) { |
| | | for (int _carBlackWhiteIndex = 0; _carBlackWhiteIndex < businessCarBlackWhiteInfos.size(); _carBlackWhiteIndex++) { |
| | | Map businessCarBlackWhiteInfo = businessCarBlackWhiteInfos.get(_carBlackWhiteIndex); |
| | | flushBusinessCarBlackWhiteInfo(businessCarBlackWhiteInfo, StatusConstant.STATUS_CD_INVALID); |
| | | carBlackWhiteServiceDaoImpl.updateCarBlackWhiteInfoInstance(businessCarBlackWhiteInfo); |
| | | dataFlowContext.addParamOut("bwId", businessCarBlackWhiteInfo.get("bw_id")); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 撤单 |
| | | * 从business表中查询到DEL的数据 将instance中的数据更新回来 |
| | | * |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doRecover(DataFlowContext dataFlowContext, Business business) { |
| | | String bId = business.getbId(); |
| | | //Assert.hasLength(bId,"请求报文中没有包含 bId"); |
| | | Map info = new HashMap(); |
| | | info.put("bId", bId); |
| | | info.put("statusCd", StatusConstant.STATUS_CD_INVALID); |
| | | |
| | | Map delInfo = new HashMap(); |
| | | delInfo.put("bId", business.getbId()); |
| | | delInfo.put("operate", StatusConstant.OPERATE_DEL); |
| | | //黑白名单信息 |
| | | List<Map> carBlackWhiteInfo = carBlackWhiteServiceDaoImpl.getCarBlackWhiteInfo(info); |
| | | if (carBlackWhiteInfo != null && carBlackWhiteInfo.size() > 0) { |
| | | |
| | | //黑白名单信息 |
| | | List<Map> businessCarBlackWhiteInfos = carBlackWhiteServiceDaoImpl.getBusinessCarBlackWhiteInfo(delInfo); |
| | | //除非程序出错了,这里不会为空 |
| | | if (businessCarBlackWhiteInfos == null || businessCarBlackWhiteInfos.size() == 0) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR, "撤单失败(carBlackWhite),程序内部异常,请检查! " + delInfo); |
| | | } |
| | | for (int _carBlackWhiteIndex = 0; _carBlackWhiteIndex < businessCarBlackWhiteInfos.size(); _carBlackWhiteIndex++) { |
| | | Map businessCarBlackWhiteInfo = businessCarBlackWhiteInfos.get(_carBlackWhiteIndex); |
| | | flushBusinessCarBlackWhiteInfo(businessCarBlackWhiteInfo, StatusConstant.STATUS_CD_VALID); |
| | | carBlackWhiteServiceDaoImpl.updateCarBlackWhiteInfoInstance(businessCarBlackWhiteInfo); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 处理 businessCarBlackWhite 节点 |
| | | * |
| | | * @param business 总的数据节点 |
| | | * @param businessCarBlackWhite 黑白名单节点 |
| | | */ |
| | | private void doBusinessCarBlackWhite(Business business, JSONObject businessCarBlackWhite) { |
| | | |
| | | Assert.jsonObjectHaveKey(businessCarBlackWhite, "bwId", "businessCarBlackWhite 节点下没有包含 bwId 节点"); |
| | | |
| | | if (businessCarBlackWhite.getString("bwId").startsWith("-")) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "bwId 错误,不能自动生成(必须已经存在的bwId)" + businessCarBlackWhite); |
| | | } |
| | | //自动插入DEL |
| | | autoSaveDelBusinessCarBlackWhite(business, businessCarBlackWhite); |
| | | } |
| | | |
| | | public ICarBlackWhiteServiceDao getCarBlackWhiteServiceDaoImpl() { |
| | | return carBlackWhiteServiceDaoImpl; |
| | | } |
| | | |
| | | public void setCarBlackWhiteServiceDaoImpl(ICarBlackWhiteServiceDao carBlackWhiteServiceDaoImpl) { |
| | | this.carBlackWhiteServiceDaoImpl = carBlackWhiteServiceDaoImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.hardwareAdapation.listener.carBlackWhite; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.hardwareAdapation.dao.ICarBlackWhiteServiceDao; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.StatusConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 保存 黑白名单信息 侦听 |
| | | * Created by wuxw on 2018/5/18. |
| | | */ |
| | | @Java110Listener("saveCarBlackWhiteInfoListener") |
| | | @Transactional |
| | | public class SaveCarBlackWhiteInfoListener extends AbstractCarBlackWhiteBusinessServiceDataFlowListener { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(SaveCarBlackWhiteInfoListener.class); |
| | | |
| | | @Autowired |
| | | private ICarBlackWhiteServiceDao carBlackWhiteServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_SAVE_CAR_BLACK_WHITE; |
| | | } |
| | | |
| | | /** |
| | | * 保存黑白名单信息 business 表中 |
| | | * |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | JSONObject data = business.getDatas(); |
| | | Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessCarBlackWhite 节点 |
| | | if (data.containsKey("businessCarBlackWhite")) { |
| | | Object bObj = data.get("businessCarBlackWhite"); |
| | | JSONArray businessCarBlackWhites = null; |
| | | if (bObj instanceof JSONObject) { |
| | | businessCarBlackWhites = new JSONArray(); |
| | | businessCarBlackWhites.add(bObj); |
| | | } else { |
| | | businessCarBlackWhites = (JSONArray) bObj; |
| | | } |
| | | //JSONObject businessCarBlackWhite = data.getJSONObject("businessCarBlackWhite"); |
| | | for (int bCarBlackWhiteIndex = 0; bCarBlackWhiteIndex < businessCarBlackWhites.size(); bCarBlackWhiteIndex++) { |
| | | JSONObject businessCarBlackWhite = businessCarBlackWhites.getJSONObject(bCarBlackWhiteIndex); |
| | | doBusinessCarBlackWhite(business, businessCarBlackWhite); |
| | | if (bObj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("bwId", businessCarBlackWhite.getString("bwId")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * business 数据转移到 instance |
| | | * |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) { |
| | | JSONObject data = business.getDatas(); |
| | | |
| | | Map info = new HashMap(); |
| | | info.put("bId", business.getbId()); |
| | | info.put("operate", StatusConstant.OPERATE_ADD); |
| | | |
| | | //黑白名单信息 |
| | | List<Map> businessCarBlackWhiteInfo = carBlackWhiteServiceDaoImpl.getBusinessCarBlackWhiteInfo(info); |
| | | if (businessCarBlackWhiteInfo != null && businessCarBlackWhiteInfo.size() > 0) { |
| | | reFreshShareColumn(info, businessCarBlackWhiteInfo.get(0)); |
| | | carBlackWhiteServiceDaoImpl.saveCarBlackWhiteInfoInstance(info); |
| | | if (businessCarBlackWhiteInfo.size() == 1) { |
| | | dataFlowContext.addParamOut("bwId", businessCarBlackWhiteInfo.get(0).get("bw_id")); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 刷 分片字段 |
| | | * |
| | | * @param info 查询对象 |
| | | * @param businessInfo 小区ID |
| | | */ |
| | | private void reFreshShareColumn(Map info, Map businessInfo) { |
| | | |
| | | if (info.containsKey("communityId")) { |
| | | return; |
| | | } |
| | | |
| | | if (!businessInfo.containsKey("community_id")) { |
| | | return; |
| | | } |
| | | |
| | | info.put("communityId", businessInfo.get("community_id")); |
| | | } |
| | | |
| | | /** |
| | | * 撤单 |
| | | * |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doRecover(DataFlowContext dataFlowContext, Business business) { |
| | | String bId = business.getbId(); |
| | | //Assert.hasLength(bId,"请求报文中没有包含 bId"); |
| | | Map info = new HashMap(); |
| | | info.put("bId", bId); |
| | | info.put("statusCd", StatusConstant.STATUS_CD_VALID); |
| | | Map paramIn = new HashMap(); |
| | | paramIn.put("bId", bId); |
| | | paramIn.put("statusCd", StatusConstant.STATUS_CD_INVALID); |
| | | //黑白名单信息 |
| | | List<Map> carBlackWhiteInfo = carBlackWhiteServiceDaoImpl.getCarBlackWhiteInfo(info); |
| | | if (carBlackWhiteInfo != null && carBlackWhiteInfo.size() > 0) { |
| | | reFreshShareColumn(paramIn, carBlackWhiteInfo.get(0)); |
| | | carBlackWhiteServiceDaoImpl.updateCarBlackWhiteInfoInstance(paramIn); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 处理 businessCarBlackWhite 节点 |
| | | * |
| | | * @param business 总的数据节点 |
| | | * @param businessCarBlackWhite 黑白名单节点 |
| | | */ |
| | | private void doBusinessCarBlackWhite(Business business, JSONObject businessCarBlackWhite) { |
| | | |
| | | Assert.jsonObjectHaveKey(businessCarBlackWhite, "bwId", "businessCarBlackWhite 节点下没有包含 bwId 节点"); |
| | | |
| | | if (businessCarBlackWhite.getString("bwId").startsWith("-")) { |
| | | //刷新缓存 |
| | | //flushCarBlackWhiteId(business.getDatas()); |
| | | |
| | | businessCarBlackWhite.put("bwId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_bwId)); |
| | | |
| | | } |
| | | |
| | | businessCarBlackWhite.put("bId", business.getbId()); |
| | | businessCarBlackWhite.put("operate", StatusConstant.OPERATE_ADD); |
| | | //保存黑白名单信息 |
| | | carBlackWhiteServiceDaoImpl.saveBusinessCarBlackWhiteInfo(businessCarBlackWhite); |
| | | |
| | | } |
| | | |
| | | public ICarBlackWhiteServiceDao getCarBlackWhiteServiceDaoImpl() { |
| | | return carBlackWhiteServiceDaoImpl; |
| | | } |
| | | |
| | | public void setCarBlackWhiteServiceDaoImpl(ICarBlackWhiteServiceDao carBlackWhiteServiceDaoImpl) { |
| | | this.carBlackWhiteServiceDaoImpl = carBlackWhiteServiceDaoImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.hardwareAdapation.listener.carBlackWhite; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.hardwareAdapation.dao.ICarBlackWhiteServiceDao; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.constant.StatusConstant; |
| | | import com.java110.utils.exception.ListenerExecuteException; |
| | | import com.java110.utils.util.Assert; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 修改黑白名单信息 侦听 |
| | | * <p> |
| | | * 处理节点 |
| | | * 1、businessCarBlackWhite:{} 黑白名单基本信息节点 |
| | | * 2、businessCarBlackWhiteAttr:[{}] 黑白名单属性信息节点 |
| | | * 3、businessCarBlackWhitePhoto:[{}] 黑白名单照片信息节点 |
| | | * 4、businessCarBlackWhiteCerdentials:[{}] 黑白名单证件信息节点 |
| | | * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E4%BF%AE%E6%94%B9%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE |
| | | * Created by wuxw on 2018/5/18. |
| | | */ |
| | | @Java110Listener("updateCarBlackWhiteInfoListener") |
| | | @Transactional |
| | | public class UpdateCarBlackWhiteInfoListener extends AbstractCarBlackWhiteBusinessServiceDataFlowListener { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(UpdateCarBlackWhiteInfoListener.class); |
| | | @Autowired |
| | | private ICarBlackWhiteServiceDao carBlackWhiteServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 2; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_CAR_BLACK_WHITE; |
| | | } |
| | | |
| | | /** |
| | | * business过程 |
| | | * |
| | | * @param dataFlowContext 上下文对象 |
| | | * @param business 业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | |
| | | JSONObject data = business.getDatas(); |
| | | |
| | | Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessCarBlackWhite 节点 |
| | | if (data.containsKey("businessCarBlackWhite")) { |
| | | //处理 businessCarBlackWhite 节点 |
| | | if (data.containsKey("businessCarBlackWhite")) { |
| | | Object _obj = data.get("businessCarBlackWhite"); |
| | | JSONArray businessCarBlackWhites = null; |
| | | if (_obj instanceof JSONObject) { |
| | | businessCarBlackWhites = new JSONArray(); |
| | | businessCarBlackWhites.add(_obj); |
| | | } else { |
| | | businessCarBlackWhites = (JSONArray) _obj; |
| | | } |
| | | //JSONObject businessCarBlackWhite = data.getJSONObject("businessCarBlackWhite"); |
| | | for (int _carBlackWhiteIndex = 0; _carBlackWhiteIndex < businessCarBlackWhites.size(); _carBlackWhiteIndex++) { |
| | | JSONObject businessCarBlackWhite = businessCarBlackWhites.getJSONObject(_carBlackWhiteIndex); |
| | | doBusinessCarBlackWhite(business, businessCarBlackWhite); |
| | | if (_obj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("bwId", businessCarBlackWhite.getString("bwId")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * business to instance 过程 |
| | | * |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) { |
| | | |
| | | JSONObject data = business.getDatas(); |
| | | |
| | | Map info = new HashMap(); |
| | | info.put("bId", business.getbId()); |
| | | info.put("operate", StatusConstant.OPERATE_ADD); |
| | | |
| | | //黑白名单信息 |
| | | List<Map> businessCarBlackWhiteInfos = carBlackWhiteServiceDaoImpl.getBusinessCarBlackWhiteInfo(info); |
| | | if (businessCarBlackWhiteInfos != null && businessCarBlackWhiteInfos.size() > 0) { |
| | | for (int _carBlackWhiteIndex = 0; _carBlackWhiteIndex < businessCarBlackWhiteInfos.size(); _carBlackWhiteIndex++) { |
| | | Map businessCarBlackWhiteInfo = businessCarBlackWhiteInfos.get(_carBlackWhiteIndex); |
| | | flushBusinessCarBlackWhiteInfo(businessCarBlackWhiteInfo, StatusConstant.STATUS_CD_VALID); |
| | | carBlackWhiteServiceDaoImpl.updateCarBlackWhiteInfoInstance(businessCarBlackWhiteInfo); |
| | | if (businessCarBlackWhiteInfo.size() == 1) { |
| | | dataFlowContext.addParamOut("bwId", businessCarBlackWhiteInfo.get("bw_id")); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 撤单 |
| | | * |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doRecover(DataFlowContext dataFlowContext, Business business) { |
| | | |
| | | String bId = business.getbId(); |
| | | //Assert.hasLength(bId,"请求报文中没有包含 bId"); |
| | | Map info = new HashMap(); |
| | | info.put("bId", bId); |
| | | info.put("statusCd", StatusConstant.STATUS_CD_VALID); |
| | | Map delInfo = new HashMap(); |
| | | delInfo.put("bId", business.getbId()); |
| | | delInfo.put("operate", StatusConstant.OPERATE_DEL); |
| | | //黑白名单信息 |
| | | List<Map> carBlackWhiteInfo = carBlackWhiteServiceDaoImpl.getCarBlackWhiteInfo(info); |
| | | if (carBlackWhiteInfo != null && carBlackWhiteInfo.size() > 0) { |
| | | |
| | | //黑白名单信息 |
| | | List<Map> businessCarBlackWhiteInfos = carBlackWhiteServiceDaoImpl.getBusinessCarBlackWhiteInfo(delInfo); |
| | | //除非程序出错了,这里不会为空 |
| | | if (businessCarBlackWhiteInfos == null || businessCarBlackWhiteInfos.size() == 0) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR, "撤单失败(carBlackWhite),程序内部异常,请检查! " + delInfo); |
| | | } |
| | | for (int _carBlackWhiteIndex = 0; _carBlackWhiteIndex < businessCarBlackWhiteInfos.size(); _carBlackWhiteIndex++) { |
| | | Map businessCarBlackWhiteInfo = businessCarBlackWhiteInfos.get(_carBlackWhiteIndex); |
| | | flushBusinessCarBlackWhiteInfo(businessCarBlackWhiteInfo, StatusConstant.STATUS_CD_VALID); |
| | | carBlackWhiteServiceDaoImpl.updateCarBlackWhiteInfoInstance(businessCarBlackWhiteInfo); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 处理 businessCarBlackWhite 节点 |
| | | * |
| | | * @param business 总的数据节点 |
| | | * @param businessCarBlackWhite 黑白名单节点 |
| | | */ |
| | | private void doBusinessCarBlackWhite(Business business, JSONObject businessCarBlackWhite) { |
| | | |
| | | Assert.jsonObjectHaveKey(businessCarBlackWhite, "bwId", "businessCarBlackWhite 节点下没有包含 bwId 节点"); |
| | | |
| | | if (businessCarBlackWhite.getString("bwId").startsWith("-")) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "bwId 错误,不能自动生成(必须已经存在的bwId)" + businessCarBlackWhite); |
| | | } |
| | | //自动保存DEL |
| | | autoSaveDelBusinessCarBlackWhite(business, businessCarBlackWhite); |
| | | |
| | | businessCarBlackWhite.put("bId", business.getbId()); |
| | | businessCarBlackWhite.put("operate", StatusConstant.OPERATE_ADD); |
| | | //保存黑白名单信息 |
| | | carBlackWhiteServiceDaoImpl.saveBusinessCarBlackWhiteInfo(businessCarBlackWhite); |
| | | |
| | | } |
| | | |
| | | |
| | | public ICarBlackWhiteServiceDao getCarBlackWhiteServiceDaoImpl() { |
| | | return carBlackWhiteServiceDaoImpl; |
| | | } |
| | | |
| | | public void setCarBlackWhiteServiceDaoImpl(ICarBlackWhiteServiceDao carBlackWhiteServiceDaoImpl) { |
| | | this.carBlackWhiteServiceDaoImpl = carBlackWhiteServiceDaoImpl; |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.hardwareAdapation.smo.impl; |
| | | |
| | | |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.core.smo.hardwareAdapation.ICarBlackWhiteInnerServiceSMO; |
| | | import com.java110.core.smo.user.IUserInnerServiceSMO; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.hardwareAdapation.CarBlackWhiteDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.hardwareAdapation.dao.ICarBlackWhiteServiceDao; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName FloorInnerServiceSMOImpl |
| | | * @Description 黑白名单内部服务实现类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:20 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @RestController |
| | | public class CarBlackWhiteInnerServiceSMOImpl extends BaseServiceSMO implements ICarBlackWhiteInnerServiceSMO { |
| | | |
| | | @Autowired |
| | | private ICarBlackWhiteServiceDao carBlackWhiteServiceDaoImpl; |
| | | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public List<CarBlackWhiteDto> queryCarBlackWhites(@RequestBody CarBlackWhiteDto carBlackWhiteDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = carBlackWhiteDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | carBlackWhiteDto.setPage((page - 1) * carBlackWhiteDto.getRow()); |
| | | } |
| | | |
| | | List<CarBlackWhiteDto> carBlackWhites = BeanConvertUtil.covertBeanList(carBlackWhiteServiceDaoImpl.getCarBlackWhiteInfo(BeanConvertUtil.beanCovertMap(carBlackWhiteDto)), CarBlackWhiteDto.class); |
| | | |
| | | |
| | | return carBlackWhites; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int queryCarBlackWhitesCount(@RequestBody CarBlackWhiteDto carBlackWhiteDto) { |
| | | return carBlackWhiteServiceDaoImpl.queryCarBlackWhitesCount(BeanConvertUtil.beanCovertMap(carBlackWhiteDto)); |
| | | } |
| | | |
| | | public ICarBlackWhiteServiceDao getCarBlackWhiteServiceDaoImpl() { |
| | | return carBlackWhiteServiceDaoImpl; |
| | | } |
| | | |
| | | public void setCarBlackWhiteServiceDaoImpl(ICarBlackWhiteServiceDao carBlackWhiteServiceDaoImpl) { |
| | | this.carBlackWhiteServiceDaoImpl = carBlackWhiteServiceDaoImpl; |
| | | } |
| | | |
| | | public IUserInnerServiceSMO getUserInnerServiceSMOImpl() { |
| | | return userInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) { |
| | | this.userInnerServiceSMOImpl = userInnerServiceSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.components.carBlackWhite; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.carBlackWhite.IAddCarBlackWhiteSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 添加黑白名单组件 |
| | | */ |
| | | @Component("addCarBlackWhite") |
| | | public class AddCarBlackWhiteComponent { |
| | | |
| | | @Autowired |
| | | private IAddCarBlackWhiteSMO addCarBlackWhiteSMOImpl; |
| | | |
| | | /** |
| | | * 添加黑白名单数据 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | public ResponseEntity<String> save(IPageData pd){ |
| | | return addCarBlackWhiteSMOImpl.saveCarBlackWhite(pd); |
| | | } |
| | | |
| | | public IAddCarBlackWhiteSMO getAddCarBlackWhiteSMOImpl() { |
| | | return addCarBlackWhiteSMOImpl; |
| | | } |
| | | |
| | | public void setAddCarBlackWhiteSMOImpl(IAddCarBlackWhiteSMO addCarBlackWhiteSMOImpl) { |
| | | this.addCarBlackWhiteSMOImpl = addCarBlackWhiteSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.components.carBlackWhite; |
| | | |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.carBlackWhite.IListCarBlackWhitesSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | /** |
| | | * 黑白名单组件管理类 |
| | | * <p> |
| | | * add by wuxw |
| | | * <p> |
| | | * 2019-06-29 |
| | | */ |
| | | @Component("carBlackWhiteManage") |
| | | public class CarBlackWhiteManageComponent { |
| | | |
| | | @Autowired |
| | | private IListCarBlackWhitesSMO listCarBlackWhitesSMOImpl; |
| | | |
| | | /** |
| | | * 查询黑白名单列表 |
| | | * |
| | | * @param pd 页面数据封装 |
| | | * @return 返回 ResponseEntity 对象 |
| | | */ |
| | | public ResponseEntity<String> list(IPageData pd) { |
| | | return listCarBlackWhitesSMOImpl.listCarBlackWhites(pd); |
| | | } |
| | | |
| | | public IListCarBlackWhitesSMO getListCarBlackWhitesSMOImpl() { |
| | | return listCarBlackWhitesSMOImpl; |
| | | } |
| | | |
| | | public void setListCarBlackWhitesSMOImpl(IListCarBlackWhitesSMO listCarBlackWhitesSMOImpl) { |
| | | this.listCarBlackWhitesSMOImpl = listCarBlackWhitesSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.components.carBlackWhite; |
| | | |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.carBlackWhite.IListCarBlackWhitesSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | /** |
| | | * 应用组件管理类 |
| | | * <p> |
| | | * add by wuxw |
| | | * <p> |
| | | * 2019-06-29 |
| | | */ |
| | | @Component("chooseCarBlackWhite") |
| | | public class ChooseCarBlackWhiteComponent { |
| | | |
| | | @Autowired |
| | | private IListCarBlackWhitesSMO listCarBlackWhitesSMOImpl; |
| | | |
| | | /** |
| | | * 查询应用列表 |
| | | * |
| | | * @param pd 页面数据封装 |
| | | * @return 返回 ResponseEntity 对象 |
| | | */ |
| | | public ResponseEntity<String> list(IPageData pd) { |
| | | return listCarBlackWhitesSMOImpl.listCarBlackWhites(pd); |
| | | } |
| | | |
| | | public IListCarBlackWhitesSMO getListCarBlackWhitesSMOImpl() { |
| | | return listCarBlackWhitesSMOImpl; |
| | | } |
| | | |
| | | public void setListCarBlackWhitesSMOImpl(IListCarBlackWhitesSMO listCarBlackWhitesSMOImpl) { |
| | | this.listCarBlackWhitesSMOImpl = listCarBlackWhitesSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.components.carBlackWhite; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.carBlackWhite.IDeleteCarBlackWhiteSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 添加黑白名单组件 |
| | | */ |
| | | @Component("deleteCarBlackWhite") |
| | | public class DeleteCarBlackWhiteComponent { |
| | | |
| | | @Autowired |
| | | private IDeleteCarBlackWhiteSMO deleteCarBlackWhiteSMOImpl; |
| | | |
| | | /** |
| | | * 添加黑白名单数据 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | public ResponseEntity<String> delete(IPageData pd){ |
| | | return deleteCarBlackWhiteSMOImpl.deleteCarBlackWhite(pd); |
| | | } |
| | | |
| | | public IDeleteCarBlackWhiteSMO getDeleteCarBlackWhiteSMOImpl() { |
| | | return deleteCarBlackWhiteSMOImpl; |
| | | } |
| | | |
| | | public void setDeleteCarBlackWhiteSMOImpl(IDeleteCarBlackWhiteSMO deleteCarBlackWhiteSMOImpl) { |
| | | this.deleteCarBlackWhiteSMOImpl = deleteCarBlackWhiteSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.components.carBlackWhite; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.carBlackWhite.IEditCarBlackWhiteSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 编辑小区组件 |
| | | */ |
| | | @Component("editCarBlackWhite") |
| | | public class EditCarBlackWhiteComponent { |
| | | |
| | | @Autowired |
| | | private IEditCarBlackWhiteSMO editCarBlackWhiteSMOImpl; |
| | | |
| | | /** |
| | | * 添加小区数据 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | public ResponseEntity<String> update(IPageData pd){ |
| | | return editCarBlackWhiteSMOImpl.updateCarBlackWhite(pd); |
| | | } |
| | | |
| | | public IEditCarBlackWhiteSMO getEditCarBlackWhiteSMOImpl() { |
| | | return editCarBlackWhiteSMOImpl; |
| | | } |
| | | |
| | | public void setEditCarBlackWhiteSMOImpl(IEditCarBlackWhiteSMO editCarBlackWhiteSMOImpl) { |
| | | this.editCarBlackWhiteSMOImpl = editCarBlackWhiteSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.carBlackWhite; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 添加黑白名单接口 |
| | | * |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | public interface IAddCarBlackWhiteSMO { |
| | | |
| | | /** |
| | | * 添加黑白名单 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | ResponseEntity<String> saveCarBlackWhite(IPageData pd); |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.carBlackWhite; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 添加黑白名单接口 |
| | | * |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | public interface IDeleteCarBlackWhiteSMO { |
| | | |
| | | /** |
| | | * 添加黑白名单 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | ResponseEntity<String> deleteCarBlackWhite(IPageData pd); |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.carBlackWhite; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 修改黑白名单接口 |
| | | * |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | public interface IEditCarBlackWhiteSMO { |
| | | |
| | | /** |
| | | * 修改小区 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | ResponseEntity<String> updateCarBlackWhite(IPageData pd); |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.carBlackWhite; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.utils.exception.SMOException; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 黑白名单管理服务接口类 |
| | | * <p> |
| | | * add by wuxw 2019-06-29 |
| | | */ |
| | | public interface IListCarBlackWhitesSMO { |
| | | |
| | | /** |
| | | * 查询黑白名单信息 |
| | | * |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象数据 |
| | | * @throws SMOException 业务代码层 |
| | | */ |
| | | ResponseEntity<String> listCarBlackWhites(IPageData pd) throws SMOException; |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.carBlackWhite.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.component.AbstractComponentSMO; |
| | | import com.java110.utils.constant.PrivilegeCodeConstant; |
| | | import com.java110.utils.constant.ServiceConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.carBlackWhite.IAddCarBlackWhiteSMO; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | /** |
| | | * 添加小区服务实现类 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Service("addCarBlackWhiteSMOImpl") |
| | | public class AddCarBlackWhiteSMOImpl extends AbstractComponentSMO implements IAddCarBlackWhiteSMO { |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Override |
| | | protected void validate(IPageData pd, JSONObject paramIn) { |
| | | |
| | | //super.validatePageInfo(pd); |
| | | |
| | | //Assert.hasKeyAndValue(paramIn, "xxx", "xxx"); |
| | | Assert.hasKeyAndValue(paramIn, "blackWhite", "必填,请填写名单类型"); |
| | | Assert.hasKeyAndValue(paramIn, "carNum", "必填,请填写车牌号"); |
| | | Assert.hasKeyAndValue(paramIn, "communityId", "必填,请填写车牌号"); |
| | | Assert.hasKeyAndValue(paramIn, "startTime", "必填,请选择开始时间"); |
| | | Assert.hasKeyAndValue(paramIn, "endTime", "必填,请选择结束时间"); |
| | | |
| | | |
| | | //super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_CARBLACKWHITE); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) { |
| | | ResponseEntity<String> responseEntity = null; |
| | | super.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), |
| | | ServiceConstant.SERVICE_API_URL + "/api/carBlackWhite.saveCarBlackWhite", |
| | | HttpMethod.POST); |
| | | return responseEntity; |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> saveCarBlackWhite(IPageData pd) { |
| | | return super.businessProcess(pd); |
| | | } |
| | | |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |
| | | |
| | | public void setRestTemplate(RestTemplate restTemplate) { |
| | | this.restTemplate = restTemplate; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.carBlackWhite.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.component.AbstractComponentSMO; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.utils.constant.ServiceConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.web.smo.carBlackWhite.IDeleteCarBlackWhiteSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | |
| | | /** |
| | | * 添加小区服务实现类 |
| | | * delete by wuxw 2019-06-30 |
| | | */ |
| | | @Service("deleteCarBlackWhiteSMOImpl") |
| | | public class DeleteCarBlackWhiteSMOImpl extends AbstractComponentSMO implements IDeleteCarBlackWhiteSMO { |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Override |
| | | protected void validate(IPageData pd, JSONObject paramIn) { |
| | | |
| | | //super.validatePageInfo(pd); |
| | | |
| | | //Assert.hasKeyAndValue(paramIn, "xxx", "xxx"); |
| | | Assert.hasKeyAndValue(paramIn, "communityId", "必填,请填写车牌号"); |
| | | |
| | | Assert.hasKeyAndValue(paramIn, "bwId", "黑白名单ID不能为空"); |
| | | |
| | | |
| | | //super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_CARBLACKWHITE); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) { |
| | | ResponseEntity<String> responseEntity = null; |
| | | super.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), |
| | | ServiceConstant.SERVICE_API_URL + "/api/carBlackWhite.deleteCarBlackWhite", |
| | | HttpMethod.POST); |
| | | return responseEntity; |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> deleteCarBlackWhite(IPageData pd) { |
| | | return super.businessProcess(pd); |
| | | } |
| | | |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |
| | | |
| | | public void setRestTemplate(RestTemplate restTemplate) { |
| | | this.restTemplate = restTemplate; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.carBlackWhite.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.component.AbstractComponentSMO; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.utils.constant.ServiceConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.web.smo.carBlackWhite.IEditCarBlackWhiteSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | /** |
| | | * 添加黑白名单服务实现类 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Service("eidtCarBlackWhiteSMOImpl") |
| | | public class EditCarBlackWhiteSMOImpl extends AbstractComponentSMO implements IEditCarBlackWhiteSMO { |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Override |
| | | protected void validate(IPageData pd, JSONObject paramIn) { |
| | | |
| | | //super.validatePageInfo(pd); |
| | | Assert.hasKeyAndValue(paramIn, "communityId", "必填,请填写车牌号"); |
| | | |
| | | Assert.hasKeyAndValue(paramIn, "bwId", "黑白名单ID不能为空"); |
| | | Assert.hasKeyAndValue(paramIn, "blackWhite", "必填,请填写名单类型"); |
| | | Assert.hasKeyAndValue(paramIn, "carNum", "必填,请填写车牌号"); |
| | | Assert.hasKeyAndValue(paramIn, "startTime", "必填,请选择开始时间"); |
| | | Assert.hasKeyAndValue(paramIn, "endTime", "必填,请选择结束时间"); |
| | | |
| | | |
| | | //super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST__CARBLACKWHITE); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) { |
| | | ResponseEntity<String> responseEntity = null; |
| | | super.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), |
| | | ServiceConstant.SERVICE_API_URL + "/api/carBlackWhite.updateCarBlackWhite", |
| | | HttpMethod.POST); |
| | | return responseEntity; |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> updateCarBlackWhite(IPageData pd) { |
| | | return super.businessProcess(pd); |
| | | } |
| | | |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |
| | | |
| | | public void setRestTemplate(RestTemplate restTemplate) { |
| | | this.restTemplate = restTemplate; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.carBlackWhite.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.component.AbstractComponentSMO; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.entity.component.ComponentValidateResult; |
| | | import com.java110.utils.constant.ServiceConstant; |
| | | import com.java110.utils.exception.SMOException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.web.smo.carBlackWhite.IListCarBlackWhitesSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 查询carBlackWhite服务类 |
| | | */ |
| | | @Service("listCarBlackWhitesSMOImpl") |
| | | public class ListCarBlackWhitesSMOImpl extends AbstractComponentSMO implements IListCarBlackWhitesSMO { |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Override |
| | | public ResponseEntity<String> listCarBlackWhites(IPageData pd) throws SMOException { |
| | | return businessProcess(pd); |
| | | } |
| | | |
| | | @Override |
| | | protected void validate(IPageData pd, JSONObject paramIn) { |
| | | Assert.hasKeyAndValue(paramIn, "communityId", "必填,请填写车牌号"); |
| | | super.validatePageInfo(pd); |
| | | |
| | | //super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_CARBLACKWHITE); |
| | | } |
| | | |
| | | @Override |
| | | protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) { |
| | | ComponentValidateResult result = super.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | |
| | | Map paramMap = BeanConvertUtil.beanCovertMap(result); |
| | | paramIn.putAll(paramMap); |
| | | |
| | | String apiUrl = ServiceConstant.SERVICE_API_URL + "/api/carBlackWhite.listCarBlackWhites" + mapToUrlParam(paramIn); |
| | | |
| | | |
| | | ResponseEntity<String> responseEntity = this.callCenterService(restTemplate, pd, "", |
| | | apiUrl, |
| | | HttpMethod.GET); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |
| | | |
| | | public void setRestTemplate(RestTemplate restTemplate) { |
| | | this.restTemplate = restTemplate; |
| | | } |
| | | } |
| New file |
| | |
| | | <div id="addCarBlackWhiteModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" |
| | | aria-hidden="true"> |
| | | <div class="modal-dialog modal-lg"> |
| | | <div class="modal-content"> |
| | | <div class="modal-body"> |
| | | <h3 class="m-t-none m-b ">添加名单</h3> |
| | | <div class="ibox-content"> |
| | | <div> |
| | | <div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">名单类型</label> |
| | | <div class="col-sm-10"> |
| | | <select class="custom-select" v-model="addCarBlackWhiteInfo.blackWhite"> |
| | | <option selected disabled value="">必填,请选择名单类型</option> |
| | | <option value="1111">黑名单</option> |
| | | <option value="2222">白名单</option> |
| | | </select></div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">车牌号</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="addCarBlackWhiteInfo.carNum" type="text" placeholder="必填,请填写车牌号" |
| | | class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">开始时间</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="addCarBlackWhiteInfo.startTime" type="text" placeholder="必填,请填写开始时间" |
| | | class="form-control addCarBlackWhiteStartTime"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">结束时间</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="addCarBlackWhiteInfo.endTime" type="text" placeholder="必填,请填写结束时间" |
| | | class="form-control addCarBlackWhiteEndTime"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="ibox-content"> |
| | | <button class="btn btn-primary float-right" type="button" |
| | | v-on:click="saveCarBlackWhiteInfo()"><i class="fa fa-check"></i> 保存 |
| | | </button> |
| | | <button type="button" class="btn btn-warning float-right" style="margin-right:20px;" |
| | | data-dismiss="modal">取消 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| New file |
| | |
| | | (function(vc) { |
| | | |
| | | vc.extends({ |
| | | propTypes: { |
| | | callBackListener: vc.propTypes.string, |
| | | //父组件名称 |
| | | callBackFunction: vc.propTypes.string //父组件监听方法 |
| | | }, |
| | | data: { |
| | | addCarBlackWhiteInfo: { |
| | | bwId: '', |
| | | blackWhite: '', |
| | | carNum: '', |
| | | startTime: '', |
| | | endTime: '', |
| | | |
| | | } |
| | | }, |
| | | _initMethod: function() { |
| | | vc.component._initAddCarBlackWhiteDateInfo(); |
| | | |
| | | }, |
| | | _initEvent: function() { |
| | | vc.on('addCarBlackWhite', 'openAddCarBlackWhiteModal', |
| | | function() { |
| | | $('#addCarBlackWhiteModel').modal('show'); |
| | | }); |
| | | }, |
| | | methods: { |
| | | _initAddCarBlackWhiteDateInfo: function () { |
| | | vc.component.addApplicationKeyInfo.startTime = vc.dateFormat(new Date().getTime()); |
| | | $('.addCarBlackWhiteStartTime').datetimepicker({ |
| | | language: 'zh-CN', |
| | | format: 'yyyy-mm-dd hh:ii:ss', |
| | | initTime: true, |
| | | initialDate: new Date(), |
| | | autoClose: 1, |
| | | todayBtn: true |
| | | |
| | | }); |
| | | $('.addCarBlackWhiteStartTime').datetimepicker() |
| | | .on('changeDate', function (ev) { |
| | | var value = $(".addCarBlackWhiteStartTime").val(); |
| | | vc.component.addCarBlackWhiteInfo.startTime = value; |
| | | }); |
| | | $('.addCarBlackWhiteEndTime').datetimepicker({ |
| | | language: 'zh-CN', |
| | | format: 'yyyy-mm-dd hh:ii:ss', |
| | | initTime: true, |
| | | initialDate: new Date(), |
| | | autoClose: 1, |
| | | todayBtn: true |
| | | }); |
| | | $('.addCarBlackWhiteEndTime').datetimepicker() |
| | | .on('changeDate', function (ev) { |
| | | var value = $(".addCarBlackWhiteEndTime").val(); |
| | | vc.component.addCarBlackWhiteInfo.endTime = value; |
| | | }); |
| | | }, |
| | | addCarBlackWhiteValidate() { |
| | | return vc.validate.validate({ |
| | | addCarBlackWhiteInfo: vc.component.addCarBlackWhiteInfo |
| | | }, |
| | | { |
| | | 'addCarBlackWhiteInfo.blackWhite': [{ |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "名单类型不能为空" |
| | | }, |
| | | { |
| | | limit: "num", |
| | | param: "", |
| | | errInfo: "名单类型格式错误" |
| | | }, |
| | | ], |
| | | 'addCarBlackWhiteInfo.carNum': [{ |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "车牌号不能为空" |
| | | }, |
| | | { |
| | | limit: "maxin", |
| | | param: "1,12", |
| | | errInfo: "车牌号大于12位" |
| | | }, |
| | | ], |
| | | 'addCarBlackWhiteInfo.startTime': [{ |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "开始时间不能为空" |
| | | }, |
| | | { |
| | | limit: "dateTime", |
| | | param: "", |
| | | errInfo: "不是有效的时间格式" |
| | | }, |
| | | ], |
| | | 'addCarBlackWhiteInfo.endTime': [{ |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "结束时间不能为空" |
| | | }, |
| | | { |
| | | limit: "dateTime", |
| | | param: "", |
| | | errInfo: "不是有效的时间格式" |
| | | }, |
| | | ], |
| | | |
| | | }); |
| | | }, |
| | | saveCarBlackWhiteInfo: function() { |
| | | if (!vc.component.addCarBlackWhiteValidate()) { |
| | | vc.toast(vc.validate.errInfo); |
| | | |
| | | return; |
| | | } |
| | | |
| | | vc.component.addCarBlackWhiteInfo.communityId = vc.getCurrentCommunity().communityId; |
| | | //不提交数据将数据 回调给侦听处理 |
| | | if (vc.notNull($props.callBackListener)) { |
| | | vc.emit($props.callBackListener, $props.callBackFunction, vc.component.addCarBlackWhiteInfo); |
| | | $('#addCarBlackWhiteModel').modal('hide'); |
| | | return; |
| | | } |
| | | |
| | | vc.http.post('addCarBlackWhite', 'save', JSON.stringify(vc.component.addCarBlackWhiteInfo), { |
| | | emulateJSON: true |
| | | }, |
| | | function(json, res) { |
| | | //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); |
| | | if (res.status == 200) { |
| | | //关闭model |
| | | $('#addCarBlackWhiteModel').modal('hide'); |
| | | vc.component.clearAddCarBlackWhiteInfo(); |
| | | vc.emit('carBlackWhiteManage', 'listCarBlackWhite', {}); |
| | | |
| | | return; |
| | | } |
| | | vc.message(json); |
| | | |
| | | }, |
| | | function(errInfo, error) { |
| | | console.log('请求失败处理'); |
| | | |
| | | vc.message(errInfo); |
| | | |
| | | }); |
| | | }, |
| | | clearAddCarBlackWhiteInfo: function() { |
| | | vc.component.addCarBlackWhiteInfo = { |
| | | blackWhite: '', |
| | | carNum: '', |
| | | startTime: '', |
| | | endTime: '', |
| | | |
| | | }; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | })(window.vc); |
| New file |
| | |
| | | <div id="component" class="wrapper wrapper-content animated fadeInRight ecommerce"> |
| | | <div class="row"> |
| | | <div class="col-lg-12"> |
| | | <div class="ibox "> |
| | | <div class="ibox-title"> |
| | | <h5>查询条件</h5> |
| | | <div class="ibox-tools" style="top:10px;"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row"> |
| | | <div class="col-sm-4" > |
| | | <select class="custom-select" v-model="carBlackWhiteManageInfo.conditions.blackWhite"> |
| | | <option selected value="">请选择名单类型</option> |
| | | <option value="1111">黑名单</option> |
| | | <option value="2222">白名单</option> |
| | | </select> </div><div class="col-sm-4" > |
| | | <div class="form-group"> |
| | | <input type="text" placeholder="请输入车牌号" v-model="carBlackWhiteManageInfo.conditions.carNum" class=" form-control"> |
| | | </div> </div><div class="col-sm-3" > |
| | | <div class="form-group"> |
| | | <input type="text" placeholder="请输入名单ID" v-model="carBlackWhiteManageInfo.conditions.bwId" class=" form-control"> |
| | | </div> </div><div class="col-sm-1"> |
| | | <button type="button" class="btn btn-primary btn-sm" v-on:click="_queryCarBlackWhiteMethod()"> |
| | | <i class="glyphicon glyphicon-search"></i> 查询 |
| | | </button> |
| | | </div></div> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-lg-12"> |
| | | <div class="ibox"> |
| | | <div class="ibox-title"> |
| | | <h5>黑白名单信息</h5> |
| | | <div class="ibox-tools" style="top:10px;"> |
| | | <button type="button" class="btn btn-primary btn-sm" v-on:click="_openAddCarBlackWhiteModal()"> |
| | | <i class="glyphicon glyphicon-plus"></i> |
| | | 添加黑白名单 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | |
| | | <table class="footable table table-stripped toggle-arrow-tiny" |
| | | data-page-size="15" |
| | | > |
| | | <thead> |
| | | <tr> |
| | | <th class="text-center">黑白名单ID</th> |
| | | <th class="text-center">名单类型</th> |
| | | <th class="text-center">车牌号</th> |
| | | <th class="text-center">开始时间</th> |
| | | <th class="text-center">结束时间</th> |
| | | <th class="text-center">操作</th> |
| | | |
| | | |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <tr v-for="carBlackWhite in carBlackWhiteManageInfo.carBlackWhites"> |
| | | <td class="text-center">{{carBlackWhite.bwId}}</td> |
| | | <td class="text-center">{{carBlackWhite.blackWhite}}</td> |
| | | <td class="text-center">{{carBlackWhite.carNum}}</td> |
| | | <td class="text-center">{{carBlackWhite.startTime}}</td> |
| | | <td class="text-center">{{carBlackWhite.endTime}}</td> |
| | | <td class="text-center"><div class="btn-group"> |
| | | <button class="btn-white btn btn-xs" v-on:click="_openEditCarBlackWhiteModel(carBlackWhite)">修改</button> |
| | | </div> |
| | | <div class="btn-group"> |
| | | <button class="btn-white btn btn-xs" v-on:click="_openDeleteCarBlackWhiteModel(carBlackWhite)">删除</button> |
| | | </div></td> |
| | | |
| | | </tr> |
| | | </tbody> |
| | | <tfoot> |
| | | <tr> |
| | | <td colspan="7"> |
| | | <ul class="pagination float-right"></ul> |
| | | </td> |
| | | </tr> |
| | | </tfoot> |
| | | </table> |
| | | <!-- 分页 --> |
| | | <vc:create name="pagination"></vc:create> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | <vc:create name="addCarBlackWhite" |
| | | callBackListener="" |
| | | callBackFunction="" |
| | | ></vc:create> |
| | | <vc:create name="editCarBlackWhite"></vc:create> |
| | | <vc:create name="deleteCarBlackWhite"></vc:create> |
| | | |
| | | </div> |
| New file |
| | |
| | | /** |
| | | 入驻小区 |
| | | **/ |
| | | (function(vc){ |
| | | var DEFAULT_PAGE = 1; |
| | | var DEFAULT_ROWS = 10; |
| | | vc.extends({ |
| | | data:{ |
| | | carBlackWhiteManageInfo:{ |
| | | carBlackWhites:[], |
| | | total:0, |
| | | records:1, |
| | | moreCondition:false, |
| | | carNum:'', |
| | | conditions:{ |
| | | blackWhite:'', |
| | | carNum:'', |
| | | bwId:'', |
| | | |
| | | } |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | vc.component._listCarBlackWhites(DEFAULT_PAGE, DEFAULT_ROWS); |
| | | }, |
| | | _initEvent:function(){ |
| | | |
| | | vc.on('carBlackWhiteManage','listCarBlackWhite',function(_param){ |
| | | vc.component._listCarBlackWhites(DEFAULT_PAGE, DEFAULT_ROWS); |
| | | }); |
| | | vc.on('pagination','page_event',function(_currentPage){ |
| | | vc.component._listCarBlackWhites(_currentPage,DEFAULT_ROWS); |
| | | }); |
| | | }, |
| | | methods:{ |
| | | _listCarBlackWhites:function(_page, _rows){ |
| | | |
| | | vc.component.carBlackWhiteManageInfo.conditions.page = _page; |
| | | vc.component.carBlackWhiteManageInfo.conditions.row = _rows; |
| | | vc.component.carBlackWhiteManageInfo.conditions.communityId = vc.getCurrentCommunity().communityId; |
| | | |
| | | var param = { |
| | | params:vc.component.carBlackWhiteManageInfo.conditions |
| | | }; |
| | | |
| | | //发送get请求 |
| | | vc.http.get('carBlackWhiteManage', |
| | | 'list', |
| | | param, |
| | | function(json,res){ |
| | | var _carBlackWhiteManageInfo=JSON.parse(json); |
| | | vc.component.carBlackWhiteManageInfo.total = _carBlackWhiteManageInfo.total; |
| | | vc.component.carBlackWhiteManageInfo.records = _carBlackWhiteManageInfo.records; |
| | | vc.component.carBlackWhiteManageInfo.carBlackWhites = _carBlackWhiteManageInfo.carBlackWhites; |
| | | vc.emit('pagination','init',{ |
| | | total:vc.component.carBlackWhiteManageInfo.records, |
| | | currentPage:_page |
| | | }); |
| | | },function(errInfo,error){ |
| | | console.log('请求失败处理'); |
| | | } |
| | | ); |
| | | }, |
| | | _openAddCarBlackWhiteModal:function(){ |
| | | vc.emit('addCarBlackWhite','openAddCarBlackWhiteModal',{}); |
| | | }, |
| | | _openEditCarBlackWhiteModel:function(_carBlackWhite){ |
| | | vc.emit('editCarBlackWhite','openEditCarBlackWhiteModal',_carBlackWhite); |
| | | }, |
| | | _openDeleteCarBlackWhiteModel:function(_carBlackWhite){ |
| | | vc.emit('deleteCarBlackWhite','openDeleteCarBlackWhiteModal',_carBlackWhite); |
| | | }, |
| | | _queryCarBlackWhiteMethod:function(){ |
| | | vc.component._listCarBlackWhites(DEFAULT_PAGE, DEFAULT_ROWS); |
| | | |
| | | }, |
| | | _moreCondition:function(){ |
| | | if(vc.component.carBlackWhiteManageInfo.moreCondition){ |
| | | vc.component.carBlackWhiteManageInfo.moreCondition = false; |
| | | }else{ |
| | | vc.component.carBlackWhiteManageInfo.moreCondition = true; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | }); |
| | | })(window.vc); |
| New file |
| | |
| | | <div id = "chooseCarBlackWhiteModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="chooseCarBlackWhiteModelLabel" aria-hidden="true" > |
| | | <div class="modal-dialog modal-lg"> |
| | | <div class="modal-content"> |
| | | <div class="modal-header"> |
| | | <h3 class="modal-title" id="chooseCarBlackWhiteModelLabel">选择黑白名单</h3> |
| | | <button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
| | | <span aria-hidden="true">×</span> |
| | | </button> |
| | | </div> |
| | | <div class="modal-body"> |
| | | <div class=" row"> |
| | | <div class="col-lg-12"> |
| | | <div class="ibox "> |
| | | <div class="row"> |
| | | |
| | | <div class="col-sm-7 m-b-xs"> |
| | | </div> |
| | | <div class="col-sm-5"> |
| | | <div class="input-group"> |
| | | <input placeholder="输入黑白名单名称" type="text" v-model="chooseCarBlackWhiteInfo._currentCarBlackWhiteName" class="form-control form-control-sm"> |
| | | <span class="input-group-append"> |
| | | <button type="button" class="btn btn-sm btn-primary" v-on:click="queryCarBlackWhites()">查询</button> |
| | | </span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="table-responsive" style="margin-top:15px"> |
| | | <table class="table table-striped"> |
| | | <thead> |
| | | <tr> |
| | | <th class="text-center">黑白名单ID</th> |
| | | <th class="text-center">名单类型</th> |
| | | <th class="text-center">车牌号</th> |
| | | <th class="text-center">开始时间</th> |
| | | <th class="text-center">结束时间</th> |
| | | <th class="text-center">操作</th> |
| | | |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <tr v-for="carBlackWhite in chooseCarBlackWhiteInfo.carBlackWhites"> |
| | | <td class="text-center">{{carBlackWhite.bwId}}</td> |
| | | <td class="text-center">{{carBlackWhite.blackWhite}}</td> |
| | | <td class="text-center">{{carBlackWhite.carNum}}</td> |
| | | <td class="text-center">{{carBlackWhite.startTime}}</td> |
| | | <td class="text-center">{{carBlackWhite.endTime}}</td> |
| | | |
| | | <td> |
| | | <button class="btn btn-primary btn-xs" v-on:click="chooseCarBlackWhite(carBlackWhite)">选择</button> |
| | | </td> |
| | | </tr> |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| New file |
| | |
| | | (function(vc){ |
| | | vc.extends({ |
| | | propTypes: { |
| | | emitChooseCarBlackWhite:vc.propTypes.string, |
| | | emitLoadData:vc.propTypes.string |
| | | }, |
| | | data:{ |
| | | chooseCarBlackWhiteInfo:{ |
| | | carBlackWhites:[], |
| | | _currentCarBlackWhiteName:'', |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on('chooseCarBlackWhite','openChooseCarBlackWhiteModel',function(_param){ |
| | | $('#chooseCarBlackWhiteModel').modal('show'); |
| | | vc.component._refreshChooseCarBlackWhiteInfo(); |
| | | vc.component._loadAllCarBlackWhiteInfo(1,10,''); |
| | | }); |
| | | }, |
| | | methods:{ |
| | | _loadAllCarBlackWhiteInfo:function(_page,_row,_name){ |
| | | var param = { |
| | | params:{ |
| | | page:_page, |
| | | row:_row, |
| | | communityId:vc.getCurrentCommunity().communityId, |
| | | name:_name |
| | | } |
| | | }; |
| | | |
| | | //发送get请求 |
| | | vc.http.get('chooseCarBlackWhite', |
| | | 'list', |
| | | param, |
| | | function(json){ |
| | | var _carBlackWhiteInfo = JSON.parse(json); |
| | | vc.component.chooseCarBlackWhiteInfo.carBlackWhites = _carBlackWhiteInfo.carBlackWhites; |
| | | },function(){ |
| | | console.log('请求失败处理'); |
| | | } |
| | | ); |
| | | }, |
| | | chooseCarBlackWhite:function(_carBlackWhite){ |
| | | if(_carBlackWhite.hasOwnProperty('name')){ |
| | | _carBlackWhite.carBlackWhiteName = _carBlackWhite.name; |
| | | } |
| | | vc.emit($props.emitChooseCarBlackWhite,'chooseCarBlackWhite',_carBlackWhite); |
| | | vc.emit($props.emitLoadData,'listCarBlackWhiteData',{ |
| | | carBlackWhiteId:_carBlackWhite.carBlackWhiteId |
| | | }); |
| | | $('#chooseCarBlackWhiteModel').modal('hide'); |
| | | }, |
| | | queryCarBlackWhites:function(){ |
| | | vc.component._loadAllCarBlackWhiteInfo(1,10,vc.component.chooseCarBlackWhiteInfo._currentCarBlackWhiteName); |
| | | }, |
| | | _refreshChooseCarBlackWhiteInfo:function(){ |
| | | vc.component.chooseCarBlackWhiteInfo._currentCarBlackWhiteName = ""; |
| | | } |
| | | } |
| | | |
| | | }); |
| | | })(window.vc); |
| New file |
| | |
| | | <div class="modal fade" id="deleteCarBlackWhiteModel" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> |
| | | <div class="modal-dialog" role="document"> |
| | | <div class="modal-content"> |
| | | <div class="modal-header"> |
| | | <h5 class="modal-title" id="exampleModalLabel">请确认您的操作!</h5> |
| | | <button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
| | | <span aria-hidden="true">×</span> |
| | | </button> |
| | | </div> |
| | | <div class="modal-body"> |
| | | <tr align="center"><th>确定删除黑白名单</th></tr> |
| | | </div> |
| | | <div class="modal-footer"> |
| | | <button type="button" class="btn btn-secondary" data-dismiss="modal" v-on:click="closeDeleteCarBlackWhiteModel()">点错了</button> |
| | | <button type="button" class="btn btn-primary" v-on:click="deleteCarBlackWhite()">确认删除</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| New file |
| | |
| | | (function(vc,vm){ |
| | | |
| | | vc.extends({ |
| | | data:{ |
| | | deleteCarBlackWhiteInfo:{ |
| | | |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on('deleteCarBlackWhite','openDeleteCarBlackWhiteModal',function(_params){ |
| | | |
| | | vc.component.deleteCarBlackWhiteInfo = _params; |
| | | $('#deleteCarBlackWhiteModel').modal('show'); |
| | | |
| | | }); |
| | | }, |
| | | methods:{ |
| | | deleteCarBlackWhite:function(){ |
| | | vc.component.deleteCarBlackWhiteInfo.communityId=vc.getCurrentCommunity().communityId; |
| | | vc.http.post( |
| | | 'deleteCarBlackWhite', |
| | | 'delete', |
| | | JSON.stringify(vc.component.deleteCarBlackWhiteInfo), |
| | | { |
| | | emulateJSON:true |
| | | }, |
| | | function(json,res){ |
| | | //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); |
| | | if(res.status == 200){ |
| | | //关闭model |
| | | $('#deleteCarBlackWhiteModel').modal('hide'); |
| | | vc.emit('carBlackWhiteManage','listCarBlackWhite',{}); |
| | | return ; |
| | | } |
| | | vc.message(json); |
| | | }, |
| | | function(errInfo,error){ |
| | | console.log('请求失败处理'); |
| | | vc.message(json); |
| | | |
| | | }); |
| | | }, |
| | | closeDeleteCarBlackWhiteModel:function(){ |
| | | $('#deleteCarBlackWhiteModel').modal('hide'); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | })(window.vc,window.vc.component); |
| New file |
| | |
| | | <div id = "editCarBlackWhiteModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" > |
| | | <div class="modal-dialog modal-lg"> |
| | | <div class="modal-content"> |
| | | <div class="modal-body"> |
| | | <h3 class="m-t-none m-b ">修改黑白名单</h3> |
| | | <div class="ibox-content"> |
| | | <div> |
| | | <div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">名单类型</label> |
| | | <div class="col-sm-10"> |
| | | <select class="custom-select" v-model="editCarBlackWhiteInfo.blackWhite"> |
| | | <option selected disabled value="">必填,请选择名单类型</option> |
| | | <option value="1111">黑名单</option> |
| | | <option value="2222">白名单</option> |
| | | </select> </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">车牌号</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="editCarBlackWhiteInfo.carNum" type="text" placeholder="必填,请填写车牌号" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">开始时间</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="editCarBlackWhiteInfo.startTime" type="text" placeholder="必填,请填写开始时间" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">结束时间</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="editCarBlackWhiteInfo.endTime" type="text" placeholder="必填,请填写结束时间" class="form-control"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="ibox-content"> |
| | | <button class="btn btn-primary float-right" type="button" v-on:click="editCarBlackWhite()" ><i class="fa fa-check"></i> 保存</button> |
| | | <button type="button" class="btn btn-warning float-right" style="margin-right:20px;" data-dismiss="modal">取消</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| New file |
| | |
| | | (function(vc, vm) { |
| | | |
| | | vc.extends({ |
| | | data: { |
| | | editCarBlackWhiteInfo: { |
| | | bwId: '', |
| | | blackWhite: '', |
| | | carNum: '', |
| | | startTime: '', |
| | | endTime: '', |
| | | |
| | | } |
| | | }, |
| | | _initMethod: function() { |
| | | vc.component._initEditCarBlackWhiteDateInfo(); |
| | | }, |
| | | _initEvent: function() { |
| | | vc.on('editCarBlackWhite', 'openEditCarBlackWhiteModal', |
| | | function(_params) { |
| | | vc.component.refreshEditCarBlackWhiteInfo(); |
| | | $('#editCarBlackWhiteModel').modal('show'); |
| | | vc.copyObject(_params, vc.component.editCarBlackWhiteInfo); |
| | | vc.component.editCarBlackWhiteInfo.communityId = vc.getCurrentCommunity().communityId; |
| | | }); |
| | | }, |
| | | methods: { |
| | | _initEditCarBlackWhiteDateInfo: function () { |
| | | vc.component.editCarBlackWhiteInfo.startTime = vc.dateFormat(new Date().getTime()); |
| | | $('.editCarBlackWhiteStartTime').datetimepicker({ |
| | | language: 'zh-CN', |
| | | format: 'yyyy-mm-dd hh:ii:ss', |
| | | initTime: true, |
| | | initialDate: new Date(), |
| | | autoClose: 1, |
| | | todayBtn: true |
| | | |
| | | }); |
| | | $('.editCarBlackWhiteStartTime').datetimepicker() |
| | | .on('changeDate', function (ev) { |
| | | var value = $(".editCarBlackWhiteStartTime").val(); |
| | | vc.component.editCarBlackWhiteInfo.startTime = value; |
| | | }); |
| | | $('.editCarBlackWhiteEndTime').datetimepicker({ |
| | | language: 'zh-CN', |
| | | format: 'yyyy-mm-dd hh:ii:ss', |
| | | initTime: true, |
| | | initialDate: new Date(), |
| | | autoClose: 1, |
| | | todayBtn: true |
| | | }); |
| | | $('.editCarBlackWhiteEndTime').datetimepicker() |
| | | .on('changeDate', function (ev) { |
| | | var value = $(".editCarBlackWhiteEndTime").val(); |
| | | vc.component.editCarBlackWhiteInfo.endTime = value; |
| | | }); |
| | | }, |
| | | editCarBlackWhiteValidate: function() { |
| | | return vc.validate.validate({ |
| | | editCarBlackWhiteInfo: vc.component.editCarBlackWhiteInfo |
| | | }, |
| | | { |
| | | 'editCarBlackWhiteInfo.blackWhite': [{ |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "名单类型不能为空" |
| | | }, |
| | | { |
| | | limit: "num", |
| | | param: "", |
| | | errInfo: "名单类型格式错误" |
| | | }, |
| | | ], |
| | | 'editCarBlackWhiteInfo.carNum': [{ |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "车牌号不能为空" |
| | | }, |
| | | { |
| | | limit: "maxin", |
| | | param: "1,12", |
| | | errInfo: "车牌号大于12位" |
| | | }, |
| | | ], |
| | | 'editCarBlackWhiteInfo.startTime': [{ |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "开始时间不能为空" |
| | | }, |
| | | { |
| | | limit: "dateTime", |
| | | param: "", |
| | | errInfo: "不是有效的时间格式" |
| | | }, |
| | | ], |
| | | 'editCarBlackWhiteInfo.endTime': [{ |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "结束时间不能为空" |
| | | }, |
| | | { |
| | | limit: "dateTime", |
| | | param: "", |
| | | errInfo: "不是有效的时间格式" |
| | | }, |
| | | ], |
| | | 'editCarBlackWhiteInfo.bwId': [{ |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "黑白名单ID不能为空" |
| | | }] |
| | | |
| | | }); |
| | | }, |
| | | editCarBlackWhite: function() { |
| | | vc.component.editCarBlackWhiteInfo.communityId = vc.getCurrentCommunity().communityId; |
| | | |
| | | if (!vc.component.editCarBlackWhiteValidate()) { |
| | | vc.toast(vc.validate.errInfo); |
| | | return; |
| | | } |
| | | |
| | | vc.http.post('editCarBlackWhite', 'update', JSON.stringify(vc.component.editCarBlackWhiteInfo), { |
| | | emulateJSON: true |
| | | }, |
| | | function(json, res) { |
| | | //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); |
| | | if (res.status == 200) { |
| | | //关闭model |
| | | $('#editCarBlackWhiteModel').modal('hide'); |
| | | vc.emit('carBlackWhiteManage', 'listCarBlackWhite', {}); |
| | | return; |
| | | } |
| | | vc.message(json); |
| | | }, |
| | | function(errInfo, error) { |
| | | console.log('请求失败处理'); |
| | | |
| | | vc.message(errInfo); |
| | | }); |
| | | }, |
| | | refreshEditCarBlackWhiteInfo: function() { |
| | | vc.component.editCarBlackWhiteInfo = { |
| | | bwId: '', |
| | | blackWhite: '', |
| | | carNum: '', |
| | | startTime: '', |
| | | endTime: '', |
| | | |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | |
| | | })(window.vc, window.vc.component); |
| New file |
| | |
| | | <div class="row"> |
| | | <div class="col-lg-12"> |
| | | <div class="ibox "> |
| | | <div class="ibox-title"> |
| | | <h5>黑白名单信息</h5> |
| | | <div class="ibox-tools" style="top:10px;"> |
| | | <button type="button" v-if="viewCarBlackWhiteInfo.index != 2" class="btn btn-primary btn-sm" style="margin-right:10px;" v-on:click="_openSelectCarBlackWhiteInfoModel()"> |
| | | <i class="glyphicon glyphicon-search"></i> 选择黑白名单</button> |
| | | |
| | | <button type="button" v-if="viewCarBlackWhiteInfo.index != 2" class="btn btn-primary btn-sm" v-on:click="_openAddCarBlackWhiteInfoModel()"> |
| | | <i class="glyphicon glyphicon-plus"></i> 添加黑白名单</button> |
| | | </div> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row"> |
| | | <div class="col-sm-4"> |
| | | <div class="form-group"> |
| | | <label class="col-form-label" >名单类型:</label> |
| | | <label class="">{{viewCarBlackWhiteInfo.blackWhite}}</label> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-4"> |
| | | <div class="form-group"> |
| | | <label class="col-form-label" >车牌号:</label> |
| | | <label class="">{{viewCarBlackWhiteInfo.carNum}}</label> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-4"> |
| | | <div class="form-group"> |
| | | <label class="col-form-label" >开始时间:</label> |
| | | <label class="">{{viewCarBlackWhiteInfo.startTime}}</label> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-sm-4"> |
| | | <div class="form-group"> |
| | | <label class="col-form-label" >结束时间:</label> |
| | | <label class="">{{viewCarBlackWhiteInfo.endTime}}</label> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <vc:create name="addCarBlackWhite" |
| | | callBackListener="viewCarBlackWhiteInfo" |
| | | callBackFunction="chooseCarBlackWhite" |
| | | ></vc:create> |
| | | |
| | | |
| | | <vc:create name="chooseCarBlackWhite" |
| | | emitChooseCarBlackWhite="viewCarBlackWhiteInfo" |
| | | emitLoadData="viewCarBlackWhiteInfo" |
| | | ></vc:create> |
| | | </div> |
| New file |
| | |
| | | /** |
| | | 黑白名单 组件 |
| | | **/ |
| | | (function(vc){ |
| | | |
| | | vc.extends({ |
| | | propTypes: { |
| | | callBackListener:vc.propTypes.string, //父组件名称 |
| | | callBackFunction:vc.propTypes.string //父组件监听方法 |
| | | }, |
| | | data:{ |
| | | viewCarBlackWhiteInfo:{ |
| | | index:0, |
| | | flowComponent:'viewCarBlackWhiteInfo', |
| | | blackWhite:'', |
| | | carNum:'', |
| | | startTime:'', |
| | | endTime:'', |
| | | |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | //根据请求参数查询 查询 业主信息 |
| | | vc.component._loadCarBlackWhiteInfoData(); |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on('viewCarBlackWhiteInfo','chooseCarBlackWhite',function(_app){ |
| | | vc.copyObject(_app, vc.component.viewCarBlackWhiteInfo); |
| | | vc.emit($props.callBackListener,$props.callBackFunction,vc.component.viewCarBlackWhiteInfo); |
| | | }); |
| | | |
| | | vc.on('viewCarBlackWhiteInfo', 'onIndex', function(_index){ |
| | | vc.component.viewCarBlackWhiteInfo.index = _index; |
| | | }); |
| | | |
| | | }, |
| | | methods:{ |
| | | |
| | | _openSelectCarBlackWhiteInfoModel(){ |
| | | vc.emit('chooseCarBlackWhite','openChooseCarBlackWhiteModel',{}); |
| | | }, |
| | | _openAddCarBlackWhiteInfoModel(){ |
| | | vc.emit('addCarBlackWhite','openAddCarBlackWhiteModal',{}); |
| | | }, |
| | | _loadCarBlackWhiteInfoData:function(){ |
| | | |
| | | } |
| | | } |
| | | }); |
| | | |
| | | })(window.vc); |
| New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en" |
| | | xmlns="http://www.w3.org/1999/xhtml" |
| | | xmlns:th="http://www.thymeleaf.org" |
| | | xmlns:vc="http://www.thymeleaf.org"> |
| | | <head> |
| | | <meta charset="UTF-8"/> |
| | | <title>黑白名单初始化|java110</title> |
| | | <vc:create name="commonTop"></vc:create> |
| | | </head> |
| | | <body> |
| | | <vc:create name="bodyTop"></vc:create> |
| | | <div id="wrapper"> |
| | | <vc:create name="menu"></vc:create> |
| | | |
| | | |
| | | <div id="page-wrapper" class="gray-bg dashbard-1"> |
| | | <div class="row border-bottom"> |
| | | <vc:create name="nav"></vc:create> |
| | | </div> |
| | | <div class="wrapper wrapper-content" style="padding-bottom: 0px;"> |
| | | <vc:create name="breadcrumb"></vc:create> |
| | | </div> |
| | | <!-- id="component" --> |
| | | <div class="wrapper wrapper-content animated fadeInRight"> |
| | | <vc:create name="carBlackWhiteManage"></vc:create> |
| | | </div> |
| | | |
| | | <vc:create name="copyright"></vc:create> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <vc:create name="commonBottom"></vc:create> |
| | | </body> |
| | | </html> |
| New file |
| | |
| | | |
| | | |
| | | **1\. 删除黑白名单** |
| | | ###### 接口功能 |
| | | > API服务做删除黑白名单时调用该接口 |
| | | |
| | | ###### URL |
| | | > [http://carBlackWhite-service/carBlackWhiteApi/service](http://carBlackWhite-service/carBlackWhiteApi/service) |
| | | |
| | | ###### 支持格式 |
| | | > JSON |
| | | |
| | | ###### HTTP请求方式 |
| | | > POST |
| | | |
| | | ###### 协议接口 |
| | | |父元素名称|参数名称|约束|类型|长度|描述|取值说明| |
| | | | :-: | :-: | :-: | :-: | :-: | :-: | :-:| |
| | | |-|orders|1|Object|-|订单节点|-| |
| | | |-|business|1|Array|-|业务节点|-| |
| | | |
| | | ###### orders |
| | | |父元素名称|参数名称|约束|类型|长度|描述|取值说明| |
| | | | :-: | :-: | :-: | :-: | :-: | :-: | :-: | |
| | | |-|orders|1|Object|-|订单节点|-| |
| | | |orders|appId|1|String|10|系统ID|由中心服务提供| |
| | | |orders|transactionId|1|String|30|交互流水|appId+'00'+YYYYMMDD+10位序列| |
| | | |orders|userId|1|String|30|用户ID|已有用户ID| |
| | | |orders|orderTypeCd|1|String|4|订单类型|查看订单类型说明| |
| | | |orders|requestTime|1|String|14|请求时间|YYYYMMDDhhmmss| |
| | | |orders|remark|1|String|200|备注|备注| |
| | | |orders|sign|?|String|64|签名|查看加密说明| |
| | | |orders|attrs|?|Array|-|订单属性|-| |
| | | |attrs|specCd|1|String|12|规格编码|由中心服务提供| |
| | | |attrs|value|1|String|50|属性值|-| |
| | | |orders|response|1|Object|-|返回结果节点|-| |
| | | |response|code|1|String|4|返回状态|查看状态说明| |
| | | |response|message|1|String|200|返回状态描述|-| |
| | | |
| | | ###### business |
| | | |父元素名称|参数名称|约束|类型|长度|描述|取值说明| |
| | | | :-: | :-: | :-: | :-: | :-: | :-: | :-: | |
| | | |-|business|?|Array|-|业务节点|-| |
| | | |business|businessTypeCd|1|String|12|业务类型编码|500100030002| |
| | | |business|datas|1|Object|-|数据节点|不同的服务下的节点不一样| |
| | | |datas|businessCarBlackWhiteInfo|1|Object|-|小区成员|小区成员| |
| | | |businessCarBlackWhiteInfo|bwId|1|String|30|-|-| |
| | | |
| | | |
| | | ###### 返回协议 |
| | | |
| | | 当http返回状态不为200 时请求处理失败 body内容为失败的原因 |
| | | |
| | | 当http返回状态为200时请求处理成功,body内容为返回内容, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | ###### 举例 |
| | | > 地址:[http://carBlackWhite-service/carBlackWhiteApi/service](http://carBlackWhite-service/carBlackWhiteApi/service) |
| | | |
| | | ``` javascript |
| | | 请求头信息: |
| | | Content-Type:application/json |
| | | |
| | | 请求报文: |
| | | |
| | | { |
| | | "orders": { |
| | | "appId": "外系统ID,分配得到", |
| | | "transactionId": "100000000020180409224736000001", |
| | | "userId": "用户ID", |
| | | "orderTypeCd": "订单类型,查询,受理", |
| | | "requestTime": "20180409224736", |
| | | "remark": "备注", |
| | | "sign": "这个服务是否要求MD5签名", |
| | | "businessType":"I", |
| | | "attrs": [{ |
| | | "specCd": "配置的字段ID", |
| | | "value": "具体值" |
| | | }] |
| | | }, |
| | | "business": { |
| | | "businessTypeCd": "112200050001", |
| | | "bId":"1234567892", |
| | | "remark": "备注", |
| | | "datas": { |
| | | "businessCarBlackWhiteInfo": { |
| | | "bwId":"填写存在的值" |
| | | } |
| | | }, |
| | | "attrs": [{ |
| | | "specCd": "配置的字段ID", |
| | | "value": "具体值" |
| | | }] |
| | | } |
| | | } |
| | | |
| | | 返回报文: |
| | | { |
| | | "orderTypeCd": "D", |
| | | "response": { |
| | | "code": "0000", |
| | | "message": "成功" |
| | | }, |
| | | "responseTime": "20190418102004", |
| | | "bId": "202019041810750003", |
| | | "businessType": "B", |
| | | "transactionId": "3a5a411ec65a4c3f895935638aa1d2bc", |
| | | "dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947" |
| | | } |
| | | |
| | | ``` |
| New file |
| | |
| | | |
| | | |
| | | **1\. 保存黑白名单** |
| | | ###### 接口功能 |
| | | > API服务做保存黑白名单时调用该接口 |
| | | |
| | | ###### URL |
| | | > [http://carBlackWhite-service/carBlackWhiteApi/service](http://carBlackWhite-service/carBlackWhiteApi/service) |
| | | |
| | | ###### 支持格式 |
| | | > JSON |
| | | |
| | | ###### HTTP请求方式 |
| | | > POST |
| | | |
| | | ###### 协议接口 |
| | | |父元素名称|参数名称|约束|类型|长度|描述|取值说明| |
| | | | :-: | :-: | :-: | :-: | :-: | :-: | :-:| |
| | | |-|orders|1|Object|-|订单节点|-| |
| | | |-|business|1|Array|-|业务节点|-| |
| | | |
| | | ###### orders |
| | | |父元素名称|参数名称|约束|类型|长度|描述|取值说明| |
| | | | :-: | :-: | :-: | :-: | :-: | :-: | :-: | |
| | | |-|orders|1|Object|-|订单节点|-| |
| | | |orders|appId|1|String|10|系统ID|由中心服务提供| |
| | | |orders|transactionId|1|String|30|交互流水|appId+'00'+YYYYMMDD+10位序列| |
| | | |orders|userId|1|String|30|用户ID|已有用户ID| |
| | | |orders|orderTypeCd|1|String|4|订单类型|查看订单类型说明| |
| | | |orders|requestTime|1|String|14|请求时间|YYYYMMDDhhmmss| |
| | | |orders|remark|1|String|200|备注|备注| |
| | | |orders|sign|?|String|64|签名|查看加密说明| |
| | | |orders|attrs|?|Array|-|订单属性|-| |
| | | |attrs|specCd|1|String|12|规格编码|由中心服务提供| |
| | | |attrs|value|1|String|50|属性值|-| |
| | | |orders|response|1|Object|-|返回结果节点|-| |
| | | |response|code|1|String|4|返回状态|查看状态说明| |
| | | |response|message|1|String|200|返回状态描述|-| |
| | | |
| | | ###### business |
| | | |父元素名称|参数名称|约束|类型|长度|描述|取值说明| |
| | | | :-: | :-: | :-: | :-: | :-: | :-: | :-: | |
| | | |-|business|?|Array|-|业务节点|-| |
| | | |business|businessTypeCd|1|String|12|业务类型编码|500100030002| |
| | | |business|datas|1|Object|-|数据节点|不同的服务下的节点不一样| |
| | | |datas|businessCarBlackWhiteInfo|1|Object|-|小区成员|小区成员| |
| | | |businessCarBlackWhiteInfo|blackWhite|1|String|30|-|-| |
| | | |businessCarBlackWhiteInfo|carNum|1|String|30|-|-| |
| | | |businessCarBlackWhiteInfo|startTime|1|String|30|-|-| |
| | | |businessCarBlackWhiteInfo|endTime|1|String|30|-|-| |
| | | |businessCarBlackWhiteInfo|communityId|1|String|30|-|-| |
| | | |businessCarBlackWhiteInfo|bwId|1|String|30|-|-| |
| | | |
| | | |
| | | ###### 返回协议 |
| | | |
| | | 当http返回状态不为200 时请求处理失败 body内容为失败的原因 |
| | | |
| | | 当http返回状态为200时请求处理成功,body内容为返回内容, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | ###### 举例 |
| | | > 地址:[http://carBlackWhite-service/carBlackWhiteApi/service](http://carBlackWhite-service/carBlackWhiteApi/service) |
| | | |
| | | ``` javascript |
| | | 请求头信息: |
| | | Content-Type:application/json |
| | | |
| | | 请求报文: |
| | | |
| | | { |
| | | "orders": { |
| | | "appId": "外系统ID,分配得到", |
| | | "transactionId": "100000000020180409224736000001", |
| | | "userId": "用户ID", |
| | | "orderTypeCd": "订单类型,查询,受理", |
| | | "requestTime": "20180409224736", |
| | | "remark": "备注", |
| | | "sign": "这个服务是否要求MD5签名", |
| | | "businessType":"I", |
| | | "attrs": [{ |
| | | "specCd": "配置的字段ID", |
| | | "value": "具体值" |
| | | }] |
| | | }, |
| | | "business": { |
| | | "businessTypeCd": "112200030001", |
| | | "bId":"1234567892", |
| | | "remark": "备注", |
| | | "datas": { |
| | | "businessCarBlackWhiteInfo": { |
| | | "blackWhite":"填写具体值", |
| | | "carNum":"填写具体值", |
| | | "startTime":"填写具体值", |
| | | "endTime":"填写具体值", |
| | | "communityId":"填写具体值", |
| | | "bwId":"填写具体值" |
| | | } |
| | | }, |
| | | "attrs": [{ |
| | | "specCd": "配置的字段ID", |
| | | "value": "具体值" |
| | | }] |
| | | } |
| | | } |
| | | |
| | | 返回报文: |
| | | { |
| | | "orderTypeCd": "D", |
| | | "response": { |
| | | "code": "0000", |
| | | "message": "成功" |
| | | }, |
| | | "responseTime": "20190418102004", |
| | | "bId": "202019041810750003", |
| | | "businessType": "B", |
| | | "transactionId": "3a5a411ec65a4c3f895935638aa1d2bc", |
| | | "dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947" |
| | | } |
| | | |
| | | ``` |
| New file |
| | |
| | | |
| | | |
| | | **1\. 修改黑白名单** |
| | | ###### 接口功能 |
| | | > API服务做修改黑白名单时调用该接口 |
| | | |
| | | ###### URL |
| | | > [http://carBlackWhite-service/carBlackWhiteApi/service](http://carBlackWhite-service/carBlackWhiteApi/service) |
| | | |
| | | ###### 支持格式 |
| | | > JSON |
| | | |
| | | ###### HTTP请求方式 |
| | | > POST |
| | | |
| | | ###### 协议接口 |
| | | |父元素名称|参数名称|约束|类型|长度|描述|取值说明| |
| | | | :-: | :-: | :-: | :-: | :-: | :-: | :-:| |
| | | |-|orders|1|Object|-|订单节点|-| |
| | | |-|business|1|Array|-|业务节点|-| |
| | | |
| | | ###### orders |
| | | |父元素名称|参数名称|约束|类型|长度|描述|取值说明| |
| | | | :-: | :-: | :-: | :-: | :-: | :-: | :-: | |
| | | |-|orders|1|Object|-|订单节点|-| |
| | | |orders|appId|1|String|10|系统ID|由中心服务提供| |
| | | |orders|transactionId|1|String|30|交互流水|appId+'00'+YYYYMMDD+10位序列| |
| | | |orders|userId|1|String|30|用户ID|已有用户ID| |
| | | |orders|orderTypeCd|1|String|4|订单类型|查看订单类型说明| |
| | | |orders|requestTime|1|String|14|请求时间|YYYYMMDDhhmmss| |
| | | |orders|remark|1|String|200|备注|备注| |
| | | |orders|sign|?|String|64|签名|查看加密说明| |
| | | |orders|attrs|?|Array|-|订单属性|-| |
| | | |attrs|specCd|1|String|12|规格编码|由中心服务提供| |
| | | |attrs|value|1|String|50|属性值|-| |
| | | |orders|response|1|Object|-|返回结果节点|-| |
| | | |response|code|1|String|4|返回状态|查看状态说明| |
| | | |response|message|1|String|200|返回状态描述|-| |
| | | |
| | | ###### business |
| | | |父元素名称|参数名称|约束|类型|长度|描述|取值说明| |
| | | | :-: | :-: | :-: | :-: | :-: | :-: | :-: | |
| | | |-|business|?|Array|-|业务节点|-| |
| | | |business|businessTypeCd|1|String|12|业务类型编码|500100030002| |
| | | |business|datas|1|Object|-|数据节点|不同的服务下的节点不一样| |
| | | |datas|businessCarBlackWhiteInfo|1|Object|-|小区成员|小区成员| |
| | | |businessCarBlackWhiteInfo|blackWhite|1|String|30|-|-| |
| | | |businessCarBlackWhiteInfo|carNum|1|String|30|-|-| |
| | | |businessCarBlackWhiteInfo|startTime|1|String|30|-|-| |
| | | |businessCarBlackWhiteInfo|endTime|1|String|30|-|-| |
| | | |businessCarBlackWhiteInfo|communityId|1|String|30|-|-| |
| | | |businessCarBlackWhiteInfo|bwId|1|String|30|-|-| |
| | | |
| | | |
| | | ###### 返回协议 |
| | | |
| | | 当http返回状态不为200 时请求处理失败 body内容为失败的原因 |
| | | |
| | | 当http返回状态为200时请求处理成功,body内容为返回内容, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | ###### 举例 |
| | | > 地址:[http://carBlackWhite-service/carBlackWhiteApi/service](http://carBlackWhite-service/carBlackWhiteApi/service) |
| | | |
| | | ``` javascript |
| | | 请求头信息: |
| | | Content-Type:application/json |
| | | |
| | | 请求报文: |
| | | |
| | | { |
| | | "orders": { |
| | | "appId": "外系统ID,分配得到", |
| | | "transactionId": "100000000020180409224736000001", |
| | | "userId": "用户ID", |
| | | "orderTypeCd": "订单类型,查询,受理", |
| | | "requestTime": "20180409224736", |
| | | "remark": "备注", |
| | | "sign": "这个服务是否要求MD5签名", |
| | | "businessType":"I", |
| | | "attrs": [{ |
| | | "specCd": "配置的字段ID", |
| | | "value": "具体值" |
| | | }] |
| | | }, |
| | | "business": { |
| | | "businessTypeCd": "112200040001", |
| | | "bId":"1234567892", |
| | | "remark": "备注", |
| | | "datas": { |
| | | "businessCarBlackWhiteInfo": { |
| | | "blackWhite":"填写具体值", |
| | | "carNum":"填写具体值", |
| | | "startTime":"填写具体值", |
| | | "endTime":"填写具体值", |
| | | "communityId":"填写具体值", |
| | | "bwId":"填写具体值" |
| | | } |
| | | }, |
| | | "attrs": [{ |
| | | "specCd": "配置的字段ID", |
| | | "value": "具体值" |
| | | }] |
| | | } |
| | | } |
| | | |
| | | 返回报文: |
| | | { |
| | | "orderTypeCd": "D", |
| | | "response": { |
| | | "code": "0000", |
| | | "message": "成功" |
| | | }, |
| | | "responseTime": "20190418102004", |
| | | "bId": "202019041810750003", |
| | | "businessType": "B", |
| | | "transactionId": "3a5a411ec65a4c3f895935638aa1d2bc", |
| | | "dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947" |
| | | } |
| | | |
| | | ``` |
| New file |
| | |
| | | package com.java110.dto.hardwareAdapation; |
| | | |
| | | import com.java110.dto.PageDto; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClassName FloorDto |
| | | * @Description 黑白名单数据层封装 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 8:52 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | public class CarBlackWhiteDto extends PageDto implements Serializable { |
| | | |
| | | private String blackWhite; |
| | | private String carNum; |
| | | private String startTime; |
| | | private String endTime; |
| | | private String communityId; |
| | | private String bwId; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | |
| | | public String getBlackWhite() { |
| | | return blackWhite; |
| | | } |
| | | |
| | | public void setBlackWhite(String blackWhite) { |
| | | this.blackWhite = blackWhite; |
| | | } |
| | | |
| | | public String getCarNum() { |
| | | return carNum; |
| | | } |
| | | |
| | | public void setCarNum(String carNum) { |
| | | this.carNum = carNum; |
| | | } |
| | | |
| | | public String getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(String startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public String getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(String endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | public String getCommunityId() { |
| | | return communityId; |
| | | } |
| | | |
| | | public void setCommunityId(String communityId) { |
| | | this.communityId = communityId; |
| | | } |
| | | |
| | | public String getBwId() { |
| | | return bwId; |
| | | } |
| | | |
| | | public void setBwId(String bwId) { |
| | | this.bwId = bwId; |
| | | } |
| | | |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.vo.api.carBlackWhite; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | public class ApiCarBlackWhiteDataVo implements Serializable { |
| | | |
| | | private String bwId; |
| | | private String blackWhite; |
| | | private String carNum; |
| | | private String startTime; |
| | | private String endTime; |
| | | public String getBwId() { |
| | | return bwId; |
| | | } |
| | | public void setBwId(String bwId) { |
| | | this.bwId = bwId; |
| | | } |
| | | public String getBlackWhite() { |
| | | return blackWhite; |
| | | } |
| | | public void setBlackWhite(String blackWhite) { |
| | | this.blackWhite = blackWhite; |
| | | } |
| | | public String getCarNum() { |
| | | return carNum; |
| | | } |
| | | public void setCarNum(String carNum) { |
| | | this.carNum = carNum; |
| | | } |
| | | public String getStartTime() { |
| | | return startTime; |
| | | } |
| | | public void setStartTime(String startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | public String getEndTime() { |
| | | return endTime; |
| | | } |
| | | public void setEndTime(String endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.vo.api.carBlackWhite; |
| | | |
| | | import com.java110.vo.MorePageVo; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | public class ApiCarBlackWhiteVo extends MorePageVo implements Serializable { |
| | | List<ApiCarBlackWhiteDataVo> carBlackWhites; |
| | | |
| | | |
| | | public List<ApiCarBlackWhiteDataVo> getCarBlackWhites() { |
| | | return carBlackWhites; |
| | | } |
| | | |
| | | public void setCarBlackWhites(List<ApiCarBlackWhiteDataVo> carBlackWhites) { |
| | | this.carBlackWhites = carBlackWhites; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110; |
| | | |
| | | |
| | | import com.java110.code.*; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Hello world! |
| | | * 车辆黑白名单 |
| | | */ |
| | | public class CarBlackWhiteGeneratorApplication { |
| | | |
| | | protected CarBlackWhiteGeneratorApplication() { |
| | | // prevents calls from subclass |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | /** |
| | | * 代码生成器 入口方法 |
| | | * 此处生成的mapper文件包含过程表和实例表的sql,所以要求两张表的特殊字段也要写上 |
| | | * BusinessTypeCd |
| | | * @param args 参数 |
| | | */ |
| | | public static void main(String[] args) { |
| | | Data data = new Data(); |
| | | data.setId("bwId"); |
| | | data.setName("carBlackWhite"); |
| | | data.setDesc("黑白名单"); |
| | | data.setShareParam("communityId"); |
| | | data.setShareColumn("community_id"); |
| | | data.setNewBusinessTypeCd("BUSINESS_TYPE_SAVE_CAR_BLACK_WHITE"); |
| | | data.setUpdateBusinessTypeCd("BUSINESS_TYPE_UPDATE_CAR_BLACK_WHITE"); |
| | | data.setDeleteBusinessTypeCd("BUSINESS_TYPE_DELETE_CAR_BLACK_WHITE"); |
| | | data.setNewBusinessTypeCdValue("112200030001"); |
| | | data.setUpdateBusinessTypeCdValue("112200040001"); |
| | | data.setDeleteBusinessTypeCdValue("112200050001"); |
| | | data.setBusinessTableName("business_car_black_white"); |
| | | data.setTableName("car_black_white"); |
| | | Map<String, String> param = new HashMap<String, String>(); |
| | | param.put("bwId", "bw_id"); //map的key为你自定义的字段名就是驼峰命名法的那个,value为数据库表的字段名 |
| | | param.put("blackWhite", "black_white"); |
| | | param.put("communityId", "community_id"); |
| | | param.put("carNum", "car_num"); |
| | | param.put("startTime", "start_time"); |
| | | param.put("endTime", "end_time"); |
| | | param.put("statusCd", "status_cd"); |
| | | param.put("operate", "operate"); |
| | | param.put("bId", "b_id"); |
| | | data.setParams(param); |
| | | GeneratorSaveInfoListener generatorSaveInfoListener = new GeneratorSaveInfoListener(); |
| | | generatorSaveInfoListener.generator(data); |
| | | |
| | | GeneratorAbstractBussiness generatorAbstractBussiness = new GeneratorAbstractBussiness(); |
| | | generatorAbstractBussiness.generator(data); |
| | | |
| | | GeneratorIServiceDaoListener generatorIServiceDaoListener = new GeneratorIServiceDaoListener(); |
| | | generatorIServiceDaoListener.generator(data); |
| | | |
| | | GeneratorServiceDaoImplListener generatorServiceDaoImplListener = new GeneratorServiceDaoImplListener(); |
| | | generatorServiceDaoImplListener.generator(data); |
| | | |
| | | GeneratorServiceDaoImplMapperListener generatorServiceDaoImplMapperListener = null; |
| | | generatorServiceDaoImplMapperListener = new GeneratorServiceDaoImplMapperListener(); |
| | | generatorServiceDaoImplMapperListener.generator(data); |
| | | |
| | | GeneratorUpdateInfoListener generatorUpdateInfoListener = new GeneratorUpdateInfoListener(); |
| | | generatorUpdateInfoListener.generator(data); |
| | | |
| | | GeneratorDeleteInfoListener generatorDeleteInfoListener = new GeneratorDeleteInfoListener(); |
| | | generatorDeleteInfoListener.generator(data); |
| | | |
| | | GeneratorInnerServiceSMOImpl generatorInnerServiceSMOImpl = new GeneratorInnerServiceSMOImpl(); |
| | | generatorInnerServiceSMOImpl.generator(data); |
| | | |
| | | GeneratorDtoBean generatorDtoBean = new GeneratorDtoBean(); |
| | | generatorDtoBean.generator(data); |
| | | |
| | | GeneratorIInnerServiceSMO generatorIInnerServiceSMO = new GeneratorIInnerServiceSMO(); |
| | | generatorIInnerServiceSMO.generator(data); |
| | | } |
| | | } |
| | |
| | | { |
| | | "templateName":"停车场", |
| | | "templateCode":"parkingArea", |
| | | "templateKey":"paId", |
| | | "templateKeyName":"停车场ID", |
| | | "searchCode": "num", |
| | | "searchName": "停车场编号", |
| | | "templateName":"黑白名单", |
| | | "templateCode":"carBlackWhite", |
| | | "templateKey":"bwId", |
| | | "templateKeyName":"黑白名单ID", |
| | | "searchCode": "carNum", |
| | | "searchName": "车牌号", |
| | | "conditions": [ |
| | | { |
| | | "name": "停车场编号", |
| | | "inputType": "input", |
| | | "code": "num", |
| | | "whereCondition": "equal" |
| | | }, |
| | | { |
| | | "name": "停车场类型", |
| | | "name": "名单类型", |
| | | "inputType": "select", |
| | | "selectValue":"1001,2001", |
| | | "selectValueName":"地上停车场,地下停车场", |
| | | "code": "typeCd", |
| | | "selectValue":"1111,2222", |
| | | "selectValueName":"黑名单,白名单", |
| | | "code": "blackWhite", |
| | | "whereCondition": "equal" |
| | | }, |
| | | { |
| | | "name": "停车场ID", |
| | | "name": "车牌号", |
| | | "inputType": "input", |
| | | "code": "paId", |
| | | "code": "carNum", |
| | | "whereCondition": "equal" |
| | | }, |
| | | { |
| | | "name": "名单ID", |
| | | "inputType": "input", |
| | | "code": "bwId", |
| | | "whereCondition": "equal" |
| | | } |
| | | ], |
| | | "columns":[ |
| | | { |
| | | "code":"num", |
| | | "cnCode":"停车场编号", |
| | | "desc":"必填,请填写停车场编号", |
| | | "code":"blackWhite", |
| | | "cnCode":"名单类型", |
| | | "desc":"必填,请填写名单类型", |
| | | "required":true, |
| | | "hasDefaultValue":false, |
| | | "inputType":"input", |
| | | "limit":"maxin", |
| | | "limitParam":"1,12", |
| | | "limitErrInfo":"停车场编号不能超过12位", |
| | | "show": true |
| | | }, |
| | | { |
| | | "code": "typeCd", |
| | | "cnCode":"停车场类型", |
| | | "desc":"必填,请选择停车场类型", |
| | | "required":true, |
| | | "hasDefaultValue":false, |
| | | "inputType": "select", |
| | | "selectValue":"1001,2001", |
| | | "selectValueName":"地上停车场,地下停车场", |
| | | "inputType":"select", |
| | | "selectValue":"1111,2222", |
| | | "selectValueName":"黑名单,白名单", |
| | | "limit":"num", |
| | | "limitParam":"", |
| | | "limitErrInfo":"停车场类型格式错误", |
| | | "limitErrInfo":"名单类型格式错误", |
| | | "show": true |
| | | }, |
| | | { |
| | | "code": "remark", |
| | | "cnCode":"备注", |
| | | "desc":"必填,请填写备注", |
| | | "code": "carNum", |
| | | "cnCode":"车牌号", |
| | | "desc":"必填,请填写车牌号", |
| | | "required":true, |
| | | "hasDefaultValue":false, |
| | | "inputType": "input", |
| | | "limit":"maxin", |
| | | "limitParam":"1,4000", |
| | | "limitErrInfo":"备注太长", |
| | | "show": false |
| | | "limitParam":"1,12", |
| | | "limitErrInfo":"车牌号大于12位", |
| | | "show": true |
| | | }, |
| | | { |
| | | "code": "startTime", |
| | | "cnCode":"开始时间", |
| | | "desc":"必填,请选择开始时间", |
| | | "required":true, |
| | | "hasDefaultValue":false, |
| | | "inputType": "input", |
| | | "limit":"dateTime", |
| | | "limitParam":"", |
| | | "limitErrInfo":"不是有效的时间格式", |
| | | "show": true |
| | | }, |
| | | { |
| | | "code": "endTime", |
| | | "cnCode":"结束时间", |
| | | "desc":"必填,请选择结束时间", |
| | | "required":true, |
| | | "hasDefaultValue":false, |
| | | "inputType": "input", |
| | | "limit":"dateTime", |
| | | "limitParam":"", |
| | | "limitErrInfo":"不是有效的时间格式", |
| | | "show": true |
| | | } |
| | | ] |
| | | } |
| New file |
| | |
| | | { |
| | | "templateName":"停车场", |
| | | "templateCode":"parkingArea", |
| | | "templateKey":"paId", |
| | | "templateKeyName":"停车场ID", |
| | | "searchCode": "num", |
| | | "searchName": "停车场编号", |
| | | "conditions": [ |
| | | { |
| | | "name": "停车场编号", |
| | | "inputType": "input", |
| | | "code": "num", |
| | | "whereCondition": "equal" |
| | | }, |
| | | { |
| | | "name": "停车场类型", |
| | | "inputType": "select", |
| | | "selectValue":"1001,2001", |
| | | "selectValueName":"地上停车场,地下停车场", |
| | | "code": "typeCd", |
| | | "whereCondition": "equal" |
| | | }, |
| | | { |
| | | "name": "停车场ID", |
| | | "inputType": "input", |
| | | "code": "paId", |
| | | "whereCondition": "equal" |
| | | } |
| | | ], |
| | | "columns":[ |
| | | { |
| | | "code":"num", |
| | | "cnCode":"停车场编号", |
| | | "desc":"必填,请填写停车场编号", |
| | | "required":true, |
| | | "hasDefaultValue":false, |
| | | "inputType":"input", |
| | | "limit":"maxin", |
| | | "limitParam":"1,12", |
| | | "limitErrInfo":"停车场编号不能超过12位", |
| | | "show": true |
| | | }, |
| | | { |
| | | "code": "typeCd", |
| | | "cnCode":"停车场类型", |
| | | "desc":"必填,请选择停车场类型", |
| | | "required":true, |
| | | "hasDefaultValue":false, |
| | | "inputType": "select", |
| | | "selectValue":"1001,2001", |
| | | "selectValueName":"地上停车场,地下停车场", |
| | | "limit":"num", |
| | | "limitParam":"", |
| | | "limitErrInfo":"停车场类型格式错误", |
| | | "show": true |
| | | }, |
| | | { |
| | | "code": "remark", |
| | | "cnCode":"备注", |
| | | "desc":"必填,请填写备注", |
| | | "required":true, |
| | | "hasDefaultValue":false, |
| | | "inputType": "input", |
| | | "limit":"maxin", |
| | | "limitParam":"1,4000", |
| | | "limitErrInfo":"备注太长", |
| | | "show": false |
| | | } |
| | | ] |
| | | } |
| | |
| | | public static final String CODE_PREFIX_appUserId = "98"; |
| | | public static final String CODE_PREFIX_activitiesId = "99"; |
| | | public static final String CODE_PREFIX_paId = "10"; |
| | | public static final String CODE_PREFIX_bwId = "11"; |
| | | |
| | | |
| | | /** |
| New file |
| | |
| | | package com.java110.core.smo.hardwareAdapation; |
| | | |
| | | import com.java110.core.feign.FeignConfiguration; |
| | | import com.java110.dto.hardwareAdapation.CarBlackWhiteDto; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName ICarBlackWhiteInnerServiceSMO |
| | | * @Description 黑白名单接口类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:04 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @FeignClient(name = "hardwareAdapation-service", configuration = {FeignConfiguration.class}) |
| | | @RequestMapping("/carBlackWhiteApi") |
| | | public interface ICarBlackWhiteInnerServiceSMO { |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * @param carBlackWhiteDto 数据对象分享 |
| | | * @return CarBlackWhiteDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/queryCarBlackWhites", method = RequestMethod.POST) |
| | | List<CarBlackWhiteDto> queryCarBlackWhites(@RequestBody CarBlackWhiteDto carBlackWhiteDto); |
| | | |
| | | /** |
| | | * 查询<p>小区楼</p>总记录数 |
| | | * |
| | | * @param carBlackWhiteDto 数据对象分享 |
| | | * @return 小区下的小区楼记录数 |
| | | */ |
| | | @RequestMapping(value = "/queryCarBlackWhitesCount", method = RequestMethod.POST) |
| | | int queryCarBlackWhitesCount(@RequestBody CarBlackWhiteDto carBlackWhiteDto); |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="carBlackWhiteServiceDaoImpl"> |
| | | |
| | | <!-- 保存黑白名单信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveBusinessCarBlackWhiteInfo" parameterType="Map"> |
| | | insert into business_car_black_white( |
| | | black_white,operate,car_num,start_time,end_time,community_id,b_id,bw_id |
| | | ) values ( |
| | | #{blackWhite},#{operate},#{carNum},#{startTime},#{endTime},#{communityId},#{bId},#{bwId} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询黑白名单信息(Business) add by wuxw 2018-07-03 --> |
| | | <select id="getBusinessCarBlackWhiteInfo" parameterType="Map" resultType="Map"> |
| | | select t.black_white,t.black_white blackWhite,t.operate,t.car_num,t.car_num carNum,t.start_time,t.start_time |
| | | startTime,t.end_time,t.end_time endTime,t.community_id,t.community_id communityId,t.b_id,t.b_id |
| | | bId,t.bw_id,t.bw_id bwId |
| | | from business_car_black_white t |
| | | where 1 =1 |
| | | <if test="blackWhite !=null and blackWhite != ''"> |
| | | and t.black_white= #{blackWhite} |
| | | </if> |
| | | <if test="operate !=null and operate != ''"> |
| | | and t.operate= #{operate} |
| | | </if> |
| | | <if test="carNum !=null and carNum != ''"> |
| | | and t.car_num= #{carNum} |
| | | </if> |
| | | <if test="startTime !=null "> |
| | | and t.start_time= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null "> |
| | | and t.end_time= #{endTime} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="bwId !=null and bwId != ''"> |
| | | and t.bw_id= #{bwId} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | <!-- 保存黑白名单信息至 instance表中 add by wuxw 2018-07-03 --> |
| | | <insert id="saveCarBlackWhiteInfoInstance" parameterType="Map"> |
| | | insert into car_black_white( |
| | | black_white,car_num,start_time,status_cd,end_time,community_id,b_id,bw_id |
| | | ) select t.black_white,t.car_num,t.start_time,'0',t.end_time,t.community_id,t.b_id,t.bw_id from |
| | | business_car_black_white t where 1=1 |
| | | <if test="blackWhite !=null and blackWhite != ''"> |
| | | and t.black_white= #{blackWhite} |
| | | </if> |
| | | and t.operate= 'ADD' |
| | | <if test="carNum !=null and carNum != ''"> |
| | | and t.car_num= #{carNum} |
| | | </if> |
| | | <if test="startTime !=null "> |
| | | and t.start_time= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null "> |
| | | and t.end_time= #{endTime} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="bwId !=null and bwId != ''"> |
| | | and t.bw_id= #{bwId} |
| | | </if> |
| | | |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询黑白名单信息 add by wuxw 2018-07-03 --> |
| | | <select id="getCarBlackWhiteInfo" parameterType="Map" resultType="Map"> |
| | | select t.black_white,t.black_white blackWhite,t.car_num,t.car_num carNum,t.start_time,t.start_time |
| | | startTime,t.status_cd,t.status_cd statusCd,t.end_time,t.end_time endTime,t.community_id,t.community_id |
| | | communityId,t.b_id,t.b_id bId,t.bw_id,t.bw_id bwId |
| | | from car_black_white t |
| | | where 1 =1 |
| | | <if test="blackWhite !=null and blackWhite != ''"> |
| | | and t.black_white= #{blackWhite} |
| | | </if> |
| | | <if test="carNum !=null and carNum != ''"> |
| | | and t.car_num= #{carNum} |
| | | </if> |
| | | <if test="startTime !=null "> |
| | | and t.start_time= #{startTime} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="endTime !=null "> |
| | | and t.end_time= #{endTime} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="bwId !=null and bwId != ''"> |
| | | and t.bw_id= #{bwId} |
| | | </if> |
| | | order by t.create_time desc |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | <!-- 修改黑白名单信息 add by wuxw 2018-07-03 --> |
| | | <update id="updateCarBlackWhiteInfoInstance" parameterType="Map"> |
| | | update car_black_white t set t.status_cd = #{statusCd} |
| | | <if test="newBId != null and newBId != ''"> |
| | | ,t.b_id = #{newBId} |
| | | </if> |
| | | <if test="blackWhite !=null and blackWhite != ''"> |
| | | , t.black_white= #{blackWhite} |
| | | </if> |
| | | <if test="carNum !=null and carNum != ''"> |
| | | , t.car_num= #{carNum} |
| | | </if> |
| | | <if test="startTime !=null "> |
| | | , t.start_time= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null "> |
| | | , t.end_time= #{endTime} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | , t.community_id= #{communityId} |
| | | </if> |
| | | where 1=1 |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="bwId !=null and bwId != ''"> |
| | | and t.bw_id= #{bwId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询黑白名单数量 add by wuxw 2018-07-03 --> |
| | | <select id="queryCarBlackWhitesCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from car_black_white t |
| | | where 1 =1 |
| | | <if test="blackWhite !=null and blackWhite != ''"> |
| | | and t.black_white= #{blackWhite} |
| | | </if> |
| | | <if test="carNum !=null and carNum != ''"> |
| | | and t.car_num= #{carNum} |
| | | </if> |
| | | <if test="startTime !=null "> |
| | | and t.start_time= #{startTime} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="endTime !=null "> |
| | | and t.end_time= #{endTime} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="bwId !=null and bwId != ''"> |
| | | and t.bw_id= #{bwId} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | public static final String BUSINESS_TYPE_DELETE_OWNER_CAR = "111200050001"; |
| | | |
| | | |
| | | /** |
| | | * 保存车辆黑白名单 |
| | | */ |
| | | public static final String BUSINESS_TYPE_SAVE_CAR_BLACK_WHITE = "112200030001"; |
| | | |
| | | /** |
| | | * 修改车辆黑白名单 |
| | | */ |
| | | public static final String BUSINESS_TYPE_UPDATE_CAR_BLACK_WHITE = "112200040001"; |
| | | |
| | | |
| | | /** |
| | | * 删除车辆黑白名单 |
| | | */ |
| | | public static final String BUSINESS_TYPE_DELETE_CAR_BLACK_WHITE = "112200050001"; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | package com.java110.utils.constant; |
| | | |
| | | /** |
| | | * 黑白名单常量类 |
| | | * Created by wuxw on 2017/5/20. |
| | | */ |
| | | public class ServiceCodeCarBlackWhiteConstant { |
| | | |
| | | /** |
| | | * 添加 黑白名单 |
| | | */ |
| | | public static final String ADD_CARBLACKWHITE = "carBlackWhite.saveCarBlackWhite"; |
| | | |
| | | |
| | | /** |
| | | * 修改 黑白名单 |
| | | */ |
| | | public static final String UPDATE_CARBLACKWHITE = "carBlackWhite.updateCarBlackWhite"; |
| | | /** |
| | | * 删除 黑白名单 |
| | | */ |
| | | public static final String DELETE_CARBLACKWHITE = "carBlackWhite.deleteCarBlackWhite"; |
| | | |
| | | |
| | | /** |
| | | * 查询 黑白名单 |
| | | */ |
| | | public static final String LIST_CARBLACKWHITES = "carBlackWhite.listCarBlackWhites"; |
| | | |
| | | |
| | | } |