| New file |
| | |
| | | package com.java110.store.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 IResourceStoreServiceDao { |
| | | |
| | | /** |
| | | * 保存 资源信息 |
| | | * @param businessResourceStoreInfo 资源信息 封装 |
| | | * @throws DAOException 操作数据库异常 |
| | | */ |
| | | void saveBusinessResourceStoreInfo(Map businessResourceStoreInfo) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询资源信息(business过程) |
| | | * 根据bId 查询资源信息 |
| | | * @param info bId 信息 |
| | | * @return 资源信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getBusinessResourceStoreInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存 资源信息 Business数据到 Instance中 |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void saveResourceStoreInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询资源信息(instance过程) |
| | | * 根据bId 查询资源信息 |
| | | * @param info bId 信息 |
| | | * @return 资源信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getResourceStoreInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改资源信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void updateResourceStoreInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询资源总数 |
| | | * |
| | | * @param info 资源信息 |
| | | * @return 资源数量 |
| | | */ |
| | | int queryResourceStoresCount(Map info); |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.dao.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.base.dao.BaseServiceDao; |
| | | import com.java110.store.dao.IResourceStoreServiceDao; |
| | | 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("resourceResourceStoreServiceDaoImpl") |
| | | //@Transactional |
| | | public class ResourceStoreServiceDaoImpl extends BaseServiceDao implements IResourceStoreServiceDao { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(ResourceStoreServiceDaoImpl.class); |
| | | |
| | | /** |
| | | * 资源信息封装 |
| | | * |
| | | * @param businessResourceStoreInfo 资源信息 封装 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveBusinessResourceStoreInfo(Map businessResourceStoreInfo) throws DAOException { |
| | | businessResourceStoreInfo.put("month", DateUtil.getCurrentMonth()); |
| | | // 查询business_user 数据是否已经存在 |
| | | logger.debug("保存资源信息 入参 businessResourceStoreInfo : {}", businessResourceStoreInfo); |
| | | int saveFlag = sqlSessionTemplate.insert("resourceResourceStoreServiceDaoImpl.saveBusinessResourceStoreInfo", businessResourceStoreInfo); |
| | | |
| | | if (saveFlag < 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存资源数据失败:" + JSONObject.toJSONString(businessResourceStoreInfo)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询资源信息 |
| | | * |
| | | * @param info bId 信息 |
| | | * @return 资源信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getBusinessResourceStoreInfo(Map info) throws DAOException { |
| | | |
| | | logger.debug("查询资源信息 入参 info : {}", info); |
| | | |
| | | List<Map> businessResourceStoreInfos = sqlSessionTemplate.selectList("resourceResourceStoreServiceDaoImpl.getBusinessResourceStoreInfo", info); |
| | | |
| | | return businessResourceStoreInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存资源信息 到 instance |
| | | * |
| | | * @param info bId 信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveResourceStoreInfoInstance(Map info) throws DAOException { |
| | | logger.debug("保存资源信息Instance 入参 info : {}", info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("resourceResourceStoreServiceDaoImpl.saveResourceStoreInfoInstance", 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> getResourceStoreInfo(Map info) throws DAOException { |
| | | logger.debug("查询资源信息 入参 info : {}", info); |
| | | |
| | | List<Map> businessResourceStoreInfos = sqlSessionTemplate.selectList("resourceResourceStoreServiceDaoImpl.getResourceStoreInfo", info); |
| | | |
| | | return businessResourceStoreInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改资源信息 |
| | | * |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void updateResourceStoreInfoInstance(Map info) throws DAOException { |
| | | logger.debug("修改资源信息Instance 入参 info : {}", info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("resourceResourceStoreServiceDaoImpl.updateResourceStoreInfoInstance", info); |
| | | |
| | | if (saveFlag < 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改资源信息Instance数据失败:" + JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询资源数量 |
| | | * |
| | | * @param info 资源信息 |
| | | * @return 资源数量 |
| | | */ |
| | | @Override |
| | | public int queryResourceStoresCount(Map info) { |
| | | logger.debug("查询资源数据 入参 info : {}", info); |
| | | |
| | | List<Map> businessResourceStoreInfos = sqlSessionTemplate.selectList("resourceResourceStoreServiceDaoImpl.queryResourceStoresCount", info); |
| | | if (businessResourceStoreInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessResourceStoreInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.listener.resourceStore; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.event.service.AbstractBusinessServiceDataFlowListener; |
| | | import com.java110.store.dao.IResourceStoreServiceDao; |
| | | 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 AbstractResourceStoreBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener { |
| | | private static Logger logger = LoggerFactory.getLogger(AbstractResourceStoreBusinessServiceDataFlowListener.class); |
| | | |
| | | |
| | | /** |
| | | * 获取 DAO工具类 |
| | | * |
| | | * @return |
| | | */ |
| | | public abstract IResourceStoreServiceDao getResourceStoreServiceDaoImpl(); |
| | | |
| | | /** |
| | | * 刷新 businessResourceStoreInfo 数据 |
| | | * 主要将 数据库 中字段和 接口传递字段建立关系 |
| | | * |
| | | * @param businessResourceStoreInfo |
| | | */ |
| | | protected void flushBusinessResourceStoreInfo(Map businessResourceStoreInfo, String statusCd) { |
| | | businessResourceStoreInfo.put("newBId", businessResourceStoreInfo.get("b_id")); |
| | | businessResourceStoreInfo.put("resName", businessResourceStoreInfo.get("res_name")); |
| | | businessResourceStoreInfo.put("operate", businessResourceStoreInfo.get("operate")); |
| | | businessResourceStoreInfo.put("price", businessResourceStoreInfo.get("price")); |
| | | businessResourceStoreInfo.put("resCode", businessResourceStoreInfo.get("res_code")); |
| | | businessResourceStoreInfo.put("description", businessResourceStoreInfo.get("description")); |
| | | businessResourceStoreInfo.put("storeId", businessResourceStoreInfo.get("store_id")); |
| | | businessResourceStoreInfo.put("stock", businessResourceStoreInfo.get("stock")); |
| | | businessResourceStoreInfo.put("resId", businessResourceStoreInfo.get("res_id")); |
| | | businessResourceStoreInfo.remove("bId"); |
| | | businessResourceStoreInfo.put("statusCd", statusCd); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中 |
| | | * |
| | | * @param businessResourceStore 资源信息 |
| | | */ |
| | | protected void autoSaveDelBusinessResourceStore(Business business, JSONObject businessResourceStore) { |
| | | //自动插入DEL |
| | | Map info = new HashMap(); |
| | | info.put("resourceResourceStoreId", businessResourceStore.getString("resourceResourceStoreId")); |
| | | info.put("statusCd", StatusConstant.STATUS_CD_VALID); |
| | | List<Map> currentResourceStoreInfos = getResourceStoreServiceDaoImpl().getResourceStoreInfo(info); |
| | | if (currentResourceStoreInfos == null || currentResourceStoreInfos.size() != 1) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "未找到需要修改数据信息,入参错误或数据有问题,请检查" + info); |
| | | } |
| | | |
| | | Map currentResourceStoreInfo = currentResourceStoreInfos.get(0); |
| | | |
| | | currentResourceStoreInfo.put("bId", business.getbId()); |
| | | |
| | | currentResourceStoreInfo.put("resName", currentResourceStoreInfo.get("res_name")); |
| | | currentResourceStoreInfo.put("operate", currentResourceStoreInfo.get("operate")); |
| | | currentResourceStoreInfo.put("price", currentResourceStoreInfo.get("price")); |
| | | currentResourceStoreInfo.put("resCode", currentResourceStoreInfo.get("res_code")); |
| | | currentResourceStoreInfo.put("description", currentResourceStoreInfo.get("description")); |
| | | currentResourceStoreInfo.put("storeId", currentResourceStoreInfo.get("store_id")); |
| | | currentResourceStoreInfo.put("stock", currentResourceStoreInfo.get("stock")); |
| | | currentResourceStoreInfo.put("resId", currentResourceStoreInfo.get("res_id")); |
| | | |
| | | |
| | | currentResourceStoreInfo.put("operate", StatusConstant.OPERATE_DEL); |
| | | getResourceStoreServiceDaoImpl().saveBusinessResourceStoreInfo(currentResourceStoreInfo); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.listener.resourceStore; |
| | | |
| | | 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.store.dao.IResourceStoreServiceDao; |
| | | 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、businessResourceStore:{} 资源基本信息节点 |
| | | * 2、businessResourceStoreAttr:[{}] 资源属性信息节点 |
| | | * 3、businessResourceStorePhoto:[{}] 资源照片信息节点 |
| | | * 4、businessResourceStoreCerdentials:[{}] 资源证件信息节点 |
| | | * 协议地址 :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("deleteResourceStoreInfoListener") |
| | | @Transactional |
| | | public class DeleteResourceStoreInfoListener extends AbstractResourceStoreBusinessServiceDataFlowListener { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(DeleteResourceStoreInfoListener.class); |
| | | @Autowired |
| | | IResourceStoreServiceDao resourceResourceStoreServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 3; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_DELETE_RESOURCE_STORE; |
| | | } |
| | | |
| | | /** |
| | | * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去 |
| | | * |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | JSONObject data = business.getDatas(); |
| | | |
| | | Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessResourceStore 节点 |
| | | if (data.containsKey("businessResourceStore")) { |
| | | //处理 businessResourceStore 节点 |
| | | if (data.containsKey("businessResourceStore")) { |
| | | Object _obj = data.get("businessResourceStore"); |
| | | JSONArray businessResourceStores = null; |
| | | if (_obj instanceof JSONObject) { |
| | | businessResourceStores = new JSONArray(); |
| | | businessResourceStores.add(_obj); |
| | | } else { |
| | | businessResourceStores = (JSONArray) _obj; |
| | | } |
| | | //JSONObject businessResourceStore = data.getJSONObject("businessResourceStore"); |
| | | for (int _resourceResourceStoreIndex = 0; _resourceResourceStoreIndex < businessResourceStores.size(); _resourceResourceStoreIndex++) { |
| | | JSONObject businessResourceStore = businessResourceStores.getJSONObject(_resourceResourceStoreIndex); |
| | | doBusinessResourceStore(business, businessResourceStore); |
| | | if (_obj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("resourceResourceStoreId", businessResourceStore.getString("resourceResourceStoreId")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 删除 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> businessResourceStoreInfos = resourceResourceStoreServiceDaoImpl.getBusinessResourceStoreInfo(info); |
| | | if (businessResourceStoreInfos != null && businessResourceStoreInfos.size() > 0) { |
| | | for (int _resourceResourceStoreIndex = 0; _resourceResourceStoreIndex < businessResourceStoreInfos.size(); _resourceResourceStoreIndex++) { |
| | | Map businessResourceStoreInfo = businessResourceStoreInfos.get(_resourceResourceStoreIndex); |
| | | flushBusinessResourceStoreInfo(businessResourceStoreInfo, StatusConstant.STATUS_CD_INVALID); |
| | | resourceResourceStoreServiceDaoImpl.updateResourceStoreInfoInstance(businessResourceStoreInfo); |
| | | dataFlowContext.addParamOut("resourceResourceStoreId", businessResourceStoreInfo.get("resourceResourceStore_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> resourceResourceStoreInfo = resourceResourceStoreServiceDaoImpl.getResourceStoreInfo(info); |
| | | if (resourceResourceStoreInfo != null && resourceResourceStoreInfo.size() > 0) { |
| | | |
| | | //资源信息 |
| | | List<Map> businessResourceStoreInfos = resourceResourceStoreServiceDaoImpl.getBusinessResourceStoreInfo(delInfo); |
| | | //除非程序出错了,这里不会为空 |
| | | if (businessResourceStoreInfos == null || businessResourceStoreInfos.size() == 0) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR, "撤单失败(resourceResourceStore),程序内部异常,请检查! " + delInfo); |
| | | } |
| | | for (int _resourceResourceStoreIndex = 0; _resourceResourceStoreIndex < businessResourceStoreInfos.size(); _resourceResourceStoreIndex++) { |
| | | Map businessResourceStoreInfo = businessResourceStoreInfos.get(_resourceResourceStoreIndex); |
| | | flushBusinessResourceStoreInfo(businessResourceStoreInfo, StatusConstant.STATUS_CD_VALID); |
| | | resourceResourceStoreServiceDaoImpl.updateResourceStoreInfoInstance(businessResourceStoreInfo); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 处理 businessResourceStore 节点 |
| | | * |
| | | * @param business 总的数据节点 |
| | | * @param businessResourceStore 资源节点 |
| | | */ |
| | | private void doBusinessResourceStore(Business business, JSONObject businessResourceStore) { |
| | | |
| | | Assert.jsonObjectHaveKey(businessResourceStore, "resourceResourceStoreId", "businessResourceStore 节点下没有包含 resourceResourceStoreId 节点"); |
| | | |
| | | if (businessResourceStore.getString("resourceResourceStoreId").startsWith("-")) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "resourceResourceStoreId 错误,不能自动生成(必须已经存在的resourceResourceStoreId)" + businessResourceStore); |
| | | } |
| | | //自动插入DEL |
| | | autoSaveDelBusinessResourceStore(business, businessResourceStore); |
| | | } |
| | | |
| | | public IResourceStoreServiceDao getResourceStoreServiceDaoImpl() { |
| | | return resourceResourceStoreServiceDaoImpl; |
| | | } |
| | | |
| | | public void setResourceStoreServiceDaoImpl(IResourceStoreServiceDao resourceResourceStoreServiceDaoImpl) { |
| | | this.resourceResourceStoreServiceDaoImpl = resourceResourceStoreServiceDaoImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.store.listener.resourceStore; |
| | | |
| | | 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.store.dao.IResourceStoreServiceDao; |
| | | 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("saveResourceStoreInfoListener") |
| | | @Transactional |
| | | public class SaveResourceStoreInfoListener extends AbstractResourceStoreBusinessServiceDataFlowListener { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(SaveResourceStoreInfoListener.class); |
| | | |
| | | @Autowired |
| | | private IResourceStoreServiceDao resourceResourceStoreServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_SAVE_RESOURCE_STORE; |
| | | } |
| | | |
| | | /** |
| | | * 保存资源信息 business 表中 |
| | | * |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | JSONObject data = business.getDatas(); |
| | | Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessResourceStore 节点 |
| | | if (data.containsKey("businessResourceStore")) { |
| | | Object bObj = data.get("businessResourceStore"); |
| | | JSONArray businessResourceStores = null; |
| | | if (bObj instanceof JSONObject) { |
| | | businessResourceStores = new JSONArray(); |
| | | businessResourceStores.add(bObj); |
| | | } else { |
| | | businessResourceStores = (JSONArray) bObj; |
| | | } |
| | | //JSONObject businessResourceStore = data.getJSONObject("businessResourceStore"); |
| | | for (int bResourceStoreIndex = 0; bResourceStoreIndex < businessResourceStores.size(); bResourceStoreIndex++) { |
| | | JSONObject businessResourceStore = businessResourceStores.getJSONObject(bResourceStoreIndex); |
| | | doBusinessResourceStore(business, businessResourceStore); |
| | | if (bObj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("resourceResourceStoreId", businessResourceStore.getString("resourceResourceStoreId")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 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> businessResourceStoreInfo = resourceResourceStoreServiceDaoImpl.getBusinessResourceStoreInfo(info); |
| | | if (businessResourceStoreInfo != null && businessResourceStoreInfo.size() > 0) { |
| | | reFreshShareColumn(info, businessResourceStoreInfo.get(0)); |
| | | resourceResourceStoreServiceDaoImpl.saveResourceStoreInfoInstance(info); |
| | | if (businessResourceStoreInfo.size() == 1) { |
| | | dataFlowContext.addParamOut("resourceResourceStoreId", businessResourceStoreInfo.get(0).get("resourceResourceStore_id")); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 刷 分片字段 |
| | | * |
| | | * @param info 查询对象 |
| | | * @param businessInfo 小区ID |
| | | */ |
| | | private void reFreshShareColumn(Map info, Map businessInfo) { |
| | | |
| | | if (info.containsKey("storeId")) { |
| | | return; |
| | | } |
| | | |
| | | if (!businessInfo.containsKey("store_id")) { |
| | | return; |
| | | } |
| | | |
| | | info.put("storeId", businessInfo.get("store_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> resourceResourceStoreInfo = resourceResourceStoreServiceDaoImpl.getResourceStoreInfo(info); |
| | | if (resourceResourceStoreInfo != null && resourceResourceStoreInfo.size() > 0) { |
| | | reFreshShareColumn(paramIn, resourceResourceStoreInfo.get(0)); |
| | | resourceResourceStoreServiceDaoImpl.updateResourceStoreInfoInstance(paramIn); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 处理 businessResourceStore 节点 |
| | | * |
| | | * @param business 总的数据节点 |
| | | * @param businessResourceStore 资源节点 |
| | | */ |
| | | private void doBusinessResourceStore(Business business, JSONObject businessResourceStore) { |
| | | |
| | | Assert.jsonObjectHaveKey(businessResourceStore, "resourceResourceStoreId", "businessResourceStore 节点下没有包含 resourceResourceStoreId 节点"); |
| | | |
| | | if (businessResourceStore.getString("resourceResourceStoreId").startsWith("-")) { |
| | | //刷新缓存 |
| | | //flushResourceStoreId(business.getDatas()); |
| | | |
| | | businessResourceStore.put("resourceResourceStoreId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_resourceResourceStoreId)); |
| | | |
| | | } |
| | | |
| | | businessResourceStore.put("bId", business.getbId()); |
| | | businessResourceStore.put("operate", StatusConstant.OPERATE_ADD); |
| | | //保存资源信息 |
| | | resourceResourceStoreServiceDaoImpl.saveBusinessResourceStoreInfo(businessResourceStore); |
| | | |
| | | } |
| | | |
| | | public IResourceStoreServiceDao getResourceStoreServiceDaoImpl() { |
| | | return resourceResourceStoreServiceDaoImpl; |
| | | } |
| | | |
| | | public void setResourceStoreServiceDaoImpl(IResourceStoreServiceDao resourceResourceStoreServiceDaoImpl) { |
| | | this.resourceResourceStoreServiceDaoImpl = resourceResourceStoreServiceDaoImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.store.listener.resourceStore; |
| | | |
| | | 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.store.dao.IResourceStoreServiceDao; |
| | | 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、businessResourceStore:{} 资源基本信息节点 |
| | | * 2、businessResourceStoreAttr:[{}] 资源属性信息节点 |
| | | * 3、businessResourceStorePhoto:[{}] 资源照片信息节点 |
| | | * 4、businessResourceStoreCerdentials:[{}] 资源证件信息节点 |
| | | * 协议地址 :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("updateResourceStoreInfoListener") |
| | | @Transactional |
| | | public class UpdateResourceStoreInfoListener extends AbstractResourceStoreBusinessServiceDataFlowListener { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(UpdateResourceStoreInfoListener.class); |
| | | @Autowired |
| | | private IResourceStoreServiceDao resourceResourceStoreServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 2; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_RESOURCE_STORE; |
| | | } |
| | | |
| | | /** |
| | | * business过程 |
| | | * |
| | | * @param dataFlowContext 上下文对象 |
| | | * @param business 业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | |
| | | JSONObject data = business.getDatas(); |
| | | |
| | | Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessResourceStore 节点 |
| | | if (data.containsKey("businessResourceStore")) { |
| | | //处理 businessResourceStore 节点 |
| | | if (data.containsKey("businessResourceStore")) { |
| | | Object _obj = data.get("businessResourceStore"); |
| | | JSONArray businessResourceStores = null; |
| | | if (_obj instanceof JSONObject) { |
| | | businessResourceStores = new JSONArray(); |
| | | businessResourceStores.add(_obj); |
| | | } else { |
| | | businessResourceStores = (JSONArray) _obj; |
| | | } |
| | | //JSONObject businessResourceStore = data.getJSONObject("businessResourceStore"); |
| | | for (int _resourceResourceStoreIndex = 0; _resourceResourceStoreIndex < businessResourceStores.size(); _resourceResourceStoreIndex++) { |
| | | JSONObject businessResourceStore = businessResourceStores.getJSONObject(_resourceResourceStoreIndex); |
| | | doBusinessResourceStore(business, businessResourceStore); |
| | | if (_obj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("resourceResourceStoreId", businessResourceStore.getString("resourceResourceStoreId")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 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> businessResourceStoreInfos = resourceResourceStoreServiceDaoImpl.getBusinessResourceStoreInfo(info); |
| | | if (businessResourceStoreInfos != null && businessResourceStoreInfos.size() > 0) { |
| | | for (int _resourceResourceStoreIndex = 0; _resourceResourceStoreIndex < businessResourceStoreInfos.size(); _resourceResourceStoreIndex++) { |
| | | Map businessResourceStoreInfo = businessResourceStoreInfos.get(_resourceResourceStoreIndex); |
| | | flushBusinessResourceStoreInfo(businessResourceStoreInfo, StatusConstant.STATUS_CD_VALID); |
| | | resourceResourceStoreServiceDaoImpl.updateResourceStoreInfoInstance(businessResourceStoreInfo); |
| | | if (businessResourceStoreInfo.size() == 1) { |
| | | dataFlowContext.addParamOut("resourceResourceStoreId", businessResourceStoreInfo.get("resourceResourceStore_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> resourceResourceStoreInfo = resourceResourceStoreServiceDaoImpl.getResourceStoreInfo(info); |
| | | if (resourceResourceStoreInfo != null && resourceResourceStoreInfo.size() > 0) { |
| | | |
| | | //资源信息 |
| | | List<Map> businessResourceStoreInfos = resourceResourceStoreServiceDaoImpl.getBusinessResourceStoreInfo(delInfo); |
| | | //除非程序出错了,这里不会为空 |
| | | if (businessResourceStoreInfos == null || businessResourceStoreInfos.size() == 0) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR, "撤单失败(resourceResourceStore),程序内部异常,请检查! " + delInfo); |
| | | } |
| | | for (int _resourceResourceStoreIndex = 0; _resourceResourceStoreIndex < businessResourceStoreInfos.size(); _resourceResourceStoreIndex++) { |
| | | Map businessResourceStoreInfo = businessResourceStoreInfos.get(_resourceResourceStoreIndex); |
| | | flushBusinessResourceStoreInfo(businessResourceStoreInfo, StatusConstant.STATUS_CD_VALID); |
| | | resourceResourceStoreServiceDaoImpl.updateResourceStoreInfoInstance(businessResourceStoreInfo); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 处理 businessResourceStore 节点 |
| | | * |
| | | * @param business 总的数据节点 |
| | | * @param businessResourceStore 资源节点 |
| | | */ |
| | | private void doBusinessResourceStore(Business business, JSONObject businessResourceStore) { |
| | | |
| | | Assert.jsonObjectHaveKey(businessResourceStore, "resourceResourceStoreId", "businessResourceStore 节点下没有包含 resourceResourceStoreId 节点"); |
| | | |
| | | if (businessResourceStore.getString("resourceResourceStoreId").startsWith("-")) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "resourceResourceStoreId 错误,不能自动生成(必须已经存在的resourceResourceStoreId)" + businessResourceStore); |
| | | } |
| | | //自动保存DEL |
| | | autoSaveDelBusinessResourceStore(business, businessResourceStore); |
| | | |
| | | businessResourceStore.put("bId", business.getbId()); |
| | | businessResourceStore.put("operate", StatusConstant.OPERATE_ADD); |
| | | //保存资源信息 |
| | | resourceResourceStoreServiceDaoImpl.saveBusinessResourceStoreInfo(businessResourceStore); |
| | | |
| | | } |
| | | |
| | | |
| | | public IResourceStoreServiceDao getResourceStoreServiceDaoImpl() { |
| | | return resourceResourceStoreServiceDaoImpl; |
| | | } |
| | | |
| | | public void setResourceStoreServiceDaoImpl(IResourceStoreServiceDao resourceResourceStoreServiceDaoImpl) { |
| | | this.resourceResourceStoreServiceDaoImpl = resourceResourceStoreServiceDaoImpl; |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.smo.impl; |
| | | |
| | | |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.core.smo.resourceStore.IResourceStoreInnerServiceSMO; |
| | | import com.java110.core.smo.user.IUserInnerServiceSMO; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.resourceStore.ResourceStoreDto; |
| | | import com.java110.store.dao.IResourceStoreServiceDao; |
| | | 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 ResourceStoreInnerServiceSMOImpl extends BaseServiceSMO implements IResourceStoreInnerServiceSMO { |
| | | |
| | | @Autowired |
| | | private IResourceStoreServiceDao resourceResourceStoreServiceDaoImpl; |
| | | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public List<ResourceStoreDto> queryResourceStores(@RequestBody ResourceStoreDto resourceResourceStoreDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = resourceResourceStoreDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | resourceResourceStoreDto.setPage((page - 1) * resourceResourceStoreDto.getRow()); |
| | | } |
| | | |
| | | List<ResourceStoreDto> resourceResourceStores = BeanConvertUtil.covertBeanList(resourceResourceStoreServiceDaoImpl.getResourceStoreInfo(BeanConvertUtil.beanCovertMap(resourceResourceStoreDto)), ResourceStoreDto.class); |
| | | |
| | | return resourceResourceStores; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int queryResourceStoresCount(@RequestBody ResourceStoreDto resourceResourceStoreDto) { |
| | | return resourceResourceStoreServiceDaoImpl.queryResourceStoresCount(BeanConvertUtil.beanCovertMap(resourceResourceStoreDto)); |
| | | } |
| | | |
| | | public IResourceStoreServiceDao getResourceStoreServiceDaoImpl() { |
| | | return resourceResourceStoreServiceDaoImpl; |
| | | } |
| | | |
| | | public void setResourceStoreServiceDaoImpl(IResourceStoreServiceDao resourceResourceStoreServiceDaoImpl) { |
| | | this.resourceResourceStoreServiceDaoImpl = resourceResourceStoreServiceDaoImpl; |
| | | } |
| | | |
| | | public IUserInnerServiceSMO getUserInnerServiceSMOImpl() { |
| | | return userInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) { |
| | | this.userInnerServiceSMOImpl = userInnerServiceSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | |
| | | |
| | | **1\. 删除资源** |
| | | ###### 接口功能 |
| | | > API服务做删除资源时调用该接口 |
| | | |
| | | ###### URL |
| | | > [http://resourceResourceStore-service/resourceResourceStoreApi/service](http://resourceResourceStore-service/resourceResourceStoreApi/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|businessResourceStoreInfo|1|Object|-|小区成员|小区成员| |
| | | |businessResourceStoreInfo|resId|1|String|30|-|-| |
| | | |
| | | |
| | | ###### 返回协议 |
| | | |
| | | 当http返回状态不为200 时请求处理失败 body内容为失败的原因 |
| | | |
| | | 当http返回状态为200时请求处理成功,body内容为返回内容, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | ###### 举例 |
| | | > 地址:[http://resourceResourceStore-service/resourceResourceStoreApi/service](http://resourceResourceStore-service/resourceResourceStoreApi/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": "150200050001", |
| | | "bId":"1234567892", |
| | | "remark": "备注", |
| | | "datas": { |
| | | "businessResourceStoreInfo": { |
| | | "resId":"填写存在的值" |
| | | } |
| | | }, |
| | | "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://resourceResourceStore-service/resourceResourceStoreApi/service](http://resourceResourceStore-service/resourceResourceStoreApi/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|businessResourceStoreInfo|1|Object|-|小区成员|小区成员| |
| | | |businessResourceStoreInfo|resName|1|String|30|-|-| |
| | | |businessResourceStoreInfo|price|1|String|30|-|-| |
| | | |businessResourceStoreInfo|resCode|1|String|30|-|-| |
| | | |businessResourceStoreInfo|description|1|String|30|-|-| |
| | | |businessResourceStoreInfo|storeId|1|String|30|-|-| |
| | | |businessResourceStoreInfo|stock|1|String|30|-|-| |
| | | |businessResourceStoreInfo|resId|1|String|30|-|-| |
| | | |
| | | |
| | | ###### 返回协议 |
| | | |
| | | 当http返回状态不为200 时请求处理失败 body内容为失败的原因 |
| | | |
| | | 当http返回状态为200时请求处理成功,body内容为返回内容, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | ###### 举例 |
| | | > 地址:[http://resourceResourceStore-service/resourceResourceStoreApi/service](http://resourceResourceStore-service/resourceResourceStoreApi/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": "150200030001", |
| | | "bId":"1234567892", |
| | | "remark": "备注", |
| | | "datas": { |
| | | "businessResourceStoreInfo": { |
| | | "resName":"填写具体值", |
| | | "price":"填写具体值", |
| | | "resCode":"填写具体值", |
| | | "description":"填写具体值", |
| | | "storeId":"填写具体值", |
| | | "stock":"填写具体值", |
| | | "resId":"填写具体值" |
| | | } |
| | | }, |
| | | "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://resourceResourceStore-service/resourceResourceStoreApi/service](http://resourceResourceStore-service/resourceResourceStoreApi/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|businessResourceStoreInfo|1|Object|-|小区成员|小区成员| |
| | | |businessResourceStoreInfo|resName|1|String|30|-|-| |
| | | |businessResourceStoreInfo|price|1|String|30|-|-| |
| | | |businessResourceStoreInfo|resCode|1|String|30|-|-| |
| | | |businessResourceStoreInfo|description|1|String|30|-|-| |
| | | |businessResourceStoreInfo|storeId|1|String|30|-|-| |
| | | |businessResourceStoreInfo|stock|1|String|30|-|-| |
| | | |businessResourceStoreInfo|resId|1|String|30|-|-| |
| | | |
| | | |
| | | ###### 返回协议 |
| | | |
| | | 当http返回状态不为200 时请求处理失败 body内容为失败的原因 |
| | | |
| | | 当http返回状态为200时请求处理成功,body内容为返回内容, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | ###### 举例 |
| | | > 地址:[http://resourceResourceStore-service/resourceResourceStoreApi/service](http://resourceResourceStore-service/resourceResourceStoreApi/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": "150200040001", |
| | | "bId":"1234567892", |
| | | "remark": "备注", |
| | | "datas": { |
| | | "businessResourceStoreInfo": { |
| | | "resName":"填写具体值", |
| | | "price":"填写具体值", |
| | | "resCode":"填写具体值", |
| | | "description":"填写具体值", |
| | | "storeId":"填写具体值", |
| | | "stock":"填写具体值", |
| | | "resId":"填写具体值" |
| | | } |
| | | }, |
| | | "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.resourceStore; |
| | | |
| | | 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 ResourceStoreDto extends PageDto implements Serializable { |
| | | |
| | | private String resName; |
| | | private String price; |
| | | private String resCode; |
| | | private String description; |
| | | private String storeId; |
| | | private String stock; |
| | | private String resId; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | |
| | | public String getResName() { |
| | | return resName; |
| | | } |
| | | |
| | | public void setResName(String resName) { |
| | | this.resName = resName; |
| | | } |
| | | |
| | | public String getPrice() { |
| | | return price; |
| | | } |
| | | |
| | | public void setPrice(String price) { |
| | | this.price = price; |
| | | } |
| | | |
| | | public String getResCode() { |
| | | return resCode; |
| | | } |
| | | |
| | | public void setResCode(String resCode) { |
| | | this.resCode = resCode; |
| | | } |
| | | |
| | | public String getDescription() { |
| | | return description; |
| | | } |
| | | |
| | | public void setDescription(String description) { |
| | | this.description = description; |
| | | } |
| | | |
| | | public String getStoreId() { |
| | | return storeId; |
| | | } |
| | | |
| | | public void setStoreId(String storeId) { |
| | | this.storeId = storeId; |
| | | } |
| | | |
| | | public String getStock() { |
| | | return stock; |
| | | } |
| | | |
| | | public void setStock(String stock) { |
| | | this.stock = stock; |
| | | } |
| | | |
| | | public String getResId() { |
| | | return resId; |
| | | } |
| | | |
| | | public void setResId(String resId) { |
| | | this.resId = resId; |
| | | } |
| | | |
| | | |
| | | 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; |
| | | |
| | | |
| | | import com.java110.code.*; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Hello world! |
| | | */ |
| | | public class ResourceStoreGeneratorApplication { |
| | | |
| | | protected ResourceStoreGeneratorApplication() { |
| | | // prevents calls from subclass |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | /** |
| | | * 代码生成器 入口方法 |
| | | * 此处生成的mapper文件包含过程表和实例表的sql,所以要求两张表的特殊字段也要写上 |
| | | * BusinessTypeCd |
| | | * @param args 参数 |
| | | */ |
| | | public static void main(String[] args) { |
| | | Data data = new Data(); |
| | | data.setId("resId"); |
| | | data.setName("resourceStore"); |
| | | data.setDesc("资源"); |
| | | data.setShareParam("storeId"); |
| | | data.setShareColumn("store_id"); |
| | | data.setNewBusinessTypeCd("BUSINESS_TYPE_SAVE_RESOURCE_STORE"); |
| | | data.setUpdateBusinessTypeCd("BUSINESS_TYPE_UPDATE_RESOURCE_STORE"); |
| | | data.setDeleteBusinessTypeCd("BUSINESS_TYPE_DELETE_RESOURCE_STORE"); |
| | | data.setNewBusinessTypeCdValue("150200030001"); |
| | | data.setUpdateBusinessTypeCdValue("150200040001"); |
| | | data.setDeleteBusinessTypeCdValue("150200050001"); |
| | | data.setBusinessTableName("business_resource_store"); |
| | | data.setTableName("resource_store"); |
| | | Map<String, String> param = new HashMap<String, String>(); |
| | | param.put("resId", "res_id"); //map的key为你自定义的字段名就是驼峰命名法的那个,value为数据库表的字段名 |
| | | param.put("storeId", "store_id"); |
| | | param.put("resName", "res_name"); |
| | | param.put("resCode", "res_code"); |
| | | param.put("description", "description"); |
| | | param.put("price", "price"); |
| | | param.put("stock", "stock"); |
| | | 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); |
| | | } |
| | | } |
| | |
| | | public static final String CODE_PREFIX_ruId = "83"; |
| | | public static final String CODE_PREFIX_orgId = "84"; |
| | | public static final String CODE_PREFIX_relId = "84"; |
| | | public static final String CODE_PREFIX_resourceResourceStoreId = "85"; |
| | | |
| | | |
| | | |
| New file |
| | |
| | | package com.java110.core.smo.resourceStore; |
| | | |
| | | import com.java110.core.feign.FeignConfiguration; |
| | | import com.java110.dto.resourceStore.ResourceStoreDto; |
| | | 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 IResourceStoreInnerServiceSMO |
| | | * @Description 资源接口类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:04 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @FeignClient(name = "store-service", configuration = {FeignConfiguration.class}) |
| | | @RequestMapping("/resourceResourceStoreApi") |
| | | public interface IResourceStoreInnerServiceSMO { |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * @param resourceResourceStoreDto 数据对象分享 |
| | | * @return ResourceStoreDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/queryResourceStores", method = RequestMethod.POST) |
| | | List<ResourceStoreDto> queryResourceStores(@RequestBody ResourceStoreDto resourceResourceStoreDto); |
| | | |
| | | /** |
| | | * 查询<p>小区楼</p>总记录数 |
| | | * |
| | | * @param resourceResourceStoreDto 数据对象分享 |
| | | * @return 小区下的小区楼记录数 |
| | | */ |
| | | @RequestMapping(value = "/queryResourceStoresCount", method = RequestMethod.POST) |
| | | int queryResourceStoresCount(@RequestBody ResourceStoreDto resourceResourceStoreDto); |
| | | } |
| 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="resourceResourceStoreServiceDaoImpl"> |
| | | |
| | | <!-- 保存资源信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveBusinessResourceStoreInfo" parameterType="Map"> |
| | | insert into business_resource_store( |
| | | res_name,operate,price,res_code,description,store_id,stock,b_id,res_id |
| | | ) values ( |
| | | #{resName},#{operate},#{price},#{resCode},#{description},#{storeId},#{stock},#{bId},#{resId} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询资源信息(Business) add by wuxw 2018-07-03 --> |
| | | <select id="getBusinessResourceStoreInfo" parameterType="Map" resultType="Map"> |
| | | select t.res_name,t.res_name resName,t.operate,t.price,t.res_code,t.res_code resCode,t.description,t.store_id,t.store_id storeId,t.stock,t.b_id,t.b_id bId,t.res_id,t.res_id resId |
| | | from business_resource_store t |
| | | where 1 =1 |
| | | <if test="resName !=null and resName != ''"> |
| | | and t.res_name= #{resName} |
| | | </if> |
| | | <if test="operate !=null and operate != ''"> |
| | | and t.operate= #{operate} |
| | | </if> |
| | | <if test="price !=null and price != ''"> |
| | | and t.price= #{price} |
| | | </if> |
| | | <if test="resCode !=null and resCode != ''"> |
| | | and t.res_code= #{resCode} |
| | | </if> |
| | | <if test="description !=null and description != ''"> |
| | | and t.description= #{description} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | and t.store_id= #{storeId} |
| | | </if> |
| | | <if test="stock !=null and stock != ''"> |
| | | and t.stock= #{stock} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="resId !=null and resId != ''"> |
| | | and t.res_id= #{resId} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 保存资源信息至 instance表中 add by wuxw 2018-07-03 --> |
| | | <insert id="saveResourceStoreInfoInstance" parameterType="Map"> |
| | | insert into resource_store( |
| | | res_name,price,res_code,description,status_cd,store_id,stock,b_id,res_id |
| | | ) select t.res_name,t.price,t.res_code,t.description,'0',t.store_id,t.stock,t.b_id,t.res_id from business_resource_store t where 1=1 |
| | | <if test="resName !=null and resName != ''"> |
| | | and t.res_name= #{resName} |
| | | </if> |
| | | and t.operate= 'ADD' |
| | | <if test="price !=null and price != ''"> |
| | | and t.price= #{price} |
| | | </if> |
| | | <if test="resCode !=null and resCode != ''"> |
| | | and t.res_code= #{resCode} |
| | | </if> |
| | | <if test="description !=null and description != ''"> |
| | | and t.description= #{description} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | and t.store_id= #{storeId} |
| | | </if> |
| | | <if test="stock !=null and stock != ''"> |
| | | and t.stock= #{stock} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="resId !=null and resId != ''"> |
| | | and t.res_id= #{resId} |
| | | </if> |
| | | |
| | | </insert> |
| | | |
| | | |
| | | |
| | | <!-- 查询资源信息 add by wuxw 2018-07-03 --> |
| | | <select id="getResourceStoreInfo" parameterType="Map" resultType="Map"> |
| | | select t.res_name,t.res_name resName,t.price,t.res_code,t.res_code resCode,t.description,t.status_cd,t.status_cd statusCd,t.store_id,t.store_id storeId,t.stock,t.b_id,t.b_id bId,t.res_id,t.res_id resId |
| | | from resource_store t |
| | | where 1 =1 |
| | | <if test="resName !=null and resName != ''"> |
| | | and t.res_name= #{resName} |
| | | </if> |
| | | <if test="price !=null and price != ''"> |
| | | and t.price= #{price} |
| | | </if> |
| | | <if test="resCode !=null and resCode != ''"> |
| | | and t.res_code= #{resCode} |
| | | </if> |
| | | <if test="description !=null and description != ''"> |
| | | and t.description= #{description} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | and t.store_id= #{storeId} |
| | | </if> |
| | | <if test="stock !=null and stock != ''"> |
| | | and t.stock= #{stock} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="resId !=null and resId != ''"> |
| | | and t.res_id= #{resId} |
| | | </if> |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 修改资源信息 add by wuxw 2018-07-03 --> |
| | | <update id="updateResourceStoreInfoInstance" parameterType="Map"> |
| | | update resource_store t set t.status_cd = #{statusCd} |
| | | <if test="newBId != null and newBId != ''"> |
| | | ,t.b_id = #{newBId} |
| | | </if> |
| | | <if test="resName !=null and resName != ''"> |
| | | , t.res_name= #{resName} |
| | | </if> |
| | | <if test="price !=null and price != ''"> |
| | | , t.price= #{price} |
| | | </if> |
| | | <if test="resCode !=null and resCode != ''"> |
| | | , t.res_code= #{resCode} |
| | | </if> |
| | | <if test="description !=null and description != ''"> |
| | | , t.description= #{description} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | , t.store_id= #{storeId} |
| | | </if> |
| | | <if test="stock !=null and stock != ''"> |
| | | , t.stock= #{stock} |
| | | </if> |
| | | where 1=1 <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="resId !=null and resId != ''"> |
| | | and t.res_id= #{resId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询资源数量 add by wuxw 2018-07-03 --> |
| | | <select id="queryResourceStoresCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from resource_store t |
| | | where 1 =1 |
| | | <if test="resName !=null and resName != ''"> |
| | | and t.res_name= #{resName} |
| | | </if> |
| | | <if test="price !=null and price != ''"> |
| | | and t.price= #{price} |
| | | </if> |
| | | <if test="resCode !=null and resCode != ''"> |
| | | and t.res_code= #{resCode} |
| | | </if> |
| | | <if test="description !=null and description != ''"> |
| | | and t.description= #{description} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | and t.store_id= #{storeId} |
| | | </if> |
| | | <if test="stock !=null and stock != ''"> |
| | | and t.stock= #{stock} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="resId !=null and resId != ''"> |
| | | and t.res_id= #{resId} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | */ |
| | | public static final String BUSINESS_TYPE_DELETE_ORG_STAFF_REL ="140200050001"; |
| | | |
| | | /** |
| | | * 保存 资源 |
| | | * 14开头 3保存 |
| | | */ |
| | | public static final String BUSINESS_TYPE_SAVE_RESOURCE_STORE="150200030001"; |
| | | |
| | | /** |
| | | * 修改资源 |
| | | */ |
| | | public static final String BUSINESS_TYPE_UPDATE_RESOURCE_STORE="150200040001"; |
| | | /** |
| | | * 删除资源 |
| | | */ |
| | | public static final String BUSINESS_TYPE_DELETE_RESOURCE_STORE ="150200050001"; |
| | | |
| | | |
| | | } |