| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.smo.hardwareAdapation.ICarBlackWhiteInnerServiceSMO; |
| | | import com.java110.core.smo.hardwareAdapation.IMachineInnerServiceSMO; |
| | | import com.java110.dto.hardwareAdapation.CarBlackWhiteDto; |
| | | import com.java110.dto.hardwareAdapation.MachineDto; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.ServiceCodeMachineTranslateConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.api.machine.MachineResDataVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | |
| | | @Java110Listener("machineRoadGateOpenListener") |
| | | public class MachineRoadGateOpenListener extends BaseMachineListener { |
| | | |
| | | private static final String MACHINE_DIRECTION_IN = "3306"; // 进入 |
| | | |
| | | private static final String MACHINE_DIRECTION_OUT = "3307"; //出去 |
| | | |
| | | private static final String CAR_BLACK = "1111"; // 车辆黑名单 |
| | | private static final String CAR_WHITE = "2222"; // 车辆白名单 |
| | | |
| | | @Autowired |
| | | private IMachineInnerServiceSMO machineInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private ICarBlackWhiteInnerServiceSMO carBlackWhiteInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | |
| | | outParam.put("message", "该设备【" + machineCode + "】未在该小区【" + communityId + "】注册"); |
| | | responseEntity = new ResponseEntity<>(outParam.toJSONString(), headers, HttpStatus.OK); |
| | | context.setResponseEntity(responseEntity); |
| | | return ; |
| | | return; |
| | | } |
| | | //设备方向 |
| | | String direction = machineDtos.get(0).getDirection(); |
| | | |
| | | //进入 |
| | | if (MACHINE_DIRECTION_IN.equals(direction)) { |
| | | dealCarIn(context, reqJson, machineDtos.get(0), communityId, machineCode); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 处理车辆进入 |
| | | * |
| | | * @param reqJson |
| | | * @param machineDto |
| | | * @param communityId |
| | | * @param machineCode |
| | | */ |
| | | private void dealCarIn(DataFlowContext context, JSONObject reqJson, MachineDto machineDto, String communityId, String machineCode) { |
| | | //车辆是否黑名单 车辆 |
| | | String carNum = reqJson.getString("carNum"); |
| | | CarBlackWhiteDto carBlackWhiteDto = new CarBlackWhiteDto(); |
| | | carBlackWhiteDto.setCommunityId(communityId); |
| | | carBlackWhiteDto.setCarNum(carNum); |
| | | carBlackWhiteDto.setBlackWhite(CAR_BLACK); |
| | | int count = carBlackWhiteInnerServiceSMOImpl.queryCarBlackWhitesCount(carBlackWhiteDto); |
| | | if (count > 0) { |
| | | context.setResponseEntity(MachineResDataVo.getResData(MachineResDataVo.CODE_ERROR, carNum + "被加入黑名单,无法放行")); |
| | | return; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| New file |
| | |
| | | package com.java110.hardwareAdapation.dao; |
| | | |
| | | |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.entity.merchant.BoMerchant; |
| | | import com.java110.entity.merchant.BoMerchantAttr; |
| | | import com.java110.entity.merchant.Merchant; |
| | | import com.java110.entity.merchant.MerchantAttr; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 进出场详情组件内部之间使用,没有给外围系统提供服务能力 |
| | | * 进出场详情服务接口类,要求全部以字符串传输,方便微服务化 |
| | | * 新建客户,修改客户,删除客户,查询客户等功能 |
| | | * |
| | | * Created by wuxw on 2016/12/27. |
| | | */ |
| | | public interface ICarInoutDetailServiceDao { |
| | | |
| | | /** |
| | | * 保存 进出场详情信息 |
| | | * @param businessCarInoutDetailInfo 进出场详情信息 封装 |
| | | * @throws DAOException 操作数据库异常 |
| | | */ |
| | | void saveBusinessCarInoutDetailInfo(Map businessCarInoutDetailInfo) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询进出场详情信息(business过程) |
| | | * 根据bId 查询进出场详情信息 |
| | | * @param info bId 信息 |
| | | * @return 进出场详情信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getBusinessCarInoutDetailInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存 进出场详情信息 Business数据到 Instance中 |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void saveCarInoutDetailInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询进出场详情信息(instance过程) |
| | | * 根据bId 查询进出场详情信息 |
| | | * @param info bId 信息 |
| | | * @return 进出场详情信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getCarInoutDetailInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改进出场详情信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void updateCarInoutDetailInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询进出场详情总数 |
| | | * |
| | | * @param info 进出场详情信息 |
| | | * @return 进出场详情数量 |
| | | */ |
| | | int queryCarInoutDetailsCount(Map info); |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.hardwareAdapation.dao.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.base.dao.BaseServiceDao; |
| | | import com.java110.hardwareAdapation.dao.ICarInoutDetailServiceDao; |
| | | 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("carInoutDetailServiceDaoImpl") |
| | | //@Transactional |
| | | public class CarInoutDetailServiceDaoImpl extends BaseServiceDao implements ICarInoutDetailServiceDao { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(CarInoutDetailServiceDaoImpl.class); |
| | | |
| | | /** |
| | | * 进出场详情信息封装 |
| | | * |
| | | * @param businessCarInoutDetailInfo 进出场详情信息 封装 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveBusinessCarInoutDetailInfo(Map businessCarInoutDetailInfo) throws DAOException { |
| | | businessCarInoutDetailInfo.put("month", DateUtil.getCurrentMonth()); |
| | | // 查询business_user 数据是否已经存在 |
| | | logger.debug("保存进出场详情信息 入参 businessCarInoutDetailInfo : {}", businessCarInoutDetailInfo); |
| | | int saveFlag = sqlSessionTemplate.insert("carInoutDetailServiceDaoImpl.saveBusinessCarInoutDetailInfo", businessCarInoutDetailInfo); |
| | | |
| | | if (saveFlag < 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存进出场详情数据失败:" + JSONObject.toJSONString(businessCarInoutDetailInfo)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询进出场详情信息 |
| | | * |
| | | * @param info bId 信息 |
| | | * @return 进出场详情信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getBusinessCarInoutDetailInfo(Map info) throws DAOException { |
| | | |
| | | logger.debug("查询进出场详情信息 入参 info : {}", info); |
| | | |
| | | List<Map> businessCarInoutDetailInfos = sqlSessionTemplate.selectList("carInoutDetailServiceDaoImpl.getBusinessCarInoutDetailInfo", info); |
| | | |
| | | return businessCarInoutDetailInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存进出场详情信息 到 instance |
| | | * |
| | | * @param info bId 信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveCarInoutDetailInfoInstance(Map info) throws DAOException { |
| | | logger.debug("保存进出场详情信息Instance 入参 info : {}", info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("carInoutDetailServiceDaoImpl.saveCarInoutDetailInfoInstance", 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> getCarInoutDetailInfo(Map info) throws DAOException { |
| | | logger.debug("查询进出场详情信息 入参 info : {}", info); |
| | | |
| | | List<Map> businessCarInoutDetailInfos = sqlSessionTemplate.selectList("carInoutDetailServiceDaoImpl.getCarInoutDetailInfo", info); |
| | | |
| | | return businessCarInoutDetailInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改进出场详情信息 |
| | | * |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void updateCarInoutDetailInfoInstance(Map info) throws DAOException { |
| | | logger.debug("修改进出场详情信息Instance 入参 info : {}", info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("carInoutDetailServiceDaoImpl.updateCarInoutDetailInfoInstance", info); |
| | | |
| | | if (saveFlag < 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改进出场详情信息Instance数据失败:" + JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询进出场详情数量 |
| | | * |
| | | * @param info 进出场详情信息 |
| | | * @return 进出场详情数量 |
| | | */ |
| | | @Override |
| | | public int queryCarInoutDetailsCount(Map info) { |
| | | logger.debug("查询进出场详情数据 入参 info : {}", info); |
| | | |
| | | List<Map> businessCarInoutDetailInfos = sqlSessionTemplate.selectList("carInoutDetailServiceDaoImpl.queryCarInoutDetailsCount", info); |
| | | if (businessCarInoutDetailInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessCarInoutDetailInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.hardwareAdapation.listener.carInoutDetail; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.event.service.AbstractBusinessServiceDataFlowListener; |
| | | import com.java110.hardwareAdapation.dao.ICarInoutDetailServiceDao; |
| | | 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 AbstractCarInoutDetailBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener { |
| | | private static Logger logger = LoggerFactory.getLogger(AbstractCarInoutDetailBusinessServiceDataFlowListener.class); |
| | | |
| | | |
| | | /** |
| | | * 获取 DAO工具类 |
| | | * |
| | | * @return |
| | | */ |
| | | public abstract ICarInoutDetailServiceDao getCarInoutDetailServiceDaoImpl(); |
| | | |
| | | /** |
| | | * 刷新 businessCarInoutDetailInfo 数据 |
| | | * 主要将 数据库 中字段和 接口传递字段建立关系 |
| | | * |
| | | * @param businessCarInoutDetailInfo |
| | | */ |
| | | protected void flushBusinessCarInoutDetailInfo(Map businessCarInoutDetailInfo, String statusCd) { |
| | | businessCarInoutDetailInfo.put("newBId", businessCarInoutDetailInfo.get("b_id")); |
| | | businessCarInoutDetailInfo.put("inoutId", businessCarInoutDetailInfo.get("inout_id")); |
| | | businessCarInoutDetailInfo.put("machineId", businessCarInoutDetailInfo.get("machine_id")); |
| | | businessCarInoutDetailInfo.put("machineCode", businessCarInoutDetailInfo.get("machine_code")); |
| | | businessCarInoutDetailInfo.put("operate", businessCarInoutDetailInfo.get("operate")); |
| | | businessCarInoutDetailInfo.put("carInout", businessCarInoutDetailInfo.get("car_inout")); |
| | | businessCarInoutDetailInfo.put("detailId", businessCarInoutDetailInfo.get("detail_id")); |
| | | businessCarInoutDetailInfo.put("carNum", businessCarInoutDetailInfo.get("car_num")); |
| | | businessCarInoutDetailInfo.put("communityId", businessCarInoutDetailInfo.get("community_id")); |
| | | businessCarInoutDetailInfo.remove("bId"); |
| | | businessCarInoutDetailInfo.put("statusCd", statusCd); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中 |
| | | * |
| | | * @param businessCarInoutDetail 进出场详情信息 |
| | | */ |
| | | protected void autoSaveDelBusinessCarInoutDetail(Business business, JSONObject businessCarInoutDetail) { |
| | | //自动插入DEL |
| | | Map info = new HashMap(); |
| | | info.put("detailId", businessCarInoutDetail.getString("detailId")); |
| | | info.put("statusCd", StatusConstant.STATUS_CD_VALID); |
| | | List<Map> currentCarInoutDetailInfos = getCarInoutDetailServiceDaoImpl().getCarInoutDetailInfo(info); |
| | | if (currentCarInoutDetailInfos == null || currentCarInoutDetailInfos.size() != 1) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "未找到需要修改数据信息,入参错误或数据有问题,请检查" + info); |
| | | } |
| | | |
| | | Map currentCarInoutDetailInfo = currentCarInoutDetailInfos.get(0); |
| | | |
| | | currentCarInoutDetailInfo.put("bId", business.getbId()); |
| | | |
| | | currentCarInoutDetailInfo.put("inoutId", currentCarInoutDetailInfo.get("inout_id")); |
| | | currentCarInoutDetailInfo.put("machineId", currentCarInoutDetailInfo.get("machine_id")); |
| | | currentCarInoutDetailInfo.put("machineCode", currentCarInoutDetailInfo.get("machine_code")); |
| | | currentCarInoutDetailInfo.put("operate", currentCarInoutDetailInfo.get("operate")); |
| | | currentCarInoutDetailInfo.put("carInout", currentCarInoutDetailInfo.get("car_inout")); |
| | | currentCarInoutDetailInfo.put("detailId", currentCarInoutDetailInfo.get("detail_id")); |
| | | currentCarInoutDetailInfo.put("carNum", currentCarInoutDetailInfo.get("car_num")); |
| | | currentCarInoutDetailInfo.put("communityId", currentCarInoutDetailInfo.get("community_id")); |
| | | |
| | | |
| | | currentCarInoutDetailInfo.put("operate", StatusConstant.OPERATE_DEL); |
| | | getCarInoutDetailServiceDaoImpl().saveBusinessCarInoutDetailInfo(currentCarInoutDetailInfo); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.hardwareAdapation.listener.carInoutDetail; |
| | | |
| | | 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.ICarInoutDetailServiceDao; |
| | | 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、businessCarInoutDetail:{} 进出场详情基本信息节点 |
| | | * 2、businessCarInoutDetailAttr:[{}] 进出场详情属性信息节点 |
| | | * 3、businessCarInoutDetailPhoto:[{}] 进出场详情照片信息节点 |
| | | * 4、businessCarInoutDetailCerdentials:[{}] 进出场详情证件信息节点 |
| | | * 协议地址 :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("deleteCarInoutDetailInfoListener") |
| | | @Transactional |
| | | public class DeleteCarInoutDetailInfoListener extends AbstractCarInoutDetailBusinessServiceDataFlowListener { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(DeleteCarInoutDetailInfoListener.class); |
| | | @Autowired |
| | | ICarInoutDetailServiceDao carInoutDetailServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 3; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_DELETE_CAR_INOUT_DETAIL; |
| | | } |
| | | |
| | | /** |
| | | * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去 |
| | | * |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | JSONObject data = business.getDatas(); |
| | | |
| | | Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessCarInoutDetail 节点 |
| | | if (data.containsKey("businessCarInoutDetail")) { |
| | | //处理 businessCarInoutDetail 节点 |
| | | if (data.containsKey("businessCarInoutDetail")) { |
| | | Object _obj = data.get("businessCarInoutDetail"); |
| | | JSONArray businessCarInoutDetails = null; |
| | | if (_obj instanceof JSONObject) { |
| | | businessCarInoutDetails = new JSONArray(); |
| | | businessCarInoutDetails.add(_obj); |
| | | } else { |
| | | businessCarInoutDetails = (JSONArray) _obj; |
| | | } |
| | | //JSONObject businessCarInoutDetail = data.getJSONObject("businessCarInoutDetail"); |
| | | for (int _carInoutDetailIndex = 0; _carInoutDetailIndex < businessCarInoutDetails.size(); _carInoutDetailIndex++) { |
| | | JSONObject businessCarInoutDetail = businessCarInoutDetails.getJSONObject(_carInoutDetailIndex); |
| | | doBusinessCarInoutDetail(business, businessCarInoutDetail); |
| | | if (_obj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("detailId", businessCarInoutDetail.getString("detailId")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 删除 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> businessCarInoutDetailInfos = carInoutDetailServiceDaoImpl.getBusinessCarInoutDetailInfo(info); |
| | | if (businessCarInoutDetailInfos != null && businessCarInoutDetailInfos.size() > 0) { |
| | | for (int _carInoutDetailIndex = 0; _carInoutDetailIndex < businessCarInoutDetailInfos.size(); _carInoutDetailIndex++) { |
| | | Map businessCarInoutDetailInfo = businessCarInoutDetailInfos.get(_carInoutDetailIndex); |
| | | flushBusinessCarInoutDetailInfo(businessCarInoutDetailInfo, StatusConstant.STATUS_CD_INVALID); |
| | | carInoutDetailServiceDaoImpl.updateCarInoutDetailInfoInstance(businessCarInoutDetailInfo); |
| | | dataFlowContext.addParamOut("detailId", businessCarInoutDetailInfo.get("detail_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> carInoutDetailInfo = carInoutDetailServiceDaoImpl.getCarInoutDetailInfo(info); |
| | | if (carInoutDetailInfo != null && carInoutDetailInfo.size() > 0) { |
| | | |
| | | //进出场详情信息 |
| | | List<Map> businessCarInoutDetailInfos = carInoutDetailServiceDaoImpl.getBusinessCarInoutDetailInfo(delInfo); |
| | | //除非程序出错了,这里不会为空 |
| | | if (businessCarInoutDetailInfos == null || businessCarInoutDetailInfos.size() == 0) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR, "撤单失败(carInoutDetail),程序内部异常,请检查! " + delInfo); |
| | | } |
| | | for (int _carInoutDetailIndex = 0; _carInoutDetailIndex < businessCarInoutDetailInfos.size(); _carInoutDetailIndex++) { |
| | | Map businessCarInoutDetailInfo = businessCarInoutDetailInfos.get(_carInoutDetailIndex); |
| | | flushBusinessCarInoutDetailInfo(businessCarInoutDetailInfo, StatusConstant.STATUS_CD_VALID); |
| | | carInoutDetailServiceDaoImpl.updateCarInoutDetailInfoInstance(businessCarInoutDetailInfo); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 处理 businessCarInoutDetail 节点 |
| | | * |
| | | * @param business 总的数据节点 |
| | | * @param businessCarInoutDetail 进出场详情节点 |
| | | */ |
| | | private void doBusinessCarInoutDetail(Business business, JSONObject businessCarInoutDetail) { |
| | | |
| | | Assert.jsonObjectHaveKey(businessCarInoutDetail, "detailId", "businessCarInoutDetail 节点下没有包含 detailId 节点"); |
| | | |
| | | if (businessCarInoutDetail.getString("detailId").startsWith("-")) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "detailId 错误,不能自动生成(必须已经存在的detailId)" + businessCarInoutDetail); |
| | | } |
| | | //自动插入DEL |
| | | autoSaveDelBusinessCarInoutDetail(business, businessCarInoutDetail); |
| | | } |
| | | |
| | | public ICarInoutDetailServiceDao getCarInoutDetailServiceDaoImpl() { |
| | | return carInoutDetailServiceDaoImpl; |
| | | } |
| | | |
| | | public void setCarInoutDetailServiceDaoImpl(ICarInoutDetailServiceDao carInoutDetailServiceDaoImpl) { |
| | | this.carInoutDetailServiceDaoImpl = carInoutDetailServiceDaoImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.hardwareAdapation.listener.carInoutDetail; |
| | | |
| | | 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.ICarInoutDetailServiceDao; |
| | | 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("saveCarInoutDetailInfoListener") |
| | | @Transactional |
| | | public class SaveCarInoutDetailInfoListener extends AbstractCarInoutDetailBusinessServiceDataFlowListener { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(SaveCarInoutDetailInfoListener.class); |
| | | |
| | | @Autowired |
| | | private ICarInoutDetailServiceDao carInoutDetailServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_SAVE_CAR_INOUT_DETAIL; |
| | | } |
| | | |
| | | /** |
| | | * 保存进出场详情信息 business 表中 |
| | | * |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | JSONObject data = business.getDatas(); |
| | | Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessCarInoutDetail 节点 |
| | | if (data.containsKey("businessCarInoutDetail")) { |
| | | Object bObj = data.get("businessCarInoutDetail"); |
| | | JSONArray businessCarInoutDetails = null; |
| | | if (bObj instanceof JSONObject) { |
| | | businessCarInoutDetails = new JSONArray(); |
| | | businessCarInoutDetails.add(bObj); |
| | | } else { |
| | | businessCarInoutDetails = (JSONArray) bObj; |
| | | } |
| | | //JSONObject businessCarInoutDetail = data.getJSONObject("businessCarInoutDetail"); |
| | | for (int bCarInoutDetailIndex = 0; bCarInoutDetailIndex < businessCarInoutDetails.size(); bCarInoutDetailIndex++) { |
| | | JSONObject businessCarInoutDetail = businessCarInoutDetails.getJSONObject(bCarInoutDetailIndex); |
| | | doBusinessCarInoutDetail(business, businessCarInoutDetail); |
| | | if (bObj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("detailId", businessCarInoutDetail.getString("detailId")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 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> businessCarInoutDetailInfo = carInoutDetailServiceDaoImpl.getBusinessCarInoutDetailInfo(info); |
| | | if (businessCarInoutDetailInfo != null && businessCarInoutDetailInfo.size() > 0) { |
| | | reFreshShareColumn(info, businessCarInoutDetailInfo.get(0)); |
| | | carInoutDetailServiceDaoImpl.saveCarInoutDetailInfoInstance(info); |
| | | if (businessCarInoutDetailInfo.size() == 1) { |
| | | dataFlowContext.addParamOut("detailId", businessCarInoutDetailInfo.get(0).get("detail_id")); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 刷 分片字段 |
| | | * |
| | | * @param info 查询对象 |
| | | * @param businessInfo 小区ID |
| | | */ |
| | | private void reFreshShareColumn(Map info, Map businessInfo) { |
| | | |
| | | if (info.containsKey("communityId")) { |
| | | return; |
| | | } |
| | | |
| | | if (!businessInfo.containsKey("community_id")) { |
| | | return; |
| | | } |
| | | |
| | | info.put("communityId", businessInfo.get("community_id")); |
| | | } |
| | | |
| | | /** |
| | | * 撤单 |
| | | * |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doRecover(DataFlowContext dataFlowContext, Business business) { |
| | | String bId = business.getbId(); |
| | | //Assert.hasLength(bId,"请求报文中没有包含 bId"); |
| | | Map info = new HashMap(); |
| | | info.put("bId", bId); |
| | | info.put("statusCd", StatusConstant.STATUS_CD_VALID); |
| | | Map paramIn = new HashMap(); |
| | | paramIn.put("bId", bId); |
| | | paramIn.put("statusCd", StatusConstant.STATUS_CD_INVALID); |
| | | //进出场详情信息 |
| | | List<Map> carInoutDetailInfo = carInoutDetailServiceDaoImpl.getCarInoutDetailInfo(info); |
| | | if (carInoutDetailInfo != null && carInoutDetailInfo.size() > 0) { |
| | | reFreshShareColumn(paramIn, carInoutDetailInfo.get(0)); |
| | | carInoutDetailServiceDaoImpl.updateCarInoutDetailInfoInstance(paramIn); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 处理 businessCarInoutDetail 节点 |
| | | * |
| | | * @param business 总的数据节点 |
| | | * @param businessCarInoutDetail 进出场详情节点 |
| | | */ |
| | | private void doBusinessCarInoutDetail(Business business, JSONObject businessCarInoutDetail) { |
| | | |
| | | Assert.jsonObjectHaveKey(businessCarInoutDetail, "detailId", "businessCarInoutDetail 节点下没有包含 detailId 节点"); |
| | | |
| | | if (businessCarInoutDetail.getString("detailId").startsWith("-")) { |
| | | //刷新缓存 |
| | | //flushCarInoutDetailId(business.getDatas()); |
| | | |
| | | businessCarInoutDetail.put("detailId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_detailId)); |
| | | |
| | | } |
| | | |
| | | businessCarInoutDetail.put("bId", business.getbId()); |
| | | businessCarInoutDetail.put("operate", StatusConstant.OPERATE_ADD); |
| | | //保存进出场详情信息 |
| | | carInoutDetailServiceDaoImpl.saveBusinessCarInoutDetailInfo(businessCarInoutDetail); |
| | | |
| | | } |
| | | |
| | | public ICarInoutDetailServiceDao getCarInoutDetailServiceDaoImpl() { |
| | | return carInoutDetailServiceDaoImpl; |
| | | } |
| | | |
| | | public void setCarInoutDetailServiceDaoImpl(ICarInoutDetailServiceDao carInoutDetailServiceDaoImpl) { |
| | | this.carInoutDetailServiceDaoImpl = carInoutDetailServiceDaoImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.hardwareAdapation.listener.carInoutDetail; |
| | | |
| | | 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.ICarInoutDetailServiceDao; |
| | | 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、businessCarInoutDetail:{} 进出场详情基本信息节点 |
| | | * 2、businessCarInoutDetailAttr:[{}] 进出场详情属性信息节点 |
| | | * 3、businessCarInoutDetailPhoto:[{}] 进出场详情照片信息节点 |
| | | * 4、businessCarInoutDetailCerdentials:[{}] 进出场详情证件信息节点 |
| | | * 协议地址 :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("updateCarInoutDetailInfoListener") |
| | | @Transactional |
| | | public class UpdateCarInoutDetailInfoListener extends AbstractCarInoutDetailBusinessServiceDataFlowListener { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(UpdateCarInoutDetailInfoListener.class); |
| | | @Autowired |
| | | private ICarInoutDetailServiceDao carInoutDetailServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 2; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_CAR_INOUT_DETAIL; |
| | | } |
| | | |
| | | /** |
| | | * business过程 |
| | | * |
| | | * @param dataFlowContext 上下文对象 |
| | | * @param business 业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | |
| | | JSONObject data = business.getDatas(); |
| | | |
| | | Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessCarInoutDetail 节点 |
| | | if (data.containsKey("businessCarInoutDetail")) { |
| | | //处理 businessCarInoutDetail 节点 |
| | | if (data.containsKey("businessCarInoutDetail")) { |
| | | Object _obj = data.get("businessCarInoutDetail"); |
| | | JSONArray businessCarInoutDetails = null; |
| | | if (_obj instanceof JSONObject) { |
| | | businessCarInoutDetails = new JSONArray(); |
| | | businessCarInoutDetails.add(_obj); |
| | | } else { |
| | | businessCarInoutDetails = (JSONArray) _obj; |
| | | } |
| | | //JSONObject businessCarInoutDetail = data.getJSONObject("businessCarInoutDetail"); |
| | | for (int _carInoutDetailIndex = 0; _carInoutDetailIndex < businessCarInoutDetails.size(); _carInoutDetailIndex++) { |
| | | JSONObject businessCarInoutDetail = businessCarInoutDetails.getJSONObject(_carInoutDetailIndex); |
| | | doBusinessCarInoutDetail(business, businessCarInoutDetail); |
| | | if (_obj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("detailId", businessCarInoutDetail.getString("detailId")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 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> businessCarInoutDetailInfos = carInoutDetailServiceDaoImpl.getBusinessCarInoutDetailInfo(info); |
| | | if (businessCarInoutDetailInfos != null && businessCarInoutDetailInfos.size() > 0) { |
| | | for (int _carInoutDetailIndex = 0; _carInoutDetailIndex < businessCarInoutDetailInfos.size(); _carInoutDetailIndex++) { |
| | | Map businessCarInoutDetailInfo = businessCarInoutDetailInfos.get(_carInoutDetailIndex); |
| | | flushBusinessCarInoutDetailInfo(businessCarInoutDetailInfo, StatusConstant.STATUS_CD_VALID); |
| | | carInoutDetailServiceDaoImpl.updateCarInoutDetailInfoInstance(businessCarInoutDetailInfo); |
| | | if (businessCarInoutDetailInfo.size() == 1) { |
| | | dataFlowContext.addParamOut("detailId", businessCarInoutDetailInfo.get("detail_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> carInoutDetailInfo = carInoutDetailServiceDaoImpl.getCarInoutDetailInfo(info); |
| | | if (carInoutDetailInfo != null && carInoutDetailInfo.size() > 0) { |
| | | |
| | | //进出场详情信息 |
| | | List<Map> businessCarInoutDetailInfos = carInoutDetailServiceDaoImpl.getBusinessCarInoutDetailInfo(delInfo); |
| | | //除非程序出错了,这里不会为空 |
| | | if (businessCarInoutDetailInfos == null || businessCarInoutDetailInfos.size() == 0) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR, "撤单失败(carInoutDetail),程序内部异常,请检查! " + delInfo); |
| | | } |
| | | for (int _carInoutDetailIndex = 0; _carInoutDetailIndex < businessCarInoutDetailInfos.size(); _carInoutDetailIndex++) { |
| | | Map businessCarInoutDetailInfo = businessCarInoutDetailInfos.get(_carInoutDetailIndex); |
| | | flushBusinessCarInoutDetailInfo(businessCarInoutDetailInfo, StatusConstant.STATUS_CD_VALID); |
| | | carInoutDetailServiceDaoImpl.updateCarInoutDetailInfoInstance(businessCarInoutDetailInfo); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 处理 businessCarInoutDetail 节点 |
| | | * |
| | | * @param business 总的数据节点 |
| | | * @param businessCarInoutDetail 进出场详情节点 |
| | | */ |
| | | private void doBusinessCarInoutDetail(Business business, JSONObject businessCarInoutDetail) { |
| | | |
| | | Assert.jsonObjectHaveKey(businessCarInoutDetail, "detailId", "businessCarInoutDetail 节点下没有包含 detailId 节点"); |
| | | |
| | | if (businessCarInoutDetail.getString("detailId").startsWith("-")) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "detailId 错误,不能自动生成(必须已经存在的detailId)" + businessCarInoutDetail); |
| | | } |
| | | //自动保存DEL |
| | | autoSaveDelBusinessCarInoutDetail(business, businessCarInoutDetail); |
| | | |
| | | businessCarInoutDetail.put("bId", business.getbId()); |
| | | businessCarInoutDetail.put("operate", StatusConstant.OPERATE_ADD); |
| | | //保存进出场详情信息 |
| | | carInoutDetailServiceDaoImpl.saveBusinessCarInoutDetailInfo(businessCarInoutDetail); |
| | | |
| | | } |
| | | |
| | | |
| | | public ICarInoutDetailServiceDao getCarInoutDetailServiceDaoImpl() { |
| | | return carInoutDetailServiceDaoImpl; |
| | | } |
| | | |
| | | public void setCarInoutDetailServiceDaoImpl(ICarInoutDetailServiceDao carInoutDetailServiceDaoImpl) { |
| | | this.carInoutDetailServiceDaoImpl = carInoutDetailServiceDaoImpl; |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.hardwareAdapation.smo.impl; |
| | | |
| | | |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.core.smo.hardwareAdapation.ICarInoutDetailInnerServiceSMO; |
| | | import com.java110.core.smo.user.IUserInnerServiceSMO; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.hardwareAdapation.CarInoutDetailDto; |
| | | import com.java110.hardwareAdapation.dao.ICarInoutDetailServiceDao; |
| | | 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 CarInoutDetailInnerServiceSMOImpl extends BaseServiceSMO implements ICarInoutDetailInnerServiceSMO { |
| | | |
| | | @Autowired |
| | | private ICarInoutDetailServiceDao carInoutDetailServiceDaoImpl; |
| | | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public List<CarInoutDetailDto> queryCarInoutDetails(@RequestBody CarInoutDetailDto carInoutDetailDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = carInoutDetailDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | carInoutDetailDto.setPage((page - 1) * carInoutDetailDto.getRow()); |
| | | } |
| | | |
| | | List<CarInoutDetailDto> carInoutDetails = BeanConvertUtil.covertBeanList(carInoutDetailServiceDaoImpl.getCarInoutDetailInfo(BeanConvertUtil.beanCovertMap(carInoutDetailDto)), CarInoutDetailDto.class); |
| | | |
| | | return carInoutDetails; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int queryCarInoutDetailsCount(@RequestBody CarInoutDetailDto carInoutDetailDto) { |
| | | return carInoutDetailServiceDaoImpl.queryCarInoutDetailsCount(BeanConvertUtil.beanCovertMap(carInoutDetailDto)); |
| | | } |
| | | |
| | | public ICarInoutDetailServiceDao getCarInoutDetailServiceDaoImpl() { |
| | | return carInoutDetailServiceDaoImpl; |
| | | } |
| | | |
| | | public void setCarInoutDetailServiceDaoImpl(ICarInoutDetailServiceDao carInoutDetailServiceDaoImpl) { |
| | | this.carInoutDetailServiceDaoImpl = carInoutDetailServiceDaoImpl; |
| | | } |
| | | |
| | | public IUserInnerServiceSMO getUserInnerServiceSMOImpl() { |
| | | return userInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) { |
| | | this.userInnerServiceSMOImpl = userInnerServiceSMOImpl; |
| | | } |
| | | } |
| | |
| | | <div class="col-sm-10"> |
| | | <select class="custom-select" v-model="addMachineInfo.direction"> |
| | | <option selected disabled value="">必填,请选择设备方向</option> |
| | | <option value="3306">进入</option> |
| | | <option value="3307">出去</option> |
| | | <option value="3306">进场</option> |
| | | <option value="3307">出场</option> |
| | | </select></div> |
| | | </div> |
| | | <div class="form-group row"> |
| | |
| | | <div class="col-sm-10"> |
| | | <select class="custom-select" v-model="editMachineInfo.direction"> |
| | | <option selected disabled value="">必填,请选择设备方向</option> |
| | | <option value="3306">进入</option> |
| | | <option value="3307">出去</option> |
| | | <option value="3306">进场</option> |
| | | <option value="3307">出场</option> |
| | | </select></div> |
| | | </div> |
| | | <div class="form-group row"> |
| New file |
| | |
| | | |
| | | |
| | | **1\. 删除进出场详情** |
| | | ###### 接口功能 |
| | | > API服务做删除进出场详情时调用该接口 |
| | | |
| | | ###### URL |
| | | > [http://carInoutDetail-service/carInoutDetailApi/service](http://carInoutDetail-service/carInoutDetailApi/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|businessCarInoutDetailInfo|1|Object|-|小区成员|小区成员| |
| | | |businessCarInoutDetailInfo|detailId|1|String|30|-|-| |
| | | |
| | | |
| | | ###### 返回协议 |
| | | |
| | | 当http返回状态不为200 时请求处理失败 body内容为失败的原因 |
| | | |
| | | 当http返回状态为200时请求处理成功,body内容为返回内容, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | ###### 举例 |
| | | > 地址:[http://carInoutDetail-service/carInoutDetailApi/service](http://carInoutDetail-service/carInoutDetailApi/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": "541120050001", |
| | | "bId":"1234567892", |
| | | "remark": "备注", |
| | | "datas": { |
| | | "businessCarInoutDetailInfo": { |
| | | "detailId":"填写存在的值" |
| | | } |
| | | }, |
| | | "attrs": [{ |
| | | "specCd": "配置的字段ID", |
| | | "value": "具体值" |
| | | }] |
| | | } |
| | | } |
| | | |
| | | 返回报文: |
| | | { |
| | | "orderTypeCd": "D", |
| | | "response": { |
| | | "code": "0000", |
| | | "message": "成功" |
| | | }, |
| | | "responseTime": "20190418102004", |
| | | "bId": "202019041810750003", |
| | | "businessType": "B", |
| | | "transactionId": "3a5a411ec65a4c3f895935638aa1d2bc", |
| | | "dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947" |
| | | } |
| | | |
| | | ``` |
| New file |
| | |
| | | |
| | | |
| | | **1\. 保存进出场详情** |
| | | ###### 接口功能 |
| | | > API服务做保存进出场详情时调用该接口 |
| | | |
| | | ###### URL |
| | | > [http://carInoutDetail-service/carInoutDetailApi/service](http://carInoutDetail-service/carInoutDetailApi/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|businessCarInoutDetailInfo|1|Object|-|小区成员|小区成员| |
| | | |businessCarInoutDetailInfo|inoutId|1|String|30|-|-| |
| | | |businessCarInoutDetailInfo|machineId|1|String|30|-|-| |
| | | |businessCarInoutDetailInfo|machineCode|1|String|30|-|-| |
| | | |businessCarInoutDetailInfo|carInout|1|String|30|-|-| |
| | | |businessCarInoutDetailInfo|detailId|1|String|30|-|-| |
| | | |businessCarInoutDetailInfo|carNum|1|String|30|-|-| |
| | | |businessCarInoutDetailInfo|communityId|1|String|30|-|-| |
| | | |
| | | |
| | | ###### 返回协议 |
| | | |
| | | 当http返回状态不为200 时请求处理失败 body内容为失败的原因 |
| | | |
| | | 当http返回状态为200时请求处理成功,body内容为返回内容, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | ###### 举例 |
| | | > 地址:[http://carInoutDetail-service/carInoutDetailApi/service](http://carInoutDetail-service/carInoutDetailApi/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": "541120030001", |
| | | "bId":"1234567892", |
| | | "remark": "备注", |
| | | "datas": { |
| | | "businessCarInoutDetailInfo": { |
| | | "inoutId":"填写具体值", |
| | | "machineId":"填写具体值", |
| | | "machineCode":"填写具体值", |
| | | "carInout":"填写具体值", |
| | | "detailId":"填写具体值", |
| | | "carNum":"填写具体值", |
| | | "communityId":"填写具体值" |
| | | } |
| | | }, |
| | | "attrs": [{ |
| | | "specCd": "配置的字段ID", |
| | | "value": "具体值" |
| | | }] |
| | | } |
| | | } |
| | | |
| | | 返回报文: |
| | | { |
| | | "orderTypeCd": "D", |
| | | "response": { |
| | | "code": "0000", |
| | | "message": "成功" |
| | | }, |
| | | "responseTime": "20190418102004", |
| | | "bId": "202019041810750003", |
| | | "businessType": "B", |
| | | "transactionId": "3a5a411ec65a4c3f895935638aa1d2bc", |
| | | "dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947" |
| | | } |
| | | |
| | | ``` |
| New file |
| | |
| | | |
| | | |
| | | **1\. 修改进出场详情** |
| | | ###### 接口功能 |
| | | > API服务做修改进出场详情时调用该接口 |
| | | |
| | | ###### URL |
| | | > [http://carInoutDetail-service/carInoutDetailApi/service](http://carInoutDetail-service/carInoutDetailApi/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|businessCarInoutDetailInfo|1|Object|-|小区成员|小区成员| |
| | | |businessCarInoutDetailInfo|inoutId|1|String|30|-|-| |
| | | |businessCarInoutDetailInfo|machineId|1|String|30|-|-| |
| | | |businessCarInoutDetailInfo|machineCode|1|String|30|-|-| |
| | | |businessCarInoutDetailInfo|carInout|1|String|30|-|-| |
| | | |businessCarInoutDetailInfo|detailId|1|String|30|-|-| |
| | | |businessCarInoutDetailInfo|carNum|1|String|30|-|-| |
| | | |businessCarInoutDetailInfo|communityId|1|String|30|-|-| |
| | | |
| | | |
| | | ###### 返回协议 |
| | | |
| | | 当http返回状态不为200 时请求处理失败 body内容为失败的原因 |
| | | |
| | | 当http返回状态为200时请求处理成功,body内容为返回内容, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | ###### 举例 |
| | | > 地址:[http://carInoutDetail-service/carInoutDetailApi/service](http://carInoutDetail-service/carInoutDetailApi/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": "541120040001", |
| | | "bId":"1234567892", |
| | | "remark": "备注", |
| | | "datas": { |
| | | "businessCarInoutDetailInfo": { |
| | | "inoutId":"填写具体值", |
| | | "machineId":"填写具体值", |
| | | "machineCode":"填写具体值", |
| | | "carInout":"填写具体值", |
| | | "detailId":"填写具体值", |
| | | "carNum":"填写具体值", |
| | | "communityId":"填写具体值" |
| | | } |
| | | }, |
| | | "attrs": [{ |
| | | "specCd": "配置的字段ID", |
| | | "value": "具体值" |
| | | }] |
| | | } |
| | | } |
| | | |
| | | 返回报文: |
| | | { |
| | | "orderTypeCd": "D", |
| | | "response": { |
| | | "code": "0000", |
| | | "message": "成功" |
| | | }, |
| | | "responseTime": "20190418102004", |
| | | "bId": "202019041810750003", |
| | | "businessType": "B", |
| | | "transactionId": "3a5a411ec65a4c3f895935638aa1d2bc", |
| | | "dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947" |
| | | } |
| | | |
| | | ``` |
| New file |
| | |
| | | package com.java110.dto.hardwareAdapation; |
| | | |
| | | import com.java110.dto.PageDto; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClassName FloorDto |
| | | * @Description 进出场详情数据层封装 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 8:52 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | public class CarInoutDetailDto extends PageDto implements Serializable { |
| | | |
| | | private String inoutId; |
| | | private String machineId; |
| | | private String machineCode; |
| | | private String carInout; |
| | | private String detailId; |
| | | private String carNum; |
| | | private String communityId; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | |
| | | public String getInoutId() { |
| | | return inoutId; |
| | | } |
| | | |
| | | public void setInoutId(String inoutId) { |
| | | this.inoutId = inoutId; |
| | | } |
| | | |
| | | public String getMachineId() { |
| | | return machineId; |
| | | } |
| | | |
| | | public void setMachineId(String machineId) { |
| | | this.machineId = machineId; |
| | | } |
| | | |
| | | public String getMachineCode() { |
| | | return machineCode; |
| | | } |
| | | |
| | | public void setMachineCode(String machineCode) { |
| | | this.machineCode = machineCode; |
| | | } |
| | | |
| | | public String getCarInout() { |
| | | return carInout; |
| | | } |
| | | |
| | | public void setCarInout(String carInout) { |
| | | this.carInout = carInout; |
| | | } |
| | | |
| | | public String getDetailId() { |
| | | return detailId; |
| | | } |
| | | |
| | | public void setDetailId(String detailId) { |
| | | this.detailId = detailId; |
| | | } |
| | | |
| | | public String getCarNum() { |
| | | return carNum; |
| | | } |
| | | |
| | | public void setCarNum(String carNum) { |
| | | this.carNum = carNum; |
| | | } |
| | | |
| | | public String getCommunityId() { |
| | | return communityId; |
| | | } |
| | | |
| | | public void setCommunityId(String communityId) { |
| | | this.communityId = communityId; |
| | | } |
| | | |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.vo.api.machine; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @ClassName MachineResDataVo |
| | | * @Description 转述于 和硬件交互对象bean |
| | | * @Author wuxw |
| | | * @Date 2020/1/25 23:09 |
| | | * @Version 1.0 |
| | | * add by wuxw 2020/1/25 |
| | | **/ |
| | | public class MachineResDataVo implements Serializable { |
| | | |
| | | public static final String CODE_ERROR = "-1"; |
| | | public static final String CODE_SUCCESS = "0"; |
| | | |
| | | public MachineResDataVo() { |
| | | } |
| | | |
| | | public MachineResDataVo(String code, String message) { |
| | | this(code, message, new JSONObject()); |
| | | } |
| | | |
| | | public MachineResDataVo(String code, String message, JSONObject data) { |
| | | this.code = code; |
| | | this.message = message; |
| | | this.data = data; |
| | | } |
| | | |
| | | private String code; |
| | | private String message; |
| | | private JSONObject data; |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(String code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getMessage() { |
| | | return message; |
| | | } |
| | | |
| | | public void setMessage(String message) { |
| | | this.message = message; |
| | | } |
| | | |
| | | public JSONObject getData() { |
| | | return data; |
| | | } |
| | | |
| | | public void setData(JSONObject data) { |
| | | this.data = data; |
| | | } |
| | | |
| | | /** |
| | | * 获取封装好格式报文 |
| | | * @param code |
| | | * @param message |
| | | * @return |
| | | */ |
| | | public static ResponseEntity<String> getResData(String code, String message) { |
| | | return getResData(code, message, new JSONObject()); |
| | | } |
| | | |
| | | /** |
| | | * 获取封装好格式报文 |
| | | * @param code |
| | | * @param message |
| | | * @param data |
| | | * @return |
| | | */ |
| | | public static ResponseEntity<String> getResData(String code, String message, JSONObject data) { |
| | | ResponseEntity<String> responseEntity = null; |
| | | MachineResDataVo machineResDataVo = new MachineResDataVo(code, message, data); |
| | | if (CODE_SUCCESS.equals(code)) { |
| | | responseEntity = new ResponseEntity<>(JSONObject.toJSONString(machineResDataVo), HttpStatus.OK); |
| | | } else { |
| | | responseEntity = new ResponseEntity<>(JSONObject.toJSONString(machineResDataVo), HttpStatus.BAD_REQUEST); |
| | | } |
| | | |
| | | return responseEntity; |
| | | } |
| | | } |
| New file |
| | |
| | | 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 CarInoutDetailGeneratorApplication { |
| | | |
| | | protected CarInoutDetailGeneratorApplication() { |
| | | // prevents calls from subclass |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | /** |
| | | * 代码生成器 入口方法 |
| | | * 此处生成的mapper文件包含过程表和实例表的sql,所以要求两张表的特殊字段也要写上 |
| | | * BusinessTypeCd |
| | | * @param args 参数 |
| | | */ |
| | | public static void main(String[] args) { |
| | | Data data = new Data(); |
| | | data.setId("detailId"); |
| | | data.setName("carInoutDetail"); |
| | | data.setDesc("进出场详情"); |
| | | data.setShareParam("communityId"); |
| | | data.setShareColumn("community_id"); |
| | | data.setNewBusinessTypeCd("BUSINESS_TYPE_SAVE_CAR_INOUT_DETAIL"); |
| | | data.setUpdateBusinessTypeCd("BUSINESS_TYPE_UPDATE_CAR_INOUT_DETAIL"); |
| | | data.setDeleteBusinessTypeCd("BUSINESS_TYPE_DELETE_CAR_INOUT_DETAIL"); |
| | | data.setNewBusinessTypeCdValue("541120030001"); |
| | | data.setUpdateBusinessTypeCdValue("541120040001"); |
| | | data.setDeleteBusinessTypeCdValue("541120050001"); |
| | | data.setBusinessTableName("business_car_inout_detail"); |
| | | data.setTableName("car_inout_detail"); |
| | | Map<String, String> param = new HashMap<String, String>(); |
| | | param.put("detailId", "detail_id"); //map的key为你自定义的字段名就是驼峰命名法的那个,value为数据库表的字段名 |
| | | param.put("inoutId", "inout_id"); //map的key为你自定义的字段名就是驼峰命名法的那个,value为数据库表的字段名 |
| | | param.put("carNum", "car_num"); |
| | | param.put("communityId", "community_id"); |
| | | param.put("machineId", "machine_id"); |
| | | param.put("machineCode", "machine_code"); |
| | | param.put("carInout", "car_inout"); |
| | | 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); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.core.smo.hardwareAdapation; |
| | | |
| | | import com.java110.core.feign.FeignConfiguration; |
| | | import com.java110.dto.hardwareAdapation.CarInoutDetailDto; |
| | | 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 ICarInoutDetailInnerServiceSMO |
| | | * @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("/carInoutDetailApi") |
| | | public interface ICarInoutDetailInnerServiceSMO { |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * @param carInoutDetailDto 数据对象分享 |
| | | * @return CarInoutDetailDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/queryCarInoutDetails", method = RequestMethod.POST) |
| | | List<CarInoutDetailDto> queryCarInoutDetails(@RequestBody CarInoutDetailDto carInoutDetailDto); |
| | | |
| | | /** |
| | | * 查询<p>小区楼</p>总记录数 |
| | | * |
| | | * @param carInoutDetailDto 数据对象分享 |
| | | * @return 小区下的小区楼记录数 |
| | | */ |
| | | @RequestMapping(value = "/queryCarInoutDetailsCount", method = RequestMethod.POST) |
| | | int queryCarInoutDetailsCount(@RequestBody CarInoutDetailDto carInoutDetailDto); |
| | | } |
| | |
| | | community_id varchar(30) not null comment '小区ID', |
| | | machine_id varchar(30) not null comment '设备ID', |
| | | machine_code varchar(30) not null comment '设备编码', |
| | | inout varchar(12) not null comment '1010 进场 2020 出场', |
| | | car_inout varchar(12) not null comment '3306 进场 3307 出场', |
| | | car_num varchar(12) not null comment '车牌号', |
| | | create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
| | | operate VARCHAR(4) NOT NULL COMMENT '数据状态,添加ADD,修改MOD 删除DEL' |
| | |
| | | community_id varchar(30) not null comment '小区ID', |
| | | machine_id varchar(30) not null comment '设备ID', |
| | | machine_code varchar(30) not null comment '设备编码', |
| | | inout varchar(12) not null comment '1010 进场 2020 出场', |
| | | car_inout varchar(12) not null comment '3306 进场 3307 出场', |
| | | car_num varchar(12) not null comment '车牌号', |
| | | create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
| | | status_cd VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效' |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="carInoutDetailServiceDaoImpl"> |
| | | |
| | | <!-- 保存进出场详情信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveBusinessCarInoutDetailInfo" parameterType="Map"> |
| | | insert into business_car_inout_detail( |
| | | inout_id,machine_id,machine_code,operate,car_inout,detail_id,car_num,community_id,b_id |
| | | ) values ( |
| | | #{inoutId},#{machineId},#{machineCode},#{operate},#{carInout},#{detailId},#{carNum},#{communityId},#{bId} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询进出场详情信息(Business) add by wuxw 2018-07-03 --> |
| | | <select id="getBusinessCarInoutDetailInfo" parameterType="Map" resultType="Map"> |
| | | select t.inout_id,t.inout_id inoutId,t.machine_id,t.machine_id machineId,t.machine_code,t.machine_code |
| | | machineCode,t.operate,t.car_inout,t.car_inout carInout,t.detail_id,t.detail_id detailId,t.car_num,t.car_num |
| | | carNum,t.community_id,t.community_id communityId,t.b_id,t.b_id bId |
| | | from business_car_inout_detail t |
| | | where 1 =1 |
| | | <if test="inoutId !=null and inoutId != ''"> |
| | | and t.inout_id= #{inoutId} |
| | | </if> |
| | | <if test="machineId !=null and machineId != ''"> |
| | | and t.machine_id= #{machineId} |
| | | </if> |
| | | <if test="machineCode !=null and machineCode != ''"> |
| | | and t.machine_code= #{machineCode} |
| | | </if> |
| | | <if test="operate !=null and operate != ''"> |
| | | and t.operate= #{operate} |
| | | </if> |
| | | <if test="carInout !=null and carInout != ''"> |
| | | and t.car_inout= #{carInout} |
| | | </if> |
| | | <if test="detailId !=null and detailId != ''"> |
| | | and t.detail_id= #{detailId} |
| | | </if> |
| | | <if test="carNum !=null and carNum != ''"> |
| | | and t.car_num= #{carNum} |
| | | </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> |
| | | |
| | | </select> |
| | | |
| | | |
| | | <!-- 保存进出场详情信息至 instance表中 add by wuxw 2018-07-03 --> |
| | | <insert id="saveCarInoutDetailInfoInstance" parameterType="Map"> |
| | | insert into car_inout_detail( |
| | | inout_id,machine_id,machine_code,car_inout,detail_id,car_num,status_cd,community_id,b_id |
| | | ) select t.inout_id,t.machine_id,t.machine_code,t.car_inout,t.detail_id,t.car_num,'0',t.community_id,t.b_id from |
| | | business_car_inout_detail t where 1=1 |
| | | <if test="inoutId !=null and inoutId != ''"> |
| | | and t.inout_id= #{inoutId} |
| | | </if> |
| | | <if test="machineId !=null and machineId != ''"> |
| | | and t.machine_id= #{machineId} |
| | | </if> |
| | | <if test="machineCode !=null and machineCode != ''"> |
| | | and t.machine_code= #{machineCode} |
| | | </if> |
| | | and t.operate= 'ADD' |
| | | <if test="carInout !=null and carInout != ''"> |
| | | and t.car_inout= #{carInout} |
| | | </if> |
| | | <if test="detailId !=null and detailId != ''"> |
| | | and t.detail_id= #{detailId} |
| | | </if> |
| | | <if test="carNum !=null and carNum != ''"> |
| | | and t.car_num= #{carNum} |
| | | </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> |
| | | |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询进出场详情信息 add by wuxw 2018-07-03 --> |
| | | <select id="getCarInoutDetailInfo" parameterType="Map" resultType="Map"> |
| | | select t.inout_id,t.inout_id inoutId,t.machine_id,t.machine_id machineId,t.machine_code,t.machine_code |
| | | machineCode,t.car_inout,t.car_inout carInout,t.detail_id,t.detail_id detailId,t.car_num,t.car_num |
| | | carNum,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId,t.b_id,t.b_id bId |
| | | from car_inout_detail t |
| | | where 1 =1 |
| | | <if test="inoutId !=null and inoutId != ''"> |
| | | and t.inout_id= #{inoutId} |
| | | </if> |
| | | <if test="machineId !=null and machineId != ''"> |
| | | and t.machine_id= #{machineId} |
| | | </if> |
| | | <if test="machineCode !=null and machineCode != ''"> |
| | | and t.machine_code= #{machineCode} |
| | | </if> |
| | | <if test="carInout !=null and carInout != ''"> |
| | | and t.car_inout= #{carInout} |
| | | </if> |
| | | <if test="detailId !=null and detailId != ''"> |
| | | and t.detail_id= #{detailId} |
| | | </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="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </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="updateCarInoutDetailInfoInstance" parameterType="Map"> |
| | | update car_inout_detail t set t.status_cd = #{statusCd} |
| | | <if test="newBId != null and newBId != ''"> |
| | | ,t.b_id = #{newBId} |
| | | </if> |
| | | <if test="inoutId !=null and inoutId != ''"> |
| | | , t.inout_id= #{inoutId} |
| | | </if> |
| | | <if test="machineId !=null and machineId != ''"> |
| | | , t.machine_id= #{machineId} |
| | | </if> |
| | | <if test="machineCode !=null and machineCode != ''"> |
| | | , t.machine_code= #{machineCode} |
| | | </if> |
| | | <if test="carInout !=null and carInout != ''"> |
| | | , t.car_inout= #{carInout} |
| | | </if> |
| | | <if test="carNum !=null and carNum != ''"> |
| | | , t.car_num= #{carNum} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | , t.community_id= #{communityId} |
| | | </if> |
| | | where 1=1 |
| | | <if test="detailId !=null and detailId != ''"> |
| | | and t.detail_id= #{detailId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询进出场详情数量 add by wuxw 2018-07-03 --> |
| | | <select id="queryCarInoutDetailsCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from car_inout_detail t |
| | | where 1 =1 |
| | | <if test="inoutId !=null and inoutId != ''"> |
| | | and t.inout_id= #{inoutId} |
| | | </if> |
| | | <if test="machineId !=null and machineId != ''"> |
| | | and t.machine_id= #{machineId} |
| | | </if> |
| | | <if test="machineCode !=null and machineCode != ''"> |
| | | and t.machine_code= #{machineCode} |
| | | </if> |
| | | <if test="carInout !=null and carInout != ''"> |
| | | and t.car_inout= #{carInout} |
| | | </if> |
| | | <if test="detailId !=null and detailId != ''"> |
| | | and t.detail_id= #{detailId} |
| | | </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="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | |
| | | /** |
| | | * 添加进场记录详情 |
| | | */ |
| | | public static final String BUSINESS_TYPE_SAVE_CAR_INOUT_DETAIL = "541120030001"; |
| | | |
| | | /** |
| | | * 修改进场记录详情 |
| | | */ |
| | | public static final String BUSINESS_TYPE_UPDATE_CAR_INOUT_DETAIL = "541120040001"; |
| | | |
| | | |
| | | /** |
| | | * 删除进场记录详情 |
| | | */ |
| | | public static final String BUSINESS_TYPE_DELETE_CAR_INOUT_DETAIL = "541120050001"; |
| | | |
| | | |
| | | /** |
| | | * 发布公告 |
| | | */ |
| | | public static final String BUSINESS_TYPE_SAVE_NOTICE = "550100030001"; |