2个文件已删除
25个文件已修改
23个文件已添加
| New file |
| | |
| | | package com.java110.api.bmo.task; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.bmo.IApiBaseBMO; |
| | | import com.java110.core.context.DataFlowContext; |
| | | |
| | | public interface ITaskBMO extends IApiBaseBMO { |
| | | |
| | | |
| | | /** |
| | | * 添加定时任务 |
| | | * @param paramInJson |
| | | * @param dataFlowContext |
| | | * @return |
| | | */ |
| | | void addTask(JSONObject paramInJson, DataFlowContext dataFlowContext); |
| | | |
| | | /** |
| | | * 添加定时任务信息 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | void updateTask(JSONObject paramInJson, DataFlowContext dataFlowContext); |
| | | |
| | | /** |
| | | * 删除定时任务 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | void deleteTask(JSONObject paramInJson, DataFlowContext dataFlowContext); |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.api.bmo.task.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.bmo.ApiBaseBMO; |
| | | import com.java110.api.bmo.task.ITaskBMO; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.smo.task.ITaskInnerServiceSMO; |
| | | import com.java110.dto.task.TaskDto; |
| | | import com.java110.po.task.TaskPo; |
| | | 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("taskBMOImpl") |
| | | public class TaskBMOImpl extends ApiBaseBMO implements ITaskBMO { |
| | | |
| | | @Autowired |
| | | private ITaskInnerServiceSMO taskInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public void addTask(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | paramInJson.put("taskId", "-1"); |
| | | TaskPo taskPo = BeanConvertUtil.covertBean(paramInJson, TaskPo.class); |
| | | super.insert(dataFlowContext, taskPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_TASK); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加活动信息 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public void updateTask(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | TaskDto taskDto = new TaskDto(); |
| | | taskDto.setTaskId(paramInJson.getString("taskId")); |
| | | //taskDto.setJobId(paramInJson.getString("jobId")); |
| | | List<TaskDto> taskDtos = taskInnerServiceSMOImpl.queryTasks(taskDto); |
| | | |
| | | Assert.listOnlyOne(taskDtos, "未找到需要修改的活动 或多条数据"); |
| | | |
| | | |
| | | paramInJson.putAll(BeanConvertUtil.beanCovertMap(taskDtos.get(0))); |
| | | TaskPo taskPo = BeanConvertUtil.covertBean(paramInJson, TaskPo.class); |
| | | super.update(dataFlowContext, taskPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_TASK); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public void deleteTask(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | TaskPo taskPo = BeanConvertUtil.covertBean(paramInJson, TaskPo.class); |
| | | super.update(dataFlowContext, taskPo, BusinessTypeConstant.BUSINESS_TYPE_DELETE_TASK); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.task; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.bmo.task.ITaskBMO; |
| | | import com.java110.api.listener.AbstractServiceApiPlusListener; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.ServiceCodeTaskConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | |
| | | |
| | | /** |
| | | * 保存小区侦听 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("deleteTaskListener") |
| | | public class DeleteTaskListener extends AbstractServiceApiPlusListener { |
| | | |
| | | @Autowired |
| | | private ITaskBMO taskBMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | //Assert.hasKeyAndValue(reqJson, "xxx", "xxx"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "taskId", "taskId不能为空"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | taskBMOImpl.deleteTask(reqJson, context); |
| | | } |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeTaskConstant.DELETE_TASK; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.task; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.core.smo.task.ITaskInnerServiceSMO; |
| | | import com.java110.dto.task.TaskDto; |
| | | import com.java110.result.ResultVo; |
| | | import com.java110.utils.constant.ServiceCodeTaskConstant; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | 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("listTasksListener") |
| | | public class ListTasksListener extends AbstractServiceApiListener { |
| | | |
| | | @Autowired |
| | | private ITaskInnerServiceSMO taskInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeTaskConstant.LIST_TASKS; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.GET; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | public ITaskInnerServiceSMO getTaskInnerServiceSMOImpl() { |
| | | return taskInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setTaskInnerServiceSMOImpl(ITaskInnerServiceSMO taskInnerServiceSMOImpl) { |
| | | this.taskInnerServiceSMOImpl = taskInnerServiceSMOImpl; |
| | | } |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | super.validatePageInfo(reqJson); |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | TaskDto taskDto = BeanConvertUtil.covertBean(reqJson, TaskDto.class); |
| | | |
| | | int count = taskInnerServiceSMOImpl.queryTasksCount(taskDto); |
| | | |
| | | List<TaskDto> taskDtos = null; |
| | | |
| | | if (count > 0) { |
| | | taskDtos = taskInnerServiceSMOImpl.queryTasks(taskDto); |
| | | } else { |
| | | taskDtos = new ArrayList<>(); |
| | | } |
| | | |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, taskDtos); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.task; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.bmo.task.ITaskBMO; |
| | | import com.java110.api.listener.AbstractServiceApiPlusListener; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.ServiceCodeTaskConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | |
| | | /** |
| | | * 保存商户侦听 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("saveTaskListener") |
| | | public class SaveTaskListener extends AbstractServiceApiPlusListener { |
| | | |
| | | @Autowired |
| | | private ITaskBMO taskBMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | //Assert.hasKeyAndValue(reqJson, "xxx", "xxx"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "taskName", "请求报文中未包含taskName"); |
| | | Assert.hasKeyAndValue(reqJson, "templateId", "请求报文中未包含templateId"); |
| | | Assert.hasKeyAndValue(reqJson, "taskCron", "请求报文中未包含taskCron"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | taskBMOImpl.addTask(reqJson, context); |
| | | } |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeTaskConstant.ADD_TASK; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.task; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.bmo.task.ITaskBMO; |
| | | import com.java110.api.listener.AbstractServiceApiPlusListener; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.ServiceCodeTaskConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | |
| | | /** |
| | | * 保存定时任务侦听 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("updateTaskListener") |
| | | public class UpdateTaskListener extends AbstractServiceApiPlusListener { |
| | | |
| | | @Autowired |
| | | private ITaskBMO taskBMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "taskId", "taskId不能为空"); |
| | | Assert.hasKeyAndValue(reqJson, "taskName", "请求报文中未包含taskName"); |
| | | Assert.hasKeyAndValue(reqJson, "templateId", "请求报文中未包含templateId"); |
| | | Assert.hasKeyAndValue(reqJson, "taskCron", "请求报文中未包含taskCron"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | taskBMOImpl.updateTask(reqJson, context); |
| | | } |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeTaskConstant.UPDATE_TASK; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.job.dao; |
| | | |
| | | |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.entity.merchant.BoMerchant; |
| | | import com.java110.entity.merchant.BoMerchantAttr; |
| | | import com.java110.entity.merchant.Merchant; |
| | | import com.java110.entity.merchant.MerchantAttr; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 定时任务组件内部之间使用,没有给外围系统提供服务能力 |
| | | * 定时任务服务接口类,要求全部以字符串传输,方便微服务化 |
| | | * 新建客户,修改客户,删除客户,查询客户等功能 |
| | | * |
| | | * Created by wuxw on 2016/12/27. |
| | | */ |
| | | public interface ITaskServiceDao { |
| | | |
| | | /** |
| | | * 保存 定时任务信息 |
| | | * @param businessTaskInfo 定时任务信息 封装 |
| | | * @throws DAOException 操作数据库异常 |
| | | */ |
| | | void saveBusinessTaskInfo(Map businessTaskInfo) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询定时任务信息(business过程) |
| | | * 根据bId 查询定时任务信息 |
| | | * @param info bId 信息 |
| | | * @return 定时任务信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getBusinessTaskInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存 定时任务信息 Business数据到 Instance中 |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void saveTaskInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询定时任务信息(instance过程) |
| | | * 根据bId 查询定时任务信息 |
| | | * @param info bId 信息 |
| | | * @return 定时任务信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getTaskInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改定时任务信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void updateTaskInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询定时任务总数 |
| | | * |
| | | * @param info 定时任务信息 |
| | | * @return 定时任务数量 |
| | | */ |
| | | int queryTasksCount(Map info); |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.job.dao.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.core.base.dao.BaseServiceDao; |
| | | import com.java110.job.dao.ITaskServiceDao; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 定时任务服务 与数据库交互 |
| | | * Created by wuxw on 2017/4/5. |
| | | */ |
| | | @Service("taskServiceDaoImpl") |
| | | //@Transactional |
| | | public class TaskServiceDaoImpl extends BaseServiceDao implements ITaskServiceDao { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(TaskServiceDaoImpl.class); |
| | | |
| | | /** |
| | | * 定时任务信息封装 |
| | | * @param businessTaskInfo 定时任务信息 封装 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveBusinessTaskInfo(Map businessTaskInfo) throws DAOException { |
| | | businessTaskInfo.put("month", DateUtil.getCurrentMonth()); |
| | | // 查询business_user 数据是否已经存在 |
| | | logger.debug("保存定时任务信息 入参 businessTaskInfo : {}",businessTaskInfo); |
| | | int saveFlag = sqlSessionTemplate.insert("taskServiceDaoImpl.saveBusinessTaskInfo",businessTaskInfo); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存定时任务数据失败:"+ JSONObject.toJSONString(businessTaskInfo)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询定时任务信息 |
| | | * @param info bId 信息 |
| | | * @return 定时任务信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getBusinessTaskInfo(Map info) throws DAOException { |
| | | |
| | | logger.debug("查询定时任务信息 入参 info : {}",info); |
| | | |
| | | List<Map> businessTaskInfos = sqlSessionTemplate.selectList("taskServiceDaoImpl.getBusinessTaskInfo",info); |
| | | |
| | | return businessTaskInfos; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存定时任务信息 到 instance |
| | | * @param info bId 信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveTaskInfoInstance(Map info) throws DAOException { |
| | | logger.debug("保存定时任务信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("taskServiceDaoImpl.saveTaskInfoInstance",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> getTaskInfo(Map info) throws DAOException { |
| | | logger.debug("查询定时任务信息 入参 info : {}",info); |
| | | |
| | | List<Map> businessTaskInfos = sqlSessionTemplate.selectList("taskServiceDaoImpl.getTaskInfo",info); |
| | | |
| | | return businessTaskInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改定时任务信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void updateTaskInfoInstance(Map info) throws DAOException { |
| | | logger.debug("修改定时任务信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("taskServiceDaoImpl.updateTaskInfoInstance",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改定时任务信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询定时任务数量 |
| | | * @param info 定时任务信息 |
| | | * @return 定时任务数量 |
| | | */ |
| | | @Override |
| | | public int queryTasksCount(Map info) { |
| | | logger.debug("查询定时任务数据 入参 info : {}",info); |
| | | |
| | | List<Map> businessTaskInfos = sqlSessionTemplate.selectList("taskServiceDaoImpl.queryTasksCount", info); |
| | | if (businessTaskInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessTaskInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.job.listener.task; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.event.service.AbstractBusinessServiceDataFlowListener; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.job.dao.ITaskServiceDao; |
| | | 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 AbstractTaskBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener { |
| | | private static Logger logger = LoggerFactory.getLogger(AbstractTaskBusinessServiceDataFlowListener.class); |
| | | |
| | | |
| | | /** |
| | | * 获取 DAO工具类 |
| | | * |
| | | * @return |
| | | */ |
| | | public abstract ITaskServiceDao getTaskServiceDaoImpl(); |
| | | |
| | | /** |
| | | * 刷新 businessTaskInfo 数据 |
| | | * 主要将 数据库 中字段和 接口传递字段建立关系 |
| | | * |
| | | * @param businessTaskInfo |
| | | */ |
| | | protected void flushBusinessTaskInfo(Map businessTaskInfo, String statusCd) { |
| | | businessTaskInfo.put("newBId", businessTaskInfo.get("b_id")); |
| | | businessTaskInfo.put("operate", businessTaskInfo.get("operate")); |
| | | businessTaskInfo.put("taskCron", businessTaskInfo.get("task_cron")); |
| | | businessTaskInfo.put("createTime", businessTaskInfo.get("create_time")); |
| | | businessTaskInfo.put("taskName", businessTaskInfo.get("task_name")); |
| | | businessTaskInfo.put("state", businessTaskInfo.get("state")); |
| | | businessTaskInfo.put("templateId", businessTaskInfo.get("template_id")); |
| | | businessTaskInfo.put("taskId", businessTaskInfo.get("task_id")); |
| | | businessTaskInfo.remove("bId"); |
| | | businessTaskInfo.put("statusCd", statusCd); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中 |
| | | * |
| | | * @param businessTask 定时任务信息 |
| | | */ |
| | | protected void autoSaveDelBusinessTask(Business business, JSONObject businessTask) { |
| | | //自动插入DEL |
| | | Map info = new HashMap(); |
| | | info.put("taskId", businessTask.getString("taskId")); |
| | | info.put("statusCd", StatusConstant.STATUS_CD_VALID); |
| | | List<Map> currentTaskInfos = getTaskServiceDaoImpl().getTaskInfo(info); |
| | | if (currentTaskInfos == null || currentTaskInfos.size() != 1) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "未找到需要修改数据信息,入参错误或数据有问题,请检查" + info); |
| | | } |
| | | |
| | | Map currentTaskInfo = currentTaskInfos.get(0); |
| | | |
| | | currentTaskInfo.put("bId", business.getbId()); |
| | | |
| | | currentTaskInfo.put("operate", currentTaskInfo.get("operate")); |
| | | currentTaskInfo.put("taskCron", currentTaskInfo.get("task_cron")); |
| | | currentTaskInfo.put("createTime", currentTaskInfo.get("create_time")); |
| | | currentTaskInfo.put("taskName", currentTaskInfo.get("task_name")); |
| | | currentTaskInfo.put("state", currentTaskInfo.get("state")); |
| | | currentTaskInfo.put("templateId", currentTaskInfo.get("template_id")); |
| | | currentTaskInfo.put("taskId", currentTaskInfo.get("task_id")); |
| | | |
| | | |
| | | currentTaskInfo.put("operate", StatusConstant.OPERATE_DEL); |
| | | getTaskServiceDaoImpl().saveBusinessTaskInfo(currentTaskInfo); |
| | | for (Object key : currentTaskInfo.keySet()) { |
| | | if (businessTask.get(key) == null) { |
| | | businessTask.put(key.toString(), currentTaskInfo.get(key)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.job.listener.task; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.po.task.TaskPo; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.constant.StatusConstant; |
| | | import com.java110.utils.exception.ListenerExecuteException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.job.dao.ITaskServiceDao; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 删除定时任务信息 侦听 |
| | | * |
| | | * 处理节点 |
| | | * 1、businessTask:{} 定时任务基本信息节点 |
| | | * 2、businessTaskAttr:[{}] 定时任务属性信息节点 |
| | | * 3、businessTaskPhoto:[{}] 定时任务照片信息节点 |
| | | * 4、businessTaskCerdentials:[{}] 定时任务证件信息节点 |
| | | * 协议地址 :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("deleteTaskInfoListener") |
| | | @Transactional |
| | | public class DeleteTaskInfoListener extends AbstractTaskBusinessServiceDataFlowListener { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(DeleteTaskInfoListener.class); |
| | | @Autowired |
| | | ITaskServiceDao taskServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 3; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_DELETE_TASK; |
| | | } |
| | | |
| | | /** |
| | | * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | JSONObject data = business.getDatas(); |
| | | |
| | | Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessTask 节点 |
| | | if(data.containsKey(TaskPo.class.getSimpleName())){ |
| | | Object _obj = data.get(TaskPo.class.getSimpleName()); |
| | | JSONArray businessTasks = null; |
| | | if(_obj instanceof JSONObject){ |
| | | businessTasks = new JSONArray(); |
| | | businessTasks.add(_obj); |
| | | }else { |
| | | businessTasks = (JSONArray)_obj; |
| | | } |
| | | //JSONObject businessTask = data.getJSONObject(TaskPo.class.getSimpleName()); |
| | | for (int _taskIndex = 0; _taskIndex < businessTasks.size();_taskIndex++) { |
| | | JSONObject businessTask = businessTasks.getJSONObject(_taskIndex); |
| | | doBusinessTask(business, businessTask); |
| | | if(_obj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("taskId", businessTask.getString("taskId")); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 删除 instance数据 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) { |
| | | String bId = business.getbId(); |
| | | //Assert.hasLength(bId,"请求报文中没有包含 bId"); |
| | | |
| | | //定时任务信息 |
| | | Map info = new HashMap(); |
| | | info.put("bId",business.getbId()); |
| | | info.put("operate",StatusConstant.OPERATE_DEL); |
| | | |
| | | //定时任务信息 |
| | | List<Map> businessTaskInfos = taskServiceDaoImpl.getBusinessTaskInfo(info); |
| | | if( businessTaskInfos != null && businessTaskInfos.size() >0) { |
| | | for (int _taskIndex = 0; _taskIndex < businessTaskInfos.size();_taskIndex++) { |
| | | Map businessTaskInfo = businessTaskInfos.get(_taskIndex); |
| | | flushBusinessTaskInfo(businessTaskInfo,StatusConstant.STATUS_CD_INVALID); |
| | | taskServiceDaoImpl.updateTaskInfoInstance(businessTaskInfo); |
| | | dataFlowContext.addParamOut("taskId",businessTaskInfo.get("task_id")); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 撤单 |
| | | * 从business表中查询到DEL的数据 将instance中的数据更新回来 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doRecover(DataFlowContext dataFlowContext, Business business) { |
| | | String bId = business.getbId(); |
| | | //Assert.hasLength(bId,"请求报文中没有包含 bId"); |
| | | Map info = new HashMap(); |
| | | info.put("bId",bId); |
| | | info.put("statusCd",StatusConstant.STATUS_CD_INVALID); |
| | | |
| | | Map delInfo = new HashMap(); |
| | | delInfo.put("bId",business.getbId()); |
| | | delInfo.put("operate",StatusConstant.OPERATE_DEL); |
| | | //定时任务信息 |
| | | List<Map> taskInfo = taskServiceDaoImpl.getTaskInfo(info); |
| | | if(taskInfo != null && taskInfo.size() > 0){ |
| | | |
| | | //定时任务信息 |
| | | List<Map> businessTaskInfos = taskServiceDaoImpl.getBusinessTaskInfo(delInfo); |
| | | //除非程序出错了,这里不会为空 |
| | | if(businessTaskInfos == null || businessTaskInfos.size() == 0){ |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(task),程序内部异常,请检查! "+delInfo); |
| | | } |
| | | for (int _taskIndex = 0; _taskIndex < businessTaskInfos.size();_taskIndex++) { |
| | | Map businessTaskInfo = businessTaskInfos.get(_taskIndex); |
| | | flushBusinessTaskInfo(businessTaskInfo,StatusConstant.STATUS_CD_VALID); |
| | | taskServiceDaoImpl.updateTaskInfoInstance(businessTaskInfo); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 处理 businessTask 节点 |
| | | * @param business 总的数据节点 |
| | | * @param businessTask 定时任务节点 |
| | | */ |
| | | private void doBusinessTask(Business business,JSONObject businessTask){ |
| | | |
| | | Assert.jsonObjectHaveKey(businessTask,"taskId","businessTask 节点下没有包含 taskId 节点"); |
| | | |
| | | if(businessTask.getString("taskId").startsWith("-")){ |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"taskId 错误,不能自动生成(必须已经存在的taskId)"+businessTask); |
| | | } |
| | | //自动插入DEL |
| | | autoSaveDelBusinessTask(business,businessTask); |
| | | } |
| | | @Override |
| | | public ITaskServiceDao getTaskServiceDaoImpl() { |
| | | return taskServiceDaoImpl; |
| | | } |
| | | |
| | | public void setTaskServiceDaoImpl(ITaskServiceDao taskServiceDaoImpl) { |
| | | this.taskServiceDaoImpl = taskServiceDaoImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.job.listener.task; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.po.task.TaskPo; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.StatusConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.job.dao.ITaskServiceDao; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.entity.center.Business; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 保存 定时任务信息 侦听 |
| | | * Created by wuxw on 2018/5/18. |
| | | */ |
| | | @Java110Listener("saveTaskInfoListener") |
| | | @Transactional |
| | | public class SaveTaskInfoListener extends AbstractTaskBusinessServiceDataFlowListener{ |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(SaveTaskInfoListener.class); |
| | | |
| | | @Autowired |
| | | private ITaskServiceDao taskServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_SAVE_TASK; |
| | | } |
| | | |
| | | /** |
| | | * 保存定时任务信息 business 表中 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | JSONObject data = business.getDatas(); |
| | | Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessTask 节点 |
| | | if(data.containsKey(TaskPo.class.getSimpleName())){ |
| | | Object bObj = data.get(TaskPo.class.getSimpleName()); |
| | | JSONArray businessTasks = null; |
| | | if(bObj instanceof JSONObject){ |
| | | businessTasks = new JSONArray(); |
| | | businessTasks.add(bObj); |
| | | }else { |
| | | businessTasks = (JSONArray)bObj; |
| | | } |
| | | //JSONObject businessTask = data.getJSONObject(TaskPo.class.getSimpleName()); |
| | | for (int bTaskIndex = 0; bTaskIndex < businessTasks.size();bTaskIndex++) { |
| | | JSONObject businessTask = businessTasks.getJSONObject(bTaskIndex); |
| | | doBusinessTask(business, businessTask); |
| | | if(bObj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("taskId", businessTask.getString("taskId")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 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> businessTaskInfo = taskServiceDaoImpl.getBusinessTaskInfo(info); |
| | | if( businessTaskInfo != null && businessTaskInfo.size() >0) { |
| | | reFreshShareColumn(info, businessTaskInfo.get(0)); |
| | | taskServiceDaoImpl.saveTaskInfoInstance(info); |
| | | if(businessTaskInfo.size() == 1) { |
| | | dataFlowContext.addParamOut("taskId", businessTaskInfo.get(0).get("task_id")); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 刷 分片字段 |
| | | * |
| | | * @param info 查询对象 |
| | | * @param businessInfo 小区ID |
| | | */ |
| | | private void reFreshShareColumn(Map info, Map businessInfo) { |
| | | |
| | | if (info.containsKey("task_id")) { |
| | | return; |
| | | } |
| | | |
| | | if (!businessInfo.containsKey("taskId")) { |
| | | return; |
| | | } |
| | | |
| | | info.put("task_id", businessInfo.get("taskId")); |
| | | } |
| | | /** |
| | | * 撤单 |
| | | * @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> taskInfo = taskServiceDaoImpl.getTaskInfo(info); |
| | | if(taskInfo != null && taskInfo.size() > 0){ |
| | | reFreshShareColumn(paramIn, taskInfo.get(0)); |
| | | taskServiceDaoImpl.updateTaskInfoInstance(paramIn); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 处理 businessTask 节点 |
| | | * @param business 总的数据节点 |
| | | * @param businessTask 定时任务节点 |
| | | */ |
| | | private void doBusinessTask(Business business,JSONObject businessTask){ |
| | | |
| | | Assert.jsonObjectHaveKey(businessTask,"taskId","businessTask 节点下没有包含 taskId 节点"); |
| | | |
| | | if(businessTask.getString("taskId").startsWith("-")){ |
| | | //刷新缓存 |
| | | //flushTaskId(business.getDatas()); |
| | | |
| | | businessTask.put("taskId",GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_taskId)); |
| | | |
| | | } |
| | | |
| | | businessTask.put("bId",business.getbId()); |
| | | businessTask.put("operate", StatusConstant.OPERATE_ADD); |
| | | //保存定时任务信息 |
| | | taskServiceDaoImpl.saveBusinessTaskInfo(businessTask); |
| | | |
| | | } |
| | | @Override |
| | | public ITaskServiceDao getTaskServiceDaoImpl() { |
| | | return taskServiceDaoImpl; |
| | | } |
| | | |
| | | public void setTaskServiceDaoImpl(ITaskServiceDao taskServiceDaoImpl) { |
| | | this.taskServiceDaoImpl = taskServiceDaoImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.job.listener.task; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.po.task.TaskPo; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.constant.StatusConstant; |
| | | import com.java110.utils.exception.ListenerExecuteException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.job.dao.ITaskServiceDao; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 修改定时任务信息 侦听 |
| | | * |
| | | * 处理节点 |
| | | * 1、businessTask:{} 定时任务基本信息节点 |
| | | * 2、businessTaskAttr:[{}] 定时任务属性信息节点 |
| | | * 3、businessTaskPhoto:[{}] 定时任务照片信息节点 |
| | | * 4、businessTaskCerdentials:[{}] 定时任务证件信息节点 |
| | | * 协议地址 :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("updateTaskInfoListener") |
| | | @Transactional |
| | | public class UpdateTaskInfoListener extends AbstractTaskBusinessServiceDataFlowListener { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(UpdateTaskInfoListener.class); |
| | | @Autowired |
| | | private ITaskServiceDao taskServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 2; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_TASK; |
| | | } |
| | | |
| | | /** |
| | | * business过程 |
| | | * @param dataFlowContext 上下文对象 |
| | | * @param business 业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | |
| | | JSONObject data = business.getDatas(); |
| | | |
| | | Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | |
| | | //处理 businessTask 节点 |
| | | if(data.containsKey(TaskPo.class.getSimpleName())){ |
| | | Object _obj = data.get(TaskPo.class.getSimpleName()); |
| | | JSONArray businessTasks = null; |
| | | if(_obj instanceof JSONObject){ |
| | | businessTasks = new JSONArray(); |
| | | businessTasks.add(_obj); |
| | | }else { |
| | | businessTasks = (JSONArray)_obj; |
| | | } |
| | | //JSONObject businessTask = data.getJSONObject(TaskPo.class.getSimpleName()); |
| | | for (int _taskIndex = 0; _taskIndex < businessTasks.size();_taskIndex++) { |
| | | JSONObject businessTask = businessTasks.getJSONObject(_taskIndex); |
| | | doBusinessTask(business, businessTask); |
| | | if(_obj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("taskId", businessTask.getString("taskId")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * business to instance 过程 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) { |
| | | |
| | | JSONObject data = business.getDatas(); |
| | | |
| | | Map info = new HashMap(); |
| | | info.put("bId",business.getbId()); |
| | | info.put("operate",StatusConstant.OPERATE_ADD); |
| | | |
| | | //定时任务信息 |
| | | List<Map> businessTaskInfos = taskServiceDaoImpl.getBusinessTaskInfo(info); |
| | | if( businessTaskInfos != null && businessTaskInfos.size() >0) { |
| | | for (int _taskIndex = 0; _taskIndex < businessTaskInfos.size();_taskIndex++) { |
| | | Map businessTaskInfo = businessTaskInfos.get(_taskIndex); |
| | | flushBusinessTaskInfo(businessTaskInfo,StatusConstant.STATUS_CD_VALID); |
| | | taskServiceDaoImpl.updateTaskInfoInstance(businessTaskInfo); |
| | | if(businessTaskInfo.size() == 1) { |
| | | dataFlowContext.addParamOut("taskId", businessTaskInfo.get("task_id")); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 撤单 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doRecover(DataFlowContext dataFlowContext, Business business) { |
| | | |
| | | String bId = business.getbId(); |
| | | //Assert.hasLength(bId,"请求报文中没有包含 bId"); |
| | | Map info = new HashMap(); |
| | | info.put("bId",bId); |
| | | info.put("statusCd",StatusConstant.STATUS_CD_VALID); |
| | | Map delInfo = new HashMap(); |
| | | delInfo.put("bId",business.getbId()); |
| | | delInfo.put("operate",StatusConstant.OPERATE_DEL); |
| | | //定时任务信息 |
| | | List<Map> taskInfo = taskServiceDaoImpl.getTaskInfo(info); |
| | | if(taskInfo != null && taskInfo.size() > 0){ |
| | | |
| | | //定时任务信息 |
| | | List<Map> businessTaskInfos = taskServiceDaoImpl.getBusinessTaskInfo(delInfo); |
| | | //除非程序出错了,这里不会为空 |
| | | if(businessTaskInfos == null || businessTaskInfos.size() == 0){ |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(task),程序内部异常,请检查! "+delInfo); |
| | | } |
| | | for (int _taskIndex = 0; _taskIndex < businessTaskInfos.size();_taskIndex++) { |
| | | Map businessTaskInfo = businessTaskInfos.get(_taskIndex); |
| | | flushBusinessTaskInfo(businessTaskInfo,StatusConstant.STATUS_CD_VALID); |
| | | taskServiceDaoImpl.updateTaskInfoInstance(businessTaskInfo); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 处理 businessTask 节点 |
| | | * @param business 总的数据节点 |
| | | * @param businessTask 定时任务节点 |
| | | */ |
| | | private void doBusinessTask(Business business,JSONObject businessTask){ |
| | | |
| | | Assert.jsonObjectHaveKey(businessTask,"taskId","businessTask 节点下没有包含 taskId 节点"); |
| | | |
| | | if(businessTask.getString("taskId").startsWith("-")){ |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"taskId 错误,不能自动生成(必须已经存在的taskId)"+businessTask); |
| | | } |
| | | //自动保存DEL |
| | | autoSaveDelBusinessTask(business,businessTask); |
| | | |
| | | businessTask.put("bId",business.getbId()); |
| | | businessTask.put("operate", StatusConstant.OPERATE_ADD); |
| | | //保存定时任务信息 |
| | | taskServiceDaoImpl.saveBusinessTaskInfo(businessTask); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public ITaskServiceDao getTaskServiceDaoImpl() { |
| | | return taskServiceDaoImpl; |
| | | } |
| | | |
| | | public void setTaskServiceDaoImpl(ITaskServiceDao taskServiceDaoImpl) { |
| | | this.taskServiceDaoImpl = taskServiceDaoImpl; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.job.smo.impl; |
| | | |
| | | |
| | | import com.java110.job.dao.ITaskServiceDao; |
| | | import com.java110.core.smo.task.ITaskInnerServiceSMO; |
| | | import com.java110.dto.task.TaskDto; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.core.smo.user.IUserInnerServiceSMO; |
| | | import com.java110.dto.PageDto; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName FloorInnerServiceSMOImpl |
| | | * @Description 定时任务内部服务实现类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:20 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @RestController |
| | | public class TaskInnerServiceSMOImpl extends BaseServiceSMO implements ITaskInnerServiceSMO { |
| | | |
| | | @Autowired |
| | | private ITaskServiceDao taskServiceDaoImpl; |
| | | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public List<TaskDto> queryTasks(@RequestBody TaskDto taskDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = taskDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | taskDto.setPage((page - 1) * taskDto.getRow()); |
| | | } |
| | | |
| | | List<TaskDto> tasks = BeanConvertUtil.covertBeanList(taskServiceDaoImpl.getTaskInfo(BeanConvertUtil.beanCovertMap(taskDto)), TaskDto.class); |
| | | |
| | | if (tasks == null || tasks.size() == 0) { |
| | | return tasks; |
| | | } |
| | | |
| | | String[] userIds = getUserIds(tasks); |
| | | //根据 userId 查询用户信息 |
| | | List<UserDto> users = userInnerServiceSMOImpl.getUserInfo(userIds); |
| | | |
| | | for (TaskDto task : tasks) { |
| | | refreshTask(task, users); |
| | | } |
| | | return tasks; |
| | | } |
| | | |
| | | /** |
| | | * 从用户列表中查询用户,将用户中的信息 刷新到 floor对象中 |
| | | * |
| | | * @param task 小区定时任务信息 |
| | | * @param users 用户列表 |
| | | */ |
| | | private void refreshTask(TaskDto task, List<UserDto> users) { |
| | | for (UserDto user : users) { |
| | | if (task.getTaskId().equals(user.getUserId())) { |
| | | BeanConvertUtil.covertBean(user, task); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取批量userId |
| | | * |
| | | * @param tasks 小区楼信息 |
| | | * @return 批量userIds 信息 |
| | | */ |
| | | private String[] getUserIds(List<TaskDto> tasks) { |
| | | List<String> userIds = new ArrayList<String>(); |
| | | for (TaskDto task : tasks) { |
| | | userIds.add(task.getTaskId()); |
| | | } |
| | | |
| | | return userIds.toArray(new String[userIds.size()]); |
| | | } |
| | | |
| | | @Override |
| | | public int queryTasksCount(@RequestBody TaskDto taskDto) { |
| | | return taskServiceDaoImpl.queryTasksCount(BeanConvertUtil.beanCovertMap(taskDto)); } |
| | | |
| | | public ITaskServiceDao getTaskServiceDaoImpl() { |
| | | return taskServiceDaoImpl; |
| | | } |
| | | |
| | | public void setTaskServiceDaoImpl(ITaskServiceDao taskServiceDaoImpl) { |
| | | this.taskServiceDaoImpl = taskServiceDaoImpl; |
| | | } |
| | | |
| | | public IUserInnerServiceSMO getUserInnerServiceSMOImpl() { |
| | | return userInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) { |
| | | this.userInnerServiceSMOImpl = userInnerServiceSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.job.listener.task; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.constant.StatusConstant; |
| | | import com.java110.utils.exception.ListenerExecuteException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.job.dao.ITaskServiceDao; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 删除定时任务信息 侦听 |
| | | * |
| | | * 处理节点 |
| | | * 1、businessTask:{} 定时任务基本信息节点 |
| | | * 2、businessTaskAttr:[{}] 定时任务属性信息节点 |
| | | * 3、businessTaskPhoto:[{}] 定时任务照片信息节点 |
| | | * 4、businessTaskCerdentials:[{}] 定时任务证件信息节点 |
| | | * 协议地址 :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("deleteTaskInfoListener") |
| | | @Transactional |
| | | public class DeleteTaskInfoListener extends AbstractTaskBusinessServiceDataFlowListener { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(DeleteTaskInfoListener.class); |
| | | @Autowired |
| | | ITaskServiceDao taskServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 3; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_DELETE_TASK; |
| | | } |
| | | |
| | | /** |
| | | * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | JSONObject data = business.getDatas(); |
| | | |
| | | Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessTask 节点 |
| | | if(data.containsKey(TaskPo.class.getSimpleName())){ |
| | | Object _obj = data.get(TaskPo.class.getSimpleName()); |
| | | JSONArray businessTasks = null; |
| | | if(_obj instanceof JSONObject){ |
| | | businessTasks = new JSONArray(); |
| | | businessTasks.add(_obj); |
| | | }else { |
| | | businessTasks = (JSONArray)_obj; |
| | | } |
| | | //JSONObject businessTask = data.getJSONObject(TaskPo.class.getSimpleName()); |
| | | for (int _taskIndex = 0; _taskIndex < businessTasks.size();_taskIndex++) { |
| | | JSONObject businessTask = businessTasks.getJSONObject(_taskIndex); |
| | | doBusinessTask(business, businessTask); |
| | | if(_obj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("taskId", businessTask.getString("taskId")); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 删除 instance数据 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) { |
| | | String bId = business.getbId(); |
| | | //Assert.hasLength(bId,"请求报文中没有包含 bId"); |
| | | |
| | | //定时任务信息 |
| | | Map info = new HashMap(); |
| | | info.put("bId",business.getbId()); |
| | | info.put("operate",StatusConstant.OPERATE_DEL); |
| | | |
| | | //定时任务信息 |
| | | List<Map> businessTaskInfos = taskServiceDaoImpl.getBusinessTaskInfo(info); |
| | | if( businessTaskInfos != null && businessTaskInfos.size() >0) { |
| | | for (int _taskIndex = 0; _taskIndex < businessTaskInfos.size();_taskIndex++) { |
| | | Map businessTaskInfo = businessTaskInfos.get(_taskIndex); |
| | | flushBusinessTaskInfo(businessTaskInfo,StatusConstant.STATUS_CD_INVALID); |
| | | taskServiceDaoImpl.updateTaskInfoInstance(businessTaskInfo); |
| | | dataFlowContext.addParamOut("taskId",businessTaskInfo.get("task_id")); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 撤单 |
| | | * 从business表中查询到DEL的数据 将instance中的数据更新回来 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doRecover(DataFlowContext dataFlowContext, Business business) { |
| | | String bId = business.getbId(); |
| | | //Assert.hasLength(bId,"请求报文中没有包含 bId"); |
| | | Map info = new HashMap(); |
| | | info.put("bId",bId); |
| | | info.put("statusCd",StatusConstant.STATUS_CD_INVALID); |
| | | |
| | | Map delInfo = new HashMap(); |
| | | delInfo.put("bId",business.getbId()); |
| | | delInfo.put("operate",StatusConstant.OPERATE_DEL); |
| | | //定时任务信息 |
| | | List<Map> taskInfo = taskServiceDaoImpl.getTaskInfo(info); |
| | | if(taskInfo != null && taskInfo.size() > 0){ |
| | | |
| | | //定时任务信息 |
| | | List<Map> businessTaskInfos = taskServiceDaoImpl.getBusinessTaskInfo(delInfo); |
| | | //除非程序出错了,这里不会为空 |
| | | if(businessTaskInfos == null || businessTaskInfos.size() == 0){ |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(task),程序内部异常,请检查! "+delInfo); |
| | | } |
| | | for (int _taskIndex = 0; _taskIndex < businessTaskInfos.size();_taskIndex++) { |
| | | Map businessTaskInfo = businessTaskInfos.get(_taskIndex); |
| | | flushBusinessTaskInfo(businessTaskInfo,StatusConstant.STATUS_CD_VALID); |
| | | taskServiceDaoImpl.updateTaskInfoInstance(businessTaskInfo); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 处理 businessTask 节点 |
| | | * @param business 总的数据节点 |
| | | * @param businessTask 定时任务节点 |
| | | */ |
| | | private void doBusinessTask(Business business,JSONObject businessTask){ |
| | | |
| | | Assert.jsonObjectHaveKey(businessTask,"taskId","businessTask 节点下没有包含 taskId 节点"); |
| | | |
| | | if(businessTask.getString("taskId").startsWith("-")){ |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"taskId 错误,不能自动生成(必须已经存在的taskId)"+businessTask); |
| | | } |
| | | //自动插入DEL |
| | | autoSaveDelBusinessTask(business,businessTask); |
| | | } |
| | | @Override |
| | | public ITaskServiceDao getTaskServiceDaoImpl() { |
| | | return taskServiceDaoImpl; |
| | | } |
| | | |
| | | public void setTaskServiceDaoImpl(ITaskServiceDao taskServiceDaoImpl) { |
| | | this.taskServiceDaoImpl = taskServiceDaoImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.job.listener.task; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.StatusConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.job.dao.ITaskServiceDao; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.entity.center.Business; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 保存 定时任务信息 侦听 |
| | | * Created by wuxw on 2018/5/18. |
| | | */ |
| | | @Java110Listener("saveTaskInfoListener") |
| | | @Transactional |
| | | public class SaveTaskInfoListener extends AbstractTaskBusinessServiceDataFlowListener{ |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(SaveTaskInfoListener.class); |
| | | |
| | | @Autowired |
| | | private ITaskServiceDao taskServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_SAVE_TASK; |
| | | } |
| | | |
| | | /** |
| | | * 保存定时任务信息 business 表中 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | JSONObject data = business.getDatas(); |
| | | Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessTask 节点 |
| | | if(data.containsKey(TaskPo.class.getSimpleName())){ |
| | | Object bObj = data.get(TaskPo.class.getSimpleName()); |
| | | JSONArray businessTasks = null; |
| | | if(bObj instanceof JSONObject){ |
| | | businessTasks = new JSONArray(); |
| | | businessTasks.add(bObj); |
| | | }else { |
| | | businessTasks = (JSONArray)bObj; |
| | | } |
| | | //JSONObject businessTask = data.getJSONObject(TaskPo.class.getSimpleName()); |
| | | for (int bTaskIndex = 0; bTaskIndex < businessTasks.size();bTaskIndex++) { |
| | | JSONObject businessTask = businessTasks.getJSONObject(bTaskIndex); |
| | | doBusinessTask(business, businessTask); |
| | | if(bObj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("taskId", businessTask.getString("taskId")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 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> businessTaskInfo = taskServiceDaoImpl.getBusinessTaskInfo(info); |
| | | if( businessTaskInfo != null && businessTaskInfo.size() >0) { |
| | | reFreshShareColumn(info, businessTaskInfo.get(0)); |
| | | taskServiceDaoImpl.saveTaskInfoInstance(info); |
| | | if(businessTaskInfo.size() == 1) { |
| | | dataFlowContext.addParamOut("taskId", businessTaskInfo.get(0).get("task_id")); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 刷 分片字段 |
| | | * |
| | | * @param info 查询对象 |
| | | * @param businessInfo 小区ID |
| | | */ |
| | | private void reFreshShareColumn(Map info, Map businessInfo) { |
| | | |
| | | if (info.containsKey("task_id")) { |
| | | return; |
| | | } |
| | | |
| | | if (!businessInfo.containsKey("taskId")) { |
| | | return; |
| | | } |
| | | |
| | | info.put("task_id", businessInfo.get("taskId")); |
| | | } |
| | | /** |
| | | * 撤单 |
| | | * @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> taskInfo = taskServiceDaoImpl.getTaskInfo(info); |
| | | if(taskInfo != null && taskInfo.size() > 0){ |
| | | reFreshShareColumn(paramIn, taskInfo.get(0)); |
| | | taskServiceDaoImpl.updateTaskInfoInstance(paramIn); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 处理 businessTask 节点 |
| | | * @param business 总的数据节点 |
| | | * @param businessTask 定时任务节点 |
| | | */ |
| | | private void doBusinessTask(Business business,JSONObject businessTask){ |
| | | |
| | | Assert.jsonObjectHaveKey(businessTask,"taskId","businessTask 节点下没有包含 taskId 节点"); |
| | | |
| | | if(businessTask.getString("taskId").startsWith("-")){ |
| | | //刷新缓存 |
| | | //flushTaskId(business.getDatas()); |
| | | |
| | | businessTask.put("taskId",GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_taskId)); |
| | | |
| | | } |
| | | |
| | | businessTask.put("bId",business.getbId()); |
| | | businessTask.put("operate", StatusConstant.OPERATE_ADD); |
| | | //保存定时任务信息 |
| | | taskServiceDaoImpl.saveBusinessTaskInfo(businessTask); |
| | | |
| | | } |
| | | @Override |
| | | public ITaskServiceDao getTaskServiceDaoImpl() { |
| | | return taskServiceDaoImpl; |
| | | } |
| | | |
| | | public void setTaskServiceDaoImpl(ITaskServiceDao taskServiceDaoImpl) { |
| | | this.taskServiceDaoImpl = taskServiceDaoImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.job.listener.task; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.constant.StatusConstant; |
| | | import com.java110.utils.exception.ListenerExecuteException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.job.dao.ITaskServiceDao; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 修改定时任务信息 侦听 |
| | | * |
| | | * 处理节点 |
| | | * 1、businessTask:{} 定时任务基本信息节点 |
| | | * 2、businessTaskAttr:[{}] 定时任务属性信息节点 |
| | | * 3、businessTaskPhoto:[{}] 定时任务照片信息节点 |
| | | * 4、businessTaskCerdentials:[{}] 定时任务证件信息节点 |
| | | * 协议地址 :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("updateTaskInfoListener") |
| | | @Transactional |
| | | public class UpdateTaskInfoListener extends AbstractTaskBusinessServiceDataFlowListener { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(UpdateTaskInfoListener.class); |
| | | @Autowired |
| | | private ITaskServiceDao taskServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 2; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_TASK; |
| | | } |
| | | |
| | | /** |
| | | * business过程 |
| | | * @param dataFlowContext 上下文对象 |
| | | * @param business 业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | |
| | | JSONObject data = business.getDatas(); |
| | | |
| | | Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | |
| | | //处理 businessTask 节点 |
| | | if(data.containsKey(TaskPo.class.getSimpleName())){ |
| | | Object _obj = data.get(TaskPo.class.getSimpleName()); |
| | | JSONArray businessTasks = null; |
| | | if(_obj instanceof JSONObject){ |
| | | businessTasks = new JSONArray(); |
| | | businessTasks.add(_obj); |
| | | }else { |
| | | businessTasks = (JSONArray)_obj; |
| | | } |
| | | //JSONObject businessTask = data.getJSONObject(TaskPo.class.getSimpleName()); |
| | | for (int _taskIndex = 0; _taskIndex < businessTasks.size();_taskIndex++) { |
| | | JSONObject businessTask = businessTasks.getJSONObject(_taskIndex); |
| | | doBusinessTask(business, businessTask); |
| | | if(_obj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("taskId", businessTask.getString("taskId")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * business to instance 过程 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) { |
| | | |
| | | JSONObject data = business.getDatas(); |
| | | |
| | | Map info = new HashMap(); |
| | | info.put("bId",business.getbId()); |
| | | info.put("operate",StatusConstant.OPERATE_ADD); |
| | | |
| | | //定时任务信息 |
| | | List<Map> businessTaskInfos = taskServiceDaoImpl.getBusinessTaskInfo(info); |
| | | if( businessTaskInfos != null && businessTaskInfos.size() >0) { |
| | | for (int _taskIndex = 0; _taskIndex < businessTaskInfos.size();_taskIndex++) { |
| | | Map businessTaskInfo = businessTaskInfos.get(_taskIndex); |
| | | flushBusinessTaskInfo(businessTaskInfo,StatusConstant.STATUS_CD_VALID); |
| | | taskServiceDaoImpl.updateTaskInfoInstance(businessTaskInfo); |
| | | if(businessTaskInfo.size() == 1) { |
| | | dataFlowContext.addParamOut("taskId", businessTaskInfo.get("task_id")); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 撤单 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doRecover(DataFlowContext dataFlowContext, Business business) { |
| | | |
| | | String bId = business.getbId(); |
| | | //Assert.hasLength(bId,"请求报文中没有包含 bId"); |
| | | Map info = new HashMap(); |
| | | info.put("bId",bId); |
| | | info.put("statusCd",StatusConstant.STATUS_CD_VALID); |
| | | Map delInfo = new HashMap(); |
| | | delInfo.put("bId",business.getbId()); |
| | | delInfo.put("operate",StatusConstant.OPERATE_DEL); |
| | | //定时任务信息 |
| | | List<Map> taskInfo = taskServiceDaoImpl.getTaskInfo(info); |
| | | if(taskInfo != null && taskInfo.size() > 0){ |
| | | |
| | | //定时任务信息 |
| | | List<Map> businessTaskInfos = taskServiceDaoImpl.getBusinessTaskInfo(delInfo); |
| | | //除非程序出错了,这里不会为空 |
| | | if(businessTaskInfos == null || businessTaskInfos.size() == 0){ |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(task),程序内部异常,请检查! "+delInfo); |
| | | } |
| | | for (int _taskIndex = 0; _taskIndex < businessTaskInfos.size();_taskIndex++) { |
| | | Map businessTaskInfo = businessTaskInfos.get(_taskIndex); |
| | | flushBusinessTaskInfo(businessTaskInfo,StatusConstant.STATUS_CD_VALID); |
| | | taskServiceDaoImpl.updateTaskInfoInstance(businessTaskInfo); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 处理 businessTask 节点 |
| | | * @param business 总的数据节点 |
| | | * @param businessTask 定时任务节点 |
| | | */ |
| | | private void doBusinessTask(Business business,JSONObject businessTask){ |
| | | |
| | | Assert.jsonObjectHaveKey(businessTask,"taskId","businessTask 节点下没有包含 taskId 节点"); |
| | | |
| | | if(businessTask.getString("taskId").startsWith("-")){ |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"taskId 错误,不能自动生成(必须已经存在的taskId)"+businessTask); |
| | | } |
| | | //自动保存DEL |
| | | autoSaveDelBusinessTask(business,businessTask); |
| | | |
| | | businessTask.put("bId",business.getbId()); |
| | | businessTask.put("operate", StatusConstant.OPERATE_ADD); |
| | | //保存定时任务信息 |
| | | taskServiceDaoImpl.saveBusinessTaskInfo(businessTask); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public ITaskServiceDao getTaskServiceDaoImpl() { |
| | | return taskServiceDaoImpl; |
| | | } |
| | | |
| | | public void setTaskServiceDaoImpl(ITaskServiceDao taskServiceDaoImpl) { |
| | | this.taskServiceDaoImpl = taskServiceDaoImpl; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.dto.task; |
| | | |
| | | import com.java110.dto.PageDto; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClassName FloorDto |
| | | * @Description 定时任务数据层封装 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 8:52 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | public class TaskDto extends PageDto implements Serializable { |
| | | |
| | | private String taskCron; |
| | | private String taskName; |
| | | private String state; |
| | | private String templateId; |
| | | private String taskId; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | |
| | | public String getTaskCron() { |
| | | return taskCron; |
| | | } |
| | | |
| | | public void setTaskCron(String taskCron) { |
| | | this.taskCron = taskCron; |
| | | } |
| | | |
| | | |
| | | public String getTaskName() { |
| | | return taskName; |
| | | } |
| | | |
| | | public void setTaskName(String taskName) { |
| | | this.taskName = taskName; |
| | | } |
| | | |
| | | public String getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(String state) { |
| | | this.state = state; |
| | | } |
| | | |
| | | public String getTemplateId() { |
| | | return templateId; |
| | | } |
| | | |
| | | public void setTemplateId(String templateId) { |
| | | this.templateId = templateId; |
| | | } |
| | | |
| | | public String getTaskId() { |
| | | return taskId; |
| | | } |
| | | |
| | | public void setTaskId(String taskId) { |
| | | this.taskId = taskId; |
| | | } |
| | | |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.po.task; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class TaskPo implements Serializable { |
| | | |
| | | private String taskCron; |
| | | private String taskName; |
| | | private String state; |
| | | private String templateId; |
| | | private String taskId; |
| | | |
| | | public String getTaskCron() { |
| | | return taskCron; |
| | | } |
| | | |
| | | public void setTaskCron(String taskCron) { |
| | | this.taskCron = taskCron; |
| | | } |
| | | |
| | | public String getTaskName() { |
| | | return taskName; |
| | | } |
| | | |
| | | public void setTaskName(String taskName) { |
| | | this.taskName = taskName; |
| | | } |
| | | |
| | | public String getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(String state) { |
| | | this.state = state; |
| | | } |
| | | |
| | | public String getTemplateId() { |
| | | return templateId; |
| | | } |
| | | |
| | | public void setTemplateId(String templateId) { |
| | | this.templateId = templateId; |
| | | } |
| | | |
| | | public String getTaskId() { |
| | | return taskId; |
| | | } |
| | | |
| | | public void setTaskId(String taskId) { |
| | | this.taskId = taskId; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | public static void main(String[] args) throws Exception { |
| | | |
| | | //加载配置 |
| | | StringBuffer sb = readFile(GeneratorStart.class.getResource("/back/template_company.json").getFile()); |
| | | StringBuffer sb = readFile(GeneratorStart.class.getResource("/back/template_1.json").getFile()); |
| | | |
| | | JSONObject dataJson = JSONObject.parseObject(sb.toString()); |
| | | |
| | | Data data = new Data(); |
| | | |
| | | if(dataJson.containsKey("autoMove")){ |
| | | data.setAutoMove(dataJson.getBoolean("autoMove")); |
| | | } |
| | | data.setId(dataJson.getString("id")); |
| | | data.setName(dataJson.getString("name")); |
| | | data.setDesc(dataJson.getString("desc")); |
| | |
| | | **/ |
| | | public class Data { |
| | | |
| | | private boolean autoMove; |
| | | private String packagePath; |
| | | |
| | | private String id; |
| | |
| | | public void setRequiredParam(String[] requiredParam) { |
| | | this.requiredParam = requiredParam; |
| | | } |
| | | |
| | | public boolean isAutoMove() { |
| | | return autoMove; |
| | | } |
| | | |
| | | public void setAutoMove(boolean autoMove) { |
| | | this.autoMove = autoMove; |
| | | } |
| | | } |
| | |
| | | StringBuffer sb = readFile(this.getClass().getResource("/template/AbstractBusinessServiceDataFlowListener.txt").getFile()); |
| | | String fileContext = sb.toString(); |
| | | fileContext = fileContext.replace("store", toLowerCaseFirstOne(data.getName())) |
| | | .replace("@@shareName@@",data.getShareName()) |
| | | .replace("@@templateCode@@",data.getName()) |
| | | .replace("@@shareName@@", data.getShareName()) |
| | | .replace("@@templateCode@@", data.getName()) |
| | | .replace("Store", toUpperCaseFirstOne(data.getName())) |
| | | .replace("商户", data.getDesc()) |
| | | .replace(data.getName() + "Id", data.getId()) |
| | |
| | | writeFile(writePath, |
| | | fileContext); |
| | | // System.out.println("看这里"+toUpperCaseFirstOne(data.getShareName()).toString()); |
| | | FileUtilBase.copyfile(writePath,toUpperCaseFirstOne(data.getShareName()).toString()+"Service\\src\\main\\java\\com\\java110\\community\\listener\\"+ data.getName() + "/Abstract" + toUpperCaseFirstOne(data.getName()) + "BusinessServiceDataFlowListener.java"); |
| | | if (data.isAutoMove()) { |
| | | FileUtilBase.copyfile(writePath, toUpperCaseFirstOne(data.getShareName()).toString() + "Service\\src\\main\\java\\com\\java110\\"+data.getShareName()+"\\listener\\" + data.getName() + "/Abstract" + toUpperCaseFirstOne(data.getName()) + "BusinessServiceDataFlowListener.java"); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.java110.code.back; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.code.util.FileUtilBase; |
| | | import com.java110.code.web.GeneratorStart; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | public class GeneratorApiListener extends BaseGenerator { |
| | | |
| | |
| | | */ |
| | | public void generator(Data data) throws Exception { |
| | | genneratorListListener(data); //API监听器 |
| | | genneratorVo(data); //API VO对象 |
| | | genneratorDataVo(data); //API DataVo对象 |
| | | //genneratorVo(data); //API VO对象 |
| | | //genneratorDataVo(data); //API DataVo对象 |
| | | genneratorPo(data); //API DataVo对象 |
| | | genneratorIBmo(data); //API IBmo |
| | | genneratorBmoImpl(data); //Api BmoImpl |
| | | genneratorSaveListener(data); |
| | |
| | | writeFile(writePath, |
| | | fileContext); |
| | | //复制生成的文件到对应分区目录下 |
| | | FileUtilBase.copyfile(writePath,"Api\\src\\main\\java\\com\\java110\\api\\listener\\"+data.getName() + "/List" + toUpperCaseFirstOne(data.getName()) + "sListener.java"); |
| | | |
| | | if (data.isAutoMove()) { |
| | | FileUtilBase.copyfile(writePath, "Api\\src\\main\\java\\com\\java110\\api\\listener\\" + data.getName() + "/List" + toUpperCaseFirstOne(data.getName()) + "sListener.java"); |
| | | } |
| | | } |
| | | |
| | | private void genneratorVo(Data data) throws Exception { |
| | |
| | | writeFile(writePath, |
| | | fileContext); |
| | | //复制生成的文件到对应分区目录下 |
| | | FileUtilBase.copyfile(writePath,"java110-bean\\src\\main\\java\\com\\java110\\vo\\api\\"+data.getName() + "/Api" + toUpperCaseFirstOne(data.getName()) + "Vo.java"); |
| | | |
| | | if (data.isAutoMove()) { |
| | | FileUtilBase.copyfile(writePath, "java110-bean\\src\\main\\java\\com\\java110\\vo\\api\\" + data.getName() + "/Api" + toUpperCaseFirstOne(data.getName()) + "Vo.java"); |
| | | } |
| | | } |
| | | |
| | | private void genneratorDataVo(Data data) throws Exception { |
| | |
| | | writeFile(writePath, |
| | | fileContext); |
| | | //复制生成的文件到对应分区目录下 |
| | | FileUtilBase.copyfile(writePath,"java110-bean\\src\\main\\java\\com\\java110\\vo\\api\\"+data.getName() + "/Api" + toUpperCaseFirstOne(data.getName()) + "DataVo.java"); |
| | | if (data.isAutoMove()) { |
| | | FileUtilBase.copyfile(writePath, "java110-bean\\src\\main\\java\\com\\java110\\vo\\api\\" + data.getName() + "/Api" + toUpperCaseFirstOne(data.getName()) + "DataVo.java"); |
| | | } |
| | | } |
| | | |
| | | private void genneratorPo(Data data) throws Exception { |
| | | StringBuffer sb = readFile(GeneratorStart.class.getResource("/template/Po.java").getFile()); |
| | | String fileContext = sb.toString(); |
| | | |
| | | fileContext = super.replaceTemplateContext(fileContext, data); |
| | | Map columns = data.getParams(); |
| | | String variable = ""; |
| | | String variableGetSet = ""; |
| | | |
| | | for (Object key : columns.keySet()) { |
| | | //JSONObject column = columns.get(columnIndex); |
| | | //String key = column.getString("code"); |
| | | if ("operate".equals(key) || "bId".equals(key) || "statusCd".equals(key) || "createTime".equals(key)) { |
| | | continue; |
| | | } |
| | | variable += "private String " + key.toString() + ";\n"; |
| | | |
| | | variableGetSet += "public String get" + toUpperCaseFirstOne(key.toString()) + "() {\n" |
| | | + " return " + key + ";\n" |
| | | + " }\n"; |
| | | variableGetSet += "public void set" + toUpperCaseFirstOne(key.toString()) + "(String " + key + ") {\n" |
| | | + " this." + key + " = " + key + ";\n" |
| | | + " }\n"; |
| | | } |
| | | |
| | | fileContext = fileContext.replace("@@templateColumns@@", variable + variableGetSet); |
| | | |
| | | String writePath = this.getClass().getResource("/").getPath() |
| | | + "out/api/po/" + data.getName() + "/" + toUpperCaseFirstOne(data.getName()) + "Po.java"; |
| | | System.out.printf("writePath: " + writePath); |
| | | writeFile(writePath, |
| | | fileContext); |
| | | //复制生成的文件到对应分区目录下 |
| | | if (data.isAutoMove()) { |
| | | FileUtilBase.copyfile(writePath, "java110-bean\\src\\main\\java\\com\\java110\\po\\" + data.getName() + "/" + toUpperCaseFirstOne(data.getName()) + "Po.java"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | writeFile(writePath, |
| | | fileContext); |
| | | //复制生成的文件到对应分区目录下 |
| | | FileUtilBase.copyfile(writePath,"Api\\src\\main\\java\\com\\java110\\api\\bmo\\"+data.getName() + "/I" + toUpperCaseFirstOne(data.getName()) + "BMO.java"); |
| | | |
| | | if (data.isAutoMove()) { |
| | | FileUtilBase.copyfile(writePath, "Api\\src\\main\\java\\com\\java110\\api\\bmo\\" + data.getName() + "/I" + toUpperCaseFirstOne(data.getName()) + "BMO.java"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | private void genneratorBmoImpl(Data data) throws Exception { |
| | | StringBuffer sb = readFile(GeneratorStart.class.getResource("/template/BMOImpl.java").getFile()); |
| | | String fileContext = sb.toString(); |
| | | fileContext=fileContext.replace("@@shareName@@",data.getShareName()) |
| | | .replace("@@ShareName@@",toUpperCaseFirstOne(data.getShareName())); |
| | | fileContext = fileContext.replace("@@shareName@@", data.getShareName()) |
| | | .replace("@@ShareName@@", toUpperCaseFirstOne(data.getShareName())); |
| | | |
| | | fileContext = super.replaceTemplateContext(fileContext, data); |
| | | |
| | |
| | | writeFile(writePath, |
| | | fileContext); |
| | | //复制生成的文件到对应分区目录下 |
| | | FileUtilBase.copyfile(writePath,"Api\\src\\main\\java\\com\\java110\\api\\bmo\\"+data.getName() + "/impl/" + toUpperCaseFirstOne(data.getName()) + "BMOImpl.java"); |
| | | |
| | | if (data.isAutoMove()) { |
| | | FileUtilBase.copyfile(writePath, "Api\\src\\main\\java\\com\\java110\\api\\bmo\\" + data.getName() + "/impl/" + toUpperCaseFirstOne(data.getName()) + "BMOImpl.java"); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | writeFile(writePath, |
| | | fileContext); |
| | | //复制生成的文件到对应分区目录下 |
| | | FileUtilBase.copyfile(writePath,"Api\\src\\main\\java\\com\\java110\\api\\listener\\"+data.getName() + "/Save" + toUpperCaseFirstOne(data.getName()) + "Listener.java"); |
| | | |
| | | if (data.isAutoMove()) { |
| | | FileUtilBase.copyfile(writePath, "Api\\src\\main\\java\\com\\java110\\api\\listener\\" + data.getName() + "/Save" + toUpperCaseFirstOne(data.getName()) + "Listener.java"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | writeFile(writePath, |
| | | fileContext); |
| | | //复制生成的文件到对应分区目录下 |
| | | FileUtilBase.copyfile(writePath,"Api\\src\\main\\java\\com\\java110\\api\\listener\\"+data.getName() + "/Update" + toUpperCaseFirstOne(data.getName()) + "Listener.java"); |
| | | |
| | | if (data.isAutoMove()) { |
| | | FileUtilBase.copyfile(writePath, "Api\\src\\main\\java\\com\\java110\\api\\listener\\" + data.getName() + "/Update" + toUpperCaseFirstOne(data.getName()) + "Listener.java"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | writeFile(writePath, |
| | | fileContext); |
| | | //复制生成的文件到对应分区目录下 |
| | | FileUtilBase.copyfile(writePath,"Api\\src\\main\\java\\com\\java110\\api\\listener\\"+data.getName() + "/Delete" + toUpperCaseFirstOne(data.getName()) + "Listener.java"); |
| | | |
| | | if (data.isAutoMove()) { |
| | | FileUtilBase.copyfile(writePath, "Api\\src\\main\\java\\com\\java110\\api\\listener\\" + data.getName() + "/Delete" + toUpperCaseFirstOne(data.getName()) + "Listener.java"); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | writeFile(writePath, |
| | | fileContext); |
| | | //复制生成的文件到对应分区目录下 |
| | | FileUtilBase.copyfile(writePath,"java110-utils\\src\\main\\java\\com\\java110\\utils\\constant\\" + "/ServiceCode" + toUpperCaseFirstOne(data.getName()) + "Constant.java"); |
| | | |
| | | if (data.isAutoMove()) { |
| | | FileUtilBase.copyfile(writePath, "java110-utils\\src\\main\\java\\com\\java110\\utils\\constant\\" + "/ServiceCode" + toUpperCaseFirstOne(data.getName()) + "Constant.java"); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | writeFile(writePath, |
| | | fileContext); |
| | | //复制生成的文件到对应分区目录下 |
| | | FileUtilBase.copyfile(writePath,toUpperCaseFirstOne(data.getShareName()).toString()+"Service\\src\\main\\java\\com\\java110\\community\\listener\\"+ data.getName() +"/Delete"+toUpperCaseFirstOne(data.getName())+"InfoListener.java"); |
| | | //生成协议 |
| | | if (data.isAutoMove()) { |
| | | FileUtilBase.copyfile(writePath, toUpperCaseFirstOne(data.getShareName()).toString() + "Service\\src\\main\\java\\com\\java110\\"+data.getShareName()+"\\listener\\" + data.getName() + "/Delete" + toUpperCaseFirstOne(data.getName()) + "InfoListener.java"); |
| | | |
| | | }//生成协议 |
| | | |
| | | /** |
| | | * |businessstoreMember|memberTypeCd|1|String|30|成员类型|成员类型| |
| | |
| | | writeFile(writePathDoc, |
| | | fileContextDoc); |
| | | //复制生成的文件到对应分区目录下 |
| | | FileUtilBase.copyfile(writePath,"docs\\document\\services\\"+ data.getName() + "/Delete" + toUpperCaseFirstOne(data.getName()) + "Info.md"); |
| | | //生成协议 |
| | | if (data.isAutoMove()) { |
| | | FileUtilBase.copyfile(writePath, "docs\\document\\services\\" + data.getName() + "/Delete" + toUpperCaseFirstOne(data.getName()) + "Info.md"); |
| | | //生成协议 |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | String variableGetSet = ""; |
| | | |
| | | for (String key : params.keySet()) { |
| | | if ("operate".equals(key) || "bId".equals(key) || "statusCd".equals(key)) { |
| | | if ("operate".equals(key) || "bId".equals(key) || "statusCd".equals(key)|| "createTime".equals(key)) { |
| | | continue; |
| | | } |
| | | variable += "private String " + key + ";\n"; |
| | |
| | | writeFile(writePath, |
| | | fileContext); |
| | | //复制生成的文件到对应分区目录下 |
| | | FileUtilBase.copyfile(writePath,"java110-bean\\src\\main\\java\\com\\java110\\dto\\" + data.getName() + "/" + toUpperCaseFirstOne(data.getName()) + "Dto.java"); |
| | | if (data.isAutoMove()) { |
| | | FileUtilBase.copyfile(writePath, "java110-bean\\src\\main\\java\\com\\java110\\dto\\" + data.getName() + "/" + toUpperCaseFirstOne(data.getName()) + "Dto.java"); |
| | | } |
| | | } |
| | | } |
| | |
| | | writeFile(writePath, |
| | | fileContext); |
| | | //复制生成的文件到对应分区目录下 |
| | | FileUtilBase.copyfile(writePath,"java110-core\\src\\main\\java\\com\\java110\\core\\smo\\" + data.getName() + "/I" + toUpperCaseFirstOne(data.getName()) + "InnerServiceSMO.java"); |
| | | |
| | | if (data.isAutoMove()) { |
| | | FileUtilBase.copyfile(writePath, "java110-core\\src\\main\\java\\com\\java110\\core\\smo\\" + data.getName() + "/I" + toUpperCaseFirstOne(data.getName()) + "InnerServiceSMO.java"); |
| | | } |
| | | } |
| | | } |
| | |
| | | writeFile(writePath, |
| | | fileContext); |
| | | //复制生成的文件到对应分区目录下 |
| | | FileUtilBase.copyfile(writePath,toUpperCaseFirstOne(data.getShareName().toString())+"Service\\src\\main\\java\\com\\java110\\community\\dao\\" +"I"+toUpperCaseFirstOne(data.getName())+"ServiceDao.java"); |
| | | |
| | | if (data.isAutoMove()) { |
| | | FileUtilBase.copyfile(writePath, toUpperCaseFirstOne(data.getShareName().toString()) + "Service\\src\\main\\java\\com\\java110\\"+data.getShareName()+"\\dao\\" + "I" + toUpperCaseFirstOne(data.getName()) + "ServiceDao.java"); |
| | | } |
| | | } |
| | | } |
| | |
| | | writeFile(writePath, |
| | | fileContext); |
| | | //复制生成的文件到对应分区目录下 |
| | | FileUtilBase.copyfile(writePath,toUpperCaseFirstOne(data.getShareName().toString())+"Service\\src\\main\\java\\com\\java110\\community\\smo\\impl\\" + toUpperCaseFirstOne(data.getName()) + "InnerServiceSMOImpl.java"); |
| | | |
| | | if (data.isAutoMove()) { |
| | | FileUtilBase.copyfile(writePath, toUpperCaseFirstOne(data.getShareName().toString()) + "Service\\src\\main\\java\\com\\java110\\"+data.getShareName()+"\\smo\\impl\\" + toUpperCaseFirstOne(data.getName()) + "InnerServiceSMOImpl.java"); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.java110.code.back; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.code.util.FileUtilBase; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | |
| | | data.setShareColumn(data.getParams().get(data.getShareColumn()).toString()); |
| | | } |
| | | fileContext = fileContext.replace("store", toLowerCaseFirstOne(data.getName())) |
| | | .replace("@@templateCode@@",data.getName()) |
| | | .replace("@@shareName@@",data.getShareName()) |
| | | .replace("@@templateCode@@", data.getName()) |
| | | .replace("@@shareName@@", data.getShareName()) |
| | | .replace("Store", toUpperCaseFirstOne(data.getName())) |
| | | .replace("商户", data.getDesc()) |
| | | .replace("BUSINESS_TYPE_SAVE_STORE_INFO", data.getNewBusinessTypeCd()) |
| | | .replace("stare_id", data.getShareColumn()) |
| | | .replace("shareId", data.getShareParam()) |
| | | .replace(data.getName()+"Id", data.getId()) |
| | | .replace(data.getName()+"_id", data.getParams().get(data.getId()).toString()); |
| | | .replace(data.getName() + "Id", data.getId()) |
| | | .replace(data.getName() + "_id", data.getParams().get(data.getId()).toString()); |
| | | String writePath = this.getClass().getResource("/").getPath() |
| | | + "out/back/listener/" + data.getName() + "/Save" + toUpperCaseFirstOne(data.getName()) + "InfoListener.java"; |
| | | System.out.printf("writePath: " + writePath); |
| | | writeFile(writePath, |
| | | fileContext); |
| | | //复制生成的文件到对应分区目录下 |
| | | FileUtilBase.copyfile(writePath,toUpperCaseFirstOne(data.getShareName()).toString()+"Service\\src\\main\\java\\com\\java110\\community\\listener\\"+ data.getName() + "/Save" + toUpperCaseFirstOne(data.getName()) + "InfoListener.java"); |
| | | if (data.isAutoMove()) { |
| | | FileUtilBase.copyfile(writePath, toUpperCaseFirstOne(data.getShareName()).toString() + "Service\\src\\main\\java\\com\\java110\\"+data.getShareName()+"\\listener\\" + data.getName() + "/Save" + toUpperCaseFirstOne(data.getName()) + "InfoListener.java"); |
| | | } |
| | | //生成协议 |
| | | |
| | | /** |
| | |
| | | writeFile(writePathDoc, |
| | | fileContextDoc); |
| | | //复制生成的文件到对应分区目录下 |
| | | FileUtilBase.copyfile(writePath,"docs\\document\\services\\"+ data.getName() + "/Save" + toUpperCaseFirstOne(data.getName()) + "Info.md"); |
| | | //生成协议 |
| | | if (data.isAutoMove()) { |
| | | FileUtilBase.copyfile(writePath, "docs\\document\\services\\" + data.getName() + "/Save" + toUpperCaseFirstOne(data.getName()) + "Info.md"); |
| | | |
| | | }//生成协议 |
| | | } |
| | | } |
| | |
| | | writeFile(writePath, |
| | | fileContext); |
| | | //复制生成的文件到对应分区目录下 |
| | | FileUtilBase.copyfile(writePath,toUpperCaseFirstOne(data.getShareName().toString())+"Service\\src\\main\\java\\com\\java110\\community\\dao\\impl\\" +toUpperCaseFirstOne(data.getName()) + "ServiceDaoImpl.java"); |
| | | |
| | | if (data.isAutoMove()) { |
| | | FileUtilBase.copyfile(writePath, toUpperCaseFirstOne(data.getShareName().toString()) + "Service\\src\\main\\java\\com\\java110\\"+data.getShareName()+"\\dao\\impl\\" + toUpperCaseFirstOne(data.getName()) + "ServiceDaoImpl.java"); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * 拼装 查询数量 |
| | | * @param data 数据 |
| | | * |
| | | * @param data 数据 |
| | | * @param fileContext 文件内容 |
| | | * @return |
| | | */ |
| | |
| | | writeFile(writePath, |
| | | fileContext); |
| | | //复制生成的文件到对应分区目录下 |
| | | FileUtilBase.copyfile(writePath,"java110-db\\src\\main\\resources\\mapper\\"+data.getShareName().toString()+"\\" + "/" + toUpperCaseFirstOne(data.getName()) + "ServiceDaoImplMapper.xml"); |
| | | if (data.isAutoMove()) { |
| | | FileUtilBase.copyfile(writePath, "java110-db\\src\\main\\resources\\mapper\\" + data.getShareName().toString() + "\\" + "/" + toUpperCaseFirstOne(data.getName()) + "ServiceDaoImplMapper.xml"); |
| | | } |
| | | } |
| | | } |
| | |
| | | public class GeneratorUpdateInfoListener extends BaseGenerator { |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 生成代码 |
| | | * |
| | | * @param data 数据分装对象@Data |
| | | */ |
| | | public void generator(Data data) throws Exception { |
| | | StringBuffer sb = readFile(this.getClass().getResource("/template/UpdateInfoListener.txt").getFile()); |
| | | String fileContext = sb.toString(); |
| | | fileContext = fileContext.replace("store", toLowerCaseFirstOne(data.getName())) |
| | | .replace("@@templateCode@@",data.getName()) |
| | | .replace("@@shareName@@",data.getShareName()) |
| | | .replace("@@templateCode@@", data.getName()) |
| | | .replace("@@shareName@@", data.getShareName()) |
| | | .replace("Store", toUpperCaseFirstOne(data.getName())) |
| | | .replace("商户", data.getDesc()) |
| | | .replace("BUSINESS_TYPE_UPDATE_STORE_INFO", data.getUpdateBusinessTypeCd()) |
| | | .replace(data.getName()+"Id", data.getId()) |
| | | .replace(data.getName()+"_id", data.getParams().get(data.getId()).toString()); |
| | | .replace(data.getName() + "Id", data.getId()) |
| | | .replace(data.getName() + "_id", data.getParams().get(data.getId()).toString()); |
| | | |
| | | String writePath = this.getClass().getResource("/").getPath() |
| | | + "out/back/listener/" + data.getName() + "/Update" + toUpperCaseFirstOne(data.getName()) + "InfoListener.java"; |
| | |
| | | fileContext); |
| | | |
| | | //复制生成的文件到对应分区目录下 |
| | | FileUtilBase.copyfile(writePath,toUpperCaseFirstOne(data.getShareName()).toString()+"Service\\src\\main\\java\\com\\java110\\community\\listener\\"+ data.getName() + "/Update" + toUpperCaseFirstOne(data.getName()) + "InfoListener.java"); |
| | | //生成协议 |
| | | |
| | | if (data.isAutoMove()) { |
| | | FileUtilBase.copyfile(writePath, toUpperCaseFirstOne(data.getShareName()).toString() + "Service\\src\\main\\java\\com\\java110\\"+data.getShareName()+"\\listener\\" + data.getName() + "/Update" + toUpperCaseFirstOne(data.getName()) + "InfoListener.java"); |
| | | //生成协议 |
| | | } |
| | | /** |
| | | * |businessstoreMember|memberTypeCd|1|String|30|成员类型|成员类型| |
| | | */ |
| | | StringBuffer sbDoc = readFile(this.getClass().getResource("/template/serviceDoc.txt").getFile()); |
| | | String fileContextDoc = sbDoc.toString(); |
| | | fileContextDoc = fileContextDoc.replace("store",toLowerCaseFirstOne(data.getName())) |
| | | .replace("Store",toUpperCaseFirstOne(data.getName())) |
| | | .replace("商户",data.getDesc()) |
| | | .replace("保存","修改") |
| | | .replace("$businessTypeCd$",data.getUpdateBusinessTypeCdValue()); |
| | | fileContextDoc = fileContextDoc.replace("store", toLowerCaseFirstOne(data.getName())) |
| | | .replace("Store", toUpperCaseFirstOne(data.getName())) |
| | | .replace("商户", data.getDesc()) |
| | | .replace("保存", "修改") |
| | | .replace("$businessTypeCd$", data.getUpdateBusinessTypeCdValue()); |
| | | |
| | | Map<String,String> tmpParams = data.getParams(); |
| | | Map<String, String> tmpParams = data.getParams(); |
| | | String tmpLine = ""; |
| | | String _tmpLine =""; |
| | | for(String key : tmpParams.keySet()){ |
| | | if("operate".equals(key) || "statusCd".equals(key) || "bId".equals(key)){ |
| | | String _tmpLine = ""; |
| | | for (String key : tmpParams.keySet()) { |
| | | if ("operate".equals(key) || "statusCd".equals(key) || "bId".equals(key)) { |
| | | continue; |
| | | } |
| | | tmpLine += "|business"+toUpperCaseFirstOne(data.getName())+"Info|"+key+"|1|String|30|-|-|\n"; |
| | | _tmpLine += " \""+key+"\":\"填写具体值\",\n"; |
| | | tmpLine += "|business" + toUpperCaseFirstOne(data.getName()) + "Info|" + key + "|1|String|30|-|-|\n"; |
| | | _tmpLine += " \"" + key + "\":\"填写具体值\",\n"; |
| | | } |
| | | _tmpLine = _tmpLine.substring(0,_tmpLine.lastIndexOf(",")); |
| | | fileContextDoc = fileContextDoc.replace("$busienssInfo$",tmpLine); |
| | | fileContextDoc = fileContextDoc.replace("$businessInfoJson$",_tmpLine); |
| | | _tmpLine = _tmpLine.substring(0, _tmpLine.lastIndexOf(",")); |
| | | fileContextDoc = fileContextDoc.replace("$busienssInfo$", tmpLine); |
| | | fileContextDoc = fileContextDoc.replace("$businessInfoJson$", _tmpLine); |
| | | System.out.println(this.getClass().getResource("/listener").getPath()); |
| | | String writePathDoc = this.getClass().getResource("/").getPath() |
| | | + "out/back/docs/" + data.getName() + "/Update" + toUpperCaseFirstOne(data.getName()) + "Info.md"; |
| | | writeFile(writePathDoc, |
| | | fileContextDoc); |
| | | //复制生成的文件到对应分区目录下 |
| | | FileUtilBase.copyfile(writePath,"docs\\document\\services\\"+ data.getName() + "/Update" + toUpperCaseFirstOne(data.getName()) + "Info.md"); |
| | | //生成协议 |
| | | if (data.isAutoMove()) { |
| | | FileUtilBase.copyfile(writePath, "docs\\document\\services\\" + data.getName() + "/Update" + toUpperCaseFirstOne(data.getName()) + "Info.md"); |
| | | //生成协议 |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | |
| | | "id": "weChatId", |
| | | "name": "smallWeChat", |
| | | "desc": "小程序管理", |
| | | "shareParam": "store_Id", |
| | | "shareColumn": "storeId", |
| | | "newBusinessTypeCd": "BUSINESS_TYPE_SAVE_SMALL_WE_CHAT", |
| | | "updateBusinessTypeCd": "BUSINESS_TYPE_UPDATE_SMALL_WE_CHAT", |
| | | "deleteBusinessTypeCd": "BUSINESS_TYPE_DELETE_SMALL_WE_CHAT", |
| | | "newBusinessTypeCdValue": "210200060001", |
| | | "updateBusinessTypeCdValue": "210200070001", |
| | | "deleteBusinessTypeCdValue": "210200080001", |
| | | "businessTableName": "buiness_small_wechat", |
| | | "tableName": "small_wechat", |
| | | "autoMove": true, |
| | | "id": "taskId", |
| | | "name": "task", |
| | | "desc": "定时任务", |
| | | "shareParam": "task_id", |
| | | "shareColumn": "taskId", |
| | | "shareName": "job", |
| | | "newBusinessTypeCd": "BUSINESS_TYPE_SAVE_TASK", |
| | | "updateBusinessTypeCd": "BUSINESS_TYPE_UPDATE_TASK", |
| | | "deleteBusinessTypeCd": "BUSINESS_TYPE_DELETE_TASK", |
| | | "newBusinessTypeCdValue": "560200030001", |
| | | "updateBusinessTypeCdValue": "560200040001", |
| | | "deleteBusinessTypeCdValue": "560200050001", |
| | | "businessTableName": "business_task", |
| | | "tableName": "task", |
| | | "param": { |
| | | "weChatId": "weChat_id", |
| | | "bId": "bId", |
| | | "storeId": "store_Id", |
| | | "name": "name", |
| | | "appId": "appId", |
| | | "appSecret": "appSecret", |
| | | "payPassword": "pay_password", |
| | | "remarks": "remarks", |
| | | "taskId": "task_id", |
| | | "bId": "b_id", |
| | | "taskName": "task_name", |
| | | "templateId": "template_id", |
| | | "taskCron": "task_cron", |
| | | "state": "state", |
| | | "statusCd": "status_cd", |
| | | "createTime": "create_time", |
| | | "operate": "operate" |
| | |
| | | "required": [ |
| | | { |
| | | |
| | | "code": "name", |
| | | "msg": "小程序名称不能为空" |
| | | "code": "taskName", |
| | | "msg": "任务名称不能为空" |
| | | }, |
| | | { |
| | | "code": "appId", |
| | | "msg": "小程序appId不能为空" |
| | | "code": "templateId", |
| | | "msg": "模板不能为空" |
| | | }, |
| | | { |
| | | "code": "appSecret", |
| | | "msg": "小程序appSecret不能为空" |
| | | }, |
| | | { |
| | | |
| | | "code": "payPassword", |
| | | "msg": "支付密码不能为空" |
| | | "code": "taskCron", |
| | | "msg": "定时时间不能为空" |
| | | } |
| | | ] |
| | | } |
| New file |
| | |
| | | { |
| | | |
| | | "id": "weChatId", |
| | | "name": "smallWeChat", |
| | | "desc": "小程序管理", |
| | | "shareParam": "store_Id", |
| | | "shareColumn": "storeId", |
| | | "newBusinessTypeCd": "BUSINESS_TYPE_SAVE_SMALL_WE_CHAT", |
| | | "updateBusinessTypeCd": "BUSINESS_TYPE_UPDATE_SMALL_WE_CHAT", |
| | | "deleteBusinessTypeCd": "BUSINESS_TYPE_DELETE_SMALL_WE_CHAT", |
| | | "newBusinessTypeCdValue": "210200060001", |
| | | "updateBusinessTypeCdValue": "210200070001", |
| | | "deleteBusinessTypeCdValue": "210200080001", |
| | | "businessTableName": "buiness_small_wechat", |
| | | "tableName": "small_wechat", |
| | | "param": { |
| | | "weChatId": "weChat_id", |
| | | "bId": "bId", |
| | | "storeId": "store_Id", |
| | | "name": "name", |
| | | "appId": "appId", |
| | | "appSecret": "appSecret", |
| | | "payPassword": "pay_password", |
| | | "remarks": "remarks", |
| | | "statusCd": "status_cd", |
| | | "createTime": "create_time", |
| | | "operate": "operate" |
| | | }, |
| | | "required": [ |
| | | { |
| | | |
| | | "code": "name", |
| | | "msg": "小程序名称不能为空" |
| | | }, |
| | | { |
| | | "code": "appId", |
| | | "msg": "小程序appId不能为空" |
| | | }, |
| | | { |
| | | "code": "appSecret", |
| | | "msg": "小程序appSecret不能为空" |
| | | }, |
| | | { |
| | | |
| | | "code": "payPassword", |
| | | "msg": "支付密码不能为空" |
| | | } |
| | | ] |
| | | } |
| | |
| | | |
| | | currentStoreInfo.put("operate",StatusConstant.OPERATE_DEL); |
| | | getStoreServiceDaoImpl().saveBusinessStoreInfo(currentStoreInfo); |
| | | for(Object key : currentStoreInfo.keySet()) { |
| | | if(businessStore.get(key) == null) { |
| | | businessStore.put(key.toString(), currentStoreInfo.get(key)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public JSONObject add@@TemplateCode@@(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | public void add@@TemplateCode@@(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_@@TEMPLATECODE@@); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject business@@TemplateCode@@ = new JSONObject(); |
| | | business@@TemplateCode@@.putAll(paramInJson); |
| | | business@@TemplateCode@@.put("@@templateKey@@", "-1"); |
| | | //计算 应收金额 |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("business@@TemplateCode@@", business@@TemplateCode@@); |
| | | return business; |
| | | paramInJson.put("@@templateKey@@", "-1"); |
| | | @@TemplateCode@@Po @@templateCode@@Po = BeanConvertUtil.covertBean(paramInJson, @@TemplateCode@@Po.class); |
| | | super.insert(dataFlowContext, @@templateCode@@Po, BusinessTypeConstant.BUSINESS_TYPE_SAVE_@@TEMPLATECODE@@); |
| | | } |
| | | |
| | | |
| | |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public JSONObject update@@TemplateCode@@(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | public void update@@TemplateCode@@(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | @@TemplateCode@@Dto @@templateCode@@Dto = new @@TemplateCode@@Dto(); |
| | | @@templateCode@@Dto.set@@TemplateKey@@(paramInJson.getString("@@templateKey@@")); |
| | |
| | | Assert.listOnlyOne(@@templateCode@@Dtos, "未找到需要修改的活动 或多条数据"); |
| | | |
| | | |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_@@TEMPLATECODE@@); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject business@@TemplateCode@@ = new JSONObject(); |
| | | business@@TemplateCode@@.putAll(BeanConvertUtil.beanCovertMap(@@templateCode@@Dtos.get(0))); |
| | | business@@TemplateCode@@.putAll(paramInJson); |
| | | //计算 应收金额 |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("business@@TemplateCode@@", business@@TemplateCode@@); |
| | | return business; |
| | | paramInJson.putAll(BeanConvertUtil.beanCovertMap(@@templateCode@@Dtos.get(0))); |
| | | @@TemplateCode@@Po @@templateCode@@Po = BeanConvertUtil.covertBean(paramInJson, @@TemplateCode@@Po.class); |
| | | super.update(dataFlowContext, @@templateCode@@Po, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_@@TEMPLATECODE@@); |
| | | } |
| | | |
| | | |
| | |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public JSONObject delete@@TemplateCode@@(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | public void delete@@TemplateCode@@(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_DELETE_@@TEMPLATECODE@@); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject business@@TemplateCode@@ = new JSONObject(); |
| | | business@@TemplateCode@@.putAll(paramInJson); |
| | | //计算 应收金额 |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("business@@TemplateCode@@", business@@TemplateCode@@); |
| | | return business; |
| | | @@TemplateCode@@Po @@templateCode@@Po = BeanConvertUtil.covertBean(paramInJson, @@TemplateCode@@Po.class); |
| | | super.update(dataFlowContext, @@templateCode@@Po, BusinessTypeConstant.BUSINESS_TYPE_DELETE_@@TEMPLATECODE@@); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessStore 节点 |
| | | if(data.containsKey("businessStore")){ |
| | | //处理 businessStore 节点 |
| | | if(data.containsKey("businessStore")){ |
| | | Object _obj = data.get("businessStore"); |
| | | if(data.containsKey(StorePo.class.getSimpleName())){ |
| | | Object _obj = data.get(StorePo.class.getSimpleName()); |
| | | JSONArray businessStores = null; |
| | | if(_obj instanceof JSONObject){ |
| | | businessStores = new JSONArray(); |
| | |
| | | }else { |
| | | businessStores = (JSONArray)_obj; |
| | | } |
| | | //JSONObject businessStore = data.getJSONObject("businessStore"); |
| | | //JSONObject businessStore = data.getJSONObject(StorePo.class.getSimpleName()); |
| | | for (int _storeIndex = 0; _storeIndex < businessStores.size();_storeIndex++) { |
| | | JSONObject businessStore = businessStores.getJSONObject(_storeIndex); |
| | | doBusinessStore(business, businessStore); |
| | |
| | | dataFlowContext.addParamOut("storeId", businessStore.getString("storeId")); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("delete@@TemplateCode@@Listener") |
| | | public class Delete@@TemplateCode@@Listener extends AbstractServiceApiListener { |
| | | public class Delete@@TemplateCode@@Listener extends AbstractServiceApiPlusListener { |
| | | |
| | | @Autowired |
| | | private I@@TemplateCode@@BMO @@templateCode@@BMOImpl; |
| | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | HttpHeaders header = new HttpHeaders(); |
| | | context.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D"); |
| | | JSONArray businesses = new JSONArray(); |
| | | |
| | | AppService service = event.getAppService(); |
| | | |
| | | //添加单元信息 |
| | | businesses.add(@@templateCode@@BMOImpl.delete@@TemplateCode@@(reqJson, context)); |
| | | |
| | | ResponseEntity<String> responseEntity = @@templateCode@@BMOImpl.callService(context, service.getServiceCode(), businesses); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | @@templateCode@@BMOImpl.delete@@TemplateCode@@(reqJson, context); |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | } |
| | |
| | | * @param dataFlowContext |
| | | * @return |
| | | */ |
| | | JSONObject add@@TemplateCode@@(JSONObject paramInJson, DataFlowContext dataFlowContext); |
| | | void add@@TemplateCode@@(JSONObject paramInJson, DataFlowContext dataFlowContext); |
| | | |
| | | /** |
| | | * 添加@@templateName@@信息 |
| | |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | JSONObject update@@TemplateCode@@(JSONObject paramInJson, DataFlowContext dataFlowContext); |
| | | void update@@TemplateCode@@(JSONObject paramInJson, DataFlowContext dataFlowContext); |
| | | |
| | | /** |
| | | * 删除@@templateName@@ |
| | |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | JSONObject delete@@TemplateCode@@(JSONObject paramInJson, DataFlowContext dataFlowContext); |
| | | void delete@@TemplateCode@@(JSONObject paramInJson, DataFlowContext dataFlowContext); |
| | | |
| | | |
| | | |
| | |
| | | |
| | | int count = @@templateCode@@InnerServiceSMOImpl.query@@TemplateCode@@sCount(@@templateCode@@Dto); |
| | | |
| | | List<Api@@TemplateCode@@DataVo> @@templateCode@@s = null; |
| | | List<@@TemplateCode@@Dto> @@templateCode@@Dtos = null; |
| | | |
| | | if (count > 0) { |
| | | @@templateCode@@s = BeanConvertUtil.covertBeanList(@@templateCode@@InnerServiceSMOImpl.query@@TemplateCode@@s(@@templateCode@@Dto), Api@@TemplateCode@@DataVo.class); |
| | | @@templateCode@@Dtos = @@templateCode@@InnerServiceSMOImpl.query@@TemplateCode@@s(@@templateCode@@Dto); |
| | | } else { |
| | | @@templateCode@@s = new ArrayList<>(); |
| | | @@templateCode@@Dtos = new ArrayList<>(); |
| | | } |
| | | |
| | | Api@@TemplateCode@@Vo api@@TemplateCode@@Vo = new Api@@TemplateCode@@Vo(); |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, @@templateCode@@Dtos); |
| | | |
| | | api@@TemplateCode@@Vo.setTotal(count); |
| | | api@@TemplateCode@@Vo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row"))); |
| | | api@@TemplateCode@@Vo.set@@TemplateCode@@s(@@templateCode@@s); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(api@@TemplateCode@@Vo), HttpStatus.OK); |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | |
| New file |
| | |
| | | package com.java110.po.@@templateCode@@; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | public class @@TemplateCode@@Po implements Serializable { |
| | | |
| | | @@templateColumns@@ |
| | | |
| | | |
| | | } |
| | |
| | | import org.springframework.http.ResponseEntity; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | /** |
| | | * 保存小区侦听 |
| | | * 保存商户侦听 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("save@@TemplateCode@@Listener") |
| | | public class Save@@TemplateCode@@Listener extends AbstractServiceApiListener { |
| | | public class Save@@TemplateCode@@Listener extends AbstractServiceApiPlusListener { |
| | | |
| | | @Autowired |
| | | private I@@TemplateCode@@BMO @@templateCode@@BMOImpl; |
| | |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | HttpHeaders header = new HttpHeaders(); |
| | | context.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D"); |
| | | JSONArray businesses = new JSONArray(); |
| | | |
| | | AppService service = event.getAppService(); |
| | | |
| | | //添加单元信息 |
| | | businesses.add(@@templateCode@@BMOImpl.add@@TemplateCode@@(reqJson, context)); |
| | | |
| | | ResponseEntity<String> responseEntity = @@templateCode@@BMOImpl.callService(context, service.getServiceCode(), businesses); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | @@templateCode@@BMOImpl.add@@TemplateCode@@(reqJson, context); |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | } |
| | |
| | | Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessStore 节点 |
| | | if(data.containsKey("businessStore")){ |
| | | Object bObj = data.get("businessStore"); |
| | | if(data.containsKey(StorePo.class.getSimpleName())){ |
| | | Object bObj = data.get(StorePo.class.getSimpleName()); |
| | | JSONArray businessStores = null; |
| | | if(bObj instanceof JSONObject){ |
| | | businessStores = new JSONArray(); |
| | |
| | | }else { |
| | | businessStores = (JSONArray)bObj; |
| | | } |
| | | //JSONObject businessStore = data.getJSONObject("businessStore"); |
| | | //JSONObject businessStore = data.getJSONObject(StorePo.class.getSimpleName()); |
| | | for (int bStoreIndex = 0; bStoreIndex < businessStores.size();bStoreIndex++) { |
| | | JSONObject businessStore = businessStores.getJSONObject(bStoreIndex); |
| | | doBusinessStore(business, businessStore); |
| | |
| | | |
| | | Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessStore 节点 |
| | | if(data.containsKey("businessStore")){ |
| | | |
| | | //处理 businessStore 节点 |
| | | if(data.containsKey("businessStore")){ |
| | | Object _obj = data.get("businessStore"); |
| | | if(data.containsKey(StorePo.class.getSimpleName())){ |
| | | Object _obj = data.get(StorePo.class.getSimpleName()); |
| | | JSONArray businessStores = null; |
| | | if(_obj instanceof JSONObject){ |
| | | businessStores = new JSONArray(); |
| | |
| | | }else { |
| | | businessStores = (JSONArray)_obj; |
| | | } |
| | | //JSONObject businessStore = data.getJSONObject("businessStore"); |
| | | //JSONObject businessStore = data.getJSONObject(StorePo.class.getSimpleName()); |
| | | for (int _storeIndex = 0; _storeIndex < businessStores.size();_storeIndex++) { |
| | | JSONObject businessStore = businessStores.getJSONObject(_storeIndex); |
| | | doBusinessStore(business, businessStore); |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | package com.java110.api.listener.@@templateCode@@; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.bmo.@@templateCode@@.I@@TemplateCode@@BMO; |
| | | .I@@TemplateCode@@BMO; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.constant.ServiceCode@@TemplateCode@@Constant; |
| | |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("update@@TemplateCode@@Listener") |
| | | public class Update@@TemplateCode@@Listener extends AbstractServiceApiListener { |
| | | public class Update@@TemplateCode@@Listener extends AbstractServiceApiPlusListener { |
| | | |
| | | @Autowired |
| | | private I@@TemplateCode@@BMO @@templateCode@@BMOImpl; |
| | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | HttpHeaders header = new HttpHeaders(); |
| | | context.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D"); |
| | | JSONArray businesses = new JSONArray(); |
| | | |
| | | AppService service = event.getAppService(); |
| | | |
| | | //添加单元信息 |
| | | businesses.add(@@templateCode@@BMOImpl.update@@TemplateCode@@(reqJson, context)); |
| | | |
| | | ResponseEntity<String> responseEntity = @@templateCode@@BMOImpl.callService(context, service.getServiceCode(), businesses); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | @@templateCode@@BMOImpl.update@@TemplateCode@@(reqJson, context); |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.core.smo.task; |
| | | |
| | | import com.java110.core.feign.FeignConfiguration; |
| | | import com.java110.dto.task.TaskDto; |
| | | 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 ITaskInnerServiceSMO |
| | | * @Description 定时任务接口类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:04 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @FeignClient(name = "job-service", configuration = {FeignConfiguration.class}) |
| | | @RequestMapping("/taskApi") |
| | | public interface ITaskInnerServiceSMO { |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * |
| | | * @param taskDto 数据对象分享 |
| | | * @return TaskDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/queryTasks", method = RequestMethod.POST) |
| | | List<TaskDto> queryTasks(@RequestBody TaskDto taskDto); |
| | | |
| | | /** |
| | | * 查询<p>小区楼</p>总记录数 |
| | | * |
| | | * @param taskDto 数据对象分享 |
| | | * @return 小区下的小区楼记录数 |
| | | */ |
| | | @RequestMapping(value = "/queryTasksCount", method = RequestMethod.POST) |
| | | int queryTasksCount(@RequestBody TaskDto taskDto); |
| | | } |
| 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="taskServiceDaoImpl"> |
| | | |
| | | <!-- 保存定时任务信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveBusinessTaskInfo" parameterType="Map"> |
| | | insert into business_task( |
| | | operate,task_cron,create_time,task_name,state,b_id,template_id,task_id |
| | | ) values ( |
| | | #{operate},#{taskCron},#{createTime},#{taskName},#{state},#{bId},#{templateId},#{taskId} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询定时任务信息(Business) add by wuxw 2018-07-03 --> |
| | | <select id="getBusinessTaskInfo" parameterType="Map" resultType="Map"> |
| | | select t.operate,t.task_cron,t.task_cron taskCron,t.create_time,t.create_time createTime,t.task_name,t.task_name taskName,t.state,t.b_id,t.b_id bId,t.template_id,t.template_id templateId,t.task_id,t.task_id taskId |
| | | from business_task t |
| | | where 1 =1 |
| | | <if test="operate !=null and operate != ''"> |
| | | and t.operate= #{operate} |
| | | </if> |
| | | <if test="taskCron !=null and taskCron != ''"> |
| | | and t.task_cron= #{taskCron} |
| | | </if> |
| | | <if test="createTime !=null and createTime != ''"> |
| | | and t.create_time= #{createTime} |
| | | </if> |
| | | <if test="taskName !=null and taskName != ''"> |
| | | and t.task_name= #{taskName} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | and t.state= #{state} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="templateId !=null and templateId != ''"> |
| | | and t.template_id= #{templateId} |
| | | </if> |
| | | <if test="taskId !=null and taskId != ''"> |
| | | and t.task_id= #{taskId} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 保存定时任务信息至 instance表中 add by wuxw 2018-07-03 --> |
| | | <insert id="saveTaskInfoInstance" parameterType="Map"> |
| | | insert into task( |
| | | task_cron,create_time,task_name,status_cd,state,b_id,template_id,task_id |
| | | ) select t.task_cron,t.create_time,t.task_name,'0',t.state,t.b_id,t.template_id,t.task_id from business_task t where 1=1 |
| | | and t.operate= 'ADD' |
| | | <if test="taskCron !=null and taskCron != ''"> |
| | | and t.task_cron= #{taskCron} |
| | | </if> |
| | | <if test="createTime !=null and createTime != ''"> |
| | | and t.create_time= #{createTime} |
| | | </if> |
| | | <if test="taskName !=null and taskName != ''"> |
| | | and t.task_name= #{taskName} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | and t.state= #{state} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="templateId !=null and templateId != ''"> |
| | | and t.template_id= #{templateId} |
| | | </if> |
| | | <if test="taskId !=null and taskId != ''"> |
| | | and t.task_id= #{taskId} |
| | | </if> |
| | | |
| | | </insert> |
| | | |
| | | |
| | | |
| | | <!-- 查询定时任务信息 add by wuxw 2018-07-03 --> |
| | | <select id="getTaskInfo" parameterType="Map" resultType="Map"> |
| | | select t.task_cron,t.task_cron taskCron,t.create_time,t.create_time createTime,t.task_name,t.task_name taskName,t.status_cd,t.status_cd statusCd,t.state,t.b_id,t.b_id bId,t.template_id,t.template_id templateId,t.task_id,t.task_id taskId |
| | | from task t |
| | | where 1 =1 |
| | | <if test="taskCron !=null and taskCron != ''"> |
| | | and t.task_cron= #{taskCron} |
| | | </if> |
| | | <if test="createTime !=null and createTime != ''"> |
| | | and t.create_time= #{createTime} |
| | | </if> |
| | | <if test="taskName !=null and taskName != ''"> |
| | | and t.task_name= #{taskName} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | and t.state= #{state} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="templateId !=null and templateId != ''"> |
| | | and t.template_id= #{templateId} |
| | | </if> |
| | | <if test="taskId !=null and taskId != ''"> |
| | | and t.task_id= #{taskId} |
| | | </if> |
| | | order by t.create_time desc |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 修改定时任务信息 add by wuxw 2018-07-03 --> |
| | | <update id="updateTaskInfoInstance" parameterType="Map"> |
| | | update task t set t.status_cd = #{statusCd} |
| | | <if test="newBId != null and newBId != ''"> |
| | | ,t.b_id = #{newBId} |
| | | </if> |
| | | <if test="taskCron !=null and taskCron != ''"> |
| | | , t.task_cron= #{taskCron} |
| | | </if> |
| | | <if test="createTime !=null and createTime != ''"> |
| | | , t.create_time= #{createTime} |
| | | </if> |
| | | <if test="taskName !=null and taskName != ''"> |
| | | , t.task_name= #{taskName} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | , t.state= #{state} |
| | | </if> |
| | | <if test="templateId !=null and templateId != ''"> |
| | | , t.template_id= #{templateId} |
| | | </if> |
| | | where 1=1 <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="taskId !=null and taskId != ''"> |
| | | and t.task_id= #{taskId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询定时任务数量 add by wuxw 2018-07-03 --> |
| | | <select id="queryTasksCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from task t |
| | | where 1 =1 |
| | | <if test="taskCron !=null and taskCron != ''"> |
| | | and t.task_cron= #{taskCron} |
| | | </if> |
| | | <if test="createTime !=null and createTime != ''"> |
| | | and t.create_time= #{createTime} |
| | | </if> |
| | | <if test="taskName !=null and taskName != ''"> |
| | | and t.task_name= #{taskName} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | and t.state= #{state} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="templateId !=null and templateId != ''"> |
| | | and t.template_id= #{templateId} |
| | | </if> |
| | | <if test="taskId !=null and taskId != ''"> |
| | | and t.task_id= #{taskId} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | */ |
| | | public static final String BUSINESS_TYPE_DELETE_JUNK_REQUIREMENT="550200050001"; |
| | | |
| | | /** |
| | | * 保存旧货市场 |
| | | * 3保存 |
| | | */ |
| | | public static final String BUSINESS_TYPE_SAVE_TASK="560200030001"; |
| | | |
| | | |
| | | /** |
| | | * 修改旧货市场 |
| | | * 3保存 |
| | | */ |
| | | public static final String BUSINESS_TYPE_UPDATE_TASK="560200040001"; |
| | | |
| | | /** |
| | | * 删除旧货市场 |
| | | */ |
| | | public static final String BUSINESS_TYPE_DELETE_TASK="560200050001"; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.utils.constant; |
| | | |
| | | /** |
| | | * 定时任务常量类 |
| | | * Created by wuxw on 2017/5/20. |
| | | */ |
| | | public class ServiceCodeTaskConstant { |
| | | |
| | | /** |
| | | * 添加 定时任务 |
| | | */ |
| | | public static final String ADD_TASK = "task.saveTask"; |
| | | |
| | | |
| | | /** |
| | | * 修改 定时任务 |
| | | */ |
| | | public static final String UPDATE_TASK = "task.updateTask"; |
| | | /** |
| | | * 删除 定时任务 |
| | | */ |
| | | public static final String DELETE_TASK = "task.deleteTask"; |
| | | |
| | | |
| | | /** |
| | | * 查询 定时任务 |
| | | */ |
| | | public static final String LIST_TASKS = "task.listTasks"; |
| | | |
| | | |
| | | } |