| New file |
| | |
| | | package com.java110.fee.listener.tempCarFeeConfigAttr; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | 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 com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.fee.dao.ITempCarFeeConfigAttrServiceDao; |
| | | 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; |
| | | |
| | | /** |
| | | * 删除临时车收费标准属性信息 侦听 |
| | | * |
| | | * 处理节点 |
| | | * 1、businessTempCarFeeConfigAttr:{} 临时车收费标准属性基本信息节点 |
| | | * 2、businessTempCarFeeConfigAttrAttr:[{}] 临时车收费标准属性属性信息节点 |
| | | * 3、businessTempCarFeeConfigAttrPhoto:[{}] 临时车收费标准属性照片信息节点 |
| | | * 4、businessTempCarFeeConfigAttrCerdentials:[{}] 临时车收费标准属性证件信息节点 |
| | | * 协议地址 :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("deleteTempCarFeeConfigAttrInfoListener") |
| | | @Transactional |
| | | public class DeleteTempCarFeeConfigAttrInfoListener extends AbstractTempCarFeeConfigAttrBusinessServiceDataFlowListener { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(DeleteTempCarFeeConfigAttrInfoListener.class); |
| | | @Autowired |
| | | ITempCarFeeConfigAttrServiceDao tempCarFeeConfigAttrServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 3; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_DELETE_TEMP_CAR_FEE_CONFIG_ATTR_INFO; |
| | | } |
| | | |
| | | /** |
| | | * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | JSONObject data = business.getDatas(); |
| | | |
| | | Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessTempCarFeeConfigAttr 节点 |
| | | if(data.containsKey(TempCarFeeConfigAttrPo.class.getSimpleName())){ |
| | | Object _obj = data.get(TempCarFeeConfigAttrPo.class.getSimpleName()); |
| | | JSONArray businessTempCarFeeConfigAttrs = null; |
| | | if(_obj instanceof JSONObject){ |
| | | businessTempCarFeeConfigAttrs = new JSONArray(); |
| | | businessTempCarFeeConfigAttrs.add(_obj); |
| | | }else { |
| | | businessTempCarFeeConfigAttrs = (JSONArray)_obj; |
| | | } |
| | | //JSONObject businessTempCarFeeConfigAttr = data.getJSONObject(TempCarFeeConfigAttrPo.class.getSimpleName()); |
| | | for (int _tempCarFeeConfigAttrIndex = 0; _tempCarFeeConfigAttrIndex < businessTempCarFeeConfigAttrs.size();_tempCarFeeConfigAttrIndex++) { |
| | | JSONObject businessTempCarFeeConfigAttr = businessTempCarFeeConfigAttrs.getJSONObject(_tempCarFeeConfigAttrIndex); |
| | | doBusinessTempCarFeeConfigAttr(business, businessTempCarFeeConfigAttr); |
| | | if(_obj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("attrId", businessTempCarFeeConfigAttr.getString("attrId")); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 删除 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> businessTempCarFeeConfigAttrInfos = tempCarFeeConfigAttrServiceDaoImpl.getBusinessTempCarFeeConfigAttrInfo(info); |
| | | if( businessTempCarFeeConfigAttrInfos != null && businessTempCarFeeConfigAttrInfos.size() >0) { |
| | | for (int _tempCarFeeConfigAttrIndex = 0; _tempCarFeeConfigAttrIndex < businessTempCarFeeConfigAttrInfos.size();_tempCarFeeConfigAttrIndex++) { |
| | | Map businessTempCarFeeConfigAttrInfo = businessTempCarFeeConfigAttrInfos.get(_tempCarFeeConfigAttrIndex); |
| | | flushBusinessTempCarFeeConfigAttrInfo(businessTempCarFeeConfigAttrInfo,StatusConstant.STATUS_CD_INVALID); |
| | | tempCarFeeConfigAttrServiceDaoImpl.updateTempCarFeeConfigAttrInfoInstance(businessTempCarFeeConfigAttrInfo); |
| | | dataFlowContext.addParamOut("attrId",businessTempCarFeeConfigAttrInfo.get("attr_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> tempCarFeeConfigAttrInfo = tempCarFeeConfigAttrServiceDaoImpl.getTempCarFeeConfigAttrInfo(info); |
| | | if(tempCarFeeConfigAttrInfo != null && tempCarFeeConfigAttrInfo.size() > 0){ |
| | | |
| | | //临时车收费标准属性信息 |
| | | List<Map> businessTempCarFeeConfigAttrInfos = tempCarFeeConfigAttrServiceDaoImpl.getBusinessTempCarFeeConfigAttrInfo(delInfo); |
| | | //除非程序出错了,这里不会为空 |
| | | if(businessTempCarFeeConfigAttrInfos == null || businessTempCarFeeConfigAttrInfos.size() == 0){ |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(tempCarFeeConfigAttr),程序内部异常,请检查! "+delInfo); |
| | | } |
| | | for (int _tempCarFeeConfigAttrIndex = 0; _tempCarFeeConfigAttrIndex < businessTempCarFeeConfigAttrInfos.size();_tempCarFeeConfigAttrIndex++) { |
| | | Map businessTempCarFeeConfigAttrInfo = businessTempCarFeeConfigAttrInfos.get(_tempCarFeeConfigAttrIndex); |
| | | flushBusinessTempCarFeeConfigAttrInfo(businessTempCarFeeConfigAttrInfo,StatusConstant.STATUS_CD_VALID); |
| | | tempCarFeeConfigAttrServiceDaoImpl.updateTempCarFeeConfigAttrInfoInstance(businessTempCarFeeConfigAttrInfo); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 处理 businessTempCarFeeConfigAttr 节点 |
| | | * @param business 总的数据节点 |
| | | * @param businessTempCarFeeConfigAttr 临时车收费标准属性节点 |
| | | */ |
| | | private void doBusinessTempCarFeeConfigAttr(Business business,JSONObject businessTempCarFeeConfigAttr){ |
| | | |
| | | Assert.jsonObjectHaveKey(businessTempCarFeeConfigAttr,"attrId","businessTempCarFeeConfigAttr 节点下没有包含 attrId 节点"); |
| | | |
| | | if(businessTempCarFeeConfigAttr.getString("attrId").startsWith("-")){ |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"attrId 错误,不能自动生成(必须已经存在的attrId)"+businessTempCarFeeConfigAttr); |
| | | } |
| | | //自动插入DEL |
| | | autoSaveDelBusinessTempCarFeeConfigAttr(business,businessTempCarFeeConfigAttr); |
| | | } |
| | | @Override |
| | | public ITempCarFeeConfigAttrServiceDao getTempCarFeeConfigAttrServiceDaoImpl() { |
| | | return tempCarFeeConfigAttrServiceDaoImpl; |
| | | } |
| | | |
| | | public void setTempCarFeeConfigAttrServiceDaoImpl(ITempCarFeeConfigAttrServiceDao tempCarFeeConfigAttrServiceDaoImpl) { |
| | | this.tempCarFeeConfigAttrServiceDaoImpl = tempCarFeeConfigAttrServiceDaoImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.fee.listener.tempCarFeeConfigAttr; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.StatusConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.fee.dao.ITempCarFeeConfigAttrServiceDao; |
| | | 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 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("saveTempCarFeeConfigAttrInfoListener") |
| | | @Transactional |
| | | public class SaveTempCarFeeConfigAttrInfoListener extends AbstractTempCarFeeConfigAttrBusinessServiceDataFlowListener{ |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(SaveTempCarFeeConfigAttrInfoListener.class); |
| | | |
| | | @Autowired |
| | | private ITempCarFeeConfigAttrServiceDao tempCarFeeConfigAttrServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_SAVE_TEMP_CAR_FEE_CONFIG_ATTR_INFO; |
| | | } |
| | | |
| | | /** |
| | | * 保存临时车收费标准属性信息 business 表中 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | JSONObject data = business.getDatas(); |
| | | Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessTempCarFeeConfigAttr 节点 |
| | | if(data.containsKey(TempCarFeeConfigAttrPo.class.getSimpleName())){ |
| | | Object bObj = data.get(TempCarFeeConfigAttrPo.class.getSimpleName()); |
| | | JSONArray businessTempCarFeeConfigAttrs = null; |
| | | if(bObj instanceof JSONObject){ |
| | | businessTempCarFeeConfigAttrs = new JSONArray(); |
| | | businessTempCarFeeConfigAttrs.add(bObj); |
| | | }else { |
| | | businessTempCarFeeConfigAttrs = (JSONArray)bObj; |
| | | } |
| | | //JSONObject businessTempCarFeeConfigAttr = data.getJSONObject(TempCarFeeConfigAttrPo.class.getSimpleName()); |
| | | for (int bTempCarFeeConfigAttrIndex = 0; bTempCarFeeConfigAttrIndex < businessTempCarFeeConfigAttrs.size();bTempCarFeeConfigAttrIndex++) { |
| | | JSONObject businessTempCarFeeConfigAttr = businessTempCarFeeConfigAttrs.getJSONObject(bTempCarFeeConfigAttrIndex); |
| | | doBusinessTempCarFeeConfigAttr(business, businessTempCarFeeConfigAttr); |
| | | if(bObj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("attrId", businessTempCarFeeConfigAttr.getString("attrId")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 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> businessTempCarFeeConfigAttrInfo = tempCarFeeConfigAttrServiceDaoImpl.getBusinessTempCarFeeConfigAttrInfo(info); |
| | | if( businessTempCarFeeConfigAttrInfo != null && businessTempCarFeeConfigAttrInfo.size() >0) { |
| | | reFreshShareColumn(info, businessTempCarFeeConfigAttrInfo.get(0)); |
| | | tempCarFeeConfigAttrServiceDaoImpl.saveTempCarFeeConfigAttrInfoInstance(info); |
| | | if(businessTempCarFeeConfigAttrInfo.size() == 1) { |
| | | dataFlowContext.addParamOut("attrId", businessTempCarFeeConfigAttrInfo.get(0).get("attr_id")); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 刷 分片字段 |
| | | * |
| | | * @param info 查询对象 |
| | | * @param businessInfo 小区ID |
| | | */ |
| | | private void reFreshShareColumn(Map info, Map businessInfo) { |
| | | |
| | | if (info.containsKey("config_id")) { |
| | | return; |
| | | } |
| | | |
| | | if (!businessInfo.containsKey("configId")) { |
| | | return; |
| | | } |
| | | |
| | | info.put("config_id", businessInfo.get("configId")); |
| | | } |
| | | /** |
| | | * 撤单 |
| | | * @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> tempCarFeeConfigAttrInfo = tempCarFeeConfigAttrServiceDaoImpl.getTempCarFeeConfigAttrInfo(info); |
| | | if(tempCarFeeConfigAttrInfo != null && tempCarFeeConfigAttrInfo.size() > 0){ |
| | | reFreshShareColumn(paramIn, tempCarFeeConfigAttrInfo.get(0)); |
| | | tempCarFeeConfigAttrServiceDaoImpl.updateTempCarFeeConfigAttrInfoInstance(paramIn); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 处理 businessTempCarFeeConfigAttr 节点 |
| | | * @param business 总的数据节点 |
| | | * @param businessTempCarFeeConfigAttr 临时车收费标准属性节点 |
| | | */ |
| | | private void doBusinessTempCarFeeConfigAttr(Business business,JSONObject businessTempCarFeeConfigAttr){ |
| | | |
| | | Assert.jsonObjectHaveKey(businessTempCarFeeConfigAttr,"attrId","businessTempCarFeeConfigAttr 节点下没有包含 attrId 节点"); |
| | | |
| | | if(businessTempCarFeeConfigAttr.getString("attrId").startsWith("-")){ |
| | | //刷新缓存 |
| | | //flushTempCarFeeConfigAttrId(business.getDatas()); |
| | | |
| | | businessTempCarFeeConfigAttr.put("attrId",GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId)); |
| | | |
| | | } |
| | | |
| | | businessTempCarFeeConfigAttr.put("bId",business.getbId()); |
| | | businessTempCarFeeConfigAttr.put("operate", StatusConstant.OPERATE_ADD); |
| | | //保存临时车收费标准属性信息 |
| | | tempCarFeeConfigAttrServiceDaoImpl.saveBusinessTempCarFeeConfigAttrInfo(businessTempCarFeeConfigAttr); |
| | | |
| | | } |
| | | @Override |
| | | public ITempCarFeeConfigAttrServiceDao getTempCarFeeConfigAttrServiceDaoImpl() { |
| | | return tempCarFeeConfigAttrServiceDaoImpl; |
| | | } |
| | | |
| | | public void setTempCarFeeConfigAttrServiceDaoImpl(ITempCarFeeConfigAttrServiceDao tempCarFeeConfigAttrServiceDaoImpl) { |
| | | this.tempCarFeeConfigAttrServiceDaoImpl = tempCarFeeConfigAttrServiceDaoImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.fee.listener.tempCarFeeConfigAttr; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | 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 com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.fee.dao.ITempCarFeeConfigAttrServiceDao; |
| | | 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; |
| | | |
| | | /** |
| | | * 修改临时车收费标准属性信息 侦听 |
| | | * |
| | | * 处理节点 |
| | | * 1、businessTempCarFeeConfigAttr:{} 临时车收费标准属性基本信息节点 |
| | | * 2、businessTempCarFeeConfigAttrAttr:[{}] 临时车收费标准属性属性信息节点 |
| | | * 3、businessTempCarFeeConfigAttrPhoto:[{}] 临时车收费标准属性照片信息节点 |
| | | * 4、businessTempCarFeeConfigAttrCerdentials:[{}] 临时车收费标准属性证件信息节点 |
| | | * 协议地址 :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("updateTempCarFeeConfigAttrInfoListener") |
| | | @Transactional |
| | | public class UpdateTempCarFeeConfigAttrInfoListener extends AbstractTempCarFeeConfigAttrBusinessServiceDataFlowListener { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(UpdateTempCarFeeConfigAttrInfoListener.class); |
| | | @Autowired |
| | | private ITempCarFeeConfigAttrServiceDao tempCarFeeConfigAttrServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 2; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_TEMP_CAR_FEE_CONFIG_ATTR_INFO; |
| | | } |
| | | |
| | | /** |
| | | * business过程 |
| | | * @param dataFlowContext 上下文对象 |
| | | * @param business 业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | |
| | | JSONObject data = business.getDatas(); |
| | | |
| | | Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | |
| | | //处理 businessTempCarFeeConfigAttr 节点 |
| | | if(data.containsKey(TempCarFeeConfigAttrPo.class.getSimpleName())){ |
| | | Object _obj = data.get(TempCarFeeConfigAttrPo.class.getSimpleName()); |
| | | JSONArray businessTempCarFeeConfigAttrs = null; |
| | | if(_obj instanceof JSONObject){ |
| | | businessTempCarFeeConfigAttrs = new JSONArray(); |
| | | businessTempCarFeeConfigAttrs.add(_obj); |
| | | }else { |
| | | businessTempCarFeeConfigAttrs = (JSONArray)_obj; |
| | | } |
| | | //JSONObject businessTempCarFeeConfigAttr = data.getJSONObject(TempCarFeeConfigAttrPo.class.getSimpleName()); |
| | | for (int _tempCarFeeConfigAttrIndex = 0; _tempCarFeeConfigAttrIndex < businessTempCarFeeConfigAttrs.size();_tempCarFeeConfigAttrIndex++) { |
| | | JSONObject businessTempCarFeeConfigAttr = businessTempCarFeeConfigAttrs.getJSONObject(_tempCarFeeConfigAttrIndex); |
| | | doBusinessTempCarFeeConfigAttr(business, businessTempCarFeeConfigAttr); |
| | | if(_obj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("attrId", businessTempCarFeeConfigAttr.getString("attrId")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 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> businessTempCarFeeConfigAttrInfos = tempCarFeeConfigAttrServiceDaoImpl.getBusinessTempCarFeeConfigAttrInfo(info); |
| | | if( businessTempCarFeeConfigAttrInfos != null && businessTempCarFeeConfigAttrInfos.size() >0) { |
| | | for (int _tempCarFeeConfigAttrIndex = 0; _tempCarFeeConfigAttrIndex < businessTempCarFeeConfigAttrInfos.size();_tempCarFeeConfigAttrIndex++) { |
| | | Map businessTempCarFeeConfigAttrInfo = businessTempCarFeeConfigAttrInfos.get(_tempCarFeeConfigAttrIndex); |
| | | flushBusinessTempCarFeeConfigAttrInfo(businessTempCarFeeConfigAttrInfo,StatusConstant.STATUS_CD_VALID); |
| | | tempCarFeeConfigAttrServiceDaoImpl.updateTempCarFeeConfigAttrInfoInstance(businessTempCarFeeConfigAttrInfo); |
| | | if(businessTempCarFeeConfigAttrInfo.size() == 1) { |
| | | dataFlowContext.addParamOut("attrId", businessTempCarFeeConfigAttrInfo.get("attr_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> tempCarFeeConfigAttrInfo = tempCarFeeConfigAttrServiceDaoImpl.getTempCarFeeConfigAttrInfo(info); |
| | | if(tempCarFeeConfigAttrInfo != null && tempCarFeeConfigAttrInfo.size() > 0){ |
| | | |
| | | //临时车收费标准属性信息 |
| | | List<Map> businessTempCarFeeConfigAttrInfos = tempCarFeeConfigAttrServiceDaoImpl.getBusinessTempCarFeeConfigAttrInfo(delInfo); |
| | | //除非程序出错了,这里不会为空 |
| | | if(businessTempCarFeeConfigAttrInfos == null || businessTempCarFeeConfigAttrInfos.size() == 0){ |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(tempCarFeeConfigAttr),程序内部异常,请检查! "+delInfo); |
| | | } |
| | | for (int _tempCarFeeConfigAttrIndex = 0; _tempCarFeeConfigAttrIndex < businessTempCarFeeConfigAttrInfos.size();_tempCarFeeConfigAttrIndex++) { |
| | | Map businessTempCarFeeConfigAttrInfo = businessTempCarFeeConfigAttrInfos.get(_tempCarFeeConfigAttrIndex); |
| | | flushBusinessTempCarFeeConfigAttrInfo(businessTempCarFeeConfigAttrInfo,StatusConstant.STATUS_CD_VALID); |
| | | tempCarFeeConfigAttrServiceDaoImpl.updateTempCarFeeConfigAttrInfoInstance(businessTempCarFeeConfigAttrInfo); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 处理 businessTempCarFeeConfigAttr 节点 |
| | | * @param business 总的数据节点 |
| | | * @param businessTempCarFeeConfigAttr 临时车收费标准属性节点 |
| | | */ |
| | | private void doBusinessTempCarFeeConfigAttr(Business business,JSONObject businessTempCarFeeConfigAttr){ |
| | | |
| | | Assert.jsonObjectHaveKey(businessTempCarFeeConfigAttr,"attrId","businessTempCarFeeConfigAttr 节点下没有包含 attrId 节点"); |
| | | |
| | | if(businessTempCarFeeConfigAttr.getString("attrId").startsWith("-")){ |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"attrId 错误,不能自动生成(必须已经存在的attrId)"+businessTempCarFeeConfigAttr); |
| | | } |
| | | //自动保存DEL |
| | | autoSaveDelBusinessTempCarFeeConfigAttr(business,businessTempCarFeeConfigAttr); |
| | | |
| | | businessTempCarFeeConfigAttr.put("bId",business.getbId()); |
| | | businessTempCarFeeConfigAttr.put("operate", StatusConstant.OPERATE_ADD); |
| | | //保存临时车收费标准属性信息 |
| | | tempCarFeeConfigAttrServiceDaoImpl.saveBusinessTempCarFeeConfigAttrInfo(businessTempCarFeeConfigAttr); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public ITempCarFeeConfigAttrServiceDao getTempCarFeeConfigAttrServiceDaoImpl() { |
| | | return tempCarFeeConfigAttrServiceDaoImpl; |
| | | } |
| | | |
| | | public void setTempCarFeeConfigAttrServiceDaoImpl(ITempCarFeeConfigAttrServiceDao tempCarFeeConfigAttrServiceDaoImpl) { |
| | | this.tempCarFeeConfigAttrServiceDaoImpl = tempCarFeeConfigAttrServiceDaoImpl; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.dto.tempCarFeeConfigAttr; |
| | | |
| | | 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 TempCarFeeConfigAttrDto extends PageDto implements Serializable { |
| | | |
| | | private String attrId; |
| | | private String configId; |
| | | private String specCd; |
| | | private String value; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | |
| | | public String getAttrId() { |
| | | return attrId; |
| | | } |
| | | public void setAttrId(String attrId) { |
| | | this.attrId = attrId; |
| | | } |
| | | public String getConfigId() { |
| | | return configId; |
| | | } |
| | | public void setConfigId(String configId) { |
| | | this.configId = configId; |
| | | } |
| | | public String getSpecCd() { |
| | | return specCd; |
| | | } |
| | | public void setSpecCd(String specCd) { |
| | | this.specCd = specCd; |
| | | } |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | |
| | | 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.po.tempCarFeeConfigAttr; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | public class TempCarFeeConfigAttrPo implements Serializable { |
| | | |
| | | private String attrId; |
| | | private String configId; |
| | | private String specCd; |
| | | private String value; |
| | | public String getAttrId() { |
| | | return attrId; |
| | | } |
| | | public void setAttrId(String attrId) { |
| | | this.attrId = attrId; |
| | | } |
| | | public String getConfigId() { |
| | | return configId; |
| | | } |
| | | public void setConfigId(String configId) { |
| | | this.configId = configId; |
| | | } |
| | | public String getSpecCd() { |
| | | return specCd; |
| | | } |
| | | public void setSpecCd(String specCd) { |
| | | this.specCd = specCd; |
| | | } |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| 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="tempCarFeeConfigAttrServiceDaoImpl"> |
| | | |
| | | <!-- 保存临时车收费标准属性信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveBusinessTempCarFeeConfigAttrInfo" parameterType="Map"> |
| | | insert into business_temp_car_fee_config_attr( |
| | | attr_id,operate,create_time,config_id,spec_cd,b_id,value |
| | | ) values ( |
| | | #{attrId},#{operate},#{createTime},#{configId},#{specCd},#{bId},#{value} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询临时车收费标准属性信息(Business) add by wuxw 2018-07-03 --> |
| | | <select id="getBusinessTempCarFeeConfigAttrInfo" parameterType="Map" resultType="Map"> |
| | | select t.attr_id,t.attr_id attrId,t.operate,t.create_time,t.create_time createTime,t.config_id,t.config_id configId,t.spec_cd,t.spec_cd specCd,t.b_id,t.b_id bId,t.value |
| | | from business_temp_car_fee_config_attr t |
| | | where 1 =1 |
| | | <if test="attrId !=null and attrId != ''"> |
| | | and t.attr_id= #{attrId} |
| | | </if> |
| | | <if test="operate !=null and operate != ''"> |
| | | and t.operate= #{operate} |
| | | </if> |
| | | <if test="createTime !=null and createTime != ''"> |
| | | and t.create_time= #{createTime} |
| | | </if> |
| | | <if test="configId !=null and configId != ''"> |
| | | and t.config_id= #{configId} |
| | | </if> |
| | | <if test="specCd !=null and specCd != ''"> |
| | | and t.spec_cd= #{specCd} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="value !=null and value != ''"> |
| | | and t.value= #{value} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 保存临时车收费标准属性信息至 instance表中 add by wuxw 2018-07-03 --> |
| | | <insert id="saveTempCarFeeConfigAttrInfoInstance" parameterType="Map"> |
| | | insert into temp_car_fee_config_attr( |
| | | attr_id,create_time,config_id,spec_cd,status_cd,b_id,value |
| | | ) select t.attr_id,t.create_time,t.config_id,t.spec_cd,'0',t.b_id,t.value from business_temp_car_fee_config_attr t where 1=1 |
| | | <if test="attrId !=null and attrId != ''"> |
| | | and t.attr_id= #{attrId} |
| | | </if> |
| | | and t.operate= 'ADD' |
| | | <if test="createTime !=null and createTime != ''"> |
| | | and t.create_time= #{createTime} |
| | | </if> |
| | | <if test="configId !=null and configId != ''"> |
| | | and t.config_id= #{configId} |
| | | </if> |
| | | <if test="specCd !=null and specCd != ''"> |
| | | and t.spec_cd= #{specCd} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="value !=null and value != ''"> |
| | | and t.value= #{value} |
| | | </if> |
| | | |
| | | </insert> |
| | | |
| | | |
| | | |
| | | <!-- 查询临时车收费标准属性信息 add by wuxw 2018-07-03 --> |
| | | <select id="getTempCarFeeConfigAttrInfo" parameterType="Map" resultType="Map"> |
| | | select t.attr_id,t.attr_id attrId,t.create_time,t.create_time createTime,t.config_id,t.config_id configId,t.spec_cd,t.spec_cd specCd,t.status_cd,t.status_cd statusCd,t.b_id,t.b_id bId,t.value |
| | | from temp_car_fee_config_attr t |
| | | where 1 =1 |
| | | <if test="attrId !=null and attrId != ''"> |
| | | and t.attr_id= #{attrId} |
| | | </if> |
| | | <if test="createTime !=null and createTime != ''"> |
| | | and t.create_time= #{createTime} |
| | | </if> |
| | | <if test="configId !=null and configId != ''"> |
| | | and t.config_id= #{configId} |
| | | </if> |
| | | <if test="specCd !=null and specCd != ''"> |
| | | and t.spec_cd= #{specCd} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="value !=null and value != ''"> |
| | | and t.value= #{value} |
| | | </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="updateTempCarFeeConfigAttrInfoInstance" parameterType="Map"> |
| | | update temp_car_fee_config_attr t set t.status_cd = #{statusCd} |
| | | <if test="newBId != null and newBId != ''"> |
| | | ,t.b_id = #{newBId} |
| | | </if> |
| | | <if test="createTime !=null and createTime != ''"> |
| | | , t.create_time= #{createTime} |
| | | </if> |
| | | <if test="configId !=null and configId != ''"> |
| | | , t.config_id= #{configId} |
| | | </if> |
| | | <if test="specCd !=null and specCd != ''"> |
| | | , t.spec_cd= #{specCd} |
| | | </if> |
| | | <if test="value !=null and value != ''"> |
| | | , t.value= #{value} |
| | | </if> |
| | | where 1=1 <if test="attrId !=null and attrId != ''"> |
| | | and t.attr_id= #{attrId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询临时车收费标准属性数量 add by wuxw 2018-07-03 --> |
| | | <select id="queryTempCarFeeConfigAttrsCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from temp_car_fee_config_attr t |
| | | where 1 =1 |
| | | <if test="attrId !=null and attrId != ''"> |
| | | and t.attr_id= #{attrId} |
| | | </if> |
| | | <if test="createTime !=null and createTime != ''"> |
| | | and t.create_time= #{createTime} |
| | | </if> |
| | | <if test="configId !=null and configId != ''"> |
| | | and t.config_id= #{configId} |
| | | </if> |
| | | <if test="specCd !=null and specCd != ''"> |
| | | and t.spec_cd= #{specCd} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="value !=null and value != ''"> |
| | | and t.value= #{value} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | { |
| | | "autoMove": true, |
| | | "id": "attrId", |
| | | "name": "taskAttr", |
| | | "desc": "定时任务属性", |
| | | "shareParam": "task_id", |
| | | "shareColumn": "taskId", |
| | | "shareName": "job", |
| | | "name": "tempCarFeeConfigAttr", |
| | | "desc": "临时车收费标准属性", |
| | | "shareParam": "config_id", |
| | | "shareColumn": "configId", |
| | | "shareName": "fee", |
| | | "newBusinessTypeCd": "BUSINESS_TYPE_SAVE_TEMP_CAR_FEE_CONFIG_ATTR_INFO", |
| | | "updateBusinessTypeCd": "BUSINESS_TYPE_UPDATE_TEMP_CAR_FEE_CONFIG_ATTR_INFO", |
| | | "deleteBusinessTypeCd": "BUSINESS_TYPE_DELETE_TEMP_CAR_FEE_CONFIG_ATTR_INFO", |
| | |
| | | }, |
| | | { |
| | | "code": "specCd", |
| | | "msg": "任务属性不能为空" |
| | | "msg": "属性不能为空" |
| | | }, |
| | | { |
| | | "code": "value", |
| | | "msg": "任务属性值不能为空" |
| | | "msg": "属性值不能为空" |
| | | } |
| | | ] |
| | | } |
| New file |
| | |
| | | package com.java110.intf.fee; |
| | | |
| | | import com.java110.config.feign.FeignConfiguration; |
| | | import com.java110.dto.tempCarFeeConfigAttr.TempCarFeeConfigAttrDto; |
| | | 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 ITempCarFeeConfigAttrInnerServiceSMO |
| | | * @Description 临时车收费标准属性接口类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:04 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @FeignClient(name = "fee-service", configuration = {FeignConfiguration.class}) |
| | | @RequestMapping("/tempCarFeeConfigAttrApi") |
| | | public interface ITempCarFeeConfigAttrInnerServiceSMO { |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * |
| | | * @param tempCarFeeConfigAttrDto 数据对象分享 |
| | | * @return TempCarFeeConfigAttrDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/queryTempCarFeeConfigAttrs", method = RequestMethod.POST) |
| | | List<TempCarFeeConfigAttrDto> queryTempCarFeeConfigAttrs(@RequestBody TempCarFeeConfigAttrDto tempCarFeeConfigAttrDto); |
| | | |
| | | /** |
| | | * 查询<p>小区楼</p>总记录数 |
| | | * |
| | | * @param tempCarFeeConfigAttrDto 数据对象分享 |
| | | * @return 小区下的小区楼记录数 |
| | | */ |
| | | @RequestMapping(value = "/queryTempCarFeeConfigAttrsCount", method = RequestMethod.POST) |
| | | int queryTempCarFeeConfigAttrsCount(@RequestBody TempCarFeeConfigAttrDto tempCarFeeConfigAttrDto); |
| | | } |
| New file |
| | |
| | | package com.java110.utils.constant; |
| | | |
| | | /** |
| | | * 临时车收费标准属性常量类 |
| | | * Created by wuxw on 2017/5/20. |
| | | */ |
| | | public class ServiceCodeTempCarFeeConfigAttrConstant { |
| | | |
| | | /** |
| | | * 添加 临时车收费标准属性 |
| | | */ |
| | | public static final String ADD_TEMPCARFEECONFIGATTR = "fee.saveTempCarFeeConfigAttr"; |
| | | |
| | | |
| | | /** |
| | | * 修改 临时车收费标准属性 |
| | | */ |
| | | public static final String UPDATE_TEMPCARFEECONFIGATTR = "fee.updateTempCarFeeConfigAttr"; |
| | | /** |
| | | * 删除 临时车收费标准属性 |
| | | */ |
| | | public static final String DELETE_TEMPCARFEECONFIGATTR = "fee.deleteTempCarFeeConfigAttr"; |
| | | |
| | | |
| | | /** |
| | | * 查询 临时车收费标准属性 |
| | | */ |
| | | public static final String LIST_TEMPCARFEECONFIGATTRS = "fee.listTempCarFeeConfigAttrs"; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.api.bmo.tempCarFeeConfigAttr; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.bmo.IApiBaseBMO; |
| | | import com.java110.core.context.DataFlowContext; |
| | | |
| | | public interface ITempCarFeeConfigAttrBMO extends IApiBaseBMO { |
| | | |
| | | |
| | | /** |
| | | * 添加临时车收费标准属性 |
| | | * @param paramInJson |
| | | * @param dataFlowContext |
| | | * @return |
| | | */ |
| | | void addTempCarFeeConfigAttr(JSONObject paramInJson, DataFlowContext dataFlowContext); |
| | | |
| | | /** |
| | | * 添加临时车收费标准属性信息 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | void updateTempCarFeeConfigAttr(JSONObject paramInJson, DataFlowContext dataFlowContext); |
| | | |
| | | /** |
| | | * 删除临时车收费标准属性 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | void deleteTempCarFeeConfigAttr(JSONObject paramInJson, DataFlowContext dataFlowContext); |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.api.bmo.tempCarFeeConfigAttr.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.bmo.ApiBaseBMO; |
| | | import com.java110.api.bmo.tempCarFeeConfigAttr.ITempCarFeeConfigAttrBMO; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.intf.fee.ITempCarFeeConfigAttrInnerServiceSMO; |
| | | import com.java110.po.tempCarFeeConfigAttr.TempCarFeeConfigAttrPo; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("tempCarFeeConfigAttrBMOImpl") |
| | | public class TempCarFeeConfigAttrBMOImpl extends ApiBaseBMO implements ITempCarFeeConfigAttrBMO { |
| | | |
| | | @Autowired |
| | | private ITempCarFeeConfigAttrInnerServiceSMO tempCarFeeConfigAttrInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public void addTempCarFeeConfigAttr(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | paramInJson.put("attrId", "-1"); |
| | | TempCarFeeConfigAttrPo tempCarFeeConfigAttrPo = BeanConvertUtil.covertBean(paramInJson, TempCarFeeConfigAttrPo.class); |
| | | super.insert(dataFlowContext, tempCarFeeConfigAttrPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_TEMP_CAR_FEE_CONFIG_ATTR_INFO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加活动信息 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public void updateTempCarFeeConfigAttr(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | TempCarFeeConfigAttrPo tempCarFeeConfigAttrPo = BeanConvertUtil.covertBean(paramInJson, TempCarFeeConfigAttrPo.class); |
| | | super.update(dataFlowContext, tempCarFeeConfigAttrPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_TEMP_CAR_FEE_CONFIG_ATTR_INFO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public void deleteTempCarFeeConfigAttr(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | TempCarFeeConfigAttrPo tempCarFeeConfigAttrPo = BeanConvertUtil.covertBean(paramInJson, TempCarFeeConfigAttrPo.class); |
| | | super.update(dataFlowContext, tempCarFeeConfigAttrPo, BusinessTypeConstant.BUSINESS_TYPE_DELETE_TEMP_CAR_FEE_CONFIG_ATTR_INFO); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.fee; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.bmo.tempCarFeeConfigAttr.ITempCarFeeConfigAttrBMO; |
| | | import com.java110.api.listener.AbstractServiceApiPlusListener; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.ServiceCodeTempCarFeeConfigAttrConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | |
| | | |
| | | /** |
| | | * 保存小区侦听 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("deleteTempCarFeeConfigAttrListener") |
| | | public class DeleteTempCarFeeConfigAttrListener extends AbstractServiceApiPlusListener { |
| | | |
| | | @Autowired |
| | | private ITempCarFeeConfigAttrBMO tempCarFeeConfigAttrBMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | //Assert.hasKeyAndValue(reqJson, "xxx", "xxx"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "attrId", "attrId不能为空"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | tempCarFeeConfigAttrBMOImpl.deleteTempCarFeeConfigAttr(reqJson, context); |
| | | } |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeTempCarFeeConfigAttrConstant.DELETE_TEMPCARFEECONFIGATTR; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.fee; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.dto.tempCarFeeConfigAttr.TempCarFeeConfigAttrDto; |
| | | import com.java110.intf.fee.ITempCarFeeConfigAttrInnerServiceSMO; |
| | | import com.java110.utils.constant.ServiceCodeTempCarFeeConfigAttrConstant; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 查询小区侦听类 |
| | | */ |
| | | @Java110Listener("listTempCarFeeConfigAttrsListener") |
| | | public class ListTempCarFeeConfigAttrsListener extends AbstractServiceApiListener { |
| | | |
| | | @Autowired |
| | | private ITempCarFeeConfigAttrInnerServiceSMO tempCarFeeConfigAttrInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeTempCarFeeConfigAttrConstant.LIST_TEMPCARFEECONFIGATTRS; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.GET; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | public ITempCarFeeConfigAttrInnerServiceSMO getTempCarFeeConfigAttrInnerServiceSMOImpl() { |
| | | return tempCarFeeConfigAttrInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setTempCarFeeConfigAttrInnerServiceSMOImpl(ITempCarFeeConfigAttrInnerServiceSMO tempCarFeeConfigAttrInnerServiceSMOImpl) { |
| | | this.tempCarFeeConfigAttrInnerServiceSMOImpl = tempCarFeeConfigAttrInnerServiceSMOImpl; |
| | | } |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | super.validatePageInfo(reqJson); |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | TempCarFeeConfigAttrDto tempCarFeeConfigAttrDto = BeanConvertUtil.covertBean(reqJson, TempCarFeeConfigAttrDto.class); |
| | | |
| | | int count = tempCarFeeConfigAttrInnerServiceSMOImpl.queryTempCarFeeConfigAttrsCount(tempCarFeeConfigAttrDto); |
| | | |
| | | List<TempCarFeeConfigAttrDto> tempCarFeeConfigAttrDtos = null; |
| | | |
| | | if (count > 0) { |
| | | tempCarFeeConfigAttrDtos = tempCarFeeConfigAttrInnerServiceSMOImpl.queryTempCarFeeConfigAttrs(tempCarFeeConfigAttrDto); |
| | | } else { |
| | | tempCarFeeConfigAttrDtos = new ArrayList<>(); |
| | | } |
| | | |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, tempCarFeeConfigAttrDtos); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.fee; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.bmo.tempCarFeeConfigAttr.ITempCarFeeConfigAttrBMO; |
| | | import com.java110.api.listener.AbstractServiceApiPlusListener; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.ServiceCodeTempCarFeeConfigAttrConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | |
| | | /** |
| | | * 保存商户侦听 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("saveTempCarFeeConfigAttrListener") |
| | | public class SaveTempCarFeeConfigAttrListener extends AbstractServiceApiPlusListener { |
| | | |
| | | @Autowired |
| | | private ITempCarFeeConfigAttrBMO tempCarFeeConfigAttrBMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | //Assert.hasKeyAndValue(reqJson, "xxx", "xxx"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "configId", "请求报文中未包含configId"); |
| | | Assert.hasKeyAndValue(reqJson, "specCd", "请求报文中未包含specCd"); |
| | | Assert.hasKeyAndValue(reqJson, "value", "请求报文中未包含value"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | tempCarFeeConfigAttrBMOImpl.addTempCarFeeConfigAttr(reqJson, context); |
| | | } |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeTempCarFeeConfigAttrConstant.ADD_TEMPCARFEECONFIGATTR; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.fee; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.bmo.tempCarFeeConfigAttr.ITempCarFeeConfigAttrBMO; |
| | | import com.java110.api.listener.AbstractServiceApiPlusListener; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.ServiceCodeTempCarFeeConfigAttrConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | |
| | | /** |
| | | * 保存临时车收费标准属性侦听 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("updateTempCarFeeConfigAttrListener") |
| | | public class UpdateTempCarFeeConfigAttrListener extends AbstractServiceApiPlusListener { |
| | | |
| | | @Autowired |
| | | private ITempCarFeeConfigAttrBMO tempCarFeeConfigAttrBMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "attrId", "attrId不能为空"); |
| | | Assert.hasKeyAndValue(reqJson, "configId", "请求报文中未包含configId"); |
| | | Assert.hasKeyAndValue(reqJson, "specCd", "请求报文中未包含specCd"); |
| | | Assert.hasKeyAndValue(reqJson, "value", "请求报文中未包含value"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | tempCarFeeConfigAttrBMOImpl.updateTempCarFeeConfigAttr(reqJson, context); |
| | | } |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeTempCarFeeConfigAttrConstant.UPDATE_TEMPCARFEECONFIGATTR; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.fee.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 ITempCarFeeConfigAttrServiceDao { |
| | | |
| | | /** |
| | | * 保存 临时车收费标准属性信息 |
| | | * @param businessTempCarFeeConfigAttrInfo 临时车收费标准属性信息 封装 |
| | | * @throws DAOException 操作数据库异常 |
| | | */ |
| | | void saveBusinessTempCarFeeConfigAttrInfo(Map businessTempCarFeeConfigAttrInfo) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询临时车收费标准属性信息(business过程) |
| | | * 根据bId 查询临时车收费标准属性信息 |
| | | * @param info bId 信息 |
| | | * @return 临时车收费标准属性信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getBusinessTempCarFeeConfigAttrInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存 临时车收费标准属性信息 Business数据到 Instance中 |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void saveTempCarFeeConfigAttrInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询临时车收费标准属性信息(instance过程) |
| | | * 根据bId 查询临时车收费标准属性信息 |
| | | * @param info bId 信息 |
| | | * @return 临时车收费标准属性信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getTempCarFeeConfigAttrInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改临时车收费标准属性信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void updateTempCarFeeConfigAttrInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询临时车收费标准属性总数 |
| | | * |
| | | * @param info 临时车收费标准属性信息 |
| | | * @return 临时车收费标准属性数量 |
| | | */ |
| | | int queryTempCarFeeConfigAttrsCount(Map info); |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.fee.dao.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.core.base.dao.BaseServiceDao; |
| | | import com.java110.fee.dao.ITempCarFeeConfigAttrServiceDao; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 临时车收费标准属性服务 与数据库交互 |
| | | * Created by wuxw on 2017/4/5. |
| | | */ |
| | | @Service("tempCarFeeConfigAttrServiceDaoImpl") |
| | | //@Transactional |
| | | public class TempCarFeeConfigAttrServiceDaoImpl extends BaseServiceDao implements ITempCarFeeConfigAttrServiceDao { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(TempCarFeeConfigAttrServiceDaoImpl.class); |
| | | |
| | | /** |
| | | * 临时车收费标准属性信息封装 |
| | | * @param businessTempCarFeeConfigAttrInfo 临时车收费标准属性信息 封装 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveBusinessTempCarFeeConfigAttrInfo(Map businessTempCarFeeConfigAttrInfo) throws DAOException { |
| | | businessTempCarFeeConfigAttrInfo.put("month", DateUtil.getCurrentMonth()); |
| | | // 查询business_user 数据是否已经存在 |
| | | logger.debug("保存临时车收费标准属性信息 入参 businessTempCarFeeConfigAttrInfo : {}",businessTempCarFeeConfigAttrInfo); |
| | | int saveFlag = sqlSessionTemplate.insert("tempCarFeeConfigAttrServiceDaoImpl.saveBusinessTempCarFeeConfigAttrInfo",businessTempCarFeeConfigAttrInfo); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存临时车收费标准属性数据失败:"+ JSONObject.toJSONString(businessTempCarFeeConfigAttrInfo)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询临时车收费标准属性信息 |
| | | * @param info bId 信息 |
| | | * @return 临时车收费标准属性信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getBusinessTempCarFeeConfigAttrInfo(Map info) throws DAOException { |
| | | |
| | | logger.debug("查询临时车收费标准属性信息 入参 info : {}",info); |
| | | |
| | | List<Map> businessTempCarFeeConfigAttrInfos = sqlSessionTemplate.selectList("tempCarFeeConfigAttrServiceDaoImpl.getBusinessTempCarFeeConfigAttrInfo",info); |
| | | |
| | | return businessTempCarFeeConfigAttrInfos; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存临时车收费标准属性信息 到 instance |
| | | * @param info bId 信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveTempCarFeeConfigAttrInfoInstance(Map info) throws DAOException { |
| | | logger.debug("保存临时车收费标准属性信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("tempCarFeeConfigAttrServiceDaoImpl.saveTempCarFeeConfigAttrInfoInstance",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> getTempCarFeeConfigAttrInfo(Map info) throws DAOException { |
| | | logger.debug("查询临时车收费标准属性信息 入参 info : {}",info); |
| | | |
| | | List<Map> businessTempCarFeeConfigAttrInfos = sqlSessionTemplate.selectList("tempCarFeeConfigAttrServiceDaoImpl.getTempCarFeeConfigAttrInfo",info); |
| | | |
| | | return businessTempCarFeeConfigAttrInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改临时车收费标准属性信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void updateTempCarFeeConfigAttrInfoInstance(Map info) throws DAOException { |
| | | logger.debug("修改临时车收费标准属性信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("tempCarFeeConfigAttrServiceDaoImpl.updateTempCarFeeConfigAttrInfoInstance",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改临时车收费标准属性信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询临时车收费标准属性数量 |
| | | * @param info 临时车收费标准属性信息 |
| | | * @return 临时车收费标准属性数量 |
| | | */ |
| | | @Override |
| | | public int queryTempCarFeeConfigAttrsCount(Map info) { |
| | | logger.debug("查询临时车收费标准属性数据 入参 info : {}",info); |
| | | |
| | | List<Map> businessTempCarFeeConfigAttrInfos = sqlSessionTemplate.selectList("tempCarFeeConfigAttrServiceDaoImpl.queryTempCarFeeConfigAttrsCount", info); |
| | | if (businessTempCarFeeConfigAttrInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessTempCarFeeConfigAttrInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.fee.listener.tempCarFeeConfigAttr; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.event.service.AbstractBusinessServiceDataFlowListener; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.fee.dao.ITempCarFeeConfigAttrServiceDao; |
| | | 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 AbstractTempCarFeeConfigAttrBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener { |
| | | private static Logger logger = LoggerFactory.getLogger(AbstractTempCarFeeConfigAttrBusinessServiceDataFlowListener.class); |
| | | |
| | | |
| | | /** |
| | | * 获取 DAO工具类 |
| | | * |
| | | * @return |
| | | */ |
| | | public abstract ITempCarFeeConfigAttrServiceDao getTempCarFeeConfigAttrServiceDaoImpl(); |
| | | |
| | | /** |
| | | * 刷新 businessTempCarFeeConfigAttrInfo 数据 |
| | | * 主要将 数据库 中字段和 接口传递字段建立关系 |
| | | * |
| | | * @param businessTempCarFeeConfigAttrInfo |
| | | */ |
| | | protected void flushBusinessTempCarFeeConfigAttrInfo(Map businessTempCarFeeConfigAttrInfo, String statusCd) { |
| | | businessTempCarFeeConfigAttrInfo.put("newBId", businessTempCarFeeConfigAttrInfo.get("b_id")); |
| | | businessTempCarFeeConfigAttrInfo.put("attrId", businessTempCarFeeConfigAttrInfo.get("attr_id")); |
| | | businessTempCarFeeConfigAttrInfo.put("operate", businessTempCarFeeConfigAttrInfo.get("operate")); |
| | | businessTempCarFeeConfigAttrInfo.put("createTime", businessTempCarFeeConfigAttrInfo.get("create_time")); |
| | | businessTempCarFeeConfigAttrInfo.put("configId", businessTempCarFeeConfigAttrInfo.get("config_id")); |
| | | businessTempCarFeeConfigAttrInfo.put("specCd", businessTempCarFeeConfigAttrInfo.get("spec_cd")); |
| | | businessTempCarFeeConfigAttrInfo.put("value", businessTempCarFeeConfigAttrInfo.get("value")); |
| | | businessTempCarFeeConfigAttrInfo.remove("bId"); |
| | | businessTempCarFeeConfigAttrInfo.put("statusCd", statusCd); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中 |
| | | * |
| | | * @param businessTempCarFeeConfigAttr 临时车收费标准属性信息 |
| | | */ |
| | | protected void autoSaveDelBusinessTempCarFeeConfigAttr(Business business, JSONObject businessTempCarFeeConfigAttr) { |
| | | //自动插入DEL |
| | | Map info = new HashMap(); |
| | | info.put("attrId", businessTempCarFeeConfigAttr.getString("attrId")); |
| | | info.put("statusCd", StatusConstant.STATUS_CD_VALID); |
| | | List<Map> currentTempCarFeeConfigAttrInfos = getTempCarFeeConfigAttrServiceDaoImpl().getTempCarFeeConfigAttrInfo(info); |
| | | if (currentTempCarFeeConfigAttrInfos == null || currentTempCarFeeConfigAttrInfos.size() != 1) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "未找到需要修改数据信息,入参错误或数据有问题,请检查" + info); |
| | | } |
| | | |
| | | Map currentTempCarFeeConfigAttrInfo = currentTempCarFeeConfigAttrInfos.get(0); |
| | | |
| | | currentTempCarFeeConfigAttrInfo.put("bId", business.getbId()); |
| | | |
| | | currentTempCarFeeConfigAttrInfo.put("attrId", currentTempCarFeeConfigAttrInfo.get("attr_id")); |
| | | currentTempCarFeeConfigAttrInfo.put("operate", currentTempCarFeeConfigAttrInfo.get("operate")); |
| | | currentTempCarFeeConfigAttrInfo.put("createTime", currentTempCarFeeConfigAttrInfo.get("create_time")); |
| | | currentTempCarFeeConfigAttrInfo.put("configId", currentTempCarFeeConfigAttrInfo.get("config_id")); |
| | | currentTempCarFeeConfigAttrInfo.put("specCd", currentTempCarFeeConfigAttrInfo.get("spec_cd")); |
| | | currentTempCarFeeConfigAttrInfo.put("value", currentTempCarFeeConfigAttrInfo.get("value")); |
| | | |
| | | |
| | | currentTempCarFeeConfigAttrInfo.put("operate", StatusConstant.OPERATE_DEL); |
| | | getTempCarFeeConfigAttrServiceDaoImpl().saveBusinessTempCarFeeConfigAttrInfo(currentTempCarFeeConfigAttrInfo); |
| | | for (Object key : currentTempCarFeeConfigAttrInfo.keySet()) { |
| | | if (businessTempCarFeeConfigAttr.get(key) == null) { |
| | | businessTempCarFeeConfigAttr.put(key.toString(), currentTempCarFeeConfigAttrInfo.get(key)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.fee.listener.tempCarFeeConfigAttr; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.po.tempCarFeeConfigAttr.TempCarFeeConfigAttrPo; |
| | | 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 com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.fee.dao.ITempCarFeeConfigAttrServiceDao; |
| | | 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; |
| | | |
| | | /** |
| | | * 删除临时车收费标准属性信息 侦听 |
| | | * |
| | | * 处理节点 |
| | | * 1、businessTempCarFeeConfigAttr:{} 临时车收费标准属性基本信息节点 |
| | | * 2、businessTempCarFeeConfigAttrAttr:[{}] 临时车收费标准属性属性信息节点 |
| | | * 3、businessTempCarFeeConfigAttrPhoto:[{}] 临时车收费标准属性照片信息节点 |
| | | * 4、businessTempCarFeeConfigAttrCerdentials:[{}] 临时车收费标准属性证件信息节点 |
| | | * 协议地址 :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("deleteTempCarFeeConfigAttrInfoListener") |
| | | @Transactional |
| | | public class DeleteTempCarFeeConfigAttrInfoListener extends AbstractTempCarFeeConfigAttrBusinessServiceDataFlowListener { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(DeleteTempCarFeeConfigAttrInfoListener.class); |
| | | @Autowired |
| | | ITempCarFeeConfigAttrServiceDao tempCarFeeConfigAttrServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 3; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_DELETE_TEMP_CAR_FEE_CONFIG_ATTR_INFO; |
| | | } |
| | | |
| | | /** |
| | | * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | JSONObject data = business.getDatas(); |
| | | |
| | | Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessTempCarFeeConfigAttr 节点 |
| | | if(data.containsKey(TempCarFeeConfigAttrPo.class.getSimpleName())){ |
| | | Object _obj = data.get(TempCarFeeConfigAttrPo.class.getSimpleName()); |
| | | JSONArray businessTempCarFeeConfigAttrs = null; |
| | | if(_obj instanceof JSONObject){ |
| | | businessTempCarFeeConfigAttrs = new JSONArray(); |
| | | businessTempCarFeeConfigAttrs.add(_obj); |
| | | }else { |
| | | businessTempCarFeeConfigAttrs = (JSONArray)_obj; |
| | | } |
| | | //JSONObject businessTempCarFeeConfigAttr = data.getJSONObject(TempCarFeeConfigAttrPo.class.getSimpleName()); |
| | | for (int _tempCarFeeConfigAttrIndex = 0; _tempCarFeeConfigAttrIndex < businessTempCarFeeConfigAttrs.size();_tempCarFeeConfigAttrIndex++) { |
| | | JSONObject businessTempCarFeeConfigAttr = businessTempCarFeeConfigAttrs.getJSONObject(_tempCarFeeConfigAttrIndex); |
| | | doBusinessTempCarFeeConfigAttr(business, businessTempCarFeeConfigAttr); |
| | | if(_obj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("attrId", businessTempCarFeeConfigAttr.getString("attrId")); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 删除 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> businessTempCarFeeConfigAttrInfos = tempCarFeeConfigAttrServiceDaoImpl.getBusinessTempCarFeeConfigAttrInfo(info); |
| | | if( businessTempCarFeeConfigAttrInfos != null && businessTempCarFeeConfigAttrInfos.size() >0) { |
| | | for (int _tempCarFeeConfigAttrIndex = 0; _tempCarFeeConfigAttrIndex < businessTempCarFeeConfigAttrInfos.size();_tempCarFeeConfigAttrIndex++) { |
| | | Map businessTempCarFeeConfigAttrInfo = businessTempCarFeeConfigAttrInfos.get(_tempCarFeeConfigAttrIndex); |
| | | flushBusinessTempCarFeeConfigAttrInfo(businessTempCarFeeConfigAttrInfo,StatusConstant.STATUS_CD_INVALID); |
| | | tempCarFeeConfigAttrServiceDaoImpl.updateTempCarFeeConfigAttrInfoInstance(businessTempCarFeeConfigAttrInfo); |
| | | dataFlowContext.addParamOut("attrId",businessTempCarFeeConfigAttrInfo.get("attr_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> tempCarFeeConfigAttrInfo = tempCarFeeConfigAttrServiceDaoImpl.getTempCarFeeConfigAttrInfo(info); |
| | | if(tempCarFeeConfigAttrInfo != null && tempCarFeeConfigAttrInfo.size() > 0){ |
| | | |
| | | //临时车收费标准属性信息 |
| | | List<Map> businessTempCarFeeConfigAttrInfos = tempCarFeeConfigAttrServiceDaoImpl.getBusinessTempCarFeeConfigAttrInfo(delInfo); |
| | | //除非程序出错了,这里不会为空 |
| | | if(businessTempCarFeeConfigAttrInfos == null || businessTempCarFeeConfigAttrInfos.size() == 0){ |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(tempCarFeeConfigAttr),程序内部异常,请检查! "+delInfo); |
| | | } |
| | | for (int _tempCarFeeConfigAttrIndex = 0; _tempCarFeeConfigAttrIndex < businessTempCarFeeConfigAttrInfos.size();_tempCarFeeConfigAttrIndex++) { |
| | | Map businessTempCarFeeConfigAttrInfo = businessTempCarFeeConfigAttrInfos.get(_tempCarFeeConfigAttrIndex); |
| | | flushBusinessTempCarFeeConfigAttrInfo(businessTempCarFeeConfigAttrInfo,StatusConstant.STATUS_CD_VALID); |
| | | tempCarFeeConfigAttrServiceDaoImpl.updateTempCarFeeConfigAttrInfoInstance(businessTempCarFeeConfigAttrInfo); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 处理 businessTempCarFeeConfigAttr 节点 |
| | | * @param business 总的数据节点 |
| | | * @param businessTempCarFeeConfigAttr 临时车收费标准属性节点 |
| | | */ |
| | | private void doBusinessTempCarFeeConfigAttr(Business business,JSONObject businessTempCarFeeConfigAttr){ |
| | | |
| | | Assert.jsonObjectHaveKey(businessTempCarFeeConfigAttr,"attrId","businessTempCarFeeConfigAttr 节点下没有包含 attrId 节点"); |
| | | |
| | | if(businessTempCarFeeConfigAttr.getString("attrId").startsWith("-")){ |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"attrId 错误,不能自动生成(必须已经存在的attrId)"+businessTempCarFeeConfigAttr); |
| | | } |
| | | //自动插入DEL |
| | | autoSaveDelBusinessTempCarFeeConfigAttr(business,businessTempCarFeeConfigAttr); |
| | | } |
| | | @Override |
| | | public ITempCarFeeConfigAttrServiceDao getTempCarFeeConfigAttrServiceDaoImpl() { |
| | | return tempCarFeeConfigAttrServiceDaoImpl; |
| | | } |
| | | |
| | | public void setTempCarFeeConfigAttrServiceDaoImpl(ITempCarFeeConfigAttrServiceDao tempCarFeeConfigAttrServiceDaoImpl) { |
| | | this.tempCarFeeConfigAttrServiceDaoImpl = tempCarFeeConfigAttrServiceDaoImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.fee.listener.tempCarFeeConfigAttr; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.po.tempCarFeeConfigAttr.TempCarFeeConfigAttrPo; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.StatusConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.fee.dao.ITempCarFeeConfigAttrServiceDao; |
| | | 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 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("saveTempCarFeeConfigAttrInfoListener") |
| | | @Transactional |
| | | public class SaveTempCarFeeConfigAttrInfoListener extends AbstractTempCarFeeConfigAttrBusinessServiceDataFlowListener{ |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(SaveTempCarFeeConfigAttrInfoListener.class); |
| | | |
| | | @Autowired |
| | | private ITempCarFeeConfigAttrServiceDao tempCarFeeConfigAttrServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_SAVE_TEMP_CAR_FEE_CONFIG_ATTR_INFO; |
| | | } |
| | | |
| | | /** |
| | | * 保存临时车收费标准属性信息 business 表中 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | JSONObject data = business.getDatas(); |
| | | Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessTempCarFeeConfigAttr 节点 |
| | | if(data.containsKey(TempCarFeeConfigAttrPo.class.getSimpleName())){ |
| | | Object bObj = data.get(TempCarFeeConfigAttrPo.class.getSimpleName()); |
| | | JSONArray businessTempCarFeeConfigAttrs = null; |
| | | if(bObj instanceof JSONObject){ |
| | | businessTempCarFeeConfigAttrs = new JSONArray(); |
| | | businessTempCarFeeConfigAttrs.add(bObj); |
| | | }else { |
| | | businessTempCarFeeConfigAttrs = (JSONArray)bObj; |
| | | } |
| | | //JSONObject businessTempCarFeeConfigAttr = data.getJSONObject(TempCarFeeConfigAttrPo.class.getSimpleName()); |
| | | for (int bTempCarFeeConfigAttrIndex = 0; bTempCarFeeConfigAttrIndex < businessTempCarFeeConfigAttrs.size();bTempCarFeeConfigAttrIndex++) { |
| | | JSONObject businessTempCarFeeConfigAttr = businessTempCarFeeConfigAttrs.getJSONObject(bTempCarFeeConfigAttrIndex); |
| | | doBusinessTempCarFeeConfigAttr(business, businessTempCarFeeConfigAttr); |
| | | if(bObj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("attrId", businessTempCarFeeConfigAttr.getString("attrId")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 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> businessTempCarFeeConfigAttrInfo = tempCarFeeConfigAttrServiceDaoImpl.getBusinessTempCarFeeConfigAttrInfo(info); |
| | | if( businessTempCarFeeConfigAttrInfo != null && businessTempCarFeeConfigAttrInfo.size() >0) { |
| | | reFreshShareColumn(info, businessTempCarFeeConfigAttrInfo.get(0)); |
| | | tempCarFeeConfigAttrServiceDaoImpl.saveTempCarFeeConfigAttrInfoInstance(info); |
| | | if(businessTempCarFeeConfigAttrInfo.size() == 1) { |
| | | dataFlowContext.addParamOut("attrId", businessTempCarFeeConfigAttrInfo.get(0).get("attr_id")); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 刷 分片字段 |
| | | * |
| | | * @param info 查询对象 |
| | | * @param businessInfo 小区ID |
| | | */ |
| | | private void reFreshShareColumn(Map info, Map businessInfo) { |
| | | |
| | | if (info.containsKey("config_id")) { |
| | | return; |
| | | } |
| | | |
| | | if (!businessInfo.containsKey("configId")) { |
| | | return; |
| | | } |
| | | |
| | | info.put("config_id", businessInfo.get("configId")); |
| | | } |
| | | /** |
| | | * 撤单 |
| | | * @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> tempCarFeeConfigAttrInfo = tempCarFeeConfigAttrServiceDaoImpl.getTempCarFeeConfigAttrInfo(info); |
| | | if(tempCarFeeConfigAttrInfo != null && tempCarFeeConfigAttrInfo.size() > 0){ |
| | | reFreshShareColumn(paramIn, tempCarFeeConfigAttrInfo.get(0)); |
| | | tempCarFeeConfigAttrServiceDaoImpl.updateTempCarFeeConfigAttrInfoInstance(paramIn); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 处理 businessTempCarFeeConfigAttr 节点 |
| | | * @param business 总的数据节点 |
| | | * @param businessTempCarFeeConfigAttr 临时车收费标准属性节点 |
| | | */ |
| | | private void doBusinessTempCarFeeConfigAttr(Business business,JSONObject businessTempCarFeeConfigAttr){ |
| | | |
| | | Assert.jsonObjectHaveKey(businessTempCarFeeConfigAttr,"attrId","businessTempCarFeeConfigAttr 节点下没有包含 attrId 节点"); |
| | | |
| | | if(businessTempCarFeeConfigAttr.getString("attrId").startsWith("-")){ |
| | | //刷新缓存 |
| | | //flushTempCarFeeConfigAttrId(business.getDatas()); |
| | | |
| | | businessTempCarFeeConfigAttr.put("attrId",GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId)); |
| | | |
| | | } |
| | | |
| | | businessTempCarFeeConfigAttr.put("bId",business.getbId()); |
| | | businessTempCarFeeConfigAttr.put("operate", StatusConstant.OPERATE_ADD); |
| | | //保存临时车收费标准属性信息 |
| | | tempCarFeeConfigAttrServiceDaoImpl.saveBusinessTempCarFeeConfigAttrInfo(businessTempCarFeeConfigAttr); |
| | | |
| | | } |
| | | @Override |
| | | public ITempCarFeeConfigAttrServiceDao getTempCarFeeConfigAttrServiceDaoImpl() { |
| | | return tempCarFeeConfigAttrServiceDaoImpl; |
| | | } |
| | | |
| | | public void setTempCarFeeConfigAttrServiceDaoImpl(ITempCarFeeConfigAttrServiceDao tempCarFeeConfigAttrServiceDaoImpl) { |
| | | this.tempCarFeeConfigAttrServiceDaoImpl = tempCarFeeConfigAttrServiceDaoImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.fee.listener.tempCarFeeConfigAttr; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.po.tempCarFeeConfigAttr.TempCarFeeConfigAttrPo; |
| | | 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 com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.fee.dao.ITempCarFeeConfigAttrServiceDao; |
| | | 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; |
| | | |
| | | /** |
| | | * 修改临时车收费标准属性信息 侦听 |
| | | * |
| | | * 处理节点 |
| | | * 1、businessTempCarFeeConfigAttr:{} 临时车收费标准属性基本信息节点 |
| | | * 2、businessTempCarFeeConfigAttrAttr:[{}] 临时车收费标准属性属性信息节点 |
| | | * 3、businessTempCarFeeConfigAttrPhoto:[{}] 临时车收费标准属性照片信息节点 |
| | | * 4、businessTempCarFeeConfigAttrCerdentials:[{}] 临时车收费标准属性证件信息节点 |
| | | * 协议地址 :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("updateTempCarFeeConfigAttrInfoListener") |
| | | @Transactional |
| | | public class UpdateTempCarFeeConfigAttrInfoListener extends AbstractTempCarFeeConfigAttrBusinessServiceDataFlowListener { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(UpdateTempCarFeeConfigAttrInfoListener.class); |
| | | @Autowired |
| | | private ITempCarFeeConfigAttrServiceDao tempCarFeeConfigAttrServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 2; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_TEMP_CAR_FEE_CONFIG_ATTR_INFO; |
| | | } |
| | | |
| | | /** |
| | | * business过程 |
| | | * @param dataFlowContext 上下文对象 |
| | | * @param business 业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | |
| | | JSONObject data = business.getDatas(); |
| | | |
| | | Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | |
| | | //处理 businessTempCarFeeConfigAttr 节点 |
| | | if(data.containsKey(TempCarFeeConfigAttrPo.class.getSimpleName())){ |
| | | Object _obj = data.get(TempCarFeeConfigAttrPo.class.getSimpleName()); |
| | | JSONArray businessTempCarFeeConfigAttrs = null; |
| | | if(_obj instanceof JSONObject){ |
| | | businessTempCarFeeConfigAttrs = new JSONArray(); |
| | | businessTempCarFeeConfigAttrs.add(_obj); |
| | | }else { |
| | | businessTempCarFeeConfigAttrs = (JSONArray)_obj; |
| | | } |
| | | //JSONObject businessTempCarFeeConfigAttr = data.getJSONObject(TempCarFeeConfigAttrPo.class.getSimpleName()); |
| | | for (int _tempCarFeeConfigAttrIndex = 0; _tempCarFeeConfigAttrIndex < businessTempCarFeeConfigAttrs.size();_tempCarFeeConfigAttrIndex++) { |
| | | JSONObject businessTempCarFeeConfigAttr = businessTempCarFeeConfigAttrs.getJSONObject(_tempCarFeeConfigAttrIndex); |
| | | doBusinessTempCarFeeConfigAttr(business, businessTempCarFeeConfigAttr); |
| | | if(_obj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("attrId", businessTempCarFeeConfigAttr.getString("attrId")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 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> businessTempCarFeeConfigAttrInfos = tempCarFeeConfigAttrServiceDaoImpl.getBusinessTempCarFeeConfigAttrInfo(info); |
| | | if( businessTempCarFeeConfigAttrInfos != null && businessTempCarFeeConfigAttrInfos.size() >0) { |
| | | for (int _tempCarFeeConfigAttrIndex = 0; _tempCarFeeConfigAttrIndex < businessTempCarFeeConfigAttrInfos.size();_tempCarFeeConfigAttrIndex++) { |
| | | Map businessTempCarFeeConfigAttrInfo = businessTempCarFeeConfigAttrInfos.get(_tempCarFeeConfigAttrIndex); |
| | | flushBusinessTempCarFeeConfigAttrInfo(businessTempCarFeeConfigAttrInfo,StatusConstant.STATUS_CD_VALID); |
| | | tempCarFeeConfigAttrServiceDaoImpl.updateTempCarFeeConfigAttrInfoInstance(businessTempCarFeeConfigAttrInfo); |
| | | if(businessTempCarFeeConfigAttrInfo.size() == 1) { |
| | | dataFlowContext.addParamOut("attrId", businessTempCarFeeConfigAttrInfo.get("attr_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> tempCarFeeConfigAttrInfo = tempCarFeeConfigAttrServiceDaoImpl.getTempCarFeeConfigAttrInfo(info); |
| | | if(tempCarFeeConfigAttrInfo != null && tempCarFeeConfigAttrInfo.size() > 0){ |
| | | |
| | | //临时车收费标准属性信息 |
| | | List<Map> businessTempCarFeeConfigAttrInfos = tempCarFeeConfigAttrServiceDaoImpl.getBusinessTempCarFeeConfigAttrInfo(delInfo); |
| | | //除非程序出错了,这里不会为空 |
| | | if(businessTempCarFeeConfigAttrInfos == null || businessTempCarFeeConfigAttrInfos.size() == 0){ |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(tempCarFeeConfigAttr),程序内部异常,请检查! "+delInfo); |
| | | } |
| | | for (int _tempCarFeeConfigAttrIndex = 0; _tempCarFeeConfigAttrIndex < businessTempCarFeeConfigAttrInfos.size();_tempCarFeeConfigAttrIndex++) { |
| | | Map businessTempCarFeeConfigAttrInfo = businessTempCarFeeConfigAttrInfos.get(_tempCarFeeConfigAttrIndex); |
| | | flushBusinessTempCarFeeConfigAttrInfo(businessTempCarFeeConfigAttrInfo,StatusConstant.STATUS_CD_VALID); |
| | | tempCarFeeConfigAttrServiceDaoImpl.updateTempCarFeeConfigAttrInfoInstance(businessTempCarFeeConfigAttrInfo); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 处理 businessTempCarFeeConfigAttr 节点 |
| | | * @param business 总的数据节点 |
| | | * @param businessTempCarFeeConfigAttr 临时车收费标准属性节点 |
| | | */ |
| | | private void doBusinessTempCarFeeConfigAttr(Business business,JSONObject businessTempCarFeeConfigAttr){ |
| | | |
| | | Assert.jsonObjectHaveKey(businessTempCarFeeConfigAttr,"attrId","businessTempCarFeeConfigAttr 节点下没有包含 attrId 节点"); |
| | | |
| | | if(businessTempCarFeeConfigAttr.getString("attrId").startsWith("-")){ |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"attrId 错误,不能自动生成(必须已经存在的attrId)"+businessTempCarFeeConfigAttr); |
| | | } |
| | | //自动保存DEL |
| | | autoSaveDelBusinessTempCarFeeConfigAttr(business,businessTempCarFeeConfigAttr); |
| | | |
| | | businessTempCarFeeConfigAttr.put("bId",business.getbId()); |
| | | businessTempCarFeeConfigAttr.put("operate", StatusConstant.OPERATE_ADD); |
| | | //保存临时车收费标准属性信息 |
| | | tempCarFeeConfigAttrServiceDaoImpl.saveBusinessTempCarFeeConfigAttrInfo(businessTempCarFeeConfigAttr); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public ITempCarFeeConfigAttrServiceDao getTempCarFeeConfigAttrServiceDaoImpl() { |
| | | return tempCarFeeConfigAttrServiceDaoImpl; |
| | | } |
| | | |
| | | public void setTempCarFeeConfigAttrServiceDaoImpl(ITempCarFeeConfigAttrServiceDao tempCarFeeConfigAttrServiceDaoImpl) { |
| | | this.tempCarFeeConfigAttrServiceDaoImpl = tempCarFeeConfigAttrServiceDaoImpl; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.fee.smo.impl; |
| | | |
| | | |
| | | import com.java110.fee.dao.ITempCarFeeConfigAttrServiceDao; |
| | | import com.java110.intf.fee.ITempCarFeeConfigAttrInnerServiceSMO; |
| | | import com.java110.dto.tempCarFeeConfigAttr.TempCarFeeConfigAttrDto; |
| | | import com.java110.intf.user.IUserInnerServiceSMO; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.dto.PageDto; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName FloorInnerServiceSMOImpl |
| | | * @Description 临时车收费标准属性内部服务实现类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:20 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @RestController |
| | | public class TempCarFeeConfigAttrInnerServiceSMOImpl extends BaseServiceSMO implements ITempCarFeeConfigAttrInnerServiceSMO { |
| | | |
| | | @Autowired |
| | | private ITempCarFeeConfigAttrServiceDao tempCarFeeConfigAttrServiceDaoImpl; |
| | | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public List<TempCarFeeConfigAttrDto> queryTempCarFeeConfigAttrs(@RequestBody TempCarFeeConfigAttrDto tempCarFeeConfigAttrDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = tempCarFeeConfigAttrDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | tempCarFeeConfigAttrDto.setPage((page - 1) * tempCarFeeConfigAttrDto.getRow()); |
| | | } |
| | | |
| | | List<TempCarFeeConfigAttrDto> tempCarFeeConfigAttrs = BeanConvertUtil.covertBeanList(tempCarFeeConfigAttrServiceDaoImpl.getTempCarFeeConfigAttrInfo(BeanConvertUtil.beanCovertMap(tempCarFeeConfigAttrDto)), TempCarFeeConfigAttrDto.class); |
| | | |
| | | if (tempCarFeeConfigAttrs == null || tempCarFeeConfigAttrs.size() == 0) { |
| | | return tempCarFeeConfigAttrs; |
| | | } |
| | | |
| | | String[] userIds = getUserIds(tempCarFeeConfigAttrs); |
| | | //根据 userId 查询用户信息 |
| | | List<UserDto> users = userInnerServiceSMOImpl.getUserInfo(userIds); |
| | | |
| | | for (TempCarFeeConfigAttrDto tempCarFeeConfigAttr : tempCarFeeConfigAttrs) { |
| | | refreshTempCarFeeConfigAttr(tempCarFeeConfigAttr, users); |
| | | } |
| | | return tempCarFeeConfigAttrs; |
| | | } |
| | | |
| | | /** |
| | | * 从用户列表中查询用户,将用户中的信息 刷新到 floor对象中 |
| | | * |
| | | * @param tempCarFeeConfigAttr 小区临时车收费标准属性信息 |
| | | * @param users 用户列表 |
| | | */ |
| | | private void refreshTempCarFeeConfigAttr(TempCarFeeConfigAttrDto tempCarFeeConfigAttr, List<UserDto> users) { |
| | | for (UserDto user : users) { |
| | | if (tempCarFeeConfigAttr.getAttrId().equals(user.getUserId())) { |
| | | BeanConvertUtil.covertBean(user, tempCarFeeConfigAttr); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取批量userId |
| | | * |
| | | * @param tempCarFeeConfigAttrs 小区楼信息 |
| | | * @return 批量userIds 信息 |
| | | */ |
| | | private String[] getUserIds(List<TempCarFeeConfigAttrDto> tempCarFeeConfigAttrs) { |
| | | List<String> userIds = new ArrayList<String>(); |
| | | for (TempCarFeeConfigAttrDto tempCarFeeConfigAttr : tempCarFeeConfigAttrs) { |
| | | userIds.add(tempCarFeeConfigAttr.getAttrId()); |
| | | } |
| | | |
| | | return userIds.toArray(new String[userIds.size()]); |
| | | } |
| | | |
| | | @Override |
| | | public int queryTempCarFeeConfigAttrsCount(@RequestBody TempCarFeeConfigAttrDto tempCarFeeConfigAttrDto) { |
| | | return tempCarFeeConfigAttrServiceDaoImpl.queryTempCarFeeConfigAttrsCount(BeanConvertUtil.beanCovertMap(tempCarFeeConfigAttrDto)); } |
| | | |
| | | public ITempCarFeeConfigAttrServiceDao getTempCarFeeConfigAttrServiceDaoImpl() { |
| | | return tempCarFeeConfigAttrServiceDaoImpl; |
| | | } |
| | | |
| | | public void setTempCarFeeConfigAttrServiceDaoImpl(ITempCarFeeConfigAttrServiceDao tempCarFeeConfigAttrServiceDaoImpl) { |
| | | this.tempCarFeeConfigAttrServiceDaoImpl = tempCarFeeConfigAttrServiceDaoImpl; |
| | | } |
| | | |
| | | public IUserInnerServiceSMO getUserInnerServiceSMOImpl() { |
| | | return userInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) { |
| | | this.userInnerServiceSMOImpl = userInnerServiceSMOImpl; |
| | | } |
| | | } |