Browse Source

加入车辆进场

wuxw 6 years ago
parent
commit
bd2e96414f
16 changed files with 1714 additions and 0 deletions
  1. 81 0
      HardwareAdapationService/src/main/java/com/java110/hardwareAdapation/dao/ICarInoutServiceDao.java
  2. 134 0
      HardwareAdapationService/src/main/java/com/java110/hardwareAdapation/dao/impl/CarInoutServiceDaoImpl.java
  3. 85 0
      HardwareAdapationService/src/main/java/com/java110/hardwareAdapation/listener/carInout/AbstractCarInoutBusinessServiceDataFlowListener.java
  4. 180 0
      HardwareAdapationService/src/main/java/com/java110/hardwareAdapation/listener/carInout/DeleteCarInoutInfoListener.java
  5. 179 0
      HardwareAdapationService/src/main/java/com/java110/hardwareAdapation/listener/carInout/SaveCarInoutInfoListener.java
  6. 190 0
      HardwareAdapationService/src/main/java/com/java110/hardwareAdapation/listener/carInout/UpdateCarInoutInfoListener.java
  7. 72 0
      HardwareAdapationService/src/main/java/com/java110/hardwareAdapation/smo/impl/CarInoutInnerServiceSMOImpl.java
  8. 114 0
      docs/document/services/carInout/DeleteCarInoutInfo.md
  9. 124 0
      docs/document/services/carInout/SaveCarInoutInfo.md
  10. 124 0
      docs/document/services/carInout/UpdateCarInoutInfo.md
  11. 95 0
      java110-bean/src/main/java/com/java110/dto/hardwareAdapation/CarInoutDto.java
  12. 92 0
      java110-code-generator/src/main/java/com/java110/CarInoutGeneratorApplication.java
  13. 1 0
      java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java
  14. 41 0
      java110-core/src/main/java/com/java110/core/smo/hardwareAdapation/ICarInoutInnerServiceSMO.java
  15. 186 0
      java110-db/src/main/resources/mapper/hardwareAdapation/CarInoutServiceDaoImplMapper.xml
  16. 16 0
      java110-utils/src/main/java/com/java110/utils/constant/BusinessTypeConstant.java

+ 81 - 0
HardwareAdapationService/src/main/java/com/java110/hardwareAdapation/dao/ICarInoutServiceDao.java

@@ -0,0 +1,81 @@
+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 ICarInoutServiceDao {
+
+    /**
+     * 保存 进出场信息
+     * @param businessCarInoutInfo 进出场信息 封装
+     * @throws DAOException 操作数据库异常
+     */
+    void saveBusinessCarInoutInfo(Map businessCarInoutInfo) throws DAOException;
+
+
+
+    /**
+     * 查询进出场信息(business过程)
+     * 根据bId 查询进出场信息
+     * @param info bId 信息
+     * @return 进出场信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getBusinessCarInoutInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 保存 进出场信息 Business数据到 Instance中
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    void saveCarInoutInfoInstance(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询进出场信息(instance过程)
+     * 根据bId 查询进出场信息
+     * @param info bId 信息
+     * @return 进出场信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getCarInoutInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改进出场信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    void updateCarInoutInfoInstance(Map info) throws DAOException;
+
+
+    /**
+     * 查询进出场总数
+     *
+     * @param info 进出场信息
+     * @return 进出场数量
+     */
+    int queryCarInoutsCount(Map info);
+
+}

+ 134 - 0
HardwareAdapationService/src/main/java/com/java110/hardwareAdapation/dao/impl/CarInoutServiceDaoImpl.java

@@ -0,0 +1,134 @@
+package com.java110.hardwareAdapation.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.hardwareAdapation.dao.ICarInoutServiceDao;
+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("carInoutServiceDaoImpl")
+//@Transactional
+public class CarInoutServiceDaoImpl extends BaseServiceDao implements ICarInoutServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(CarInoutServiceDaoImpl.class);
+
+    /**
+     * 进出场信息封装
+     *
+     * @param businessCarInoutInfo 进出场信息 封装
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void saveBusinessCarInoutInfo(Map businessCarInoutInfo) throws DAOException {
+        businessCarInoutInfo.put("month", DateUtil.getCurrentMonth());
+        // 查询business_user 数据是否已经存在
+        logger.debug("保存进出场信息 入参 businessCarInoutInfo : {}", businessCarInoutInfo);
+        int saveFlag = sqlSessionTemplate.insert("carInoutServiceDaoImpl.saveBusinessCarInoutInfo", businessCarInoutInfo);
+
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存进出场数据失败:" + JSONObject.toJSONString(businessCarInoutInfo));
+        }
+    }
+
+
+    /**
+     * 查询进出场信息
+     *
+     * @param info bId 信息
+     * @return 进出场信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getBusinessCarInoutInfo(Map info) throws DAOException {
+
+        logger.debug("查询进出场信息 入参 info : {}", info);
+
+        List<Map> businessCarInoutInfos = sqlSessionTemplate.selectList("carInoutServiceDaoImpl.getBusinessCarInoutInfo", info);
+
+        return businessCarInoutInfos;
+    }
+
+
+    /**
+     * 保存进出场信息 到 instance
+     *
+     * @param info bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void saveCarInoutInfoInstance(Map info) throws DAOException {
+        logger.debug("保存进出场信息Instance 入参 info : {}", info);
+
+        int saveFlag = sqlSessionTemplate.insert("carInoutServiceDaoImpl.saveCarInoutInfoInstance", 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> getCarInoutInfo(Map info) throws DAOException {
+        logger.debug("查询进出场信息 入参 info : {}", info);
+
+        List<Map> businessCarInoutInfos = sqlSessionTemplate.selectList("carInoutServiceDaoImpl.getCarInoutInfo", info);
+
+        return businessCarInoutInfos;
+    }
+
+
+    /**
+     * 修改进出场信息
+     *
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void updateCarInoutInfoInstance(Map info) throws DAOException {
+        logger.debug("修改进出场信息Instance 入参 info : {}", info);
+
+        int saveFlag = sqlSessionTemplate.update("carInoutServiceDaoImpl.updateCarInoutInfoInstance", info);
+
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改进出场信息Instance数据失败:" + JSONObject.toJSONString(info));
+        }
+    }
+
+    /**
+     * 查询进出场数量
+     *
+     * @param info 进出场信息
+     * @return 进出场数量
+     */
+    @Override
+    public int queryCarInoutsCount(Map info) {
+        logger.debug("查询进出场数据 入参 info : {}", info);
+
+        List<Map> businessCarInoutInfos = sqlSessionTemplate.selectList("carInoutServiceDaoImpl.queryCarInoutsCount", info);
+        if (businessCarInoutInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessCarInoutInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 85 - 0
HardwareAdapationService/src/main/java/com/java110/hardwareAdapation/listener/carInout/AbstractCarInoutBusinessServiceDataFlowListener.java

@@ -0,0 +1,85 @@
+package com.java110.hardwareAdapation.listener.carInout;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.entity.center.Business;
+import com.java110.event.service.AbstractBusinessServiceDataFlowListener;
+import com.java110.hardwareAdapation.dao.ICarInoutServiceDao;
+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 AbstractCarInoutBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener {
+    private static Logger logger = LoggerFactory.getLogger(AbstractCarInoutBusinessServiceDataFlowListener.class);
+
+
+    /**
+     * 获取 DAO工具类
+     *
+     * @return
+     */
+    public abstract ICarInoutServiceDao getCarInoutServiceDaoImpl();
+
+    /**
+     * 刷新 businessCarInoutInfo 数据
+     * 主要将 数据库 中字段和 接口传递字段建立关系
+     *
+     * @param businessCarInoutInfo
+     */
+    protected void flushBusinessCarInoutInfo(Map businessCarInoutInfo, String statusCd) {
+        businessCarInoutInfo.put("newBId", businessCarInoutInfo.get("b_id"));
+        businessCarInoutInfo.put("inTime", businessCarInoutInfo.get("in_time"));
+        businessCarInoutInfo.put("inoutId", businessCarInoutInfo.get("inout_id"));
+        businessCarInoutInfo.put("operate", businessCarInoutInfo.get("operate"));
+        businessCarInoutInfo.put("carNum", businessCarInoutInfo.get("car_num"));
+        businessCarInoutInfo.put("state", businessCarInoutInfo.get("state"));
+        businessCarInoutInfo.put("communityId", businessCarInoutInfo.get("community_id"));
+        businessCarInoutInfo.put("outTime", businessCarInoutInfo.get("out_time"));
+        businessCarInoutInfo.remove("bId");
+        businessCarInoutInfo.put("statusCd", statusCd);
+    }
+
+
+    /**
+     * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中
+     *
+     * @param businessCarInout 进出场信息
+     */
+    protected void autoSaveDelBusinessCarInout(Business business, JSONObject businessCarInout) {
+//自动插入DEL
+        Map info = new HashMap();
+        info.put("inoutId", businessCarInout.getString("inoutId"));
+        info.put("statusCd", StatusConstant.STATUS_CD_VALID);
+        List<Map> currentCarInoutInfos = getCarInoutServiceDaoImpl().getCarInoutInfo(info);
+        if (currentCarInoutInfos == null || currentCarInoutInfos.size() != 1) {
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "未找到需要修改数据信息,入参错误或数据有问题,请检查" + info);
+        }
+
+        Map currentCarInoutInfo = currentCarInoutInfos.get(0);
+
+        currentCarInoutInfo.put("bId", business.getbId());
+
+        currentCarInoutInfo.put("inTime", currentCarInoutInfo.get("in_time"));
+        currentCarInoutInfo.put("inoutId", currentCarInoutInfo.get("inout_id"));
+        currentCarInoutInfo.put("operate", currentCarInoutInfo.get("operate"));
+        currentCarInoutInfo.put("carNum", currentCarInoutInfo.get("car_num"));
+        currentCarInoutInfo.put("state", currentCarInoutInfo.get("state"));
+        currentCarInoutInfo.put("communityId", currentCarInoutInfo.get("community_id"));
+        currentCarInoutInfo.put("outTime", currentCarInoutInfo.get("out_time"));
+
+
+        currentCarInoutInfo.put("operate", StatusConstant.OPERATE_DEL);
+        getCarInoutServiceDaoImpl().saveBusinessCarInoutInfo(currentCarInoutInfo);
+    }
+
+
+}

+ 180 - 0
HardwareAdapationService/src/main/java/com/java110/hardwareAdapation/listener/carInout/DeleteCarInoutInfoListener.java

@@ -0,0 +1,180 @@
+package com.java110.hardwareAdapation.listener.carInout;
+
+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.ICarInoutServiceDao;
+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、businessCarInout:{} 进出场基本信息节点
+ * 2、businessCarInoutAttr:[{}] 进出场属性信息节点
+ * 3、businessCarInoutPhoto:[{}] 进出场照片信息节点
+ * 4、businessCarInoutCerdentials:[{}] 进出场证件信息节点
+ * 协议地址 :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("deleteCarInoutInfoListener")
+@Transactional
+public class DeleteCarInoutInfoListener extends AbstractCarInoutBusinessServiceDataFlowListener {
+
+    private final static Logger logger = LoggerFactory.getLogger(DeleteCarInoutInfoListener.class);
+    @Autowired
+    ICarInoutServiceDao carInoutServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 3;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_DELETE_CAR_INOUT;
+    }
+
+    /**
+     * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去
+     *
+     * @param dataFlowContext 数据对象
+     * @param business        当前业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+
+        Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理");
+
+        //处理 businessCarInout 节点
+        if (data.containsKey("businessCarInout")) {
+            //处理 businessCarInout 节点
+            if (data.containsKey("businessCarInout")) {
+                Object _obj = data.get("businessCarInout");
+                JSONArray businessCarInouts = null;
+                if (_obj instanceof JSONObject) {
+                    businessCarInouts = new JSONArray();
+                    businessCarInouts.add(_obj);
+                } else {
+                    businessCarInouts = (JSONArray) _obj;
+                }
+                //JSONObject businessCarInout = data.getJSONObject("businessCarInout");
+                for (int _carInoutIndex = 0; _carInoutIndex < businessCarInouts.size(); _carInoutIndex++) {
+                    JSONObject businessCarInout = businessCarInouts.getJSONObject(_carInoutIndex);
+                    doBusinessCarInout(business, businessCarInout);
+                    if (_obj instanceof JSONObject) {
+                        dataFlowContext.addParamOut("inoutId", businessCarInout.getString("inoutId"));
+                    }
+                }
+            }
+        }
+
+
+    }
+
+    /**
+     * 删除 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> businessCarInoutInfos = carInoutServiceDaoImpl.getBusinessCarInoutInfo(info);
+        if (businessCarInoutInfos != null && businessCarInoutInfos.size() > 0) {
+            for (int _carInoutIndex = 0; _carInoutIndex < businessCarInoutInfos.size(); _carInoutIndex++) {
+                Map businessCarInoutInfo = businessCarInoutInfos.get(_carInoutIndex);
+                flushBusinessCarInoutInfo(businessCarInoutInfo, StatusConstant.STATUS_CD_INVALID);
+                carInoutServiceDaoImpl.updateCarInoutInfoInstance(businessCarInoutInfo);
+                dataFlowContext.addParamOut("inoutId", businessCarInoutInfo.get("inout_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> carInoutInfo = carInoutServiceDaoImpl.getCarInoutInfo(info);
+        if (carInoutInfo != null && carInoutInfo.size() > 0) {
+
+            //进出场信息
+            List<Map> businessCarInoutInfos = carInoutServiceDaoImpl.getBusinessCarInoutInfo(delInfo);
+            //除非程序出错了,这里不会为空
+            if (businessCarInoutInfos == null || businessCarInoutInfos.size() == 0) {
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR, "撤单失败(carInout),程序内部异常,请检查! " + delInfo);
+            }
+            for (int _carInoutIndex = 0; _carInoutIndex < businessCarInoutInfos.size(); _carInoutIndex++) {
+                Map businessCarInoutInfo = businessCarInoutInfos.get(_carInoutIndex);
+                flushBusinessCarInoutInfo(businessCarInoutInfo, StatusConstant.STATUS_CD_VALID);
+                carInoutServiceDaoImpl.updateCarInoutInfoInstance(businessCarInoutInfo);
+            }
+        }
+    }
+
+
+    /**
+     * 处理 businessCarInout 节点
+     *
+     * @param business         总的数据节点
+     * @param businessCarInout 进出场节点
+     */
+    private void doBusinessCarInout(Business business, JSONObject businessCarInout) {
+
+        Assert.jsonObjectHaveKey(businessCarInout, "inoutId", "businessCarInout 节点下没有包含 inoutId 节点");
+
+        if (businessCarInout.getString("inoutId").startsWith("-")) {
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "inoutId 错误,不能自动生成(必须已经存在的inoutId)" + businessCarInout);
+        }
+        //自动插入DEL
+        autoSaveDelBusinessCarInout(business, businessCarInout);
+    }
+
+    public ICarInoutServiceDao getCarInoutServiceDaoImpl() {
+        return carInoutServiceDaoImpl;
+    }
+
+    public void setCarInoutServiceDaoImpl(ICarInoutServiceDao carInoutServiceDaoImpl) {
+        this.carInoutServiceDaoImpl = carInoutServiceDaoImpl;
+    }
+}

+ 179 - 0
HardwareAdapationService/src/main/java/com/java110/hardwareAdapation/listener/carInout/SaveCarInoutInfoListener.java

@@ -0,0 +1,179 @@
+package com.java110.hardwareAdapation.listener.carInout;
+
+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.ICarInoutServiceDao;
+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("saveCarInoutInfoListener")
+@Transactional
+public class SaveCarInoutInfoListener extends AbstractCarInoutBusinessServiceDataFlowListener {
+
+    private static Logger logger = LoggerFactory.getLogger(SaveCarInoutInfoListener.class);
+
+    @Autowired
+    private ICarInoutServiceDao carInoutServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 0;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_SAVE_CAR_INOUT;
+    }
+
+    /**
+     * 保存进出场信息 business 表中
+     *
+     * @param dataFlowContext 数据对象
+     * @param business        当前业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+        Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理");
+
+        //处理 businessCarInout 节点
+        if (data.containsKey("businessCarInout")) {
+            Object bObj = data.get("businessCarInout");
+            JSONArray businessCarInouts = null;
+            if (bObj instanceof JSONObject) {
+                businessCarInouts = new JSONArray();
+                businessCarInouts.add(bObj);
+            } else {
+                businessCarInouts = (JSONArray) bObj;
+            }
+            //JSONObject businessCarInout = data.getJSONObject("businessCarInout");
+            for (int bCarInoutIndex = 0; bCarInoutIndex < businessCarInouts.size(); bCarInoutIndex++) {
+                JSONObject businessCarInout = businessCarInouts.getJSONObject(bCarInoutIndex);
+                doBusinessCarInout(business, businessCarInout);
+                if (bObj instanceof JSONObject) {
+                    dataFlowContext.addParamOut("inoutId", businessCarInout.getString("inoutId"));
+                }
+            }
+        }
+    }
+
+    /**
+     * 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> businessCarInoutInfo = carInoutServiceDaoImpl.getBusinessCarInoutInfo(info);
+        if (businessCarInoutInfo != null && businessCarInoutInfo.size() > 0) {
+            reFreshShareColumn(info, businessCarInoutInfo.get(0));
+            carInoutServiceDaoImpl.saveCarInoutInfoInstance(info);
+            if (businessCarInoutInfo.size() == 1) {
+                dataFlowContext.addParamOut("inoutId", businessCarInoutInfo.get(0).get("inout_id"));
+            }
+        }
+    }
+
+
+    /**
+     * 刷 分片字段
+     *
+     * @param info         查询对象
+     * @param businessInfo 小区ID
+     */
+    private void reFreshShareColumn(Map info, Map businessInfo) {
+
+        if (info.containsKey("inoutId")) {
+            return;
+        }
+
+        if (!businessInfo.containsKey("inout_id")) {
+            return;
+        }
+
+        info.put("inoutId", businessInfo.get("inout_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> carInoutInfo = carInoutServiceDaoImpl.getCarInoutInfo(info);
+        if (carInoutInfo != null && carInoutInfo.size() > 0) {
+            reFreshShareColumn(paramIn, carInoutInfo.get(0));
+            carInoutServiceDaoImpl.updateCarInoutInfoInstance(paramIn);
+        }
+    }
+
+
+    /**
+     * 处理 businessCarInout 节点
+     *
+     * @param business         总的数据节点
+     * @param businessCarInout 进出场节点
+     */
+    private void doBusinessCarInout(Business business, JSONObject businessCarInout) {
+
+        Assert.jsonObjectHaveKey(businessCarInout, "inoutId", "businessCarInout 节点下没有包含 inoutId 节点");
+
+        if (businessCarInout.getString("inoutId").startsWith("-")) {
+            //刷新缓存
+            //flushCarInoutId(business.getDatas());
+
+            businessCarInout.put("inoutId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_inoutId));
+
+        }
+
+        businessCarInout.put("bId", business.getbId());
+        businessCarInout.put("operate", StatusConstant.OPERATE_ADD);
+        //保存进出场信息
+        carInoutServiceDaoImpl.saveBusinessCarInoutInfo(businessCarInout);
+
+    }
+
+    public ICarInoutServiceDao getCarInoutServiceDaoImpl() {
+        return carInoutServiceDaoImpl;
+    }
+
+    public void setCarInoutServiceDaoImpl(ICarInoutServiceDao carInoutServiceDaoImpl) {
+        this.carInoutServiceDaoImpl = carInoutServiceDaoImpl;
+    }
+}

+ 190 - 0
HardwareAdapationService/src/main/java/com/java110/hardwareAdapation/listener/carInout/UpdateCarInoutInfoListener.java

@@ -0,0 +1,190 @@
+package com.java110.hardwareAdapation.listener.carInout;
+
+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.ICarInoutServiceDao;
+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、businessCarInout:{} 进出场基本信息节点
+ * 2、businessCarInoutAttr:[{}] 进出场属性信息节点
+ * 3、businessCarInoutPhoto:[{}] 进出场照片信息节点
+ * 4、businessCarInoutCerdentials:[{}] 进出场证件信息节点
+ * 协议地址 :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("updateCarInoutInfoListener")
+@Transactional
+public class UpdateCarInoutInfoListener extends AbstractCarInoutBusinessServiceDataFlowListener {
+
+    private static Logger logger = LoggerFactory.getLogger(UpdateCarInoutInfoListener.class);
+    @Autowired
+    private ICarInoutServiceDao carInoutServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 2;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_CAR_INOUT;
+    }
+
+    /**
+     * business过程
+     *
+     * @param dataFlowContext 上下文对象
+     * @param business        业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+
+        JSONObject data = business.getDatas();
+
+        Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理");
+
+        //处理 businessCarInout 节点
+        if (data.containsKey("businessCarInout")) {
+            //处理 businessCarInout 节点
+            if (data.containsKey("businessCarInout")) {
+                Object _obj = data.get("businessCarInout");
+                JSONArray businessCarInouts = null;
+                if (_obj instanceof JSONObject) {
+                    businessCarInouts = new JSONArray();
+                    businessCarInouts.add(_obj);
+                } else {
+                    businessCarInouts = (JSONArray) _obj;
+                }
+                //JSONObject businessCarInout = data.getJSONObject("businessCarInout");
+                for (int _carInoutIndex = 0; _carInoutIndex < businessCarInouts.size(); _carInoutIndex++) {
+                    JSONObject businessCarInout = businessCarInouts.getJSONObject(_carInoutIndex);
+                    doBusinessCarInout(business, businessCarInout);
+                    if (_obj instanceof JSONObject) {
+                        dataFlowContext.addParamOut("inoutId", businessCarInout.getString("inoutId"));
+                    }
+                }
+            }
+        }
+    }
+
+
+    /**
+     * 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> businessCarInoutInfos = carInoutServiceDaoImpl.getBusinessCarInoutInfo(info);
+        if (businessCarInoutInfos != null && businessCarInoutInfos.size() > 0) {
+            for (int _carInoutIndex = 0; _carInoutIndex < businessCarInoutInfos.size(); _carInoutIndex++) {
+                Map businessCarInoutInfo = businessCarInoutInfos.get(_carInoutIndex);
+                flushBusinessCarInoutInfo(businessCarInoutInfo, StatusConstant.STATUS_CD_VALID);
+                carInoutServiceDaoImpl.updateCarInoutInfoInstance(businessCarInoutInfo);
+                if (businessCarInoutInfo.size() == 1) {
+                    dataFlowContext.addParamOut("inoutId", businessCarInoutInfo.get("inout_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> carInoutInfo = carInoutServiceDaoImpl.getCarInoutInfo(info);
+        if (carInoutInfo != null && carInoutInfo.size() > 0) {
+
+            //进出场信息
+            List<Map> businessCarInoutInfos = carInoutServiceDaoImpl.getBusinessCarInoutInfo(delInfo);
+            //除非程序出错了,这里不会为空
+            if (businessCarInoutInfos == null || businessCarInoutInfos.size() == 0) {
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR, "撤单失败(carInout),程序内部异常,请检查! " + delInfo);
+            }
+            for (int _carInoutIndex = 0; _carInoutIndex < businessCarInoutInfos.size(); _carInoutIndex++) {
+                Map businessCarInoutInfo = businessCarInoutInfos.get(_carInoutIndex);
+                flushBusinessCarInoutInfo(businessCarInoutInfo, StatusConstant.STATUS_CD_VALID);
+                carInoutServiceDaoImpl.updateCarInoutInfoInstance(businessCarInoutInfo);
+            }
+        }
+
+    }
+
+
+    /**
+     * 处理 businessCarInout 节点
+     *
+     * @param business         总的数据节点
+     * @param businessCarInout 进出场节点
+     */
+    private void doBusinessCarInout(Business business, JSONObject businessCarInout) {
+
+        Assert.jsonObjectHaveKey(businessCarInout, "inoutId", "businessCarInout 节点下没有包含 inoutId 节点");
+
+        if (businessCarInout.getString("inoutId").startsWith("-")) {
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "inoutId 错误,不能自动生成(必须已经存在的inoutId)" + businessCarInout);
+        }
+        //自动保存DEL
+        autoSaveDelBusinessCarInout(business, businessCarInout);
+
+        businessCarInout.put("bId", business.getbId());
+        businessCarInout.put("operate", StatusConstant.OPERATE_ADD);
+        //保存进出场信息
+        carInoutServiceDaoImpl.saveBusinessCarInoutInfo(businessCarInout);
+
+    }
+
+
+    public ICarInoutServiceDao getCarInoutServiceDaoImpl() {
+        return carInoutServiceDaoImpl;
+    }
+
+    public void setCarInoutServiceDaoImpl(ICarInoutServiceDao carInoutServiceDaoImpl) {
+        this.carInoutServiceDaoImpl = carInoutServiceDaoImpl;
+    }
+
+
+}

+ 72 - 0
HardwareAdapationService/src/main/java/com/java110/hardwareAdapation/smo/impl/CarInoutInnerServiceSMOImpl.java

@@ -0,0 +1,72 @@
+package com.java110.hardwareAdapation.smo.impl;
+
+
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.core.smo.hardwareAdapation.ICarInoutInnerServiceSMO;
+import com.java110.core.smo.user.IUserInnerServiceSMO;
+import com.java110.dto.PageDto;
+import com.java110.dto.hardwareAdapation.CarInoutDto;
+import com.java110.hardwareAdapation.dao.ICarInoutServiceDao;
+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.List;
+
+/**
+ * @ClassName FloorInnerServiceSMOImpl
+ * @Description 进出场内部服务实现类
+ * @Author wuxw
+ * @Date 2019/4/24 9:20
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+@RestController
+public class CarInoutInnerServiceSMOImpl extends BaseServiceSMO implements ICarInoutInnerServiceSMO {
+
+    @Autowired
+    private ICarInoutServiceDao carInoutServiceDaoImpl;
+
+    @Autowired
+    private IUserInnerServiceSMO userInnerServiceSMOImpl;
+
+    @Override
+    public List<CarInoutDto> queryCarInouts(@RequestBody CarInoutDto carInoutDto) {
+
+        //校验是否传了 分页信息
+
+        int page = carInoutDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            carInoutDto.setPage((page - 1) * carInoutDto.getRow());
+        }
+
+        List<CarInoutDto> carInouts = BeanConvertUtil.covertBeanList(carInoutServiceDaoImpl.getCarInoutInfo(BeanConvertUtil.beanCovertMap(carInoutDto)), CarInoutDto.class);
+
+
+        return carInouts;
+    }
+
+
+    @Override
+    public int queryCarInoutsCount(@RequestBody CarInoutDto carInoutDto) {
+        return carInoutServiceDaoImpl.queryCarInoutsCount(BeanConvertUtil.beanCovertMap(carInoutDto));
+    }
+
+    public ICarInoutServiceDao getCarInoutServiceDaoImpl() {
+        return carInoutServiceDaoImpl;
+    }
+
+    public void setCarInoutServiceDaoImpl(ICarInoutServiceDao carInoutServiceDaoImpl) {
+        this.carInoutServiceDaoImpl = carInoutServiceDaoImpl;
+    }
+
+    public IUserInnerServiceSMO getUserInnerServiceSMOImpl() {
+        return userInnerServiceSMOImpl;
+    }
+
+    public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) {
+        this.userInnerServiceSMOImpl = userInnerServiceSMOImpl;
+    }
+}

+ 114 - 0
docs/document/services/carInout/DeleteCarInoutInfo.md

@@ -0,0 +1,114 @@
+
+
+**1\. 删除进出场**
+###### 接口功能
+> API服务做删除进出场时调用该接口
+
+###### URL
+> [http://carInout-service/carInoutApi/service](http://carInout-service/carInoutApi/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|businessCarInoutInfo|1|Object|-|小区成员|小区成员|
+|businessCarInoutInfo|inoutId|1|String|30|-|-|
+
+
+###### 返回协议
+
+当http返回状态不为200 时请求处理失败 body内容为失败的原因
+
+当http返回状态为200时请求处理成功,body内容为返回内容,
+
+
+
+
+
+###### 举例
+> 地址:[http://carInout-service/carInoutApi/service](http://carInout-service/carInoutApi/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": "541110050001",
+    "bId":"1234567892",
+    "remark": "备注",
+    "datas": {
+      "businessCarInoutInfo": {
+                "inoutId":"填写存在的值"
+      }
+    },
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  }
+}
+
+返回报文:
+ {
+	"orderTypeCd": "D",
+	"response": {
+		"code": "0000",
+		"message": "成功"
+	},
+	"responseTime": "20190418102004",
+	"bId": "202019041810750003",
+	"businessType": "B",
+	"transactionId": "3a5a411ec65a4c3f895935638aa1d2bc",
+	"dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947"
+}
+
+```

+ 124 - 0
docs/document/services/carInout/SaveCarInoutInfo.md

@@ -0,0 +1,124 @@
+
+
+**1\. 保存进出场**
+###### 接口功能
+> API服务做保存进出场时调用该接口
+
+###### URL
+> [http://carInout-service/carInoutApi/service](http://carInout-service/carInoutApi/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|businessCarInoutInfo|1|Object|-|小区成员|小区成员|
+|businessCarInoutInfo|inTime|1|String|30|-|-|
+|businessCarInoutInfo|inoutId|1|String|30|-|-|
+|businessCarInoutInfo|carNum|1|String|30|-|-|
+|businessCarInoutInfo|state|1|String|30|-|-|
+|businessCarInoutInfo|communityId|1|String|30|-|-|
+|businessCarInoutInfo|outTime|1|String|30|-|-|
+
+
+###### 返回协议
+
+当http返回状态不为200 时请求处理失败 body内容为失败的原因
+
+当http返回状态为200时请求处理成功,body内容为返回内容,
+
+
+
+
+
+###### 举例
+> 地址:[http://carInout-service/carInoutApi/service](http://carInout-service/carInoutApi/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": "541110030001",
+    "bId":"1234567892",
+    "remark": "备注",
+    "datas": {
+      "businessCarInoutInfo": {
+                "inTime":"填写具体值",
+        "inoutId":"填写具体值",
+        "carNum":"填写具体值",
+        "state":"填写具体值",
+        "communityId":"填写具体值",
+        "outTime":"填写具体值"
+      }
+    },
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  }
+}
+
+返回报文:
+ {
+	"orderTypeCd": "D",
+	"response": {
+		"code": "0000",
+		"message": "成功"
+	},
+	"responseTime": "20190418102004",
+	"bId": "202019041810750003",
+	"businessType": "B",
+	"transactionId": "3a5a411ec65a4c3f895935638aa1d2bc",
+	"dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947"
+}
+
+```

+ 124 - 0
docs/document/services/carInout/UpdateCarInoutInfo.md

@@ -0,0 +1,124 @@
+
+
+**1\. 修改进出场**
+###### 接口功能
+> API服务做修改进出场时调用该接口
+
+###### URL
+> [http://carInout-service/carInoutApi/service](http://carInout-service/carInoutApi/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|businessCarInoutInfo|1|Object|-|小区成员|小区成员|
+|businessCarInoutInfo|inTime|1|String|30|-|-|
+|businessCarInoutInfo|inoutId|1|String|30|-|-|
+|businessCarInoutInfo|carNum|1|String|30|-|-|
+|businessCarInoutInfo|state|1|String|30|-|-|
+|businessCarInoutInfo|communityId|1|String|30|-|-|
+|businessCarInoutInfo|outTime|1|String|30|-|-|
+
+
+###### 返回协议
+
+当http返回状态不为200 时请求处理失败 body内容为失败的原因
+
+当http返回状态为200时请求处理成功,body内容为返回内容,
+
+
+
+
+
+###### 举例
+> 地址:[http://carInout-service/carInoutApi/service](http://carInout-service/carInoutApi/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": "541110040001",
+    "bId":"1234567892",
+    "remark": "备注",
+    "datas": {
+      "businessCarInoutInfo": {
+                "inTime":"填写具体值",
+        "inoutId":"填写具体值",
+        "carNum":"填写具体值",
+        "state":"填写具体值",
+        "communityId":"填写具体值",
+        "outTime":"填写具体值"
+      }
+    },
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  }
+}
+
+返回报文:
+ {
+	"orderTypeCd": "D",
+	"response": {
+		"code": "0000",
+		"message": "成功"
+	},
+	"responseTime": "20190418102004",
+	"bId": "202019041810750003",
+	"businessType": "B",
+	"transactionId": "3a5a411ec65a4c3f895935638aa1d2bc",
+	"dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947"
+}
+
+```

+ 95 - 0
java110-bean/src/main/java/com/java110/dto/hardwareAdapation/CarInoutDto.java

@@ -0,0 +1,95 @@
+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 CarInoutDto extends PageDto implements Serializable {
+
+    private String inTime;
+    private String inoutId;
+    private String carNum;
+    private String state;
+    private String communityId;
+    private String outTime;
+
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+
+    public String getInTime() {
+        return inTime;
+    }
+
+    public void setInTime(String inTime) {
+        this.inTime = inTime;
+    }
+
+    public String getInoutId() {
+        return inoutId;
+    }
+
+    public void setInoutId(String inoutId) {
+        this.inoutId = inoutId;
+    }
+
+    public String getCarNum() {
+        return carNum;
+    }
+
+    public void setCarNum(String carNum) {
+        this.carNum = carNum;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getCommunityId() {
+        return communityId;
+    }
+
+    public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+
+    public String getOutTime() {
+        return outTime;
+    }
+
+    public void setOutTime(String outTime) {
+        this.outTime = outTime;
+    }
+
+
+    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;
+    }
+}

+ 92 - 0
java110-code-generator/src/main/java/com/java110/CarInoutGeneratorApplication.java

@@ -0,0 +1,92 @@
+package com.java110;
+
+
+import com.java110.code.Data;
+import com.java110.code.GeneratorAbstractBussiness;
+import com.java110.code.GeneratorDeleteInfoListener;
+import com.java110.code.GeneratorDtoBean;
+import com.java110.code.GeneratorIInnerServiceSMO;
+import com.java110.code.GeneratorIServiceDaoListener;
+import com.java110.code.GeneratorInnerServiceSMOImpl;
+import com.java110.code.GeneratorSaveInfoListener;
+import com.java110.code.GeneratorServiceDaoImplListener;
+import com.java110.code.GeneratorServiceDaoImplMapperListener;
+import com.java110.code.GeneratorUpdateInfoListener;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Hello world!
+ */
+public class CarInoutGeneratorApplication {
+
+    protected CarInoutGeneratorApplication() {
+        // prevents calls from subclass
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * 代码生成器 入口方法
+     *  此处生成的mapper文件包含过程表和实例表的sql,所以要求两张表的特殊字段也要写上
+     *   BusinessTypeCd
+     * @param args 参数
+     */
+    public static void main(String[] args) {
+        Data data = new Data();
+        data.setId("inoutId");
+        data.setName("carInout");
+        data.setDesc("进出场");
+        data.setShareParam("inoutId");
+        data.setShareColumn("inout_id");
+        data.setNewBusinessTypeCd("BUSINESS_TYPE_SAVE_CAR_INOUT");
+        data.setUpdateBusinessTypeCd("BUSINESS_TYPE_UPDATE_CAR_INOUT");
+        data.setDeleteBusinessTypeCd("BUSINESS_TYPE_DELETE_CAR_INOUT");
+        data.setNewBusinessTypeCdValue("541110030001");
+        data.setUpdateBusinessTypeCdValue("541110040001");
+        data.setDeleteBusinessTypeCdValue("541110050001");
+        data.setBusinessTableName("business_car_inout");
+        data.setTableName("car_inout");
+        Map<String, String> param = new HashMap<String, String>();
+        param.put("inoutId", "inout_id");       //map的key为你自定义的字段名就是驼峰命名法的那个,value为数据库表的字段名
+        param.put("carNum", "car_num");
+        param.put("communityId", "community_id");
+        param.put("state", "state");
+        param.put("inTime", "in_time");
+        param.put("outTime", "out_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);
+    }
+}

+ 1 - 0
java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java

@@ -113,6 +113,7 @@ public class GenerateCodeFactory {
     public static final String CODE_PREFIX_activitiesId = "99";
     public static final String CODE_PREFIX_paId = "10";
     public static final String CODE_PREFIX_bwId = "11";
+    public static final String CODE_PREFIX_inoutId = "12";
 
 
     /**

+ 41 - 0
java110-core/src/main/java/com/java110/core/smo/hardwareAdapation/ICarInoutInnerServiceSMO.java

@@ -0,0 +1,41 @@
+package com.java110.core.smo.hardwareAdapation;
+
+import com.java110.core.feign.FeignConfiguration;
+import com.java110.dto.hardwareAdapation.CarInoutDto;
+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 ICarInoutInnerServiceSMO
+ * @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("/carInoutApi")
+public interface ICarInoutInnerServiceSMO {
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     * @param carInoutDto 数据对象分享
+     * @return CarInoutDto 对象数据
+     */
+    @RequestMapping(value = "/queryCarInouts", method = RequestMethod.POST)
+    List<CarInoutDto> queryCarInouts(@RequestBody CarInoutDto carInoutDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param carInoutDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryCarInoutsCount", method = RequestMethod.POST)
+    int queryCarInoutsCount(@RequestBody CarInoutDto carInoutDto);
+}

+ 186 - 0
java110-db/src/main/resources/mapper/hardwareAdapation/CarInoutServiceDaoImplMapper.xml

@@ -0,0 +1,186 @@
+<?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="carInoutServiceDaoImpl">
+
+    <!-- 保存进出场信息 add by wuxw 2018-07-03 -->
+       <insert id="saveBusinessCarInoutInfo" parameterType="Map">
+           insert into business_car_inout(
+in_time,inout_id,operate,car_num,state,community_id,b_id,out_time
+) values (
+#{inTime},#{inoutId},#{operate},#{carNum},#{state},#{communityId},#{bId},#{outTime}
+)
+       </insert>
+
+
+       <!-- 查询进出场信息(Business) add by wuxw 2018-07-03 -->
+       <select id="getBusinessCarInoutInfo" parameterType="Map" resultType="Map">
+           select  t.in_time,t.in_time inTime,t.inout_id,t.inout_id inoutId,t.operate,t.car_num,t.car_num carNum,t.state,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.out_time,t.out_time outTime 
+from business_car_inout t 
+where 1 =1 
+<if test="inTime !=null and inTime != ''">
+   and t.in_time= #{inTime}
+</if> 
+<if test="inoutId !=null and inoutId != ''">
+   and t.inout_id= #{inoutId}
+</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="state !=null and state != ''">
+   and t.state= #{state}
+</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="outTime !=null and outTime != ''">
+   and t.out_time= #{outTime}
+</if> 
+
+       </select>
+
+
+
+
+
+    <!-- 保存进出场信息至 instance表中 add by wuxw 2018-07-03 -->
+    <insert id="saveCarInoutInfoInstance" parameterType="Map">
+        insert into car_inout(
+in_time,inout_id,car_num,status_cd,state,community_id,b_id,out_time
+) select t.in_time,t.inout_id,t.car_num,'0',t.state,t.community_id,t.b_id,t.out_time from business_car_inout t where 1=1
+<if test="inTime !=null and inTime != ''">
+   and t.in_time= #{inTime}
+</if> 
+<if test="inoutId !=null and inoutId != ''">
+   and t.inout_id= #{inoutId}
+</if> 
+   and t.operate= 'ADD'
+<if test="carNum !=null and carNum != ''">
+   and t.car_num= #{carNum}
+</if> 
+<if test="state !=null and state != ''">
+   and t.state= #{state}
+</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="outTime !=null and outTime != ''">
+   and t.out_time= #{outTime}
+</if> 
+
+    </insert>
+
+
+
+    <!-- 查询进出场信息 add by wuxw 2018-07-03 -->
+    <select id="getCarInoutInfo" parameterType="Map" resultType="Map">
+        select  t.in_time,t.in_time inTime,t.inout_id,t.inout_id inoutId,t.car_num,t.car_num carNum,t.status_cd,t.status_cd statusCd,t.state,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.out_time,t.out_time outTime 
+from car_inout t 
+where 1 =1 
+<if test="inTime !=null and inTime != ''">
+   and t.in_time= #{inTime}
+</if> 
+<if test="inoutId !=null and inoutId != ''">
+   and t.inout_id= #{inoutId}
+</if> 
+<if test="carNum !=null and carNum != ''">
+   and t.car_num= #{carNum}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="state !=null and state != ''">
+   and t.state= #{state}
+</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="outTime !=null and outTime != ''">
+   and t.out_time= #{outTime}
+</if> 
+<if test="page != -1 and page != null ">
+   limit #{page}, #{row}
+</if> 
+
+    </select>
+
+
+
+
+    <!-- 修改进出场信息 add by wuxw 2018-07-03 -->
+    <update id="updateCarInoutInfoInstance" parameterType="Map">
+        update  car_inout t set t.status_cd = #{statusCd}
+<if test="newBId != null and newBId != ''">
+,t.b_id = #{newBId}
+</if> 
+<if test="inTime !=null and inTime != ''">
+, t.in_time= #{inTime}
+</if> 
+<if test="carNum !=null and carNum != ''">
+, t.car_num= #{carNum}
+</if> 
+<if test="state !=null and state != ''">
+, t.state= #{state}
+</if> 
+<if test="communityId !=null and communityId != ''">
+, t.community_id= #{communityId}
+</if> 
+<if test="outTime !=null and outTime != ''">
+, t.out_time= #{outTime}
+</if> 
+ where 1=1 <if test="inoutId !=null and inoutId != ''">
+and t.inout_id= #{inoutId}
+</if> 
+<if test="bId !=null and bId != ''">
+and t.b_id= #{bId}
+</if> 
+
+    </update>
+
+    <!-- 查询进出场数量 add by wuxw 2018-07-03 -->
+     <select id="queryCarInoutsCount" parameterType="Map" resultType="Map">
+        select  count(1) count 
+from car_inout t 
+where 1 =1 
+<if test="inTime !=null and inTime != ''">
+   and t.in_time= #{inTime}
+</if> 
+<if test="inoutId !=null and inoutId != ''">
+   and t.inout_id= #{inoutId}
+</if> 
+<if test="carNum !=null and carNum != ''">
+   and t.car_num= #{carNum}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="state !=null and state != ''">
+   and t.state= #{state}
+</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="outTime !=null and outTime != ''">
+   and t.out_time= #{outTime}
+</if> 
+
+
+     </select>
+
+</mapper>

+ 16 - 0
java110-utils/src/main/java/com/java110/utils/constant/BusinessTypeConstant.java

@@ -329,6 +329,22 @@ public class BusinessTypeConstant {
      */
     public static final String BUSINESS_TYPE_DELETE_PARKING_SPACE = "540100050001";
 
+    /**
+     * 增加车位
+     */
+    public static final String BUSINESS_TYPE_SAVE_CAR_INOUT = "541110030001";
+
+    /**
+     * 修改车位
+     */
+    public static final String BUSINESS_TYPE_UPDATE_CAR_INOUT = "541110040001";
+
+
+    /**
+     * 删除车位
+     */
+    public static final String BUSINESS_TYPE_DELETE_CAR_INOUT = "541110050001";
+
 
     /**
      * 发布公告