Sfoglia il codice sorgente

优化老的模式改为新模式

wuxw 3 anni fa
parent
commit
206ff918c9
27 ha cambiato i file con 1005 aggiunte e 709 eliminazioni
  1. 9 0
      java110-bean/src/main/java/com/java110/po/car/CarBlackWhitePo.java
  2. 124 0
      java110-db/src/main/resources/mapper/user/CarBlackWhiteV1ServiceDaoImplMapper.xml
  3. 68 0
      java110-interface/src/main/java/com/java110/intf/user/ICarBlackWhiteV1InnerServiceSMO.java
  4. 1 1
      java110-utils/src/main/java/com/java110/utils/constant/ServiceCodeCarInoutConstant.java
  5. 0 69
      service-api/src/main/java/com/java110/api/listener/basePrivilege/DeleteBasePrivilegeListener.java
  6. 0 77
      service-api/src/main/java/com/java110/api/listener/basePrivilege/UpdateBasePrivilegeListener.java
  7. 0 87
      service-api/src/main/java/com/java110/api/listener/businesstype/QueryBusinessTypeConfigListener.java
  8. 0 58
      service-api/src/main/java/com/java110/api/listener/carBlackWhite/DeleteCarBlackWhiteListener.java
  9. 0 61
      service-api/src/main/java/com/java110/api/listener/carBlackWhite/SaveCarBlackWhiteListener.java
  10. 0 59
      service-api/src/main/java/com/java110/api/listener/carBlackWhite/UpdateCarBlackWhiteListener.java
  11. 0 61
      service-api/src/main/java/com/java110/api/listener/carInout/SaveCarInoutListener.java
  12. 0 58
      service-api/src/main/java/com/java110/api/listener/carInout/UpdateCarInoutListener.java
  13. 45 0
      service-dev/src/main/java/com/java110/dev/cmd/basePrivilege/DeleteBasePrivilegeCmd.java
  14. 13 43
      service-api/src/main/java/com/java110/api/listener/basePrivilege/ListBasePrivilegesListener.java
  15. 13 50
      service-api/src/main/java/com/java110/api/listener/basePrivilege/SaveBasePrivilegeListener.java
  16. 44 0
      service-dev/src/main/java/com/java110/dev/cmd/basePrivilege/UpdateBasePrivilegeCmd.java
  17. 42 0
      service-dev/src/main/java/com/java110/dev/cmd/business/QueryBusinessTypeConfigCmd.java
  18. 71 0
      service-user/src/main/java/com/java110/user/cmd/carBlackWhite/DeleteCarBlackWhiteCmd.java
  19. 44 42
      service-api/src/main/java/com/java110/api/listener/carBlackWhite/ListCarBlackWhitesListener.java
  20. 80 0
      service-user/src/main/java/com/java110/user/cmd/carBlackWhite/SaveCarBlackWhiteCmd.java
  21. 75 0
      service-user/src/main/java/com/java110/user/cmd/carBlackWhite/UpdateCarBlackWhiteCmd.java
  22. 12 43
      service-api/src/main/java/com/java110/api/listener/carInout/ListCarInoutsListener.java
  23. 42 0
      service-user/src/main/java/com/java110/user/cmd/carInout/SaveCarInoutCmd.java
  24. 44 0
      service-user/src/main/java/com/java110/user/cmd/carInout/UpdateCarInoutCmd.java
  25. 77 0
      service-user/src/main/java/com/java110/user/dao/ICarBlackWhiteV1ServiceDao.java
  26. 112 0
      service-user/src/main/java/com/java110/user/dao/impl/CarBlackWhiteV1ServiceDaoImpl.java
  27. 89 0
      service-user/src/main/java/com/java110/user/smo/impl/CarBlackWhiteV1InnerServiceSMOImpl.java

+ 9 - 0
java110-bean/src/main/java/com/java110/po/car/CarBlackWhitePo.java

@@ -19,6 +19,7 @@ public class CarBlackWhitePo implements Serializable {
     private String startTime;
     private String endTime;
     private String paId;
+    private String statusCd="0";
 
 
     public String getBwId() {
@@ -76,4 +77,12 @@ public class CarBlackWhitePo implements Serializable {
     public void setPaId(String paId) {
         this.paId = paId;
     }
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
 }

+ 124 - 0
java110-db/src/main/resources/mapper/user/CarBlackWhiteV1ServiceDaoImplMapper.xml

@@ -0,0 +1,124 @@
+<?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="carBlackWhiteV1ServiceDaoImpl">
+
+
+
+
+
+    <!-- 保存车辆黑白名单信息 add by wuxw 2018-07-03 -->
+    <insert id="saveCarBlackWhiteInfo" parameterType="Map">
+        insert into car_black_white(
+black_white,pa_id,car_num,start_time,end_time,community_id,bw_id
+) values (
+#{blackWhite},#{paId},#{carNum},#{startTime},#{endTime},#{communityId},#{bwId}
+)
+    </insert>
+
+
+
+    <!-- 查询车辆黑白名单信息 add by wuxw 2018-07-03 -->
+    <select id="getCarBlackWhiteInfo" parameterType="Map" resultType="Map">
+        select  t.black_white,t.black_white blackWhite,t.pa_id,t.pa_id paId,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.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="paId !=null and paId != ''">
+   and t.pa_id= #{paId}
+</if> 
+<if test="carNum !=null and carNum != ''">
+   and t.car_num= #{carNum}
+</if> 
+<if test="startTime !=null and startTime != ''">
+   and t.start_time= #{startTime}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="endTime !=null and endTime != ''">
+   and t.end_time= #{endTime}
+</if> 
+<if test="communityId !=null and communityId != ''">
+   and t.community_id= #{communityId}
+</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="updateCarBlackWhiteInfo" 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="paId !=null and paId != ''">
+, t.pa_id= #{paId}
+</if> 
+<if test="carNum !=null and carNum != ''">
+, t.car_num= #{carNum}
+</if> 
+<if test="startTime !=null and startTime != ''">
+, t.start_time= #{startTime}
+</if> 
+<if test="endTime !=null and endTime != ''">
+, t.end_time= #{endTime}
+</if> 
+<if test="communityId !=null and communityId != ''">
+, t.community_id= #{communityId}
+</if> 
+ where 1=1 <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="paId !=null and paId != ''">
+   and t.pa_id= #{paId}
+</if> 
+<if test="carNum !=null and carNum != ''">
+   and t.car_num= #{carNum}
+</if> 
+<if test="startTime !=null and startTime != ''">
+   and t.start_time= #{startTime}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="endTime !=null and endTime != ''">
+   and t.end_time= #{endTime}
+</if> 
+<if test="communityId !=null and communityId != ''">
+   and t.community_id= #{communityId}
+</if> 
+<if test="bwId !=null and bwId != ''">
+   and t.bw_id= #{bwId}
+</if> 
+
+
+     </select>
+
+</mapper>

+ 68 - 0
java110-interface/src/main/java/com/java110/intf/user/ICarBlackWhiteV1InnerServiceSMO.java

@@ -0,0 +1,68 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.intf.user;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.machine.CarBlackWhiteDto;
+import com.java110.po.car.CarBlackWhitePo;
+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;
+
+/**
+ * 类表述: 服务之前调用的接口类,不对外提供接口能力 只用于接口建调用
+ * add by 吴学文 at 2022-07-16 23:23:24 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@FeignClient(name = "user-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/carBlackWhiteV1Api")
+public interface ICarBlackWhiteV1InnerServiceSMO {
+
+
+    @RequestMapping(value = "/saveCarBlackWhite", method = RequestMethod.POST)
+    public int saveCarBlackWhite(@RequestBody CarBlackWhitePo carBlackWhitePo);
+
+    @RequestMapping(value = "/updateCarBlackWhite", method = RequestMethod.POST)
+    public int updateCarBlackWhite(@RequestBody CarBlackWhitePo carBlackWhitePo);
+
+    @RequestMapping(value = "/deleteCarBlackWhite", method = RequestMethod.POST)
+    public int deleteCarBlackWhite(@RequestBody CarBlackWhitePo carBlackWhitePo);
+
+    /**
+     * <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);
+}

+ 1 - 1
java110-utils/src/main/java/com/java110/utils/constant/ServiceCodeCarInoutConstant.java

@@ -15,7 +15,7 @@ public class ServiceCodeCarInoutConstant {
     /**
      * 修改 车辆进场
      */
-    public static final String UPDATE_CARINOUT = "carInout.updateCarInout";
+    public static final String UPDATE_CARINOUT = "ccccccc";
 //    /**
 //     * 删除 车辆进场
 //     */

+ 0 - 69
service-api/src/main/java/com/java110/api/listener/basePrivilege/DeleteBasePrivilegeListener.java

@@ -1,69 +0,0 @@
-package com.java110.api.listener.basePrivilege;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.listener.AbstractServiceApiListener;
-import com.java110.utils.constant.ServiceCodeBasePrivilegeConstant;
-import com.java110.utils.util.Assert;
-import com.java110.utils.util.BeanConvertUtil;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.intf.community.IMenuInnerServiceSMO;
-import com.java110.dto.basePrivilege.BasePrivilegeDto;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-
-/**
- * 保存小区侦听
- * add by wuxw 2019-06-30
- */
-@Java110Listener("deleteBasePrivilegeListener")
-public class DeleteBasePrivilegeListener extends AbstractServiceApiListener {
-
-    @Autowired
-    private IMenuInnerServiceSMO menuInnerServiceSMOImpl;
-
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
-
-        Assert.hasKeyAndValue(reqJson, "pId", "权限ID不能为空");
-
-    }
-
-    @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
-
-        ResponseEntity<String> responseEntity = null;
-
-        BasePrivilegeDto basePrivilegeDto = BeanConvertUtil.covertBean(reqJson, BasePrivilegeDto.class);
-
-
-        int saveFlag = menuInnerServiceSMOImpl.deleteBasePrivilege(basePrivilegeDto);
-
-        responseEntity = new ResponseEntity<String>(saveFlag > 0 ? "成功" : "失败", saveFlag > 0 ? HttpStatus.OK : HttpStatus.BAD_REQUEST);
-
-        context.setResponseEntity(responseEntity);
-    }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeBasePrivilegeConstant.DELETE_BASEPRIVILEGE;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-
-    @Override
-    public int getOrder() {
-        return DEFAULT_ORDER;
-    }
-
-    
-
-}

+ 0 - 77
service-api/src/main/java/com/java110/api/listener/basePrivilege/UpdateBasePrivilegeListener.java

@@ -1,77 +0,0 @@
-package com.java110.api.listener.basePrivilege;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.listener.AbstractServiceApiListener;
-import com.java110.utils.util.Assert;
-import com.java110.utils.util.BeanConvertUtil;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.intf.community.IMenuInnerServiceSMO;
-import com.java110.dto.basePrivilege.BasePrivilegeDto;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import com.java110.utils.constant.ServiceCodeBasePrivilegeConstant;
-
-/**
- * 保存权限侦听
- * add by wuxw 2019-06-30
- */
-@Java110Listener("updateBasePrivilegeListener")
-public class UpdateBasePrivilegeListener extends AbstractServiceApiListener {
-
-    @Autowired
-    private IMenuInnerServiceSMO menuInnerServiceSMOImpl;
-
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-
-        Assert.hasKeyAndValue(reqJson, "pId", "权限ID不能为空");
-        Assert.hasKeyAndValue(reqJson, "name", "必填,请填写权限名称");
-        Assert.hasKeyAndValue(reqJson, "domain", "必填,请选择商户类型");
-        Assert.hasKeyAndValue(reqJson, "resource", "必填,请选择资源路径");
-
-    }
-
-    @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
-
-        ResponseEntity<String> responseEntity = null;
-
-        BasePrivilegeDto basePrivilegeDto = BeanConvertUtil.covertBean(reqJson, BasePrivilegeDto.class);
-
-
-        int saveFlag = menuInnerServiceSMOImpl.updateBasePrivilege(basePrivilegeDto);
-
-        responseEntity = new ResponseEntity<String>(saveFlag > 0 ? "成功" : "失败", saveFlag > 0 ? HttpStatus.OK : HttpStatus.BAD_REQUEST);
-
-        context.setResponseEntity(responseEntity);
-    }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeBasePrivilegeConstant.UPDATE_BASEPRIVILEGE;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-
-    @Override
-    public int getOrder() {
-        return DEFAULT_ORDER;
-    }
-
-
-    public IMenuInnerServiceSMO getMenuInnerServiceSMOImpl() {
-        return menuInnerServiceSMOImpl;
-    }
-
-    public void setMenuInnerServiceSMOImpl(IMenuInnerServiceSMO menuInnerServiceSMOImpl) {
-        this.menuInnerServiceSMOImpl = menuInnerServiceSMOImpl;
-    }
-}

+ 0 - 87
service-api/src/main/java/com/java110/api/listener/businesstype/QueryBusinessTypeConfigListener.java

@@ -1,87 +0,0 @@
-package com.java110.api.listener.businesstype;
-
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.listener.AbstractServiceApiDataFlowListener;
-import com.java110.utils.constant.ServiceCodeConstant;
-import com.java110.utils.util.Assert;
-import com.java110.utils.util.BeanConvertUtil;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.intf.store.ICbusinesstypeInnerServiceSMO;
-import com.java110.dto.businesstype.CbusinesstypeDto;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
-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.List;
-
-/**
- * @ClassName FloorDto
- * @Description 用例数据层侦听类
- * @Author wuxw
- * @Date 2019/4/24 8:52
- * @Version 1.0
- * add by wuxw 2019/4/24
- **/
-@Java110Listener("queryBusinessTypeConfig")
-public class QueryBusinessTypeConfigListener extends AbstractServiceApiDataFlowListener {
-
-    @Autowired
-    private ICbusinesstypeInnerServiceSMO iCbusinesstypeInnerServiceSMOImpl;
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeConstant.SERVICE_CODE_QUERY_BUSINESSTYPE_CONFIG;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.GET;
-    }
-
-    /**
-     * 业务层数据处理
-     *
-     * @param event 时间对象
-     */
-    @Override
-    public void soService(ServiceDataFlowEvent event) {
-        DataFlowContext dataFlowContext = event.getDataFlowContext();
-        //获取请求数据
-        JSONObject reqJson = dataFlowContext.getReqJson();
-        //validateDemoConfigData(reqJson);
-
-        List<CbusinesstypeDto> cbusinesstypeDto = iCbusinesstypeInnerServiceSMOImpl.queryCbusinesstypes(BeanConvertUtil.covertBean(reqJson, CbusinesstypeDto.class));
-        ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(cbusinesstypeDto), HttpStatus.OK);
-
-        dataFlowContext.setResponseEntity(responseEntity);
-    }
-
-    /**
-     * 校验查询条件是否满足条件
-     *
-     * @param reqJson 包含查询条件
-     */
-    private void validateDemoConfigData(JSONObject reqJson) {
-        Assert.jsonObjectHaveKey(reqJson, "demoName", "请求中未包含demoName信息");
-        Assert.jsonObjectHaveKey(reqJson, "demoValue", "请求中未包含demoValue信息");
-
-
-    }
-
-    @Override
-    public int getOrder() {
-        return super.DEFAULT_ORDER;
-    }
-
-    public ICbusinesstypeInnerServiceSMO getiCbusinesstypeInnerServiceSMOImpl() {
-        return iCbusinesstypeInnerServiceSMOImpl;
-    }
-
-    public void setiCbusinesstypeInnerServiceSMOImpl(ICbusinesstypeInnerServiceSMO iCbusinesstypeInnerServiceSMOImpl) {
-        this.iCbusinesstypeInnerServiceSMOImpl = iCbusinesstypeInnerServiceSMOImpl;
-    }
-}

+ 0 - 58
service-api/src/main/java/com/java110/api/listener/carBlackWhite/DeleteCarBlackWhiteListener.java

@@ -1,58 +0,0 @@
-package com.java110.api.listener.carBlackWhite;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.carBlackWhite.ICarBlackWhiteBMO;
-import com.java110.api.listener.AbstractServiceApiPlusListener;
-import com.java110.utils.util.Assert;
-import com.java110.core.context.DataFlowContext;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
-
-import com.java110.core.annotation.Java110Listener;
-import com.java110.utils.constant.ServiceCodeCarBlackWhiteConstant;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
-
-/**
- * 保存小区侦听
- * add by wuxw 2019-06-30
- */
-@Java110Listener("deleteCarBlackWhiteListener")
-public class DeleteCarBlackWhiteListener extends AbstractServiceApiPlusListener {
-
-    @Autowired
-    private ICarBlackWhiteBMO carBlackWhiteBMOImpl;
-
-    @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) {
-
-        carBlackWhiteBMOImpl.deleteCarBlackWhite(reqJson, context);
-
-    }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeCarBlackWhiteConstant.DELETE_CARBLACKWHITE;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-
-    @Override
-    public int getOrder() {
-        return DEFAULT_ORDER;
-    }
-
-
-
-}

+ 0 - 61
service-api/src/main/java/com/java110/api/listener/carBlackWhite/SaveCarBlackWhiteListener.java

@@ -1,61 +0,0 @@
-package com.java110.api.listener.carBlackWhite;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.carBlackWhite.ICarBlackWhiteBMO;
-import com.java110.api.listener.AbstractServiceApiPlusListener;
-import com.java110.utils.util.Assert;
-import com.java110.core.context.DataFlowContext;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
-import com.java110.utils.constant.ServiceCodeCarBlackWhiteConstant;
-
-
-import com.java110.core.annotation.Java110Listener;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
-
-/**
- * 保存小区侦听
- * add by wuxw 2019-06-30
- */
-@Java110Listener("saveCarBlackWhiteListener")
-public class SaveCarBlackWhiteListener extends AbstractServiceApiPlusListener {
-
-    @Autowired
-    private ICarBlackWhiteBMO carBlackWhiteBMOImpl;
-    @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) {
-
-       carBlackWhiteBMOImpl.addCarBlackWhite(reqJson, context);
-
-    }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeCarBlackWhiteConstant.ADD_CARBLACKWHITE;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-
-    @Override
-    public int getOrder() {
-        return DEFAULT_ORDER;
-    }
-
-
-
-}

+ 0 - 59
service-api/src/main/java/com/java110/api/listener/carBlackWhite/UpdateCarBlackWhiteListener.java

@@ -1,59 +0,0 @@
-package com.java110.api.listener.carBlackWhite;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.carBlackWhite.ICarBlackWhiteBMO;
-import com.java110.api.listener.AbstractServiceApiPlusListener;
-import com.java110.utils.util.Assert;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
-import com.java110.utils.constant.ServiceCodeCarBlackWhiteConstant;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
-
-/**
- * 保存黑白名单侦听
- * add by wuxw 2019-06-30
- */
-@Java110Listener("updateCarBlackWhiteListener")
-public class UpdateCarBlackWhiteListener extends AbstractServiceApiPlusListener {
-
-    @Autowired
-    private ICarBlackWhiteBMO carBlackWhiteBMOImpl;
-
-    @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) {
-
-       carBlackWhiteBMOImpl.updateCarBlackWhite(reqJson, context);
-    }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeCarBlackWhiteConstant.UPDATE_CARBLACKWHITE;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-
-    @Override
-    public int getOrder() {
-        return DEFAULT_ORDER;
-    }
-
-
-}

+ 0 - 61
service-api/src/main/java/com/java110/api/listener/carInout/SaveCarInoutListener.java

@@ -1,61 +0,0 @@
-package com.java110.api.listener.carInout;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.carInout.ICarInoutBMO;
-import com.java110.api.listener.AbstractServiceApiPlusListener;
-import com.java110.utils.util.Assert;
-import com.java110.core.context.DataFlowContext;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
-import com.java110.utils.constant.ServiceCodeCarInoutConstant;
-
-
-import com.java110.core.annotation.Java110Listener;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
-
-/**
- * 保存小区侦听
- * add by wuxw 2019-06-30
- */
-@Java110Listener("saveCarInoutListener")
-public class SaveCarInoutListener extends AbstractServiceApiPlusListener {
-
-    @Autowired
-    private ICarInoutBMO carInoutBMOImpl;
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
-
-        Assert.hasKeyAndValue(reqJson, "state", "必填,请填写车辆状态");
-        Assert.hasKeyAndValue(reqJson, "communityId", "必填,请填写小区信息");
-        Assert.hasKeyAndValue(reqJson, "carNum", "必填,请填写车牌号");
-        Assert.hasKeyAndValue(reqJson, "inTime", "必填,请选择进场时间");
-        Assert.hasKeyAndValue(reqJson, "outTime", "必填,请选择出场时间");
-
-    }
-
-    @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
-        carInoutBMOImpl.addCarInout(reqJson, context);
-    }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeCarInoutConstant.ADD_CARINOUT;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-
-    @Override
-    public int getOrder() {
-        return DEFAULT_ORDER;
-    }
-
-
-
-
-}

+ 0 - 58
service-api/src/main/java/com/java110/api/listener/carInout/UpdateCarInoutListener.java

@@ -1,58 +0,0 @@
-package com.java110.api.listener.carInout;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.carInout.ICarInoutBMO;
-import com.java110.api.listener.AbstractServiceApiPlusListener;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
-import com.java110.utils.constant.ServiceCodeCarInoutConstant;
-import com.java110.utils.util.Assert;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
-
-/**
- * 保存车辆进场侦听
- * add by wuxw 2019-06-30
- */
-@Java110Listener("updateCarInoutListener")
-public class UpdateCarInoutListener extends AbstractServiceApiPlusListener {
-
-    @Autowired
-    private ICarInoutBMO carInoutBMOImpl;
-
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-
-        Assert.hasKeyAndValue(reqJson, "inoutId", "进出场ID不能为空");
-        Assert.hasKeyAndValue(reqJson, "communityId", "必填,请填写小区信息");
-
-        Assert.hasKeyAndValue(reqJson, "state", "必填,请填写车辆状态");
-        Assert.hasKeyAndValue(reqJson, "carNum", "必填,请填写车牌号");
-        Assert.hasKeyAndValue(reqJson, "inTime", "必填,请选择进场时间");
-        Assert.hasKeyAndValue(reqJson, "outTime", "必填,请选择出场时间");
-
-    }
-
-    @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-        carInoutBMOImpl.updateCarInout(reqJson, context);
-    }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeCarInoutConstant.UPDATE_CARINOUT;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-
-    @Override
-    public int getOrder() {
-        return DEFAULT_ORDER;
-    }
-
-
-}

+ 45 - 0
service-dev/src/main/java/com/java110/dev/cmd/basePrivilege/DeleteBasePrivilegeCmd.java

@@ -0,0 +1,45 @@
+package com.java110.dev.cmd.basePrivilege;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.dto.basePrivilege.BasePrivilegeDto;
+import com.java110.intf.community.IMenuInnerServiceSMO;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+
+@Java110Cmd(serviceCode = "basePrivilege.deleteBasePrivilege")
+public class DeleteBasePrivilegeCmd extends Cmd{
+
+    @Autowired
+    private IMenuInnerServiceSMO menuInnerServiceSMOImpl;
+
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+
+        Assert.hasKeyAndValue(reqJson, "pId", "权限ID不能为空");
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+
+
+        ResponseEntity<String> responseEntity = null;
+
+        BasePrivilegeDto basePrivilegeDto = BeanConvertUtil.covertBean(reqJson, BasePrivilegeDto.class);
+
+
+        int saveFlag = menuInnerServiceSMOImpl.deleteBasePrivilege(basePrivilegeDto);
+
+        responseEntity = new ResponseEntity<String>(saveFlag > 0 ? "成功" : "失败", saveFlag > 0 ? HttpStatus.OK : HttpStatus.BAD_REQUEST);
+
+        context.setResponseEntity(responseEntity);
+    }
+}

+ 13 - 43
service-api/src/main/java/com/java110/api/listener/basePrivilege/ListBasePrivilegesListener.java

@@ -1,66 +1,37 @@
-package com.java110.api.listener.basePrivilege;
+package com.java110.dev.cmd.basePrivilege;
 
 import com.alibaba.fastjson.JSONObject;
-import com.java110.api.listener.AbstractServiceApiListener;
-import com.java110.utils.constant.ServiceCodeBasePrivilegeConstant;
-import com.java110.utils.util.BeanConvertUtil;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.intf.community.IMenuInnerServiceSMO;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
 import com.java110.dto.basePrivilege.BasePrivilegeDto;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
+import com.java110.intf.community.IMenuInnerServiceSMO;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.BeanConvertUtil;
 import com.java110.vo.api.basePrivilege.ApiBasePrivilegeDataVo;
 import com.java110.vo.api.basePrivilege.ApiBasePrivilegeVo;
 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("listBasePrivilegesListener")
-public class ListBasePrivilegesListener extends AbstractServiceApiListener {
+@Java110Cmd(serviceCode = "basePrivilege.listBasePrivileges")
+public class ListBasePrivilegesCmd extends Cmd{
 
     @Autowired
     private IMenuInnerServiceSMO menuInnerServiceSMOImpl;
 
     @Override
-    public String getServiceCode() {
-        return ServiceCodeBasePrivilegeConstant.LIST_BASEPRIVILEGES;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.GET;
-    }
-
-
-    @Override
-    public int getOrder() {
-        return DEFAULT_ORDER;
-    }
-
-
-    public IMenuInnerServiceSMO getMenuInnerServiceSMOImpl() {
-        return menuInnerServiceSMOImpl;
-    }
-
-    public void setMenuInnerServiceSMOImpl(IMenuInnerServiceSMO menuInnerServiceSMOImpl) {
-        this.menuInnerServiceSMOImpl = menuInnerServiceSMOImpl;
-    }
-
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
         super.validatePageInfo(reqJson);
     }
 
     @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+
 
         BasePrivilegeDto basePrivilegeDto = BeanConvertUtil.covertBean(reqJson, BasePrivilegeDto.class);
 
@@ -83,6 +54,5 @@ public class ListBasePrivilegesListener extends AbstractServiceApiListener {
         ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiBasePrivilegeVo), HttpStatus.OK);
 
         context.setResponseEntity(responseEntity);
-
     }
 }

+ 13 - 50
service-api/src/main/java/com/java110/api/listener/basePrivilege/SaveBasePrivilegeListener.java

@@ -1,48 +1,37 @@
-package com.java110.api.listener.basePrivilege;
+package com.java110.dev.cmd.basePrivilege;
 
 import com.alibaba.fastjson.JSONObject;
-import com.java110.api.listener.AbstractServiceApiListener;
-import com.java110.utils.util.Assert;
-import com.java110.utils.util.BeanConvertUtil;
-import com.java110.core.context.DataFlowContext;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
 import com.java110.core.factory.GenerateCodeFactory;
-import com.java110.intf.community.IMenuInnerServiceSMO;
 import com.java110.dto.basePrivilege.BasePrivilegeDto;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
+import com.java110.intf.community.IMenuInnerServiceSMO;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
-import com.java110.utils.constant.ServiceCodeBasePrivilegeConstant;
-
 
-import com.java110.core.annotation.Java110Listener;
-
-/**
- * 保存小区侦听
- * add by wuxw 2019-06-30
- */
-@Java110Listener("saveBasePrivilegeListener")
-public class SaveBasePrivilegeListener extends AbstractServiceApiListener {
+@Java110Cmd(serviceCode = "basePrivilege.saveBasePrivilege")
+public class SaveBasePrivilegCmd extends Cmd{
 
     @Autowired
     private IMenuInnerServiceSMO menuInnerServiceSMOImpl;
 
     @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
-
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
         Assert.hasKeyAndValue(reqJson, "name", "必填,请填写权限名称");
         Assert.hasKeyAndValue(reqJson, "domain", "必填,请选择商户类型");
         Assert.hasKeyAndValue(reqJson, "resource", "必填,请选择资源路径");
         Assert.hasKeyAndValue(reqJson, "mId", "必填,菜单为空");
-
     }
 
     @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
         ResponseEntity<String> responseEntity = null;
 
         BasePrivilegeDto basePrivilegeDto = BeanConvertUtil.covertBean(reqJson, BasePrivilegeDto.class);
@@ -69,30 +58,4 @@ public class SaveBasePrivilegeListener extends AbstractServiceApiListener {
         //生成流水
         basePrivilegeDto.setPId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.BASE_PRIVILEGE));
     }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeBasePrivilegeConstant.ADD_BASEPRIVILEGE;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-
-    @Override
-    public int getOrder() {
-        return DEFAULT_ORDER;
-    }
-
-
-
-
-    public IMenuInnerServiceSMO getMenuInnerServiceSMOImpl() {
-        return menuInnerServiceSMOImpl;
-    }
-
-    public void setMenuInnerServiceSMOImpl(IMenuInnerServiceSMO menuInnerServiceSMOImpl) {
-        this.menuInnerServiceSMOImpl = menuInnerServiceSMOImpl;
-    }
 }

+ 44 - 0
service-dev/src/main/java/com/java110/dev/cmd/basePrivilege/UpdateBasePrivilegeCmd.java

@@ -0,0 +1,44 @@
+package com.java110.dev.cmd.basePrivilege;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.dto.basePrivilege.BasePrivilegeDto;
+import com.java110.intf.community.IMenuInnerServiceSMO;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+
+@Java110Cmd(serviceCode = "basePrivilege.updateBasePrivilege")
+public class UpdateBasePrivilegeCmd extends Cmd {
+
+    @Autowired
+    private IMenuInnerServiceSMO menuInnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+        Assert.hasKeyAndValue(reqJson, "pId", "权限ID不能为空");
+        Assert.hasKeyAndValue(reqJson, "name", "必填,请填写权限名称");
+        Assert.hasKeyAndValue(reqJson, "domain", "必填,请选择商户类型");
+        Assert.hasKeyAndValue(reqJson, "resource", "必填,请选择资源路径");
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+        ResponseEntity<String> responseEntity = null;
+
+        BasePrivilegeDto basePrivilegeDto = BeanConvertUtil.covertBean(reqJson, BasePrivilegeDto.class);
+
+
+        int saveFlag = menuInnerServiceSMOImpl.updateBasePrivilege(basePrivilegeDto);
+
+        responseEntity = new ResponseEntity<String>(saveFlag > 0 ? "成功" : "失败", saveFlag > 0 ? HttpStatus.OK : HttpStatus.BAD_REQUEST);
+
+        context.setResponseEntity(responseEntity);
+    }
+}

+ 42 - 0
service-dev/src/main/java/com/java110/dev/cmd/business/QueryBusinessTypeConfigCmd.java

@@ -0,0 +1,42 @@
+package com.java110.dev.cmd.business;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.DataFlowContext;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.dto.businesstype.CbusinesstypeDto;
+import com.java110.intf.store.ICbusinesstypeInnerServiceSMO;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+
+import java.util.List;
+
+@Java110Cmd(serviceCode = "business.queryBusinessTypeConfig")
+public class QueryBusinessTypeConfigCmd extends Cmd {
+
+    @Autowired
+    private ICbusinesstypeInnerServiceSMO iCbusinesstypeInnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+
+        //validateDemoConfigData(reqJson);
+
+        List<CbusinesstypeDto> cbusinesstypeDto = iCbusinesstypeInnerServiceSMOImpl.queryCbusinesstypes(BeanConvertUtil.covertBean(reqJson, CbusinesstypeDto.class));
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(cbusinesstypeDto), HttpStatus.OK);
+
+        context.setResponseEntity(responseEntity);
+
+    }
+}

+ 71 - 0
service-user/src/main/java/com/java110/user/cmd/carBlackWhite/DeleteCarBlackWhiteCmd.java

@@ -0,0 +1,71 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.user.cmd.carBlackWhite;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.intf.user.ICarBlackWhiteV1InnerServiceSMO;
+import com.java110.po.car.CarBlackWhitePo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * 类表述:删除
+ * 服务编码:carBlackWhite.deleteCarBlackWhite
+ * 请求路劲:/app/carBlackWhite.DeleteCarBlackWhite
+ * add by 吴学文 at 2022-07-16 23:23:24 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "carBlackWhite.deleteCarBlackWhite")
+public class DeleteCarBlackWhiteCmd extends Cmd {
+    private static Logger logger = LoggerFactory.getLogger(DeleteCarBlackWhiteCmd.class);
+
+    @Autowired
+    private ICarBlackWhiteV1InnerServiceSMO carBlackWhiteV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "bwId", "bwId不能为空");
+        Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        CarBlackWhitePo carBlackWhitePo = BeanConvertUtil.covertBean(reqJson, CarBlackWhitePo.class);
+        int flag = carBlackWhiteV1InnerServiceSMOImpl.deleteCarBlackWhite(carBlackWhitePo);
+
+        if (flag < 1) {
+            throw new CmdException("删除数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 44 - 42
service-api/src/main/java/com/java110/api/listener/carBlackWhite/ListCarBlackWhitesListener.java

@@ -1,35 +1,62 @@
-package com.java110.api.listener.carBlackWhite;
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.user.cmd.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.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.dto.machine.CarBlackWhiteDto;
 import com.java110.dto.parkingBoxArea.ParkingBoxAreaDto;
 import com.java110.intf.common.ICarBlackWhiteInnerServiceSMO;
-import com.java110.dto.machine.CarBlackWhiteDto;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
 import com.java110.intf.community.IParkingBoxAreaV1InnerServiceSMO;
-import com.java110.utils.constant.ServiceCodeCarBlackWhiteConstant;
+import com.java110.intf.user.ICarBlackWhiteV1InnerServiceSMO;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
 import com.java110.utils.util.StringUtil;
+import com.java110.vo.ResultVo;
 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;
+import java.util.ArrayList;
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.HttpStatus;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
- * 查询小区侦听类
+ * 类表述:查询
+ * 服务编码:carBlackWhite.listCarBlackWhite
+ * 请求路劲:/app/carBlackWhite.ListCarBlackWhite
+ * add by 吴学文 at 2022-07-16 23:23:24 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
  */
-@Java110Listener("listCarBlackWhitesListener")
-public class ListCarBlackWhitesListener extends AbstractServiceApiListener {
+@Java110Cmd(serviceCode = "carBlackWhite.listCarBlackWhites")
+public class ListCarBlackWhitesCmd extends Cmd {
+
+  private static Logger logger = LoggerFactory.getLogger(ListCarBlackWhitesCmd.class);
+    @Autowired
+    private ICarBlackWhiteV1InnerServiceSMO carBlackWhiteV1InnerServiceSMOImpl;
 
     @Autowired
     private ICarBlackWhiteInnerServiceSMO carBlackWhiteInnerServiceSMOImpl;
@@ -38,39 +65,14 @@ public class ListCarBlackWhitesListener extends AbstractServiceApiListener {
     private IParkingBoxAreaV1InnerServiceSMO parkingBoxAreaV1InnerServiceSMOImpl;
 
     @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) {
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
         Assert.hasKeyAndValue(reqJson, "communityId", "必填,请填写小区ID");
 
         super.validatePageInfo(reqJson);
     }
 
     @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
 
         CarBlackWhiteDto carBlackWhiteDto = BeanConvertUtil.covertBean(reqJson, CarBlackWhiteDto.class);
         carBlackWhiteDto.setPaIds(getPaIds(reqJson));

+ 80 - 0
service-user/src/main/java/com/java110/user/cmd/carBlackWhite/SaveCarBlackWhiteCmd.java

@@ -0,0 +1,80 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.user.cmd.carBlackWhite;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.intf.user.ICarBlackWhiteV1InnerServiceSMO;
+import com.java110.po.car.CarBlackWhitePo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * 类表述:保存
+ * 服务编码:carBlackWhite.saveCarBlackWhite
+ * 请求路劲:/app/carBlackWhite.SaveCarBlackWhite
+ * add by 吴学文 at 2022-07-16 23:23:24 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "carBlackWhite.saveCarBlackWhite")
+public class SaveCarBlackWhiteCmd extends Cmd {
+
+    private static Logger logger = LoggerFactory.getLogger(SaveCarBlackWhiteCmd.class);
+
+    public static final String CODE_PREFIX_ID = "10";
+
+    @Autowired
+    private ICarBlackWhiteV1InnerServiceSMO carBlackWhiteV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "blackWhite", "必填,请填写名单类型");
+        Assert.hasKeyAndValue(reqJson, "carNum", "必填,请填写车牌号");
+        Assert.hasKeyAndValue(reqJson, "communityId", "必填,请填写小区ID");
+        Assert.hasKeyAndValue(reqJson, "startTime", "必填,请选择开始时间");
+        Assert.hasKeyAndValue(reqJson, "endTime", "必填,请选择结束时间");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        CarBlackWhitePo carBlackWhitePo = BeanConvertUtil.covertBean(reqJson, CarBlackWhitePo.class);
+        carBlackWhitePo.setBwId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
+        int flag = carBlackWhiteV1InnerServiceSMOImpl.saveCarBlackWhite(carBlackWhitePo);
+
+        if (flag < 1) {
+            throw new CmdException("保存数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 75 - 0
service-user/src/main/java/com/java110/user/cmd/carBlackWhite/UpdateCarBlackWhiteCmd.java

@@ -0,0 +1,75 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.user.cmd.carBlackWhite;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.intf.user.ICarBlackWhiteV1InnerServiceSMO;
+import com.java110.po.car.CarBlackWhitePo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * 类表述:更新
+ * 服务编码:carBlackWhite.updateCarBlackWhite
+ * 请求路劲:/app/carBlackWhite.UpdateCarBlackWhite
+ * add by 吴学文 at 2022-07-16 23:23:24 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "carBlackWhite.updateCarBlackWhite")
+public class UpdateCarBlackWhiteCmd extends Cmd {
+
+  private static Logger logger = LoggerFactory.getLogger(UpdateCarBlackWhiteCmd.class);
+
+
+    @Autowired
+    private ICarBlackWhiteV1InnerServiceSMO carBlackWhiteV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "bwId", "bwId不能为空");
+Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+       CarBlackWhitePo carBlackWhitePo = BeanConvertUtil.covertBean(reqJson, CarBlackWhitePo.class);
+        int flag = carBlackWhiteV1InnerServiceSMOImpl.updateCarBlackWhite(carBlackWhitePo);
+
+        if (flag < 1) {
+            throw new CmdException("更新数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 12 - 43
service-api/src/main/java/com/java110/api/listener/carInout/ListCarInoutsListener.java

@@ -1,10 +1,11 @@
-package com.java110.api.listener.carInout;
+package com.java110.user.cmd.carInout;
 
 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.event.service.api.ServiceDataFlowEvent;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.core.log.LoggerFactory;
 import com.java110.dto.fee.FeeConfigDto;
 import com.java110.dto.fee.FeeDto;
 import com.java110.dto.machine.CarInoutDto;
@@ -12,16 +13,14 @@ import com.java110.intf.common.ICarInoutInnerServiceSMO;
 import com.java110.intf.fee.IFeeConfigInnerServiceSMO;
 import com.java110.intf.fee.IFeeInnerServiceSMO;
 import com.java110.utils.constant.FeeTypeConstant;
-import com.java110.utils.constant.ServiceCodeCarInoutConstant;
+import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
 import com.java110.utils.util.DateUtil;
 import com.java110.vo.api.carInout.ApiCarInoutDataVo;
 import com.java110.vo.api.carInout.ApiCarInoutVo;
 import org.slf4j.Logger;
-import com.java110.core.log.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 
@@ -30,14 +29,10 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
+@Java110Cmd(serviceCode = "carInout.listCarInouts")
+public class ListCarInoutsCmd extends Cmd{
 
-/**
- * 查询小区侦听类
- */
-@Java110Listener("listCarInoutsListener")
-public class ListCarInoutsListener extends AbstractServiceApiListener {
-    private static Logger logger = LoggerFactory.getLogger(ListCarInoutsListener.class);
-
+    private static Logger logger = LoggerFactory.getLogger(ListCarInoutsCmd.class);
 
     @Autowired
     private ICarInoutInnerServiceSMO carInoutInnerServiceSMOImpl;
@@ -49,39 +44,13 @@ public class ListCarInoutsListener extends AbstractServiceApiListener {
     private IFeeInnerServiceSMO feeInnerServiceSMOImpl;
 
     @Override
-    public String getServiceCode() {
-        return ServiceCodeCarInoutConstant.LIST_CARINOUTS;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.GET;
-    }
-
-
-    @Override
-    public int getOrder() {
-        return DEFAULT_ORDER;
-    }
-
-
-    public ICarInoutInnerServiceSMO getCarInoutInnerServiceSMOImpl() {
-        return carInoutInnerServiceSMOImpl;
-    }
-
-    public void setCarInoutInnerServiceSMOImpl(ICarInoutInnerServiceSMO carInoutInnerServiceSMOImpl) {
-        this.carInoutInnerServiceSMOImpl = carInoutInnerServiceSMOImpl;
-    }
-
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
         Assert.hasKeyAndValue(reqJson, "communityId", "必填,请填写小区信息");
         super.validatePageInfo(reqJson);
     }
 
     @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
         CarInoutDto carInoutDto = BeanConvertUtil.covertBean(reqJson, CarInoutDto.class);
 
         if (reqJson.containsKey("state") && reqJson.getString("state").contains(",")) {

+ 42 - 0
service-user/src/main/java/com/java110/user/cmd/carInout/SaveCarInoutCmd.java

@@ -0,0 +1,42 @@
+package com.java110.user.cmd.carInout;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.intf.common.ICarInoutV1InnerServiceSMO;
+import com.java110.po.car.CarInoutPo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+
+@Java110Cmd(serviceCode = "carInout.saveCarInout")
+public class SaveCarInoutCmd extends Cmd {
+
+    @Autowired
+    private ICarInoutV1InnerServiceSMO carInoutV1InnerServiceSMOImpl;
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+        Assert.hasKeyAndValue(reqJson, "state", "必填,请填写车辆状态");
+        Assert.hasKeyAndValue(reqJson, "communityId", "必填,请填写小区信息");
+        Assert.hasKeyAndValue(reqJson, "carNum", "必填,请填写车牌号");
+        Assert.hasKeyAndValue(reqJson, "inTime", "必填,请选择进场时间");
+        Assert.hasKeyAndValue(reqJson, "outTime", "必填,请选择出场时间");
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+
+        reqJson.put("inoutId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_inoutId));
+        CarInoutPo carInoutPo = BeanConvertUtil.covertBean(reqJson, CarInoutPo.class);
+
+        int flag = carInoutV1InnerServiceSMOImpl.saveCarInout(carInoutPo);
+
+        if(flag < 1){
+            throw new CmdException("车辆进出失败");
+        }
+    }
+}

+ 44 - 0
service-user/src/main/java/com/java110/user/cmd/carInout/UpdateCarInoutCmd.java

@@ -0,0 +1,44 @@
+package com.java110.user.cmd.carInout;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.intf.common.ICarInoutV1InnerServiceSMO;
+import com.java110.po.car.CarInoutPo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+
+@Java110Cmd(serviceCode = "carInout.updateCarInout")
+public class UpdateCarInoutCmd extends Cmd{
+
+
+    @Autowired
+    private ICarInoutV1InnerServiceSMO carInoutV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+        Assert.hasKeyAndValue(reqJson, "inoutId", "进出场ID不能为空");
+        Assert.hasKeyAndValue(reqJson, "communityId", "必填,请填写小区信息");
+
+        Assert.hasKeyAndValue(reqJson, "state", "必填,请填写车辆状态");
+        Assert.hasKeyAndValue(reqJson, "carNum", "必填,请填写车牌号");
+        Assert.hasKeyAndValue(reqJson, "inTime", "必填,请选择进场时间");
+        Assert.hasKeyAndValue(reqJson, "outTime", "必填,请选择出场时间");
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+
+        CarInoutPo carInoutPo = BeanConvertUtil.covertBean(reqJson, CarInoutPo.class);
+
+        int flag = carInoutV1InnerServiceSMOImpl.saveCarInout(carInoutPo);
+
+        if(flag < 1){
+            throw new CmdException("车辆进出失败");
+        }
+    }
+}

+ 77 - 0
service-user/src/main/java/com/java110/user/dao/ICarBlackWhiteV1ServiceDao.java

@@ -0,0 +1,77 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.user.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;
+
+/**
+ * 类表述:
+ * add by 吴学文 at 2022-07-16 23:23:24 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+public interface ICarBlackWhiteV1ServiceDao {
+
+
+    /**
+     * 保存 车辆黑白名单信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    int saveCarBlackWhiteInfo(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异常
+     */
+    int updateCarBlackWhiteInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询车辆黑白名单总数
+     *
+     * @param info 车辆黑白名单信息
+     * @return 车辆黑白名单数量
+     */
+    int queryCarBlackWhitesCount(Map info);
+
+}

+ 112 - 0
service-user/src/main/java/com/java110/user/dao/impl/CarBlackWhiteV1ServiceDaoImpl.java

@@ -0,0 +1,112 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.user.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.exception.DAOException;
+import com.java110.utils.util.DateUtil;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.user.dao.ICarBlackWhiteV1ServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 类表述:
+ * add by 吴学文 at 2022-07-16 23:23:24 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Service("carBlackWhiteV1ServiceDaoImpl")
+public class CarBlackWhiteV1ServiceDaoImpl extends BaseServiceDao implements ICarBlackWhiteV1ServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(CarBlackWhiteV1ServiceDaoImpl.class);
+
+
+
+
+
+    /**
+     * 保存车辆黑白名单信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int saveCarBlackWhiteInfo(Map info) throws DAOException {
+        logger.debug("保存 saveCarBlackWhiteInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("carBlackWhiteV1ServiceDaoImpl.saveCarBlackWhiteInfo",info);
+
+        return saveFlag;
+    }
+
+
+    /**
+     * 查询车辆黑白名单信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getCarBlackWhiteInfo(Map info) throws DAOException {
+        logger.debug("查询 getCarBlackWhiteInfo 入参 info : {}",info);
+
+        List<Map> businessCarBlackWhiteInfos = sqlSessionTemplate.selectList("carBlackWhiteV1ServiceDaoImpl.getCarBlackWhiteInfo",info);
+
+        return businessCarBlackWhiteInfos;
+    }
+
+
+    /**
+     * 修改车辆黑白名单信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int updateCarBlackWhiteInfo(Map info) throws DAOException {
+        logger.debug("修改 updateCarBlackWhiteInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("carBlackWhiteV1ServiceDaoImpl.updateCarBlackWhiteInfo",info);
+
+        return saveFlag;
+    }
+
+     /**
+     * 查询车辆黑白名单数量
+     * @param info 车辆黑白名单信息
+     * @return 车辆黑白名单数量
+     */
+    @Override
+    public int queryCarBlackWhitesCount(Map info) {
+        logger.debug("查询 queryCarBlackWhitesCount 入参 info : {}",info);
+
+        List<Map> businessCarBlackWhiteInfos = sqlSessionTemplate.selectList("carBlackWhiteV1ServiceDaoImpl.queryCarBlackWhitesCount", info);
+        if (businessCarBlackWhiteInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessCarBlackWhiteInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 89 - 0
service-user/src/main/java/com/java110/user/smo/impl/CarBlackWhiteV1InnerServiceSMOImpl.java

@@ -0,0 +1,89 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.user.smo.impl;
+
+
+import com.java110.dto.machine.CarBlackWhiteDto;
+import com.java110.po.car.CarBlackWhitePo;
+import com.java110.user.dao.ICarBlackWhiteV1ServiceDao;
+import com.java110.intf.user.ICarBlackWhiteV1InnerServiceSMO;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.dto.user.UserDto;
+import com.java110.dto.PageDto;
+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;
+
+/**
+ * 类表述: 服务之前调用的接口实现类,不对外提供接口能力 只用于接口建调用
+ * add by 吴学文 at 2022-07-16 23:23:24 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@RestController
+public class CarBlackWhiteV1InnerServiceSMOImpl extends BaseServiceSMO implements ICarBlackWhiteV1InnerServiceSMO {
+
+    @Autowired
+    private ICarBlackWhiteV1ServiceDao carBlackWhiteV1ServiceDaoImpl;
+
+
+    @Override
+    public int saveCarBlackWhite(@RequestBody CarBlackWhitePo carBlackWhitePo) {
+        int saveFlag = carBlackWhiteV1ServiceDaoImpl.saveCarBlackWhiteInfo(BeanConvertUtil.beanCovertMap(carBlackWhitePo));
+        return saveFlag;
+    }
+
+     @Override
+    public int updateCarBlackWhite(@RequestBody  CarBlackWhitePo carBlackWhitePo) {
+        int saveFlag = carBlackWhiteV1ServiceDaoImpl.updateCarBlackWhiteInfo(BeanConvertUtil.beanCovertMap(carBlackWhitePo));
+        return saveFlag;
+    }
+
+     @Override
+    public int deleteCarBlackWhite(@RequestBody  CarBlackWhitePo carBlackWhitePo) {
+       carBlackWhitePo.setStatusCd("1");
+       int saveFlag = carBlackWhiteV1ServiceDaoImpl.updateCarBlackWhiteInfo(BeanConvertUtil.beanCovertMap(carBlackWhitePo));
+       return saveFlag;
+    }
+
+    @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(carBlackWhiteV1ServiceDaoImpl.getCarBlackWhiteInfo(BeanConvertUtil.beanCovertMap(carBlackWhiteDto)), CarBlackWhiteDto.class);
+
+        return carBlackWhites;
+    }
+
+
+    @Override
+    public int queryCarBlackWhitesCount(@RequestBody CarBlackWhiteDto carBlackWhiteDto) {
+        return carBlackWhiteV1ServiceDaoImpl.queryCarBlackWhitesCount(BeanConvertUtil.beanCovertMap(carBlackWhiteDto));    }
+
+}