| New file |
| | |
| | | package com.java110.api.bmo.fastuser; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.bmo.IApiBaseBMO; |
| | | import com.java110.core.context.DataFlowContext; |
| | | |
| | | public interface IFastuserBMO extends IApiBaseBMO { |
| | | |
| | | |
| | | |
| | | /** |
| | | * 添加活动 |
| | | * @param paramInJson |
| | | * @param dataFlowContext |
| | | * @return |
| | | */ |
| | | JSONObject addFastuser(JSONObject paramInJson, DataFlowContext dataFlowContext); |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.api.bmo.fastuser.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.bmo.ApiBaseBMO; |
| | | import com.java110.api.bmo.fastuser.IFastuserBMO; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.smo.community.IActivitiesInnerServiceSMO; |
| | | import com.java110.core.smo.file.IFileInnerServiceSMO; |
| | | import com.java110.core.smo.file.IFileRelInnerServiceSMO; |
| | | import com.java110.dto.activities.ActivitiesDto; |
| | | import com.java110.dto.file.FileRelDto; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service("fastuserBMOImpl") |
| | | public class FastuserBMOImpl extends ApiBaseBMO implements IFastuserBMO { |
| | | |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public JSONObject addFastuser(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FASTUSER); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessFastuer = new JSONObject(); |
| | | businessFastuer.putAll(paramInJson); |
| | | businessFastuer.put("state","11000"); // 先设置为不审核 |
| | | //businessActivities.put("activitiesId", "-1"); |
| | | //计算 应收金额 |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessFastuser", businessFastuer); |
| | | return business; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.fastuser; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.smo.community.IFastuserInnerServiceSMO; |
| | | import com.java110.dto.fastuser.FastuserDto; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.ServiceCodeActivitiesConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.vo.api.fastuser.ApiFastuserDataVo; |
| | | import com.java110.vo.api.fastuser.ApiFastuserVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 查询小区侦听类 |
| | | */ |
| | | @Java110Listener("listFastUserListener") |
| | | public class ListFastUserListener extends AbstractServiceApiListener { |
| | | |
| | | @Autowired |
| | | private IFastuserInnerServiceSMO fastuserInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeActivitiesConstant.LIST_FASTUSER; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.GET; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含小区信息"); |
| | | super.validatePageInfo(reqJson); |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | FastuserDto fastuserDto = BeanConvertUtil.covertBean(reqJson, FastuserDto.class); |
| | | |
| | | int count = fastuserInnerServiceSMOImpl.queryFastuserCount(fastuserDto); |
| | | |
| | | List<ApiFastuserDataVo> fastuserDataVos = null; |
| | | |
| | | if (count > 0) { |
| | | fastuserDataVos = BeanConvertUtil.covertBeanList(fastuserInnerServiceSMOImpl.queryFastuser(fastuserDto), ApiFastuserDataVo.class); |
| | | } else { |
| | | fastuserDataVos = new ArrayList<>(); |
| | | } |
| | | |
| | | ApiFastuserVo apiFastuserVo = new ApiFastuserVo(); |
| | | |
| | | apiFastuserVo.setTotal(count); |
| | | apiFastuserVo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row"))); |
| | | apiFastuserVo.setFastuserDataVos(fastuserDataVos); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiFastuserVo), HttpStatus.OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | |
| | | } |
| | | |
| | | public IFastuserInnerServiceSMO getFastuserInnerServiceSMOImpl() { |
| | | return fastuserInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setFastuserInnerServiceSMOImpl(IFastuserInnerServiceSMO fastuserInnerServiceSMOImpl) { |
| | | this.fastuserInnerServiceSMOImpl = fastuserInnerServiceSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.fastuser; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.bmo.activities.IActivitiesBMO; |
| | | import com.java110.api.bmo.fastuser.IFastuserBMO; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.core.smo.file.IFileInnerServiceSMO; |
| | | import com.java110.dto.file.FileDto; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.ServiceCodeActivitiesConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 保存小区侦听 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("saveFastuserListener") |
| | | public class SaveFastuserListener extends AbstractServiceApiListener { |
| | | |
| | | @Autowired |
| | | private IFastuserBMO fastuserBMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "fastUserTitle", "必填,请填写业活动标题"); |
| | | Assert.hasKeyAndValue(reqJson, "fastUserContext", "必填,请填写活动内容"); |
| | | Assert.hasKeyAndValue(reqJson, "startTime", "必填,请选择开始时间"); |
| | | Assert.hasKeyAndValue(reqJson, "endTime", "必填,请选择结束时间"); |
| | | Assert.hasKeyAndValue(reqJson, "userId", "必填,请填写用户ID"); |
| | | Assert.hasKeyAndValue(reqJson, "userName", "必填,请填写用户名称"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | |
| | | JSONArray businesses = new JSONArray(); |
| | | |
| | | AppService service = event.getAppService(); |
| | | |
| | | reqJson.put("fastuserId",GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_fastuserId)); |
| | | |
| | | //添加单元信息 |
| | | businesses.add(fastuserBMOImpl.addFastuser(reqJson, context)); |
| | | |
| | | ResponseEntity<String> responseEntity = fastuserBMOImpl.callService(context, service.getServiceCode(), businesses); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeActivitiesConstant.ADD_FASTUSER; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.community.dao; |
| | | |
| | | |
| | | import com.java110.utils.exception.DAOException; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 活动组件内部之间使用,没有给外围系统提供服务能力 |
| | | * 活动服务接口类,要求全部以字符串传输,方便微服务化 |
| | | * 新建客户,修改客户,删除客户,查询客户等功能 |
| | | * |
| | | * Created by wuxw on 2016/12/27. |
| | | */ |
| | | public interface IFastuserServiceDao { |
| | | |
| | | /** |
| | | * 保存 活动信息 |
| | | * @param businessFastuserInfo 活动信息 封装 |
| | | * @throws DAOException 操作数据库异常 |
| | | */ |
| | | void saveBusinessFastuserInfo(Map businessFastuserInfo) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存 活动信息 Business数据到 Instance中 |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void saveFastuserInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询活动信息(instance过程) |
| | | * 根据bId 查询活动信息 |
| | | * @param info bId 信息 |
| | | * @return 活动信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getFastuserInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询活动信息(business过程) |
| | | * 根据bId 查询活动信息 |
| | | * @param info bId 信息 |
| | | * @return 活动信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getBusinessFastuserInfo(Map info) throws DAOException; |
| | | /** |
| | | * 查询活动总数 |
| | | * |
| | | * @param info 活动信息 |
| | | * @return 活动数量 |
| | | */ |
| | | |
| | | /** |
| | | * 修改活动信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void updateFastuserInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | int queryFastuserCount(Map info); |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.community.dao.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.community.dao.IActivitiesServiceDao; |
| | | import com.java110.community.dao.IFastuserServiceDao; |
| | | import com.java110.core.base.dao.BaseServiceDao; |
| | | 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("fastuserServiceDaoImpl") |
| | | //@Transactional |
| | | public class FastuserServiceDaoImpl extends BaseServiceDao implements IFastuserServiceDao { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(FastuserServiceDaoImpl.class); |
| | | |
| | | /** |
| | | * 活动信息封装 |
| | | * |
| | | * @param businessFastuserInfo 活动信息 封装 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveBusinessFastuserInfo(Map businessFastuserInfo) throws DAOException { |
| | | businessFastuserInfo.put("month", DateUtil.getCurrentMonth()); |
| | | // 查询business_user 数据是否已经存在 |
| | | logger.debug("保存活动信息 入参 businessFastuserInfo : {}", businessFastuserInfo); |
| | | int saveFlag = sqlSessionTemplate.insert("fastuserServiceDaoImpl.saveBusinessFastuserInfo", businessFastuserInfo); |
| | | |
| | | if (saveFlag < 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存活动数据失败:" + JSONObject.toJSONString(businessFastuserInfo)); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存活动信息 到 instance |
| | | * |
| | | * @param info bId 信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveFastuserInfoInstance(Map info) throws DAOException { |
| | | logger.debug("保存活动信息Instance 入参 info : {}", info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("fastuserServiceDaoImpl.saveFastuserInfoInstance", 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> getFastuserInfo(Map info) throws DAOException { |
| | | logger.debug("查询活动信息 入参 info : {}", info); |
| | | |
| | | List<Map> businessActivitiesInfos = sqlSessionTemplate.selectList("fastuserServiceDaoImpl.getFastuserInfo", info); |
| | | |
| | | return businessActivitiesInfos; |
| | | } |
| | | |
| | | /** |
| | | * 查询活动信息 |
| | | * |
| | | * @param info bId 信息 |
| | | * @return 活动信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getBusinessFastuserInfo(Map info) throws DAOException { |
| | | |
| | | logger.debug("查询活动信息 入参 info : {}", info); |
| | | |
| | | List<Map> businessActivitiesInfos = sqlSessionTemplate.selectList("fastuserServiceDaoImpl.getBusinessFastuserInfo", info); |
| | | |
| | | return businessActivitiesInfos; |
| | | } |
| | | |
| | | /** |
| | | * 查询活动数量 |
| | | * |
| | | * @param info 活动信息 |
| | | * @return 活动数量 |
| | | */ |
| | | @Override |
| | | public int queryFastuserCount(Map info) { |
| | | logger.debug("查询活动数据 入参 info : {}", info); |
| | | |
| | | List<Map> businessActivitiesInfos = sqlSessionTemplate.selectList("fastuserServiceDaoImpl.queryFastuserCount", info); |
| | | if (businessActivitiesInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessActivitiesInfos.get(0).get("count").toString()); |
| | | } |
| | | /** |
| | | * 修改活动信息 |
| | | * |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void updateFastuserInfoInstance(Map info) throws DAOException { |
| | | logger.debug("修改活动信息Instance 入参 info : {}", info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("fastuserServiceDaoImpl.updateFastuserInfoInstance", info); |
| | | |
| | | if (saveFlag < 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改活动信息Instance数据失败:" + JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.community.listener.fastuser; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.community.dao.IActivitiesServiceDao; |
| | | import com.java110.community.dao.IFastuserServiceDao; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.event.service.AbstractBusinessServiceDataFlowListener; |
| | | 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 AbstractFastuserBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener { |
| | | private static Logger logger = LoggerFactory.getLogger(AbstractFastuserBusinessServiceDataFlowListener.class); |
| | | |
| | | |
| | | /** |
| | | * 获取 DAO工具类 |
| | | * |
| | | * @return |
| | | */ |
| | | public abstract IFastuserServiceDao getFastuserServiceDaoImpl(); |
| | | |
| | | /** |
| | | * 刷新 businessActivitiesInfo 数据 |
| | | * 主要将 数据库 中字段和 接口传递字段建立关系 |
| | | * |
| | | * @param businessActivitiesInfo |
| | | */ |
| | | protected void flushBusinessActivitiesInfo(Map businessActivitiesInfo, String statusCd) { |
| | | businessActivitiesInfo.put("newBId", businessActivitiesInfo.get("b_id")); |
| | | businessActivitiesInfo.put("collectCount", businessActivitiesInfo.get("collect_count")); |
| | | businessActivitiesInfo.put("likeCount", businessActivitiesInfo.get("like_count")); |
| | | businessActivitiesInfo.put("title", businessActivitiesInfo.get("title")); |
| | | businessActivitiesInfo.put("readCount", businessActivitiesInfo.get("read_count")); |
| | | businessActivitiesInfo.put("userName", businessActivitiesInfo.get("user_name")); |
| | | businessActivitiesInfo.put("userId", businessActivitiesInfo.get("user_id")); |
| | | businessActivitiesInfo.put("activitiesId", businessActivitiesInfo.get("activities_id")); |
| | | businessActivitiesInfo.put("operate", businessActivitiesInfo.get("operate")); |
| | | businessActivitiesInfo.put("typeCd", businessActivitiesInfo.get("type_cd")); |
| | | businessActivitiesInfo.put("context", businessActivitiesInfo.get("context")); |
| | | businessActivitiesInfo.put("startTime", businessActivitiesInfo.get("start_time")); |
| | | businessActivitiesInfo.put("endTime", businessActivitiesInfo.get("end_time")); |
| | | businessActivitiesInfo.put("communityId", businessActivitiesInfo.get("community_id")); |
| | | businessActivitiesInfo.put("headerImg", businessActivitiesInfo.get("header_img")); |
| | | businessActivitiesInfo.put("state", businessActivitiesInfo.get("state")); |
| | | businessActivitiesInfo.remove("bId"); |
| | | businessActivitiesInfo.put("statusCd", statusCd); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中 |
| | | * |
| | | * @param businessActivities 活动信息 |
| | | */ |
| | | protected void autoSaveDelBusinessActivities(Business business, JSONObject businessActivities) { |
| | | //自动插入DEL |
| | | Map info = new HashMap(); |
| | | info.put("activitiesId", businessActivities.getString("activitiesId")); |
| | | info.put("statusCd", StatusConstant.STATUS_CD_VALID); |
| | | List<Map> currentActivitiesInfos = getFastuserServiceDaoImpl().getFastuserInfo(info); |
| | | if (currentActivitiesInfos == null || currentActivitiesInfos.size() != 1) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "未找到需要修改数据信息,入参错误或数据有问题,请检查" + info); |
| | | } |
| | | |
| | | Map currentActivitiesInfo = currentActivitiesInfos.get(0); |
| | | |
| | | currentActivitiesInfo.put("bId", business.getbId()); |
| | | |
| | | currentActivitiesInfo.put("collectCount", currentActivitiesInfo.get("collect_count")); |
| | | currentActivitiesInfo.put("likeCount", currentActivitiesInfo.get("like_count")); |
| | | currentActivitiesInfo.put("title", currentActivitiesInfo.get("title")); |
| | | currentActivitiesInfo.put("readCount", currentActivitiesInfo.get("read_count")); |
| | | currentActivitiesInfo.put("userName", currentActivitiesInfo.get("user_name")); |
| | | currentActivitiesInfo.put("userId", currentActivitiesInfo.get("user_id")); |
| | | currentActivitiesInfo.put("activitiesId", currentActivitiesInfo.get("activities_id")); |
| | | currentActivitiesInfo.put("operate", currentActivitiesInfo.get("operate")); |
| | | currentActivitiesInfo.put("typeCd", currentActivitiesInfo.get("type_cd")); |
| | | currentActivitiesInfo.put("context", currentActivitiesInfo.get("context")); |
| | | currentActivitiesInfo.put("startTime", currentActivitiesInfo.get("start_time")); |
| | | currentActivitiesInfo.put("endTime", currentActivitiesInfo.get("end_time")); |
| | | currentActivitiesInfo.put("communityId", currentActivitiesInfo.get("community_id")); |
| | | currentActivitiesInfo.put("headerImg", currentActivitiesInfo.get("header_img")); |
| | | currentActivitiesInfo.put("state", currentActivitiesInfo.get("state")); |
| | | |
| | | |
| | | currentActivitiesInfo.put("operate", StatusConstant.OPERATE_DEL); |
| | | getFastuserServiceDaoImpl().saveBusinessFastuserInfo(currentActivitiesInfo); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.community.listener.fastuser; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.community.dao.IActivitiesServiceDao; |
| | | import com.java110.community.dao.IFastuserServiceDao; |
| | | 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.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("saveFastuserInfoListener") |
| | | @Transactional |
| | | public class SaveFastuserInfoListener extends AbstractFastuserBusinessServiceDataFlowListener { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(SaveFastuserInfoListener.class); |
| | | |
| | | @Autowired |
| | | private IFastuserServiceDao fastuserServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_SAVE_FASTUSER; |
| | | } |
| | | |
| | | /** |
| | | * 保存活动信息 business 表中 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | JSONObject data = business.getDatas(); |
| | | Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessActivities 节点 |
| | | if(data.containsKey("businessFastuser")){ |
| | | Object bObj = data.get("businessFastuser"); |
| | | JSONArray businessFastusers = null; |
| | | if(bObj instanceof JSONObject){ |
| | | businessFastusers = new JSONArray(); |
| | | businessFastusers.add(bObj); |
| | | }else { |
| | | businessFastusers = (JSONArray)bObj; |
| | | } |
| | | //JSONObject businessActivities = data.getJSONObject("businessActivities"); |
| | | for (int bFastusersIndex = 0; bFastusersIndex < businessFastusers.size();bFastusersIndex++) { |
| | | JSONObject businessFastuser = businessFastusers.getJSONObject(bFastusersIndex); |
| | | doBusinessFastuser(business, businessFastuser); |
| | | if(bObj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("fastuserId", businessFastuser.getString("fastuserId")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 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> businessActivitiesInfo = fastuserServiceDaoImpl.getBusinessFastuserInfo(info); |
| | | if( businessActivitiesInfo != null && businessActivitiesInfo.size() >0) { |
| | | reFreshShareColumn(info, businessActivitiesInfo.get(0)); |
| | | fastuserServiceDaoImpl.saveFastuserInfoInstance(info); |
| | | if(businessActivitiesInfo.size() == 1) { |
| | | dataFlowContext.addParamOut("fastuserId", businessActivitiesInfo.get(0).get("fast_user_id")); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 刷 分片字段 |
| | | * |
| | | * @param info 查询对象 |
| | | * @param businessInfo 小区ID |
| | | */ |
| | | private void reFreshShareColumn(Map info, Map businessInfo) { |
| | | |
| | | if (info.containsKey("communityId")) { |
| | | return; |
| | | } |
| | | |
| | | if (!businessInfo.containsKey("community_id")) { |
| | | return; |
| | | } |
| | | |
| | | info.put("communityId", businessInfo.get("community_id")); |
| | | } |
| | | /** |
| | | * 撤单 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doRecover(DataFlowContext dataFlowContext, Business business) { |
| | | String bId = business.getbId(); |
| | | //Assert.hasLength(bId,"请求报文中没有包含 bId"); |
| | | Map info = new HashMap(); |
| | | info.put("bId",bId); |
| | | info.put("statusCd",StatusConstant.STATUS_CD_VALID); |
| | | Map paramIn = new HashMap(); |
| | | paramIn.put("bId",bId); |
| | | paramIn.put("statusCd",StatusConstant.STATUS_CD_INVALID); |
| | | //活动信息 |
| | | List<Map> activitiesInfo = fastuserServiceDaoImpl.getFastuserInfo(info); |
| | | if(activitiesInfo != null && activitiesInfo.size() > 0){ |
| | | reFreshShareColumn(paramIn, activitiesInfo.get(0)); |
| | | fastuserServiceDaoImpl.updateFastuserInfoInstance(paramIn); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 处理 businessActivities 节点 |
| | | * @param business 总的数据节点 |
| | | * @param businessFastusers 活动节点 |
| | | */ |
| | | private void doBusinessFastuser(Business business,JSONObject businessFastusers){ |
| | | |
| | | Assert.jsonObjectHaveKey(businessFastusers,"fastuserId","businessFastusers 节点下没有包含 fastuserId 节点"); |
| | | |
| | | if(businessFastusers.getString("fastuserId").startsWith("-")){ |
| | | //刷新缓存 |
| | | //flushActivitiesId(business.getDatas()); |
| | | |
| | | businessFastusers.put("fastuserId",GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_fastuserId)); |
| | | |
| | | } |
| | | |
| | | businessFastusers.put("bId",business.getbId()); |
| | | businessFastusers.put("operate", StatusConstant.OPERATE_ADD); |
| | | //保存活动信息 |
| | | fastuserServiceDaoImpl.saveBusinessFastuserInfo(businessFastusers); |
| | | |
| | | } |
| | | |
| | | public IFastuserServiceDao getFastuserServiceDaoImpl() { |
| | | return fastuserServiceDaoImpl; |
| | | } |
| | | |
| | | public void setFastuserServiceDaoImpl(IFastuserServiceDao fastuserServiceDaoImpl) { |
| | | this.fastuserServiceDaoImpl = fastuserServiceDaoImpl; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.community.smo.impl; |
| | | |
| | | |
| | | import com.java110.community.dao.IActivitiesServiceDao; |
| | | import com.java110.community.dao.IFastuserServiceDao; |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.core.smo.community.IActivitiesInnerServiceSMO; |
| | | import com.java110.core.smo.community.IFastuserInnerServiceSMO; |
| | | import com.java110.core.smo.user.IUserInnerServiceSMO; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.activities.ActivitiesDto; |
| | | import com.java110.dto.fastuser.FastuserDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.vo.api.fastuser.ApiFastuserDataVo; |
| | | 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 FastuserInnerServiceSMOImpl |
| | | * @Description 活动内部服务实现类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:20 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @RestController |
| | | public class FastuserInnerServiceSMOImpl extends BaseServiceSMO implements IFastuserInnerServiceSMO { |
| | | |
| | | |
| | | @Autowired |
| | | private IFastuserServiceDao fastuserServiceDaoImpl; |
| | | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public List<FastuserDto> queryFastuser(@RequestBody FastuserDto fastuserDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = fastuserDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | fastuserDto.setPage((page - 1) * fastuserDto.getRow()); |
| | | } |
| | | |
| | | List<FastuserDto> fastusers = BeanConvertUtil.covertBeanList(fastuserServiceDaoImpl.getFastuserInfo(BeanConvertUtil.beanCovertMap(fastuserDto)), FastuserDto.class); |
| | | |
| | | if (fastusers == null || fastusers.size() == 0) { |
| | | return fastusers; |
| | | } |
| | | |
| | | String[] userIds = getUserIds(fastusers); |
| | | //根据 userId 查询用户信息 |
| | | List<UserDto> users = userInnerServiceSMOImpl.getUserInfo(userIds); |
| | | |
| | | for (FastuserDto fastuser : fastusers) { |
| | | refreshFastuser(fastuser, users); |
| | | } |
| | | return fastusers; |
| | | } |
| | | |
| | | /** |
| | | * 从用户列表中查询用户,将用户中的信息 刷新到 floor对象中 |
| | | * |
| | | * @param fastusers 小区活动信息 |
| | | * @param users 用户列表 |
| | | */ |
| | | private void refreshFastuser(FastuserDto fastusers,List<UserDto> users) { |
| | | for (UserDto user : users) { |
| | | if (fastusers.getUserId().equals(user.getUserId())) { |
| | | BeanConvertUtil.covertBean(user, fastusers); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取批量userId |
| | | * |
| | | * @param fastuserDto 小区楼信息 |
| | | * @return 批量userIds 信息 |
| | | */ |
| | | private String[] getUserIds(List<FastuserDto> fastuserDto) { |
| | | List<String> userIds = new ArrayList<String>(); |
| | | for (FastuserDto fastuserDtos : fastuserDto) { |
| | | userIds.add(fastuserDtos.getUserId()); |
| | | } |
| | | |
| | | return userIds.toArray(new String[userIds.size()]); |
| | | } |
| | | |
| | | @Override |
| | | public int queryFastuserCount(@RequestBody FastuserDto fastuserDto) { |
| | | return fastuserServiceDaoImpl.queryFastuserCount(BeanConvertUtil.beanCovertMap(fastuserDto)); |
| | | } |
| | | |
| | | |
| | | |
| | | public IUserInnerServiceSMO getUserInnerServiceSMOImpl() { |
| | | return userInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) { |
| | | this.userInnerServiceSMOImpl = userInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public IFastuserServiceDao getFastuserServiceDaoImpl() { |
| | | return fastuserServiceDaoImpl; |
| | | } |
| | | |
| | | public void setFastuserServiceDaoImpl(IFastuserServiceDao fastuserServiceDaoImpl) { |
| | | this.fastuserServiceDaoImpl = fastuserServiceDaoImpl; |
| | | } |
| | | } |
| | |
| | | host: dev.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | password: hc |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | database: 0 |
| | | host: dev.redis.java110.com |
| | | port: 6379 |
| | | password: |
| | | password: hc |
| | | pool: |
| | | max-active: 300 |
| | | max-wait: 10000 |
| | |
| | | |
| | | serviceBusiness = ServiceBusinessUtil.getServiceBusiness(business.getBusinessTypeCd()); |
| | | requestBusinessJson = OrderDataFlowContextFactory.getRequestBusinessJson(dataFlow, business); |
| | | |
| | | //调用下游中心 |
| | | JSONObject responseJson = doRequestBusinessSystem(dataFlow, serviceBusiness, requestBusinessJson); |
| | | |
| | | //发布事件 |
| | |
| | | host: dev.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | password: hc |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | database: 0 |
| | | host: dev.redis.java110.com |
| | | port: 6379 |
| | | password: hc |
| | | pool: |
| | | max-active: 300 |
| | | max-wait: 10000 |
| | |
| | | host: dev.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | password: hc |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | database: 0 |
| | | host: dev.redis.java110.com |
| | | port: 6379 |
| | | password: hc |
| | | pool: |
| | | max-active: 300 |
| | | max-wait: 10000 |
| New file |
| | |
| | | package com.java110.dto.fastuser; |
| | | |
| | | import com.java110.dto.PageDto; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClassName FastuserDto |
| | | * @Description 活动数据层封装 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 8:52 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | public class FastuserDto extends PageDto implements Serializable { |
| | | |
| | | private String fastUserContext; |
| | | private String fastUserTitle; |
| | | private String userName; |
| | | private String userId; |
| | | private String fastUserId; |
| | | private String startTime; |
| | | private String endTime; |
| | | private String communityId; |
| | | private String state; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | |
| | | public String getUserName() { |
| | | return userName; |
| | | } |
| | | |
| | | public void setUserName(String userName) { |
| | | this.userName = userName; |
| | | } |
| | | |
| | | public String getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(String userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | |
| | | public String getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(String startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public String getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(String endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | public String getCommunityId() { |
| | | return communityId; |
| | | } |
| | | |
| | | public void setCommunityId(String communityId) { |
| | | this.communityId = communityId; |
| | | } |
| | | |
| | | |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | |
| | | public String getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(String state) { |
| | | this.state = state; |
| | | } |
| | | |
| | | public String getFastUserContext() { |
| | | return fastUserContext; |
| | | } |
| | | |
| | | public void setFastUserContext(String fastUserContext) { |
| | | this.fastUserContext = fastUserContext; |
| | | } |
| | | |
| | | public String getFastUserTitle() { |
| | | return fastUserTitle; |
| | | } |
| | | |
| | | public void setFastUserTitle(String fastUserTitle) { |
| | | this.fastUserTitle = fastUserTitle; |
| | | } |
| | | |
| | | public String getFastUserId() { |
| | | return fastUserId; |
| | | } |
| | | |
| | | public void setFastUserId(String fastUserId) { |
| | | this.fastUserId = fastUserId; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.vo.api.fastuser; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | public class ApiFastuserDataVo implements Serializable { |
| | | |
| | | private String fastUserContext; |
| | | private String fastUserTitle; |
| | | private String userName; |
| | | private String startTime; |
| | | private String endTime; |
| | | private String fastUserId; |
| | | private Date createTime; |
| | | |
| | | public String getUserName() { |
| | | return userName; |
| | | } |
| | | |
| | | public void setUserName(String userName) { |
| | | this.userName = userName; |
| | | } |
| | | |
| | | public String getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(String startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public String getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(String endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getFastUserContext() { |
| | | return fastUserContext; |
| | | } |
| | | |
| | | public void setFastUserContext(String fastUserContext) { |
| | | this.fastUserContext = fastUserContext; |
| | | } |
| | | |
| | | public String getFastUserTitle() { |
| | | return fastUserTitle; |
| | | } |
| | | |
| | | public void setFastUserTitle(String fastUserTitle) { |
| | | this.fastUserTitle = fastUserTitle; |
| | | } |
| | | |
| | | public String getFastUserId() { |
| | | return fastUserId; |
| | | } |
| | | |
| | | public void setFastUserId(String fastUserId) { |
| | | this.fastUserId = fastUserId; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.vo.api.fastuser; |
| | | |
| | | import com.java110.vo.MorePageVo; |
| | | import com.java110.vo.api.activities.ApiActivitiesDataVo; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | public class ApiFastuserVo extends MorePageVo implements Serializable { |
| | | |
| | | List<ApiFastuserDataVo> fastuserDataVos; |
| | | |
| | | public List<ApiFastuserDataVo> getFastuserDataVos() { |
| | | return fastuserDataVos; |
| | | } |
| | | |
| | | public void setFastuserDataVos(List<ApiFastuserDataVo> fastuserDataVos) { |
| | | this.fastuserDataVos = fastuserDataVos; |
| | | } |
| | | |
| | | } |
| | |
| | | public static final String CODE_PREFIX_irmRelId = "51"; |
| | | public static final String CODE_PREFIX_inspectionPlanId = "14"; |
| | | public static final String CODE_PREFIX_applyOrderId = "15"; |
| | | public static final String CODE_PREFIX_fastuserId = "68"; |
| | | |
| | | |
| | | |
| New file |
| | |
| | | package com.java110.core.smo.community; |
| | | |
| | | import com.java110.core.feign.FeignConfiguration; |
| | | import com.java110.dto.fastuser.FastuserDto; |
| | | import com.java110.vo.api.fastuser.ApiFastuserDataVo; |
| | | 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 IFastuserInnerServiceSMO |
| | | * @Description 活动接口类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:04 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @FeignClient(name = "community-service", configuration = {FeignConfiguration.class}) |
| | | @RequestMapping("/fastuserApi") |
| | | public interface IFastuserInnerServiceSMO { |
| | | |
| | | /** |
| | | * <p>查询用户测试信息</p> |
| | | * |
| | | * @param fastuserDto 数据对象分享 |
| | | * @return ActivitiesDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/queryFastuser", method = RequestMethod.POST) |
| | | List<FastuserDto> queryFastuser(@RequestBody FastuserDto fastuserDto); |
| | | |
| | | /** |
| | | * 查询<p>小区楼</p>总记录数 |
| | | * |
| | | * @param fastuserDto 数据对象分享 |
| | | * @return 小区下的小区楼记录数 |
| | | */ |
| | | @RequestMapping(value = "/queryFastuserCount", method = RequestMethod.POST) |
| | | int queryFastuserCount(@RequestBody FastuserDto fastuserDto); |
| | | } |
| New file |
| | |
| | | -- 活动信息表 |
| | | CREATE TABLE business_fast_user( |
| | | fast_user_id VARCHAR(30) NOT NULL COMMENT '用户首次测试ID', |
| | | b_id VARCHAR(30) NOT NULL COMMENT '业务Id', |
| | | fast_user_title VARCHAR(12) NOT NULL COMMENT '测试标题', |
| | | fast_user_context longtext not null comment '测试内容', |
| | | community_id varchar(30) not null comment '小区ID', |
| | | user_id VARCHAR(30) NOT NULL COMMENT '创建用户Id', |
| | | user_name VARCHAR(30) NOT NULL COMMENT '创建用户名称', |
| | | start_time timestamp not null default current_timestamp comment '开始时间', |
| | | end_time timestamp not null comment '结束时间', |
| | | state varchar(12) not null default '10000' comment '审核状态,10000 待审核 ,11000 审核完成 12000 审核失败', |
| | | create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
| | | operate VARCHAR(4) NOT NULL COMMENT '数据状态,添加ADD,修改MOD 删除DEL' |
| | | ); |
| | | |
| | | |
| | | CREATE INDEX idx_business_fast_user_id ON business_fastuser(fast_user_id); |
| | | CREATE INDEX idx_business_fast_user_b_id ON business_fastuser(b_id); |
| | | |
| | | |
| | | CREATE TABLE fast_user( |
| | | fast_user_id VARCHAR(30) NOT NULL COMMENT '用户首次测试ID', |
| | | b_id VARCHAR(30) NOT NULL COMMENT '业务Id', |
| | | fast_user_title VARCHAR(12) NOT NULL COMMENT '测试标题', |
| | | fast_user_context longtext not null comment '测试内容', |
| | | community_id varchar(30) not null comment '小区ID', |
| | | user_id VARCHAR(30) NOT NULL COMMENT '创建用户Id', |
| | | user_name VARCHAR(30) NOT NULL COMMENT '创建用户名称', |
| | | start_time timestamp not null default current_timestamp comment '开始时间', |
| | | end_time timestamp not null comment '结束时间', |
| | | state varchar(12) not null default '10000' comment '审核状态,10000 待审核 ,11000 审核完成 12000 审核失败', |
| | | create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
| | | status_cd VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效', |
| | | UNIQUE KEY (fast_user_id) |
| | | ); |
| | | CREATE INDEX idx_fast_user_b_id ON fast_user(b_id); |
| | | CREATE UNIQUE INDEX idx_fast_user_id ON fast_user(fast_user_id); |
| 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="fastuserServiceDaoImpl"> |
| | | |
| | | <!-- 保存活动信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveBusinessFastuserInfo" parameterType="Map"> |
| | | |
| | | insert into business_fast_user( |
| | | fast_user_id,fast_user_title,user_name,user_id,operate,fast_user_context,start_time,end_time,community_id,b_id,state |
| | | ) values ( |
| | | #{fastUserId},#{fastUserTitle},#{userName},#{userId},#{operate},#{fastUserContext},#{startTime},#{endTime}, |
| | | #{communityId},#{bId},#{state} |
| | | |
| | | </insert> |
| | | |
| | | |
| | | <!-- 保存活动信息至 instance表中 add by wuxw 2018-07-03 --> |
| | | <insert id="saveFastuserInfoInstance" parameterType="Map"> |
| | | insert into fast_user( |
| | | fast_user_id,fast_user_title,user_name,user_id,operate,fast_user_context,start_time,end_time,community_id,b_id,state |
| | | ) select |
| | | fast_user_id,fast_user_title,user_name,user_id,operate,fast_user_context,start_time,end_time,community_id,b_id,state |
| | | from business_fast_user t where 1=1 |
| | | |
| | | <if test="fastUserId !=null and fastUserId != ''"> |
| | | and t.fast_user_id= #{fastUserId} |
| | | </if> |
| | | <if test="fastUserTitle !=null and fastUserTitle != ''"> |
| | | and t.fast_user_title= #{fastUserTitle} |
| | | </if> |
| | | <if test="userName !=null and userName != ''"> |
| | | and t.user_name= #{userName} |
| | | </if> |
| | | <if test="userId !=null and userId != ''"> |
| | | and t.user_id= #{userId} |
| | | </if> |
| | | and t.operate= 'ADD' |
| | | <if test="startTime !=null "> |
| | | and t.start_time= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null "> |
| | | and t.end_time= #{endTime} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询活动信息 add by wuxw 2018-07-03 --> |
| | | <select id="getFastuserInfo" parameterType="Map" resultType="Map"> |
| | | select t.fast_user_id,t.fast_user_id fastUserId,t.status_cd,t.status_cd |
| | | statusCd,t.fast_user_title,t.fast_user_title fastUserTitle,t.fast_user_context,t.fast_user_context fastUserContext,t.user_name,t.user_name userName,t.user_id,t.user_id |
| | | userId,t.start_time,t.start_time startTime,t.end_time,t.end_time endTime,t.community_id,t.community_id |
| | | communityId,t.b_id,t.b_id bId,t.state |
| | | from fast_user t |
| | | where 1 =1 |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="fastUserTitle !=null and fastUserTitle != ''"> |
| | | and t.fast_user_title= #{fastUserTitle} |
| | | </if> |
| | | <if test="userName !=null and userName != ''"> |
| | | and t.user_name= #{userName} |
| | | </if> |
| | | <if test="userId !=null and userId != ''"> |
| | | and t.user_id= #{userId} |
| | | </if> |
| | | |
| | | <if test="startTime !=null "> |
| | | and t.start_time= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null "> |
| | | and t.end_time= #{endTime} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | and t.state= #{state} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | <!-- 查询活动信息(Business) add by wuxw 2018-07-03 --> |
| | | <select id="getBusinessFastuserInfo" parameterType="Map" resultType="Map"> |
| | | select t.fast_user_id,t.fast_user_id fastUserId,t.operate,t.fast_user_title,t.fast_user_title fastUserTitle,t.fast_user_context,t.fast_user_context fastUserContext,t.user_name,t.user_name userName,t.user_id,t.user_id |
| | | userId,t.start_time,t.start_time startTime,t.end_time,t.end_time endTime,t.community_id,t.community_id |
| | | communityId,t.b_id,t.b_id bId,t.state |
| | | from business_fast_user t |
| | | where 1 =1 |
| | | <if test="operate !=null and operate != ''"> |
| | | and t.operate= #{operate} |
| | | </if> |
| | | <if test="fastUserTitle !=null and fastUserTitle != ''"> |
| | | and t.fast_user_title= #{fastUserTitle} |
| | | </if> |
| | | <if test="userName !=null and userName != ''"> |
| | | and t.user_name= #{userName} |
| | | </if> |
| | | <if test="userId !=null and userId != ''"> |
| | | and t.user_id= #{userId} |
| | | </if> |
| | | <if test="startTime !=null "> |
| | | and t.start_time= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null "> |
| | | and t.end_time= #{endTime} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | and t.state= #{state} |
| | | </if> |
| | | <if test="fastUserId !=null and fastUserId != ''"> |
| | | and t.fast_user_id= #{fastUserId} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <!-- 查询活动数量 add by wuxw 2018-07-03 --> |
| | | <select id="queryFastuserCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from fast_user t |
| | | where 1 =1 |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="fastUserTitle !=null and fastUserTitle != ''"> |
| | | and t.fast_user_title= #{fastUserTitle} |
| | | </if> |
| | | <if test="userName !=null and userName != ''"> |
| | | and t.user_name= #{userName} |
| | | </if> |
| | | <if test="userId !=null and userId != ''"> |
| | | and t.user_id= #{userId} |
| | | </if> |
| | | |
| | | <if test="startTime !=null "> |
| | | and t.start_time= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null "> |
| | | and t.end_time= #{endTime} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | and t.state= #{state} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | <!-- 修改活动信息 add by wuxw 2018-07-03 --> |
| | | <update id="updateFastuserInfoInstance" parameterType="Map"> |
| | | update fast_user t set t.status_cd = #{statusCd} |
| | | <if test="fastUserTitle !=null and fastUserTitle != ''"> |
| | | , t.fast_user_title= #{fastUserTitle} |
| | | </if> |
| | | <if test="userName !=null and userName != ''"> |
| | | , t.user_name= #{userName} |
| | | </if> |
| | | <if test="userId !=null and userId != ''"> |
| | | , t.user_id= #{userId} |
| | | </if> |
| | | <if test="fastUserContext !=null and fastUserContext != ''"> |
| | | , t.fast_user_context= #{fastUserContext} |
| | | </if> |
| | | <if test="startTime !=null "> |
| | | , t.start_time= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null "> |
| | | , t.end_time= #{endTime} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | , t.community_id= #{communityId} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | , t.state= #{state} |
| | | </if> |
| | | where 1=1 |
| | | <if test="fastUserId !=null and fastUserId != ''"> |
| | | and t.fast_user_id= #{fastUserId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | </mapper> |
| | |
| | | public static final String BUSINESS_TYPE_DELETE_INSPECTION_PLAN ="520200050001"; |
| | | |
| | | |
| | | /** |
| | | * 保存用户标题测试 |
| | | * 14开头 3保存 |
| | | */ |
| | | public static final String BUSINESS_TYPE_SAVE_FASTUSER="666666668888888"; |
| | | |
| | | } |
| | |
| | | */ |
| | | public static final String LIST_ACTIVITIESS = "activities.listActivitiess"; |
| | | |
| | | /** |
| | | * 查询 用户测试标题 |
| | | */ |
| | | public static final String LIST_FASTUSER = "fastuser.listFastuser"; |
| | | |
| | | /** |
| | | * 添加 活动 |
| | | */ |
| | | public static final String ADD_FASTUSER = "fastuser.saveFastuser"; |
| | | } |