| New file |
| | |
| | | package com.java110.api.listener.businesstype; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiDataFlowListener; |
| | | import com.java110.common.constant.ServiceCodeConstant; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.common.util.BeanConvertUtil; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.smo.businessytpe.IC_business_typeInnerServiceSMO; |
| | | import com.java110.dto.businesstypecd.C_business_typeDto; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName FloorDto |
| | | * @Description 用例数据层侦听类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 8:52 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @Java110Listener("queryBusinessTypeConfig") |
| | | public class QueryBusinessTypeConfigListener extends AbstractServiceApiDataFlowListener { |
| | | |
| | | @Autowired |
| | | private IC_business_typeInnerServiceSMO ic_business_typeInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeConstant.SERVICE_CODE_QUERY_BUSINESSTYPE_CONFIG; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.GET; |
| | | } |
| | | |
| | | /** |
| | | * 业务层数据处理 |
| | | * |
| | | * @param event 时间对象 |
| | | */ |
| | | @Override |
| | | public void soService(ServiceDataFlowEvent event) { |
| | | DataFlowContext dataFlowContext = event.getDataFlowContext(); |
| | | //获取请求数据 |
| | | JSONObject reqJson = dataFlowContext.getReqJson(); |
| | | //validateDemoConfigData(reqJson); |
| | | |
| | | List<C_business_typeDto> C_business_typeDto = ic_business_typeInnerServiceSMOImpl.queryC_business_types(BeanConvertUtil.covertBean(reqJson, C_business_typeDto.class)); |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(C_business_typeDto), HttpStatus.OK); |
| | | |
| | | dataFlowContext.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | /** |
| | | * 校验查询条件是否满足条件 |
| | | * |
| | | * @param reqJson 包含查询条件 |
| | | */ |
| | | private void validateDemoConfigData(JSONObject reqJson) { |
| | | Assert.jsonObjectHaveKey(reqJson, "demoName", "请求中未包含demoName信息"); |
| | | Assert.jsonObjectHaveKey(reqJson, "demoValue", "请求中未包含demoValue信息"); |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return super.DEFAULT_ORDER; |
| | | } |
| | | |
| | | public IC_business_typeInnerServiceSMO getIc_business_typeInnerServiceSMOImpl() { |
| | | return ic_business_typeInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setIc_business_typeInnerServiceSMOImpl(IC_business_typeInnerServiceSMO ic_business_typeInnerServiceSMOImpl) { |
| | | this.ic_business_typeInnerServiceSMOImpl = ic_business_typeInnerServiceSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.store.dao; |
| | | |
| | | |
| | | import com.java110.common.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; |
| | | |
| | | /** |
| | | * BusinessType组件内部之间使用,没有给外围系统提供服务能力 |
| | | * BusinessType服务接口类,要求全部以字符串传输,方便微服务化 |
| | | * 新建客户,修改客户,删除客户,查询客户等功能 |
| | | * |
| | | * Created by wuxw on 2016/12/27. |
| | | */ |
| | | public interface IC_business_typeServiceDao { |
| | | |
| | | /** |
| | | * 保存 BusinessType信息 |
| | | * @param businessC_business_typeInfo BusinessType信息 封装 |
| | | * @throws DAOException 操作数据库异常 |
| | | */ |
| | | void saveBusinessC_business_typeInfo(Map businessC_business_typeInfo) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询BusinessType信息(business过程) |
| | | * 根据bId 查询BusinessType信息 |
| | | * @param info bId 信息 |
| | | * @return BusinessType信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getBusinessC_business_typeInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存 BusinessType信息 Business数据到 Instance中 |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void saveC_business_typeInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询BusinessType信息(instance过程) |
| | | * 根据bId 查询BusinessType信息 |
| | | * @param info bId 信息 |
| | | * @return BusinessType信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getC_business_typeInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改BusinessType信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void updateC_business_typeInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询BusinessType总数 |
| | | * |
| | | * @param info BusinessType信息 |
| | | * @return BusinessType数量 |
| | | */ |
| | | int queryC_business_typesCount(Map info); |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.dao.impl.businesstype; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.ResponseConstant; |
| | | import com.java110.common.exception.DAOException; |
| | | import com.java110.common.util.DateUtil; |
| | | import com.java110.core.base.dao.BaseServiceDao; |
| | | import com.java110.store.dao.IC_business_typeServiceDao; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * BusinessType服务 与数据库交互 |
| | | * Created by wuxw on 2017/4/5. |
| | | */ |
| | | @Service("c_business_typeServiceDaoImpl") |
| | | //@Transactional |
| | | public class C_business_typeServiceDaoImpl extends BaseServiceDao implements IC_business_typeServiceDao { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(C_business_typeServiceDaoImpl.class); |
| | | |
| | | /** |
| | | * BusinessType信息封装 |
| | | * @param businessC_business_typeInfo BusinessType信息 封装 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveBusinessC_business_typeInfo(Map businessC_business_typeInfo) throws DAOException { |
| | | businessC_business_typeInfo.put("month", DateUtil.getCurrentMonth()); |
| | | // 查询business_user 数据是否已经存在 |
| | | logger.debug("保存BusinessType信息 入参 businessC_business_typeInfo : {}",businessC_business_typeInfo); |
| | | int saveFlag = sqlSessionTemplate.insert("c_business_typeServiceDaoImpl.saveBusinessC_business_typeInfo",businessC_business_typeInfo); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存BusinessType数据失败:"+ JSONObject.toJSONString(businessC_business_typeInfo)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询BusinessType信息 |
| | | * @param info bId 信息 |
| | | * @return BusinessType信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getBusinessC_business_typeInfo(Map info) throws DAOException { |
| | | |
| | | logger.debug("查询BusinessType信息 入参 info : {}",info); |
| | | |
| | | List<Map> businessC_business_typeInfos = sqlSessionTemplate.selectList("c_business_typeServiceDaoImpl.getBusinessC_business_typeInfo",info); |
| | | |
| | | return businessC_business_typeInfos; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存BusinessType信息 到 instance |
| | | * @param info bId 信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveC_business_typeInfoInstance(Map info) throws DAOException { |
| | | logger.debug("保存BusinessType信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("c_business_typeServiceDaoImpl.saveC_business_typeInfoInstance",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存BusinessType信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询BusinessType信息(instance) |
| | | * @param info bId 信息 |
| | | * @return List<Map> |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getC_business_typeInfo(Map info) throws DAOException { |
| | | logger.debug("查询BusinessType信息 入参 info : {}",info); |
| | | |
| | | List<Map> businessC_business_typeInfos = sqlSessionTemplate.selectList("c_business_typeServiceDaoImpl.getC_business_typeInfo",info); |
| | | |
| | | return businessC_business_typeInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改BusinessType信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void updateC_business_typeInfoInstance(Map info) throws DAOException { |
| | | logger.debug("修改BusinessType信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("c_business_typeServiceDaoImpl.updateC_business_typeInfoInstance",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改BusinessType信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询BusinessType数量 |
| | | * @param info BusinessType信息 |
| | | * @return BusinessType数量 |
| | | */ |
| | | @Override |
| | | public int queryC_business_typesCount(Map info) { |
| | | logger.debug("查询BusinessType数据 入参 info : {}",info); |
| | | |
| | | List<Map> businessC_business_typeInfos = sqlSessionTemplate.selectList("c_business_typeServiceDaoImpl.queryC_business_typesCount", info); |
| | | if (businessC_business_typeInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessC_business_typeInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.listener.businesstypecd; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.ResponseConstant; |
| | | import com.java110.common.constant.StatusConstant; |
| | | import com.java110.common.exception.ListenerExecuteException; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.event.service.AbstractBusinessServiceDataFlowListener; |
| | | import com.java110.store.dao.IC_business_typeServiceDao; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * |
| | | * BusinessType 服务侦听 父类 |
| | | * Created by wuxw on 2018/7/4. |
| | | */ |
| | | public abstract class AbstractC_business_typeBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener{ |
| | | private static Logger logger = LoggerFactory.getLogger(AbstractC_business_typeBusinessServiceDataFlowListener.class); |
| | | |
| | | |
| | | /** |
| | | * 获取 DAO工具类 |
| | | * @return |
| | | */ |
| | | public abstract IC_business_typeServiceDao getC_business_typeServiceDaoImpl(); |
| | | |
| | | /** |
| | | * 刷新 businessC_business_typeInfo 数据 |
| | | * 主要将 数据库 中字段和 接口传递字段建立关系 |
| | | * @param businessC_business_typeInfo |
| | | */ |
| | | protected void flushBusinessC_business_typeInfo(Map businessC_business_typeInfo,String statusCd){ |
| | | businessC_business_typeInfo.put("newBId", businessC_business_typeInfo.get("b_id")); |
| | | businessC_business_typeInfo.put("businessTypeCd",businessC_business_typeInfo.get("business_type_cd")); |
| | | businessC_business_typeInfo.put("operate",businessC_business_typeInfo.get("operate")); |
| | | businessC_business_typeInfo.put("name",businessC_business_typeInfo.get("name")); |
| | | businessC_business_typeInfo.put("description",businessC_business_typeInfo.get("description")); |
| | | businessC_business_typeInfo.put("id",businessC_business_typeInfo.get("id")); |
| | | businessC_business_typeInfo.put("userId",businessC_business_typeInfo.get("user_id")); |
| | | businessC_business_typeInfo.remove("bId"); |
| | | businessC_business_typeInfo.put("statusCd", statusCd); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中 |
| | | * @param businessC_business_type BusinessType信息 |
| | | */ |
| | | protected void autoSaveDelBusinessC_business_type(Business business, JSONObject businessC_business_type){ |
| | | //自动插入DEL |
| | | Map info = new HashMap(); |
| | | info.put("id",businessC_business_type.getString("id")); |
| | | info.put("statusCd",StatusConstant.STATUS_CD_VALID); |
| | | List<Map> currentC_business_typeInfos = getC_business_typeServiceDaoImpl().getC_business_typeInfo(info); |
| | | if(currentC_business_typeInfos == null || currentC_business_typeInfos.size() != 1){ |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"未找到需要修改数据信息,入参错误或数据有问题,请检查"+info); |
| | | } |
| | | |
| | | Map currentC_business_typeInfo = currentC_business_typeInfos.get(0); |
| | | |
| | | currentC_business_typeInfo.put("bId",business.getbId()); |
| | | |
| | | currentC_business_typeInfo.put("businessTypeCd",currentC_business_typeInfo.get("business_type_cd")); |
| | | currentC_business_typeInfo.put("operate",currentC_business_typeInfo.get("operate")); |
| | | currentC_business_typeInfo.put("name",currentC_business_typeInfo.get("name")); |
| | | currentC_business_typeInfo.put("description",currentC_business_typeInfo.get("description")); |
| | | currentC_business_typeInfo.put("id",currentC_business_typeInfo.get("id")); |
| | | currentC_business_typeInfo.put("userId",currentC_business_typeInfo.get("user_id")); |
| | | |
| | | |
| | | currentC_business_typeInfo.put("operate",StatusConstant.OPERATE_DEL); |
| | | getC_business_typeServiceDaoImpl().saveBusinessC_business_typeInfo(currentC_business_typeInfo); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.listener.businesstypecd; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.BusinessTypeConstant; |
| | | import com.java110.common.constant.ResponseConstant; |
| | | import com.java110.common.constant.StatusConstant; |
| | | import com.java110.common.exception.ListenerExecuteException; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.store.dao.IC_business_typeServiceDao; |
| | | 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; |
| | | |
| | | /** |
| | | * 删除BusinessType信息 侦听 |
| | | * |
| | | * 处理节点 |
| | | * 1、businessC_business_type:{} BusinessType基本信息节点 |
| | | * 2、businessC_business_typeAttr:[{}] BusinessType属性信息节点 |
| | | * 3、businessC_business_typePhoto:[{}] BusinessType照片信息节点 |
| | | * 4、businessC_business_typeCerdentials:[{}] BusinessType证件信息节点 |
| | | * 协议地址 :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("deleteC_business_typeInfoListener") |
| | | @Transactional |
| | | public class DeleteC_business_typeInfoListener extends AbstractC_business_typeBusinessServiceDataFlowListener { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(DeleteC_business_typeInfoListener.class); |
| | | @Autowired |
| | | IC_business_typeServiceDao c_business_typeServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 3; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_DELETE_BUSINESSTYPE_INFO; |
| | | } |
| | | |
| | | /** |
| | | * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | JSONObject data = business.getDatas(); |
| | | |
| | | Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessC_business_type 节点 |
| | | if(data.containsKey("businessC_business_type")){ |
| | | //处理 businessC_business_type 节点 |
| | | if(data.containsKey("businessC_business_type")){ |
| | | Object _obj = data.get("businessC_business_type"); |
| | | JSONArray businessC_business_types = null; |
| | | if(_obj instanceof JSONObject){ |
| | | businessC_business_types = new JSONArray(); |
| | | businessC_business_types.add(_obj); |
| | | }else { |
| | | businessC_business_types = (JSONArray)_obj; |
| | | } |
| | | //JSONObject businessC_business_type = data.getJSONObject("businessC_business_type"); |
| | | for (int _c_business_typeIndex = 0; _c_business_typeIndex < businessC_business_types.size();_c_business_typeIndex++) { |
| | | JSONObject businessC_business_type = businessC_business_types.getJSONObject(_c_business_typeIndex); |
| | | doBusinessC_business_type(business, businessC_business_type); |
| | | if(_obj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("id", businessC_business_type.getString("id")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 删除 instance数据 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) { |
| | | String bId = business.getbId(); |
| | | //Assert.hasLength(bId,"请求报文中没有包含 bId"); |
| | | |
| | | //BusinessType信息 |
| | | Map info = new HashMap(); |
| | | info.put("bId",business.getbId()); |
| | | info.put("operate",StatusConstant.OPERATE_DEL); |
| | | |
| | | //BusinessType信息 |
| | | List<Map> businessC_business_typeInfos = c_business_typeServiceDaoImpl.getBusinessC_business_typeInfo(info); |
| | | if( businessC_business_typeInfos != null && businessC_business_typeInfos.size() >0) { |
| | | for (int _c_business_typeIndex = 0; _c_business_typeIndex < businessC_business_typeInfos.size();_c_business_typeIndex++) { |
| | | Map businessC_business_typeInfo = businessC_business_typeInfos.get(_c_business_typeIndex); |
| | | flushBusinessC_business_typeInfo(businessC_business_typeInfo,StatusConstant.STATUS_CD_INVALID); |
| | | c_business_typeServiceDaoImpl.updateC_business_typeInfoInstance(businessC_business_typeInfo); |
| | | dataFlowContext.addParamOut("id",businessC_business_typeInfo.get("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); |
| | | //BusinessType信息 |
| | | List<Map> c_business_typeInfo = c_business_typeServiceDaoImpl.getC_business_typeInfo(info); |
| | | if(c_business_typeInfo != null && c_business_typeInfo.size() > 0){ |
| | | |
| | | //BusinessType信息 |
| | | List<Map> businessC_business_typeInfos = c_business_typeServiceDaoImpl.getBusinessC_business_typeInfo(delInfo); |
| | | //除非程序出错了,这里不会为空 |
| | | if(businessC_business_typeInfos == null || businessC_business_typeInfos.size() == 0){ |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(c_business_type),程序内部异常,请检查! "+delInfo); |
| | | } |
| | | for (int _c_business_typeIndex = 0; _c_business_typeIndex < businessC_business_typeInfos.size();_c_business_typeIndex++) { |
| | | Map businessC_business_typeInfo = businessC_business_typeInfos.get(_c_business_typeIndex); |
| | | flushBusinessC_business_typeInfo(businessC_business_typeInfo,StatusConstant.STATUS_CD_VALID); |
| | | c_business_typeServiceDaoImpl.updateC_business_typeInfoInstance(businessC_business_typeInfo); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 处理 businessC_business_type 节点 |
| | | * @param business 总的数据节点 |
| | | * @param businessC_business_type BusinessType节点 |
| | | */ |
| | | private void doBusinessC_business_type(Business business,JSONObject businessC_business_type){ |
| | | |
| | | Assert.jsonObjectHaveKey(businessC_business_type,"id","businessC_business_type 节点下没有包含 id 节点"); |
| | | |
| | | if(businessC_business_type.getString("id").startsWith("-")){ |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"id 错误,不能自动生成(必须已经存在的id)"+businessC_business_type); |
| | | } |
| | | //自动插入DEL |
| | | autoSaveDelBusinessC_business_type(business,businessC_business_type); |
| | | } |
| | | |
| | | public IC_business_typeServiceDao getC_business_typeServiceDaoImpl() { |
| | | return c_business_typeServiceDaoImpl; |
| | | } |
| | | |
| | | public void setC_business_typeServiceDaoImpl(IC_business_typeServiceDao c_business_typeServiceDaoImpl) { |
| | | this.c_business_typeServiceDaoImpl = c_business_typeServiceDaoImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.store.listener.businesstypecd; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.BusinessTypeConstant; |
| | | import com.java110.common.constant.StatusConstant; |
| | | import com.java110.common.util.Assert; |
| | | 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.IC_business_typeServiceDao; |
| | | 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; |
| | | |
| | | /** |
| | | * 保存 BusinessType信息 侦听 |
| | | * Created by wuxw on 2018/5/18. |
| | | */ |
| | | @Java110Listener("saveC_business_typeInfoListener") |
| | | @Transactional |
| | | public class SaveC_business_typeInfoListener extends AbstractC_business_typeBusinessServiceDataFlowListener{ |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(SaveC_business_typeInfoListener.class); |
| | | |
| | | @Autowired |
| | | private IC_business_typeServiceDao c_business_typeServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_SAVE_BUSINESSTYPE_INFO; |
| | | } |
| | | |
| | | /** |
| | | * 保存BusinessType信息 business 表中 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | JSONObject data = business.getDatas(); |
| | | Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessC_business_type 节点 |
| | | if(data.containsKey("businessC_business_type")){ |
| | | Object bObj = data.get("businessC_business_type"); |
| | | JSONArray businessC_business_types = null; |
| | | if(bObj instanceof JSONObject){ |
| | | businessC_business_types = new JSONArray(); |
| | | businessC_business_types.add(bObj); |
| | | }else { |
| | | businessC_business_types = (JSONArray)bObj; |
| | | } |
| | | //JSONObject businessC_business_type = data.getJSONObject("businessC_business_type"); |
| | | for (int bC_business_typeIndex = 0; bC_business_typeIndex < businessC_business_types.size();bC_business_typeIndex++) { |
| | | JSONObject businessC_business_type = businessC_business_types.getJSONObject(bC_business_typeIndex); |
| | | doBusinessC_business_type(business, businessC_business_type); |
| | | if(bObj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("id", businessC_business_type.getString("id")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 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); |
| | | |
| | | //BusinessType信息 |
| | | List<Map> businessC_business_typeInfo = c_business_typeServiceDaoImpl.getBusinessC_business_typeInfo(info); |
| | | if( businessC_business_typeInfo != null && businessC_business_typeInfo.size() >0) { |
| | | reFreshShareColumn(info, businessC_business_typeInfo.get(0)); |
| | | c_business_typeServiceDaoImpl.saveC_business_typeInfoInstance(info); |
| | | if(businessC_business_typeInfo.size() == 1) { |
| | | dataFlowContext.addParamOut("id", businessC_business_typeInfo.get(0).get("id")); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 刷 分片字段 |
| | | * |
| | | * @param info 查询对象 |
| | | * @param businessInfo 小区ID |
| | | */ |
| | | private void reFreshShareColumn(Map info, Map businessInfo) { |
| | | |
| | | if (info.containsKey("id")) { |
| | | return; |
| | | } |
| | | |
| | | if (!businessInfo.containsKey("id")) { |
| | | return; |
| | | } |
| | | |
| | | info.put("id", businessInfo.get("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); |
| | | //BusinessType信息 |
| | | List<Map> c_business_typeInfo = c_business_typeServiceDaoImpl.getC_business_typeInfo(info); |
| | | if(c_business_typeInfo != null && c_business_typeInfo.size() > 0){ |
| | | reFreshShareColumn(paramIn, c_business_typeInfo.get(0)); |
| | | c_business_typeServiceDaoImpl.updateC_business_typeInfoInstance(paramIn); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 处理 businessC_business_type 节点 |
| | | * @param business 总的数据节点 |
| | | * @param businessC_business_type BusinessType节点 |
| | | */ |
| | | private void doBusinessC_business_type(Business business,JSONObject businessC_business_type){ |
| | | |
| | | Assert.jsonObjectHaveKey(businessC_business_type,"id","businessC_business_type 节点下没有包含 id 节点"); |
| | | |
| | | if(businessC_business_type.getString("id").startsWith("-")){ |
| | | //刷新缓存 |
| | | //flushC_business_typeId(business.getDatas()); |
| | | |
| | | businessC_business_type.put("id",GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_id)); |
| | | |
| | | } |
| | | |
| | | businessC_business_type.put("bId",business.getbId()); |
| | | businessC_business_type.put("operate", StatusConstant.OPERATE_ADD); |
| | | //保存BusinessType信息 |
| | | c_business_typeServiceDaoImpl.saveBusinessC_business_typeInfo(businessC_business_type); |
| | | |
| | | } |
| | | |
| | | public IC_business_typeServiceDao getC_business_typeServiceDaoImpl() { |
| | | return c_business_typeServiceDaoImpl; |
| | | } |
| | | |
| | | public void setC_business_typeServiceDaoImpl(IC_business_typeServiceDao c_business_typeServiceDaoImpl) { |
| | | this.c_business_typeServiceDaoImpl = c_business_typeServiceDaoImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.store.listener.businesstypecd; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.BusinessTypeConstant; |
| | | import com.java110.common.constant.ResponseConstant; |
| | | import com.java110.common.constant.StatusConstant; |
| | | import com.java110.common.exception.ListenerExecuteException; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.store.dao.IC_business_typeServiceDao; |
| | | 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; |
| | | |
| | | /** |
| | | * 修改BusinessType信息 侦听 |
| | | * |
| | | * 处理节点 |
| | | * 1、businessC_business_type:{} BusinessType基本信息节点 |
| | | * 2、businessC_business_typeAttr:[{}] BusinessType属性信息节点 |
| | | * 3、businessC_business_typePhoto:[{}] BusinessType照片信息节点 |
| | | * 4、businessC_business_typeCerdentials:[{}] BusinessType证件信息节点 |
| | | * 协议地址 :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("updateC_business_typeInfoListener") |
| | | @Transactional |
| | | public class UpdateC_business_typeInfoListener extends AbstractC_business_typeBusinessServiceDataFlowListener { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(UpdateC_business_typeInfoListener.class); |
| | | @Autowired |
| | | private IC_business_typeServiceDao c_business_typeServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 2; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_BUSINESSTYPE_INFO; |
| | | } |
| | | |
| | | /** |
| | | * business过程 |
| | | * @param dataFlowContext 上下文对象 |
| | | * @param business 业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | |
| | | JSONObject data = business.getDatas(); |
| | | |
| | | Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessC_business_type 节点 |
| | | if(data.containsKey("businessC_business_type")){ |
| | | //处理 businessC_business_type 节点 |
| | | if(data.containsKey("businessC_business_type")){ |
| | | Object _obj = data.get("businessC_business_type"); |
| | | JSONArray businessC_business_types = null; |
| | | if(_obj instanceof JSONObject){ |
| | | businessC_business_types = new JSONArray(); |
| | | businessC_business_types.add(_obj); |
| | | }else { |
| | | businessC_business_types = (JSONArray)_obj; |
| | | } |
| | | //JSONObject businessC_business_type = data.getJSONObject("businessC_business_type"); |
| | | for (int _c_business_typeIndex = 0; _c_business_typeIndex < businessC_business_types.size();_c_business_typeIndex++) { |
| | | JSONObject businessC_business_type = businessC_business_types.getJSONObject(_c_business_typeIndex); |
| | | doBusinessC_business_type(business, businessC_business_type); |
| | | if(_obj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("id", businessC_business_type.getString("id")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 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); |
| | | |
| | | //BusinessType信息 |
| | | List<Map> businessC_business_typeInfos = c_business_typeServiceDaoImpl.getBusinessC_business_typeInfo(info); |
| | | if( businessC_business_typeInfos != null && businessC_business_typeInfos.size() >0) { |
| | | for (int _c_business_typeIndex = 0; _c_business_typeIndex < businessC_business_typeInfos.size();_c_business_typeIndex++) { |
| | | Map businessC_business_typeInfo = businessC_business_typeInfos.get(_c_business_typeIndex); |
| | | flushBusinessC_business_typeInfo(businessC_business_typeInfo,StatusConstant.STATUS_CD_VALID); |
| | | c_business_typeServiceDaoImpl.updateC_business_typeInfoInstance(businessC_business_typeInfo); |
| | | if(businessC_business_typeInfo.size() == 1) { |
| | | dataFlowContext.addParamOut("id", businessC_business_typeInfo.get("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); |
| | | //BusinessType信息 |
| | | List<Map> c_business_typeInfo = c_business_typeServiceDaoImpl.getC_business_typeInfo(info); |
| | | if(c_business_typeInfo != null && c_business_typeInfo.size() > 0){ |
| | | |
| | | //BusinessType信息 |
| | | List<Map> businessC_business_typeInfos = c_business_typeServiceDaoImpl.getBusinessC_business_typeInfo(delInfo); |
| | | //除非程序出错了,这里不会为空 |
| | | if(businessC_business_typeInfos == null || businessC_business_typeInfos.size() == 0){ |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(c_business_type),程序内部异常,请检查! "+delInfo); |
| | | } |
| | | for (int _c_business_typeIndex = 0; _c_business_typeIndex < businessC_business_typeInfos.size();_c_business_typeIndex++) { |
| | | Map businessC_business_typeInfo = businessC_business_typeInfos.get(_c_business_typeIndex); |
| | | flushBusinessC_business_typeInfo(businessC_business_typeInfo,StatusConstant.STATUS_CD_VALID); |
| | | c_business_typeServiceDaoImpl.updateC_business_typeInfoInstance(businessC_business_typeInfo); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 处理 businessC_business_type 节点 |
| | | * @param business 总的数据节点 |
| | | * @param businessC_business_type BusinessType节点 |
| | | */ |
| | | private void doBusinessC_business_type(Business business,JSONObject businessC_business_type){ |
| | | |
| | | Assert.jsonObjectHaveKey(businessC_business_type,"id","businessC_business_type 节点下没有包含 id 节点"); |
| | | |
| | | if(businessC_business_type.getString("id").startsWith("-")){ |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"id 错误,不能自动生成(必须已经存在的id)"+businessC_business_type); |
| | | } |
| | | //自动保存DEL |
| | | autoSaveDelBusinessC_business_type(business,businessC_business_type); |
| | | |
| | | businessC_business_type.put("bId",business.getbId()); |
| | | businessC_business_type.put("operate", StatusConstant.OPERATE_ADD); |
| | | //保存BusinessType信息 |
| | | c_business_typeServiceDaoImpl.saveBusinessC_business_typeInfo(businessC_business_type); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public IC_business_typeServiceDao getC_business_typeServiceDaoImpl() { |
| | | return c_business_typeServiceDaoImpl; |
| | | } |
| | | |
| | | public void setC_business_typeServiceDaoImpl(IC_business_typeServiceDao c_business_typeServiceDaoImpl) { |
| | | this.c_business_typeServiceDaoImpl = c_business_typeServiceDaoImpl; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.store.smo.impl.businesstype; |
| | | |
| | | |
| | | import com.java110.common.util.BeanConvertUtil; |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.core.smo.businessytpe.IC_business_typeInnerServiceSMO; |
| | | import com.java110.core.smo.user.IUserInnerServiceSMO; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.UserDto; |
| | | import com.java110.dto.businesstypecd.C_business_typeDto; |
| | | import com.java110.store.dao.IC_business_typeServiceDao; |
| | | 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 BusinessType内部服务实现类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:20 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @RestController |
| | | public class C_business_typeInnerServiceSMOImpl extends BaseServiceSMO implements IC_business_typeInnerServiceSMO { |
| | | |
| | | @Autowired |
| | | private IC_business_typeServiceDao c_business_typeServiceDaoImpl; |
| | | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public List<C_business_typeDto> queryC_business_types(@RequestBody C_business_typeDto c_business_typeDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = c_business_typeDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | c_business_typeDto.setPage((page - 1) * c_business_typeDto.getRow()); |
| | | c_business_typeDto.setRow(page * c_business_typeDto.getRow()); |
| | | } |
| | | |
| | | List<C_business_typeDto> c_business_types = BeanConvertUtil.covertBeanList(c_business_typeServiceDaoImpl.getC_business_typeInfo(BeanConvertUtil.beanCovertMap(c_business_typeDto)), C_business_typeDto.class); |
| | | |
| | | if (c_business_types == null || c_business_types.size() == 0) { |
| | | return c_business_types; |
| | | } |
| | | |
| | | String[] userIds = getUserIds(c_business_types); |
| | | //根据 userId 查询用户信息 |
| | | List<UserDto> users = userInnerServiceSMOImpl.getUserInfo(userIds); |
| | | |
| | | for (C_business_typeDto c_business_type : c_business_types) { |
| | | refreshC_business_type(c_business_type, users); |
| | | } |
| | | return c_business_types; |
| | | } |
| | | |
| | | /** |
| | | * 从用户列表中查询用户,将用户中的信息 刷新到 floor对象中 |
| | | * |
| | | * @param c_business_type 小区BusinessType信息 |
| | | * @param users 用户列表 |
| | | */ |
| | | private void refreshC_business_type(C_business_typeDto c_business_type, List<UserDto> users) { |
| | | for (UserDto user : users) { |
| | | if (c_business_type.getUserId().equals(user.getUserId())) { |
| | | BeanConvertUtil.covertBean(user, c_business_type); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取批量userId |
| | | * |
| | | * @param c_business_types 小区楼信息 |
| | | * @return 批量userIds 信息 |
| | | */ |
| | | private String[] getUserIds(List<C_business_typeDto> c_business_types) { |
| | | List<String> userIds = new ArrayList<String>(); |
| | | for (C_business_typeDto c_business_type : c_business_types) { |
| | | userIds.add(c_business_type.getUserId()); |
| | | } |
| | | |
| | | return userIds.toArray(new String[userIds.size()]); |
| | | } |
| | | |
| | | @Override |
| | | public int queryC_business_typesCount(@RequestBody C_business_typeDto c_business_typeDto) { |
| | | return c_business_typeServiceDaoImpl.queryC_business_typesCount(BeanConvertUtil.beanCovertMap(c_business_typeDto)); } |
| | | |
| | | public IC_business_typeServiceDao getC_business_typeServiceDaoImpl() { |
| | | return c_business_typeServiceDaoImpl; |
| | | } |
| | | |
| | | public void setC_business_typeServiceDaoImpl(IC_business_typeServiceDao c_business_typeServiceDaoImpl) { |
| | | this.c_business_typeServiceDaoImpl = c_business_typeServiceDaoImpl; |
| | | } |
| | | |
| | | public IUserInnerServiceSMO getUserInnerServiceSMOImpl() { |
| | | return userInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) { |
| | | this.userInnerServiceSMOImpl = userInnerServiceSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.components.businessType; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.IBusinessTypeServiceSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component("listBusinessType") |
| | | public class ListBusinessTypeComponent { |
| | | @Autowired |
| | | private IBusinessTypeServiceSMO businessTypeServiceSMOImpl; |
| | | |
| | | /** |
| | | * 查询小区楼信息 |
| | | * |
| | | * @param pd 页面封装对象 包含页面请求数据 |
| | | * @return ResponseEntity对象返回给页面 |
| | | */ |
| | | public ResponseEntity<String> list(IPageData pd) { |
| | | |
| | | return businessTypeServiceSMOImpl.listBusinessType(pd); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 用例接口 |
| | | */ |
| | | public interface IBusinessTypeServiceSMO { |
| | | |
| | | /** |
| | | * 查询用例信息 |
| | | * |
| | | * @param pd 页面数据封装对象 |
| | | * @return 返回 ResponseEntity对象包含 http状态 信息 body信息 |
| | | */ |
| | | ResponseEntity<String> listBusinessType(IPageData pd); |
| | | |
| | | |
| | | /** |
| | | * 添加用例信息 |
| | | * |
| | | * @param pd 页面数据封装对象 |
| | | * @return 返回 ResponseEntity对象包含 http状态 信息 body信息 |
| | | */ |
| | | ResponseEntity<String> saveBusinessType(IPageData pd); |
| | | |
| | | /** |
| | | * 编辑用例信息 |
| | | * |
| | | * @param pd 页面数据封装对象 |
| | | * @return 返回 ResponseEntity对象包含 http状态 信息 body信息 |
| | | */ |
| | | ResponseEntity<String> editBusinessType(IPageData pd); |
| | | |
| | | /** |
| | | * 删除用例 |
| | | * |
| | | * @param pd 页面数据封装对象 |
| | | * @return 返回 ResponseEntity对象包含 http状态 信息 body信息 |
| | | */ |
| | | ResponseEntity<String> deleteBusinessType(IPageData pd); |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.PrivilegeCodeConstant; |
| | | import com.java110.common.constant.ResponseConstant; |
| | | import com.java110.common.constant.ServiceConstant; |
| | | import com.java110.common.exception.SMOException; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.core.BaseComponentSMO; |
| | | import com.java110.web.smo.IBusinessTypeServiceSMO; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | /** |
| | | * 用例实现类 |
| | | * <p> |
| | | * add by wuxw 2019-04-22 |
| | | */ |
| | | |
| | | @Service("businessTypeServiceSMO") |
| | | public class BusinessTypeServiceSMOImpl extends BaseComponentSMO implements IBusinessTypeServiceSMO { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(BusinessTypeServiceSMOImpl.class); |
| | | |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | /** |
| | | * 查询小区楼 |
| | | * |
| | | * @param pd 页面数据封装对象 |
| | | * @return 返回 ResponseEntity对象包含 http状态 信息 body信息 |
| | | */ |
| | | @Override |
| | | public ResponseEntity<String> listBusinessType(IPageData pd) { |
| | | |
| | | validateListDemo(pd); |
| | | |
| | | JSONObject paramIn = JSONObject.parseObject(pd.getReqData()); |
| | | int page = Integer.parseInt(paramIn.getString("page")); |
| | | int row = Integer.parseInt(paramIn.getString("row")); |
| | | |
| | | |
| | | //校验用户是否有权限 |
| | | super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.PRIVILEGE_FLOOR); |
| | | |
| | | ResponseEntity responseEntity = super.getStoreInfo(pd, restTemplate); |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { |
| | | return responseEntity; |
| | | } |
| | | Assert.jsonObjectHaveKey(responseEntity.getBody().toString(), "storeId", "根据用户ID查询商户ID失败,未包含storeId节点"); |
| | | Assert.jsonObjectHaveKey(responseEntity.getBody().toString(), "storeTypeCd", "根据用户ID查询商户类型失败,未包含storeTypeCd节点"); |
| | | |
| | | String storeId = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeId"); |
| | | String storeTypeCd = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeTypeCd"); |
| | | //数据校验是否 商户是否入驻该小区 |
| | | // super.checkStoreEnterCommunity(pd, storeId, storeTypeCd, communityId, restTemplate); |
| | | String apiUrl = ServiceConstant.SERVICE_API_URL + "/api/business.queryBusinessTypeConfig" + mapToUrlParam(paramIn); |
| | | |
| | | |
| | | responseEntity = this.callCenterService(restTemplate, pd, "", |
| | | apiUrl, |
| | | HttpMethod.GET); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> saveBusinessType(IPageData pd) { |
| | | |
| | | validateSaveCar(pd); |
| | | |
| | | //校验员工是否有权限操作 |
| | | //super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.PRIVILEGE_CAR); |
| | | |
| | | JSONObject paramIn = JSONObject.parseObject(pd.getReqData()); |
| | | //String communityId = paramIn.getString("communityId"); |
| | | ResponseEntity responseEntity = super.getStoreInfo(pd, restTemplate); |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { |
| | | return responseEntity; |
| | | } |
| | | Assert.jsonObjectHaveKey(responseEntity.getBody().toString(), "storeId", "根据用户ID查询商户ID失败,未包含storeId节点"); |
| | | Assert.jsonObjectHaveKey(responseEntity.getBody().toString(), "storeTypeCd", "根据用户ID查询商户类型失败,未包含storeTypeCd节点"); |
| | | |
| | | String storeId = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeId"); |
| | | String storeTypeCd = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeTypeCd"); |
| | | //数据校验是否 商户是否入驻该小区 |
| | | //super.checkStoreEnterCommunity(pd, storeId, storeTypeCd, communityId, restTemplate); |
| | | |
| | | paramIn.put("userId", pd.getUserId()); |
| | | paramIn.put("storeId", storeId); |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), |
| | | ServiceConstant.SERVICE_API_URL + "/api/demo.saveDemoConfig", |
| | | HttpMethod.POST); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | /** |
| | | * 编辑小区楼信息 |
| | | * |
| | | * @param pd 页面数据封装对象 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResponseEntity<String> editBusinessType(IPageData pd) { |
| | | |
| | | validateEditCar(pd); |
| | | |
| | | //校验员工是否有权限操作 |
| | | super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.PRIVILEGE_FLOOR); |
| | | |
| | | JSONObject paramIn = JSONObject.parseObject(pd.getReqData()); |
| | | if (paramIn.getString("carId").equals(paramIn.getString("memberId"))) { |
| | | paramIn.put("carTypeCd", "1001"); |
| | | } else { |
| | | paramIn.put("carTypeCd", "1002"); |
| | | } |
| | | String communityId = paramIn.getString("communityId"); |
| | | ResponseEntity responseEntity = super.getStoreInfo(pd, restTemplate); |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { |
| | | return responseEntity; |
| | | } |
| | | Assert.jsonObjectHaveKey(responseEntity.getBody().toString(), "storeId", "根据用户ID查询商户ID失败,未包含storeId节点"); |
| | | Assert.jsonObjectHaveKey(responseEntity.getBody().toString(), "storeTypeCd", "根据用户ID查询商户类型失败,未包含storeTypeCd节点"); |
| | | |
| | | String storeId = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeId"); |
| | | String storeTypeCd = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeTypeCd"); |
| | | //数据校验是否 商户是否入驻该小区 |
| | | super.checkStoreEnterCommunity(pd, storeId, storeTypeCd, communityId, restTemplate); |
| | | paramIn.put("userId", pd.getUserId()); |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), |
| | | ServiceConstant.SERVICE_API_URL + "/api/car.editCar", |
| | | HttpMethod.POST); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> deleteBusinessType(IPageData pd) { |
| | | validateDeleteCar(pd); |
| | | //校验员工是否有权限操作 |
| | | super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.PRIVILEGE_FLOOR); |
| | | JSONObject paramIn = JSONObject.parseObject(pd.getReqData()); |
| | | if (paramIn.getString("carId").equals(paramIn.getString("memberId"))) { |
| | | paramIn.put("carTypeCd", "1001"); |
| | | } else { |
| | | paramIn.put("carTypeCd", "1002"); |
| | | } |
| | | String communityId = paramIn.getString("communityId"); |
| | | ResponseEntity responseEntity = super.getStoreInfo(pd, restTemplate); |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { |
| | | return responseEntity; |
| | | } |
| | | Assert.jsonObjectHaveKey(responseEntity.getBody().toString(), "storeId", "根据用户ID查询商户ID失败,未包含storeId节点"); |
| | | Assert.jsonObjectHaveKey(responseEntity.getBody().toString(), "storeTypeCd", "根据用户ID查询商户类型失败,未包含storeTypeCd节点"); |
| | | |
| | | String storeId = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeId"); |
| | | String storeTypeCd = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeTypeCd"); |
| | | //数据校验是否 商户是否入驻该小区 |
| | | super.checkStoreEnterCommunity(pd, storeId, storeTypeCd, communityId, restTemplate); |
| | | |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), |
| | | ServiceConstant.SERVICE_API_URL + "/api/car.deleteCar", |
| | | HttpMethod.POST); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | /** |
| | | * 删除小区楼 校验 |
| | | * |
| | | * @param pd 页面数据封装 |
| | | */ |
| | | private void validateDeleteCar(IPageData pd) { |
| | | |
| | | Assert.jsonObjectHaveKey(pd.getReqData(), "communityId", "未包含小区ID"); |
| | | Assert.jsonObjectHaveKey(pd.getReqData(), "memberId", "未包含业主ID"); |
| | | Assert.jsonObjectHaveKey(pd.getReqData(), "carId", "未包含业主ID"); |
| | | //Assert.jsonObjectHaveKey(pd.getReqData(), "carTypeCd", "请求报文中未包含carTypeCd节点"); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 校验修改小区楼 信息 |
| | | * |
| | | * @param pd 页面数据封装 |
| | | */ |
| | | private void validateEditCar(IPageData pd) { |
| | | Assert.jsonObjectHaveKey(pd.getReqData(), "communityId", "未包含小区ID"); |
| | | Assert.jsonObjectHaveKey(pd.getReqData(), "memberId", "未包含memberId"); |
| | | Assert.jsonObjectHaveKey(pd.getReqData(), "carId", "未包含carId"); |
| | | Assert.jsonObjectHaveKey(pd.getReqData(), "name", "请求报文中未包含name"); |
| | | Assert.jsonObjectHaveKey(pd.getReqData(), "age", "请求报文中未包含age"); |
| | | //Assert.jsonObjectHaveKey(pd.getReqData(), "carTypeCd", "请求报文中未包含carTypeCd节点"); |
| | | Assert.jsonObjectHaveKey(pd.getReqData(), "link", "请求报文中未包含link"); |
| | | Assert.jsonObjectHaveKey(pd.getReqData(), "sex", "请求报文中未包含sex"); |
| | | Assert.jsonObjectHaveKey(pd.getReqData(), "remark", "未包含小区楼备注"); |
| | | } |
| | | |
| | | /** |
| | | * 校验保存小区楼 信息 |
| | | * |
| | | * @param pd 页面数据封装 |
| | | */ |
| | | private void validateSaveCar(IPageData pd) { |
| | | |
| | | Assert.jsonObjectHaveKey(pd.getReqData(), "demoName", "未包含demoName"); |
| | | Assert.jsonObjectHaveKey(pd.getReqData(), "demoValue", "未包含demoValue"); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 校验查询小区楼信息 |
| | | * |
| | | * @param pd 页面封装对象 |
| | | */ |
| | | private void validateListDemo(IPageData pd) { |
| | | Assert.jsonObjectHaveKey(pd.getReqData(), "page", "请求报文中未包含page节点"); |
| | | Assert.jsonObjectHaveKey(pd.getReqData(), "row", "请求报文中未包含row节点"); |
| | | JSONObject paramIn = JSONObject.parseObject(pd.getReqData()); |
| | | Assert.isInteger(paramIn.getString("page"), "page不是数字"); |
| | | Assert.isInteger(paramIn.getString("row"), "rows不是数字"); |
| | | int row = Integer.parseInt(paramIn.getString("row")); |
| | | |
| | | |
| | | if (row > MAX_ROW) { |
| | | throw new SMOException(ResponseConstant.RESULT_CODE_ERROR, "row 数量不能大于50"); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |
| | | |
| | | public void setRestTemplate(RestTemplate restTemplate) { |
| | | this.restTemplate = restTemplate; |
| | | } |
| | | } |
| New file |
| | |
| | | <div id = "addOwnerModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" > |
| | | <div class="modal-dialog modal-lg"> |
| | | <div class="modal-content"> |
| | | <div class="modal-body"> |
| | | <h3 class="m-t-none m-b ">添加订单类型</h3> |
| | | <div class="ibox-content"> |
| | | <div> |
| | | <div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">订单类型编码</label> |
| | | <div class="col-sm-10"><input v-model="addOwnerInfo.name" type="text" placeholder="必填,请填写订单类型编码" class="form-control"></div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">订单类型名称</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="addOwnerInfo.name" type="text" placeholder="必填,请填写订单类型名称" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">年龄</label> |
| | | <div class="col-sm-10"><input v-model="addOwnerInfo.age" type="number" placeholder="必填,请填写年龄" class="form-control"></div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">手机</label> |
| | | <div class="col-sm-10"><input v-model="addOwnerInfo.link" type="number" placeholder="必填,请填写联系方式" class="form-control"></div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">备注</label> |
| | | <div class="col-sm-10"><input v-model="addOwnerInfo.remark" type="tel" placeholder="可填,请填写备注" class="form-control"></div> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <button class="btn btn-primary float-right" type="button" v-on:click="saveOwnerInfo()" ><i class="fa fa-check"></i> 保存</button> |
| | | <button type="button" class="btn btn-warning float-right" style="margin-right:20px;" data-dismiss="modal">取消</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| New file |
| | |
| | | (function(vc){ |
| | | |
| | | vc.extends({ |
| | | propTypes: { |
| | | notifyLoadDataComponentName:vc.propTypes.string |
| | | }, |
| | | data:{ |
| | | addOwnerInfo:{ |
| | | name:'', |
| | | age:'', |
| | | link:'', |
| | | sex:'', |
| | | remark:'', |
| | | ownerId:'' |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on('addOwner','openAddOwnerModal',function(_ownerId){ |
| | | if(_ownerId != null || _ownerId != -1){ |
| | | vc.component.addOwnerInfo.ownerId = _ownerId; |
| | | } |
| | | $('#addOwnerModel').modal('show'); |
| | | }); |
| | | }, |
| | | methods:{ |
| | | addOwnerValidate(){ |
| | | return vc.validate.validate({ |
| | | addOwnerInfo:vc.component.addOwnerInfo |
| | | },{ |
| | | 'addOwnerInfo.name':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"名称不能为空" |
| | | }, |
| | | { |
| | | limit:"maxin", |
| | | param:"2,10", |
| | | errInfo:"名称长度必须在2位至10位" |
| | | }, |
| | | ], |
| | | 'addOwnerInfo.age':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"年龄不能为空" |
| | | }, |
| | | { |
| | | limit:"num", |
| | | param:"", |
| | | errInfo:"年龄不是有效的数字" |
| | | }, |
| | | ], |
| | | 'addOwnerInfo.sex':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"性别不能为空" |
| | | } |
| | | ], |
| | | 'addOwnerInfo.link':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"手机号不能为空" |
| | | }, |
| | | { |
| | | limit:"phone", |
| | | param:"", |
| | | errInfo:"不是有效的手机号" |
| | | } |
| | | ], |
| | | 'addOwnerInfo.remark':[ |
| | | |
| | | { |
| | | limit:"maxLength", |
| | | param:"200", |
| | | errInfo:"备注长度不能超过200位" |
| | | } |
| | | ] |
| | | |
| | | }); |
| | | }, |
| | | saveOwnerInfo:function(){ |
| | | if(!vc.component.addOwnerValidate()){ |
| | | vc.message(vc.validate.errInfo); |
| | | |
| | | return ; |
| | | } |
| | | |
| | | vc.component.addOwnerInfo.communityId = vc.getCurrentCommunity().communityId; |
| | | vc.http.post( |
| | | 'addOwner', |
| | | 'saveOwner', |
| | | JSON.stringify(vc.component.addOwnerInfo), |
| | | { |
| | | emulateJSON:true |
| | | }, |
| | | function(json,res){ |
| | | //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); |
| | | if(res.status == 200){ |
| | | //关闭model |
| | | $('#addOwnerModel').modal('hide'); |
| | | vc.component.clearAddOwnerInfo(); |
| | | vc.emit($props.notifyLoadDataComponentName,'listOwnerData',{}); |
| | | |
| | | return ; |
| | | } |
| | | vc.message(json); |
| | | |
| | | }, |
| | | function(errInfo,error){ |
| | | console.log('请求失败处理'); |
| | | |
| | | vc.message(errInfo); |
| | | |
| | | }); |
| | | }, |
| | | clearAddOwnerInfo:function(){ |
| | | vc.component.addOwnerInfo = { |
| | | name:'', |
| | | age:'', |
| | | link:'', |
| | | sex:'', |
| | | remark:'' |
| | | }; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | })(window.vc); |
| New file |
| | |
| | | <div class="modal fade" id="deleteBusinessTypeModel" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> |
| | | <div class="modal-dialog" role="document"> |
| | | <div class="modal-content"> |
| | | <div class="modal-header"> |
| | | <h5 class="modal-title" id="exampleModalLabel">请确认您的操作!</h5> |
| | | <button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
| | | <span aria-hidden="true">×</span> |
| | | </button> |
| | | </div> |
| | | <div class="modal-body"> |
| | | <tr align="center"><th>您确定要删除吗?请再三考虑下呢!</th></tr> |
| | | </div> |
| | | <div class="modal-footer"> |
| | | <button type="button" class="btn btn-secondary" data-dismiss="modal" >点错了</button> |
| | | <button type="button" class="btn btn-primary" v-on:click="deleteBusinessType()">确认删除</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| New file |
| | |
| | | (function(vc){ |
| | | vc.extends({ |
| | | propTypes: { |
| | | notifyLoadDataComponentName:vc.propTypes.string |
| | | }, |
| | | data:{ |
| | | deleteBusinessTypeInfo:{} |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on('deleteBusinessType','openBusinessTypeModel',function(_BusinessTypeInfo){ |
| | | vc.component.deleteBusinessTypeInfo = _BusinessTypeInfo; |
| | | $('#deleteBusinessTypeModel').modal('show'); |
| | | }); |
| | | }, |
| | | methods:{ |
| | | closeDeleteOwnerModel:function(){ |
| | | $('#deleteBusinessTypeModel').modal('hide'); |
| | | }, |
| | | deleteOwner:function(){ |
| | | |
| | | vc.component.deleteBusinessTypeInfo.communityId = vc.getCurrentCommunity().communityId; |
| | | vc.http.post( |
| | | 'deleteBusinessType', |
| | | 'delete', |
| | | JSON.stringify(vc.component.deleteBusinessTypeInfo), |
| | | { |
| | | emulateJSON:true |
| | | }, |
| | | function(json,res){ |
| | | //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); |
| | | if(res.status == 200){ |
| | | //关闭model |
| | | $('#deleteBusinessTypeModel').modal('hide'); |
| | | vc.emit($props.notifyLoadDataComponentName,'listBusinessTypeData',{}); |
| | | return ; |
| | | } |
| | | vc.component.deleteBusinessTypeInfo.errorInfo = json; |
| | | }, |
| | | function(errInfo,error){ |
| | | console.log('请求失败处理'); |
| | | |
| | | vc.component.deleteBusinessTypeInfo.errorInfo = errInfo; |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | })(window.vc); |
| New file |
| | |
| | | <div id="component" class="wrapper wrapper-content animated fadeInRight ecommerce"> |
| | | <div class="row"> |
| | | <div class="col-lg-12"> |
| | | <div class="ibox"> |
| | | <div class="ibox-title"> |
| | | <h5>订单类型信息</h5> |
| | | <div class="ibox-tools" style="top:10px;"> |
| | | <button type="button" class="btn btn-primary btn-sm" v-on:click="_openAddBusinessTypeModal(-1)"> |
| | | <i class="glyphicon glyphicon-plus"></i> |
| | | 添加订单类型 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | |
| | | <table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15"> |
| | | <thead> |
| | | <tr> |
| | | <th>订单ID</th> |
| | | <th data-hide="phone">订单类型编码</th> |
| | | <th data-hide="phone">订单类型名称</th> |
| | | <th data-hide="phone">订单类型说明</th> |
| | | <th class="text-right">操作</th> |
| | | |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <tr v-for="BusTypes in BusinessType.BusType"> |
| | | <td> |
| | | {{BusTypes.ID}} |
| | | </td> |
| | | <td> |
| | | {{BusTypes.BusinessTypecD}} |
| | | </td> |
| | | <td> |
| | | {{BusTypes.Name}} |
| | | </td> |
| | | <td> |
| | | {{BusTypes.Description}} |
| | | </td> |
| | | <td class="text-right"> |
| | | <div class="btn-group"> |
| | | <button class="btn-white btn btn-xs" v-on:click="_openEditBusinessTypeModel(owner)">修改</button> |
| | | </div> |
| | | <div class="btn-group"> |
| | | <button class="btn-white btn btn-xs" v-on:click="_openDelBusinessTypeModel(owner)">删除</button> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | </tbody> |
| | | <tfoot> |
| | | <tr> |
| | | <td colspan="7"> |
| | | <ul class="pagination float-right"></ul> |
| | | </td> |
| | | </tr> |
| | | </tfoot> |
| | | </table> |
| | | <!-- 分页 --> |
| | | <vc:create name="pagination"></vc:create> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- <vc:create |
| | | name="addOwner" |
| | | notifyLoadDataComponentName="listOwner" |
| | | ></vc:create> |
| | | <vc:create |
| | | name="editOwner" |
| | | notifyLoadDataComponentName="listOwner" |
| | | |
| | | ></vc:create>--> |
| | | <vc:create name="deleteBusinessType" |
| | | ></vc:create> |
| | | |
| | | </div> |
| New file |
| | |
| | | (function(vc){ |
| | | var DEFAULT_PAGE = 1; |
| | | var DEFAULT_ROWS = 10; |
| | | vc.extends({ |
| | | data:{ |
| | | listBusinessTypeInfo:{ |
| | | BusinessType:[], |
| | | total:0, |
| | | records:1 |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | vc.component._listBusinessTypeData(DEFAULT_PAGE,DEFAULT_ROWS); |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on('listOwner','listOwnerData',function(){ |
| | | vc.component._listBusinessTypeData(DEFAULT_PAGE,DEFAULT_ROWS); |
| | | }); |
| | | vc.on('pagination','page_event',function(_currentPage){ |
| | | vc.component._listBusinessTypeData(_currentPage,DEFAULT_ROWS); |
| | | }); |
| | | }, |
| | | methods:{ |
| | | _listBusinessTypeData:function(_page,_row){ |
| | | var param = { |
| | | params:{ |
| | | page:_page, |
| | | row:_row |
| | | } |
| | | } |
| | | |
| | | //发送get请求 |
| | | vc.http.get('listBusinessType', |
| | | 'list', |
| | | param, |
| | | function(json,res){ |
| | | var listBusinessTypeData =JSON.parse(json); |
| | | |
| | | vc.component.listBusinessTypeInfo.total = listBusinessTypeData.total; |
| | | vc.component.listBusinessTypeInfo.records = listBusinessTypeData.records; |
| | | vc.component.listBusinessTypeInfo.BusinessType = listBusinessTypeData.BusinessType; |
| | | |
| | | vc.emit('pagination','init',{ |
| | | total:vc.component.listBusinessTypeInfo.records, |
| | | currentPage:_page |
| | | }); |
| | | },function(errInfo,error){ |
| | | console.log('请求失败处理'); |
| | | } |
| | | ); |
| | | |
| | | }, |
| | | _openAddBusinessTypeModal:function(){ //打开添加框 |
| | | vc.emit('addBusinessType','openAddBusinessTypeModal',-1); |
| | | }, |
| | | _openDelBusinessTypeModel:function(_owner){ // 打开删除对话框 |
| | | vc.emit('deleteBusinessType','openBusinessTypeModel',_owner); |
| | | }, |
| | | _openEditBusinessTypeModel:function(_owner){ |
| | | vc.emit('editBusinessType','openEditBusinessTypeModal',_owner); |
| | | } |
| | | } |
| | | }) |
| | | })(window.vc); |
| New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en" |
| | | xmlns="http://www.w3.org/1999/xhtml" |
| | | xmlns:th="http://www.thymeleaf.org" |
| | | xmlns:vc="http://www.thymeleaf.org"> |
| | | <head> |
| | | <meta charset="UTF-8"/> |
| | | <title>订单类型配置|java110</title> |
| | | <vc:create name="commonTop"></vc:create> |
| | | </head> |
| | | <body> |
| | | <vc:create name="bodyTop"></vc:create> |
| | | <div id="wrapper"> |
| | | <vc:create name="menu"></vc:create> |
| | | |
| | | |
| | | <div id="page-wrapper" class="gray-bg dashbard-1"> |
| | | <div class="row border-bottom"> |
| | | <vc:create name="nav"></vc:create> |
| | | </div> |
| | | <!-- id="component" --> |
| | | <div class="wrapper wrapper-content animated fadeInRight"> |
| | | <vc:create name="listBusinessType"></vc:create> |
| | | </div> |
| | | |
| | | <vc:create name="copyright"></vc:create> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <vc:create name="commonBottom"></vc:create> |
| | | </body> |
| | | </html> |
| New file |
| | |
| | | |
| | | |
| | | **1\. 删除BusinessType** |
| | | ###### 接口功能 |
| | | > API服务做删除BusinessType时调用该接口 |
| | | |
| | | ###### URL |
| | | > [http://c_business_type-service/c_business_typeApi/service](http://c_business_type-service/c_business_typeApi/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|businessC_business_typeInfo|1|Object|-|小区成员|小区成员| |
| | | |businessC_business_typeInfo|id|1|String|30|-|-| |
| | | |
| | | |
| | | ###### 返回协议 |
| | | |
| | | 当http返回状态不为200 时请求处理失败 body内容为失败的原因 |
| | | |
| | | 当http返回状态为200时请求处理成功,body内容为返回内容, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | ###### 举例 |
| | | > 地址:[http://c_business_type-service/c_business_typeApi/service](http://c_business_type-service/c_business_typeApi/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": "900100050002", |
| | | "bId":"1234567892", |
| | | "remark": "备注", |
| | | "datas": { |
| | | "businessC_business_typeInfo": { |
| | | "id":"填写存在的值" |
| | | } |
| | | }, |
| | | "attrs": [{ |
| | | "specCd": "配置的字段ID", |
| | | "value": "具体值" |
| | | }] |
| | | } |
| | | } |
| | | |
| | | 返回报文: |
| | | { |
| | | "orderTypeCd": "D", |
| | | "response": { |
| | | "code": "0000", |
| | | "message": "成功" |
| | | }, |
| | | "responseTime": "20190418102004", |
| | | "bId": "202019041810750003", |
| | | "businessType": "B", |
| | | "transactionId": "3a5a411ec65a4c3f895935638aa1d2bc", |
| | | "dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947" |
| | | } |
| | | |
| | | ``` |
| New file |
| | |
| | | |
| | | |
| | | **1\. 保存BusinessType** |
| | | ###### 接口功能 |
| | | > API服务做保存BusinessType时调用该接口 |
| | | |
| | | ###### URL |
| | | > [http://c_business_type-service/c_business_typeApi/service](http://c_business_type-service/c_business_typeApi/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|businessC_business_typeInfo|1|Object|-|小区成员|小区成员| |
| | | |businessC_business_typeInfo|businessTypeCd|1|String|30|-|-| |
| | | |businessC_business_typeInfo|name|1|String|30|-|-| |
| | | |businessC_business_typeInfo|description|1|String|30|-|-| |
| | | |businessC_business_typeInfo|id|1|String|30|-|-| |
| | | |businessC_business_typeInfo|userId|1|String|30|-|-| |
| | | |
| | | |
| | | ###### 返回协议 |
| | | |
| | | 当http返回状态不为200 时请求处理失败 body内容为失败的原因 |
| | | |
| | | 当http返回状态为200时请求处理成功,body内容为返回内容, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | ###### 举例 |
| | | > 地址:[http://c_business_type-service/c_business_typeApi/service](http://c_business_type-service/c_business_typeApi/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": "900100030002", |
| | | "bId":"1234567892", |
| | | "remark": "备注", |
| | | "datas": { |
| | | "businessC_business_typeInfo": { |
| | | "businessTypeCd":"填写具体值", |
| | | "name":"填写具体值", |
| | | "description":"填写具体值", |
| | | "id":"填写具体值", |
| | | "userId":"填写具体值" |
| | | } |
| | | }, |
| | | "attrs": [{ |
| | | "specCd": "配置的字段ID", |
| | | "value": "具体值" |
| | | }] |
| | | } |
| | | } |
| | | |
| | | 返回报文: |
| | | { |
| | | "orderTypeCd": "D", |
| | | "response": { |
| | | "code": "0000", |
| | | "message": "成功" |
| | | }, |
| | | "responseTime": "20190418102004", |
| | | "bId": "202019041810750003", |
| | | "businessType": "B", |
| | | "transactionId": "3a5a411ec65a4c3f895935638aa1d2bc", |
| | | "dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947" |
| | | } |
| | | |
| | | ``` |
| New file |
| | |
| | | |
| | | |
| | | **1\. 修改BusinessType** |
| | | ###### 接口功能 |
| | | > API服务做修改BusinessType时调用该接口 |
| | | |
| | | ###### URL |
| | | > [http://c_business_type-service/c_business_typeApi/service](http://c_business_type-service/c_business_typeApi/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|businessC_business_typeInfo|1|Object|-|小区成员|小区成员| |
| | | |businessC_business_typeInfo|businessTypeCd|1|String|30|-|-| |
| | | |businessC_business_typeInfo|name|1|String|30|-|-| |
| | | |businessC_business_typeInfo|description|1|String|30|-|-| |
| | | |businessC_business_typeInfo|id|1|String|30|-|-| |
| | | |businessC_business_typeInfo|userId|1|String|30|-|-| |
| | | |
| | | |
| | | ###### 返回协议 |
| | | |
| | | 当http返回状态不为200 时请求处理失败 body内容为失败的原因 |
| | | |
| | | 当http返回状态为200时请求处理成功,body内容为返回内容, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | ###### 举例 |
| | | > 地址:[http://c_business_type-service/c_business_typeApi/service](http://c_business_type-service/c_business_typeApi/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": "900100040002", |
| | | "bId":"1234567892", |
| | | "remark": "备注", |
| | | "datas": { |
| | | "businessC_business_typeInfo": { |
| | | "businessTypeCd":"填写具体值", |
| | | "name":"填写具体值", |
| | | "description":"填写具体值", |
| | | "id":"填写具体值", |
| | | "userId":"填写具体值" |
| | | } |
| | | }, |
| | | "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.businesstypecd; |
| | | |
| | | import com.java110.dto.PageDto; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClassName FloorDto |
| | | * @Description BusinessType数据层封装 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 8:52 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | public class C_business_typeDto extends PageDto implements Serializable { |
| | | |
| | | private String businessTypeCd; |
| | | private String name; |
| | | private String description; |
| | | private String id; |
| | | private String userId; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | |
| | | public String getBusinessTypeCd() { |
| | | return businessTypeCd; |
| | | } |
| | | public void setBusinessTypeCd(String businessTypeCd) { |
| | | this.businessTypeCd = businessTypeCd; |
| | | } |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | public String getDescription() { |
| | | return description; |
| | | } |
| | | public void setDescription(String description) { |
| | | this.description = description; |
| | | } |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | public String getUserId() { |
| | | return userId; |
| | | } |
| | | public void setUserId(String userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | |
| | | 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 BusinessTypeGeneratorApplication { |
| | | |
| | | protected BusinessTypeGeneratorApplication() { |
| | | // prevents calls from subclass |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | /** |
| | | * 代码生成器 入口方法 |
| | | * |
| | | * @param args 参数 |
| | | */ |
| | | public static void main(String[] args) { |
| | | Data data = new Data(); |
| | | data.setId("id");//主键ID |
| | | data.setName("c_business_type");//表名 |
| | | data.setDesc("BusinessType");//中文表名 |
| | | data.setNewBusinessTypeCd("BUSINESS_TYPE_SAVE_BUSINESSTYPE_INFO"); //业务类型 |
| | | data.setUpdateBusinessTypeCd("BUSINESS_TYPE_UPDATE_BUSINESSTYPE_INFO");//修改业务类型 |
| | | data.setDeleteBusinessTypeCd("BUSINESS_TYPE_DELETE_BUSINESSTYPE_INFO");//删除业务类型 |
| | | data.setNewBusinessTypeCdValue("900100030002");//业务类型编码 |
| | | data.setUpdateBusinessTypeCdValue("900100040002");//修修改业务类型编码 |
| | | data.setDeleteBusinessTypeCdValue("900100050002");//删除业务类型编码 |
| | | data.setBusinessTableName("business_bus");//表模型过程表名称 |
| | | data.setTableName("c_business_type");//表模型实列表名称 |
| | | data.setShareParam("id"); |
| | | data.setShareColumn("id"); |
| | | Map<String, String> param = new HashMap<String, String>(); |
| | | /**表模型字段绑定**/ |
| | | param.put("id", "id"); |
| | | param.put("businessTypeCd", "business_type_cd"); |
| | | param.put("name", "name"); |
| | | param.put("description", "description"); |
| | | param.put("userId", "user_id"); |
| | | param.put("operate", "operate"); |
| | | /**表模型字段绑定end 创建时间CREATE_DATE不需要绑定系统默认自带**/ |
| | | 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 BUSINESS_TYPE_UPDATE_DEMO_INFO = "900100040001"; |
| | | /** |
| | | * 删除BUSINESSTYPE方法编码 |
| | | */ |
| | | public static final String BUSINESS_TYPE_DELETE_BUSINESSTYPE_INFO = "900100050002"; |
| | | /** |
| | | * 保存BUSINESSTYPE方法编码 |
| | | */ |
| | | public static final String BUSINESS_TYPE_SAVE_BUSINESSTYPE_INFO = "900100030002"; |
| | | /** |
| | | * 修改BUSINESSTYPE方法编码 |
| | | */ |
| | | public static final String BUSINESS_TYPE_UPDATE_BUSINESSTYPE_INFO = "900100040002"; |
| | | |
| | | |
| | | } |
| | |
| | | //保存用例配置 |
| | | public static final String SERVICE_CODE_SAVE_DEMO_CONFIG = "demo.saveDemoConfig"; |
| | | |
| | | // 保存BUSINESSTYPE信息 |
| | | public static final String SERVICE_CODE_EXIT_BUSINESSTYPE_SPACE = "business.exitBusinessTypeSpace"; |
| | | |
| | | //查询BUSINESSTYPE配置 |
| | | public static final String SERVICE_CODE_QUERY_BUSINESSTYPE_CONFIG = "business.queryBusinessTypeConfig"; |
| | | |
| | | //保存BUSINESSTYPE配置 |
| | | public static final String SERVICE_CODE_SAVE_BUSINESSTYPE_CONFIG = "business.saveBusinessTypeConfig"; |
| | | |
| | | } |
| | |
| | | //测试用列 |
| | | public static final String CODE_PREFIX_demoId="90"; |
| | | |
| | | //BUSINESSTYPE |
| | | public static final String CODE_PREFIX_id="99"; |
| | | |
| | | /** |
| | | * 只有在不调用服务生成ID时有用 |
| | | */ |
| New file |
| | |
| | | package com.java110.core.smo.businessytpe; |
| | | |
| | | import com.java110.core.feign.FeignConfiguration; |
| | | import com.java110.dto.businesstypecd.C_business_typeDto; |
| | | import org.springframework.cloud.netflix.feign.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 IC_business_typeInnerServiceSMO |
| | | * @Description BusinessType接口类 |
| | | * @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("/c_business_typeApi") |
| | | public interface IC_business_typeInnerServiceSMO { |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * |
| | | * @param c_business_typeDto 数据对象分享 |
| | | * @return C_business_typeDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/queryC_business_types", method = RequestMethod.POST) |
| | | List<C_business_typeDto> queryC_business_types(@RequestBody C_business_typeDto c_business_typeDto); |
| | | |
| | | /** |
| | | * 查询<p>小区楼</p>总记录数 |
| | | * |
| | | * @param c_business_typeDto 数据对象分享 |
| | | * @return 小区下的小区楼记录数 |
| | | */ |
| | | @RequestMapping(value = "/queryC_business_typesCount", method = RequestMethod.POST) |
| | | int queryC_business_typesCount(@RequestBody C_business_typeDto c_business_typeDto); |
| | | } |
| New file |
| | |
| | | -- 服务注册过程表 |
| | | |
| | | create table business_bus( |
| | | id varchar(30) not null comment '服务ID', |
| | | b_id VARCHAR(30) NOT NULL COMMENT '业务Id', |
| | | business_type_cd VARCHAR(20) NOT null COMMENT '服务编码', |
| | | name VARCHAR(20) NOT null COMMENT '服务名称', |
| | | description VARCHAR(20) NOT null COMMENT '服务描述', |
| | | user_id varchar(30) not null comment '创建用户ID', |
| | | create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
| | | operate VARCHAR(4) NOT NULL COMMENT '数据状态,添加ADD,修改MOD 删除DEL' |
| | | ); |
| 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="c_business_typeServiceDaoImpl"> |
| | | |
| | | <!-- 保存BusinessType信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveBusinessC_business_typeInfo" parameterType="Map"> |
| | | insert into business_bus( |
| | | business_type_cd,operate,name,description,id,user_id |
| | | ) values ( |
| | | #{businessTypeCd},#{operate},#{name},#{description},#{id},#{userId} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询BusinessType信息(Business) add by wuxw 2018-07-03 --> |
| | | <select id="getBusinessC_business_typeInfo" parameterType="Map" resultType="Map"> |
| | | select t.business_type_cd,t.business_type_cd businessTypeCd,t.operate,t.name,t.description,t.id,t.user_id,t.user_id userId |
| | | from business_bus t |
| | | where 1 =1 |
| | | <if test="businessTypeCd !=null and businessTypeCd != ''"> |
| | | and t.business_type_cd= #{businessTypeCd} |
| | | </if> |
| | | <if test="operate !=null and operate != ''"> |
| | | and t.operate= #{operate} |
| | | </if> |
| | | <if test="name !=null and name != ''"> |
| | | and t.name= #{name} |
| | | </if> |
| | | <if test="description !=null and description != ''"> |
| | | and t.description= #{description} |
| | | </if> |
| | | <if test="id !=null and id != ''"> |
| | | and t.id= #{id} |
| | | </if> |
| | | <if test="userId !=null and userId != ''"> |
| | | and t.user_id= #{userId} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 保存BusinessType信息至 instance表中 add by wuxw 2018-07-03 --> |
| | | <insert id="saveC_business_typeInfoInstance" parameterType="Map"> |
| | | insert into c_business_type( |
| | | business_type_cd,name,description,id,user_id |
| | | ) select t.business_type_cd,t.name,t.description,t.id,t.user_id from business_bus t where 1=1 |
| | | <if test="businessTypeCd !=null and businessTypeCd != ''"> |
| | | and t.business_type_cd= #{businessTypeCd} |
| | | </if> |
| | | and t.operate= 'ADD' |
| | | <if test="name !=null and name != ''"> |
| | | and t.name= #{name} |
| | | </if> |
| | | <if test="description !=null and description != ''"> |
| | | and t.description= #{description} |
| | | </if> |
| | | <if test="id !=null and id != ''"> |
| | | and t.id= #{id} |
| | | </if> |
| | | <if test="userId !=null and userId != ''"> |
| | | and t.user_id= #{userId} |
| | | </if> |
| | | |
| | | </insert> |
| | | |
| | | |
| | | |
| | | <!-- 查询BusinessType信息 add by wuxw 2018-07-03 --> |
| | | <select id="getC_business_typeInfo" parameterType="Map" resultType="Map"> |
| | | select t.business_type_cd,t.business_type_cd businessTypeCd,t.name,t.description,t.id,t.user_id,t.user_id userId |
| | | from c_business_type t |
| | | where 1 =1 |
| | | <if test="businessTypeCd !=null and businessTypeCd != ''"> |
| | | and t.business_type_cd= #{businessTypeCd} |
| | | </if> |
| | | <if test="name !=null and name != ''"> |
| | | and t.name= #{name} |
| | | </if> |
| | | <if test="description !=null and description != ''"> |
| | | and t.description= #{description} |
| | | </if> |
| | | <if test="id !=null and id != ''"> |
| | | and t.id= #{id} |
| | | </if> |
| | | <if test="userId !=null and userId != ''"> |
| | | and t.user_id= #{userId} |
| | | </if> |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 修改BusinessType信息 add by wuxw 2018-07-03 --> |
| | | <update id="updateC_business_typeInfoInstance" parameterType="Map"> |
| | | update c_business_type t set t.status_cd = #{statusCd} |
| | | <if test="newBId != null and newBId != ''"> |
| | | ,t.b_id = #{newBId} |
| | | </if> |
| | | <if test="businessTypeCd !=null and businessTypeCd != ''"> |
| | | , t.business_type_cd= #{businessTypeCd} |
| | | </if> |
| | | <if test="name !=null and name != ''"> |
| | | , t.name= #{name} |
| | | </if> |
| | | <if test="description !=null and description != ''"> |
| | | , t.description= #{description} |
| | | </if> |
| | | <if test="userId !=null and userId != ''"> |
| | | , t.user_id= #{userId} |
| | | </if> |
| | | where 1=1 <if test="id !=null and id != ''"> |
| | | and t.id= #{id} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询BusinessType数量 add by wuxw 2018-07-03 --> |
| | | <select id="queryC_business_typesCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from c_business_type t |
| | | where 1 =1 |
| | | <if test="businessTypeCd !=null and businessTypeCd != ''"> |
| | | and t.business_type_cd= #{businessTypeCd} |
| | | </if> |
| | | <if test="name !=null and name != ''"> |
| | | and t.name= #{name} |
| | | </if> |
| | | <if test="description !=null and description != ''"> |
| | | and t.description= #{description} |
| | | </if> |
| | | <if test="id !=null and id != ''"> |
| | | and t.id= #{id} |
| | | </if> |
| | | <if test="userId !=null and userId != ''"> |
| | | and t.user_id= #{userId} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |