| New file |
| | |
| | | package com.java110.api.bmo.inspectionTask; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.bmo.IApiBaseBMO; |
| | | import com.java110.core.context.DataFlowContext; |
| | | |
| | | public interface IInspectionTaskBMO extends IApiBaseBMO { |
| | | |
| | | |
| | | /** |
| | | * 添加活动 |
| | | * @param paramInJson |
| | | * @param dataFlowContext |
| | | * @return |
| | | */ |
| | | JSONObject addInspectionTask(JSONObject paramInJson, DataFlowContext dataFlowContext); |
| | | |
| | | /** |
| | | * 添加活动信息 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | // JSONObject updateInspectionTask(JSONObject paramInJson, DataFlowContext dataFlowContext); |
| | | |
| | | /** |
| | | * 删除活动 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | //JSONObject deleteInspectionTask(JSONObject paramInJson, DataFlowContext dataFlowContext); |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.api.bmo.inspectionTask.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.bmo.ApiBaseBMO; |
| | | import com.java110.api.bmo.inspectionTask.IInspectionTaskBMO; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.smo.inspectionTask.IInspectionTaskInnerServiceSMO; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("inspectionTaskBMOImpl") |
| | | public class InspectionTaskBMOImpl extends ApiBaseBMO implements IInspectionTaskBMO { |
| | | |
| | | @Autowired |
| | | private IInspectionTaskInnerServiceSMO inspectionTaskInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public JSONObject addInspectionTask(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_INSPECTION_TASK); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessInspectionTask = new JSONObject(); |
| | | businessInspectionTask.putAll(paramInJson); |
| | | businessInspectionTask.put("taskId", "-1"); |
| | | //计算 应收金额 |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessInspectionTask", businessInspectionTask); |
| | | return business; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加活动信息 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | /* public JSONObject updateInspectionTask(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | InspectionTaskDto inspectionTaskDto = new InspectionTaskDto(); |
| | | inspectionTaskDto.setInspectionTaskId(paramInJson.getString("inspectionTaskId")); |
| | | inspectionTaskDto.setCommunityId(paramInJson.getString("communityId")); |
| | | List<InspectionTaskDto> inspectionTaskDtos = inspectionTaskInnerServiceSMOImpl.queryInspectionTasks(inspectionTaskDto); |
| | | |
| | | Assert.listOnlyOne(inspectionTaskDtos, "未找到需要修改的活动 或多条数据"); |
| | | |
| | | |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_inspectionTask); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessInspectionTask = new JSONObject(); |
| | | businessInspectionTask.putAll(activitiesDtos.get(0)); |
| | | businessInspectionTask.putAll(paramInJson); |
| | | //计算 应收金额 |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessInspectionTask", businessInspectionTask); |
| | | return business; |
| | | }*/ |
| | | |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | /*public JSONObject deleteInspectionTask(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_DELETE_inspectionTask); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessInspectionTask = new JSONObject(); |
| | | businessInspectionTask.putAll(paramInJson); |
| | | //计算 应收金额 |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessInspectionTask", businessInspectionTask); |
| | | return business; |
| | | } |
| | | */ |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.inspectionTask; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.smo.inspectionTask.IInspectionTaskInnerServiceSMO; |
| | | import com.java110.dto.inspectionTask.InspectionTaskDto; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.ServiceCodeInspectionTaskConstant; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.vo.api.inspectionTask.ApiInspectionTaskDataVo; |
| | | import com.java110.vo.api.inspectionTask.ApiInspectionTaskVo; |
| | | 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("listInspectionTasksListener") |
| | | public class ListInspectionTasksListener extends AbstractServiceApiListener { |
| | | |
| | | @Autowired |
| | | private IInspectionTaskInnerServiceSMO inspectionTaskInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeInspectionTaskConstant.LIST_INSPECTIONTASKS; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.GET; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | public IInspectionTaskInnerServiceSMO getInspectionTaskInnerServiceSMOImpl() { |
| | | return inspectionTaskInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setInspectionTaskInnerServiceSMOImpl(IInspectionTaskInnerServiceSMO inspectionTaskInnerServiceSMOImpl) { |
| | | this.inspectionTaskInnerServiceSMOImpl = inspectionTaskInnerServiceSMOImpl; |
| | | } |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | super.validatePageInfo(reqJson); |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | InspectionTaskDto inspectionTaskDto = BeanConvertUtil.covertBean(reqJson, InspectionTaskDto.class); |
| | | |
| | | int count = inspectionTaskInnerServiceSMOImpl.queryInspectionTasksCount(inspectionTaskDto); |
| | | |
| | | List<ApiInspectionTaskDataVo> inspectionTasks = null; |
| | | |
| | | if (count > 0) { |
| | | inspectionTasks = BeanConvertUtil.covertBeanList(inspectionTaskInnerServiceSMOImpl.queryInspectionTasks(inspectionTaskDto), ApiInspectionTaskDataVo.class); |
| | | } else { |
| | | inspectionTasks = new ArrayList<>(); |
| | | } |
| | | |
| | | ApiInspectionTaskVo apiInspectionTaskVo = new ApiInspectionTaskVo(); |
| | | |
| | | apiInspectionTaskVo.setTotal(count); |
| | | apiInspectionTaskVo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row"))); |
| | | apiInspectionTaskVo.setInspectionTasks(inspectionTasks); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiInspectionTaskVo), HttpStatus.OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.inspectionTask; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.bmo.inspectionTask.IInspectionTaskBMO; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.constant.ServiceCodeInspectionTaskConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | |
| | | /** |
| | | * 保存小区侦听 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("saveInspectionTaskListener") |
| | | public class SaveInspectionTaskListener extends AbstractServiceApiListener { |
| | | |
| | | @Autowired |
| | | private IInspectionTaskBMO inspectionTaskBMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | //Assert.hasKeyAndValue(reqJson, "xxx", "xxx"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "inspectionPlanId", "请求报文中未包含inspectionPlanId"); |
| | | Assert.hasKeyAndValue(reqJson, "actInsTime", "请求报文中未包含actInsTime"); |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId"); |
| | | Assert.hasKeyAndValue(reqJson, "actUserId", "请求报文中未包含actUserId"); |
| | | Assert.hasKeyAndValue(reqJson, "actUserName", "请求报文中未包含actUserName"); |
| | | Assert.hasKeyAndValue(reqJson, "signType", "请求报文中未包含signType"); |
| | | |
| | | } |
| | | |
| | | @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(inspectionTaskBMOImpl.addInspectionTask(reqJson, context)); |
| | | |
| | | ResponseEntity<String> responseEntity = inspectionTaskBMOImpl.callService(context, service.getServiceCode(), businesses); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeInspectionTaskConstant.ADD_INSPECTIONTASK; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.community.dao; |
| | | |
| | | |
| | | import com.java110.utils.exception.DAOException; |
| | | import 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 IInspectionTaskServiceDao { |
| | | |
| | | /** |
| | | * 保存 活动信息 |
| | | * @param businessInspectionTaskInfo 活动信息 封装 |
| | | * @throws DAOException 操作数据库异常 |
| | | */ |
| | | void saveBusinessInspectionTaskInfo(Map businessInspectionTaskInfo) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询活动信息(business过程) |
| | | * 根据bId 查询活动信息 |
| | | * @param info bId 信息 |
| | | * @return 活动信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getBusinessInspectionTaskInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存 活动信息 Business数据到 Instance中 |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void saveInspectionTaskInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询活动信息(instance过程) |
| | | * 根据bId 查询活动信息 |
| | | * @param info bId 信息 |
| | | * @return 活动信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getInspectionTaskInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改活动信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void updateInspectionTaskInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询活动总数 |
| | | * |
| | | * @param info 活动信息 |
| | | * @return 活动数量 |
| | | */ |
| | | int queryInspectionTasksCount(Map info); |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.community.dao.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.community.dao.IInspectionTaskServiceDao; |
| | | import com.java110.core.base.dao.BaseServiceDao; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.utils.util.DateUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 活动服务 与数据库交互 |
| | | * Created by wuxw on 2017/4/5. |
| | | */ |
| | | @Service("inspectionTaskServiceDaoImpl") |
| | | //@Transactional |
| | | public class InspectionTaskServiceDaoImpl extends BaseServiceDao implements IInspectionTaskServiceDao { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(InspectionTaskServiceDaoImpl.class); |
| | | |
| | | /** |
| | | * 活动信息封装 |
| | | * |
| | | * @param businessInspectionTaskInfo 活动信息 封装 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveBusinessInspectionTaskInfo(Map businessInspectionTaskInfo) throws DAOException { |
| | | businessInspectionTaskInfo.put("month", DateUtil.getCurrentMonth()); |
| | | // 查询business_user 数据是否已经存在 |
| | | logger.debug("保存活动信息 入参 businessInspectionTaskInfo : {}", businessInspectionTaskInfo); |
| | | int saveFlag = sqlSessionTemplate.insert("inspectionTaskServiceDaoImpl.saveBusinessInspectionTaskInfo", businessInspectionTaskInfo); |
| | | |
| | | if (saveFlag < 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存活动数据失败:" + JSONObject.toJSONString(businessInspectionTaskInfo)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询活动信息 |
| | | * |
| | | * @param info bId 信息 |
| | | * @return 活动信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getBusinessInspectionTaskInfo(Map info) throws DAOException { |
| | | |
| | | logger.debug("查询活动信息 入参 info : {}", info); |
| | | |
| | | List<Map> businessInspectionTaskInfos = sqlSessionTemplate.selectList("inspectionTaskServiceDaoImpl.getBusinessInspectionTaskInfo", info); |
| | | |
| | | return businessInspectionTaskInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存活动信息 到 instance |
| | | * |
| | | * @param info bId 信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveInspectionTaskInfoInstance(Map info) throws DAOException { |
| | | logger.debug("保存活动信息Instance 入参 info : {}", info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("inspectionTaskServiceDaoImpl.saveInspectionTaskInfoInstance", 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> getInspectionTaskInfo(Map info) throws DAOException { |
| | | logger.debug("查询活动信息 入参 info : {}", info); |
| | | |
| | | List<Map> businessInspectionTaskInfos = sqlSessionTemplate.selectList("inspectionTaskServiceDaoImpl.getInspectionTaskInfo", info); |
| | | |
| | | return businessInspectionTaskInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改活动信息 |
| | | * |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void updateInspectionTaskInfoInstance(Map info) throws DAOException { |
| | | logger.debug("修改活动信息Instance 入参 info : {}", info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("inspectionTaskServiceDaoImpl.updateInspectionTaskInfoInstance", info); |
| | | |
| | | if (saveFlag < 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改活动信息Instance数据失败:" + JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询活动数量 |
| | | * |
| | | * @param info 活动信息 |
| | | * @return 活动数量 |
| | | */ |
| | | @Override |
| | | public int queryInspectionTasksCount(Map info) { |
| | | logger.debug("查询活动数据 入参 info : {}", info); |
| | | |
| | | List<Map> businessInspectionTaskInfos = sqlSessionTemplate.selectList("inspectionTaskServiceDaoImpl.queryInspectionTasksCount", info); |
| | | if (businessInspectionTaskInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessInspectionTaskInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.community.listener.inspectionTask; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.community.dao.IInspectionTaskServiceDao; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.event.service.AbstractBusinessServiceDataFlowListener; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.constant.StatusConstant; |
| | | import com.java110.utils.exception.ListenerExecuteException; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 活动 服务侦听 父类 |
| | | * Created by wuxw on 2018/7/4. |
| | | */ |
| | | public abstract class AbstractInspectionTaskBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener { |
| | | private static Logger logger = LoggerFactory.getLogger(AbstractInspectionTaskBusinessServiceDataFlowListener.class); |
| | | |
| | | |
| | | /** |
| | | * 获取 DAO工具类 |
| | | * |
| | | * @return |
| | | */ |
| | | public abstract IInspectionTaskServiceDao getInspectionTaskServiceDaoImpl(); |
| | | |
| | | /** |
| | | * 刷新 businessInspectionTaskInfo 数据 |
| | | * 主要将 数据库 中字段和 接口传递字段建立关系 |
| | | * |
| | | * @param businessInspectionTaskInfo |
| | | */ |
| | | protected void flushBusinessInspectionTaskInfo(Map businessInspectionTaskInfo, String statusCd) { |
| | | businessInspectionTaskInfo.put("newBId", businessInspectionTaskInfo.get("b_id")); |
| | | businessInspectionTaskInfo.put("planUserId", businessInspectionTaskInfo.get("plan_user_id")); |
| | | businessInspectionTaskInfo.put("actInsTime", businessInspectionTaskInfo.get("act_ins_time")); |
| | | businessInspectionTaskInfo.put("planInsTime", businessInspectionTaskInfo.get("plan_ins_time")); |
| | | businessInspectionTaskInfo.put("actUserName", businessInspectionTaskInfo.get("act_user_name")); |
| | | businessInspectionTaskInfo.put("operate", businessInspectionTaskInfo.get("operate")); |
| | | businessInspectionTaskInfo.put("signType", businessInspectionTaskInfo.get("sign_type")); |
| | | businessInspectionTaskInfo.put("inspectionPlanId", businessInspectionTaskInfo.get("inspection_plan_id")); |
| | | businessInspectionTaskInfo.put("planUserName", businessInspectionTaskInfo.get("plan_user_name")); |
| | | businessInspectionTaskInfo.put("communityId", businessInspectionTaskInfo.get("community_id")); |
| | | businessInspectionTaskInfo.put("actUserId", businessInspectionTaskInfo.get("act_user_id")); |
| | | businessInspectionTaskInfo.put("taskId", businessInspectionTaskInfo.get("task_id")); |
| | | businessInspectionTaskInfo.remove("bId"); |
| | | businessInspectionTaskInfo.put("statusCd", statusCd); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中 |
| | | * |
| | | * @param businessInspectionTask 活动信息 |
| | | */ |
| | | protected void autoSaveDelBusinessInspectionTask(Business business, JSONObject businessInspectionTask) { |
| | | //自动插入DEL |
| | | Map info = new HashMap(); |
| | | info.put("taskId", businessInspectionTask.getString("taskId")); |
| | | info.put("statusCd", StatusConstant.STATUS_CD_VALID); |
| | | List<Map> currentInspectionTaskInfos = getInspectionTaskServiceDaoImpl().getInspectionTaskInfo(info); |
| | | if (currentInspectionTaskInfos == null || currentInspectionTaskInfos.size() != 1) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "未找到需要修改数据信息,入参错误或数据有问题,请检查" + info); |
| | | } |
| | | |
| | | Map currentInspectionTaskInfo = currentInspectionTaskInfos.get(0); |
| | | |
| | | currentInspectionTaskInfo.put("bId", business.getbId()); |
| | | |
| | | currentInspectionTaskInfo.put("planUserId", currentInspectionTaskInfo.get("plan_user_id")); |
| | | currentInspectionTaskInfo.put("actInsTime", currentInspectionTaskInfo.get("act_ins_time")); |
| | | currentInspectionTaskInfo.put("planInsTime", currentInspectionTaskInfo.get("plan_ins_time")); |
| | | currentInspectionTaskInfo.put("actUserName", currentInspectionTaskInfo.get("act_user_name")); |
| | | currentInspectionTaskInfo.put("operate", currentInspectionTaskInfo.get("operate")); |
| | | currentInspectionTaskInfo.put("signType", currentInspectionTaskInfo.get("sign_type")); |
| | | currentInspectionTaskInfo.put("inspectionPlanId", currentInspectionTaskInfo.get("inspection_plan_id")); |
| | | currentInspectionTaskInfo.put("planUserName", currentInspectionTaskInfo.get("plan_user_name")); |
| | | currentInspectionTaskInfo.put("communityId", currentInspectionTaskInfo.get("community_id")); |
| | | currentInspectionTaskInfo.put("actUserId", currentInspectionTaskInfo.get("act_user_id")); |
| | | currentInspectionTaskInfo.put("taskId", currentInspectionTaskInfo.get("task_id")); |
| | | |
| | | |
| | | currentInspectionTaskInfo.put("operate", StatusConstant.OPERATE_DEL); |
| | | getInspectionTaskServiceDaoImpl().saveBusinessInspectionTaskInfo(currentInspectionTaskInfo); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.community.listener.inspectionTask; |
| | | |
| | | 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.community.dao.IInspectionTaskServiceDao; |
| | | 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("saveInspectionTaskInfoListener") |
| | | @Transactional |
| | | public class SaveInspectionTaskInfoListener extends AbstractInspectionTaskBusinessServiceDataFlowListener{ |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(SaveInspectionTaskInfoListener.class); |
| | | |
| | | @Autowired |
| | | private IInspectionTaskServiceDao inspectionTaskServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_SAVE_INSPECTION_TASK; |
| | | } |
| | | |
| | | /** |
| | | * 保存活动信息 business 表中 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | JSONObject data = business.getDatas(); |
| | | Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessInspectionTask 节点 |
| | | if(data.containsKey("businessInspectionTask")){ |
| | | Object bObj = data.get("businessInspectionTask"); |
| | | JSONArray businessInspectionTasks = null; |
| | | if(bObj instanceof JSONObject){ |
| | | businessInspectionTasks = new JSONArray(); |
| | | businessInspectionTasks.add(bObj); |
| | | }else { |
| | | businessInspectionTasks = (JSONArray)bObj; |
| | | } |
| | | //JSONObject businessInspectionTask = data.getJSONObject("businessInspectionTask"); |
| | | for (int bInspectionTaskIndex = 0; bInspectionTaskIndex < businessInspectionTasks.size();bInspectionTaskIndex++) { |
| | | JSONObject businessInspectionTask = businessInspectionTasks.getJSONObject(bInspectionTaskIndex); |
| | | doBusinessInspectionTask(business, businessInspectionTask); |
| | | if(bObj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("taskId", businessInspectionTask.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> businessInspectionTaskInfo = inspectionTaskServiceDaoImpl.getBusinessInspectionTaskInfo(info); |
| | | if( businessInspectionTaskInfo != null && businessInspectionTaskInfo.size() >0) { |
| | | reFreshShareColumn(info, businessInspectionTaskInfo.get(0)); |
| | | inspectionTaskServiceDaoImpl.saveInspectionTaskInfoInstance(info); |
| | | if(businessInspectionTaskInfo.size() == 1) { |
| | | dataFlowContext.addParamOut("taskId", businessInspectionTaskInfo.get(0).get("task_id")); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 刷 分片字段 |
| | | * |
| | | * @param info 查询对象 |
| | | * @param businessInfo 小区ID |
| | | */ |
| | | private void reFreshShareColumn(Map info, Map businessInfo) { |
| | | |
| | | if (info.containsKey("communityId")) { |
| | | return; |
| | | } |
| | | |
| | | if (!businessInfo.containsKey("community_id")) { |
| | | return; |
| | | } |
| | | |
| | | info.put("communityId", businessInfo.get("community_id")); |
| | | } |
| | | /** |
| | | * 撤单 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doRecover(DataFlowContext dataFlowContext, Business business) { |
| | | String bId = business.getbId(); |
| | | //Assert.hasLength(bId,"请求报文中没有包含 bId"); |
| | | Map info = new HashMap(); |
| | | info.put("bId",bId); |
| | | info.put("statusCd",StatusConstant.STATUS_CD_VALID); |
| | | Map paramIn = new HashMap(); |
| | | paramIn.put("bId",bId); |
| | | paramIn.put("statusCd",StatusConstant.STATUS_CD_INVALID); |
| | | //活动信息 |
| | | List<Map> inspectionTaskInfo = inspectionTaskServiceDaoImpl.getInspectionTaskInfo(info); |
| | | if(inspectionTaskInfo != null && inspectionTaskInfo.size() > 0){ |
| | | reFreshShareColumn(paramIn, inspectionTaskInfo.get(0)); |
| | | inspectionTaskServiceDaoImpl.updateInspectionTaskInfoInstance(paramIn); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 处理 businessInspectionTask 节点 |
| | | * @param business 总的数据节点 |
| | | * @param businessInspectionTask 活动节点 |
| | | */ |
| | | private void doBusinessInspectionTask(Business business,JSONObject businessInspectionTask){ |
| | | |
| | | Assert.jsonObjectHaveKey(businessInspectionTask,"taskId","businessInspectionTask 节点下没有包含 taskId 节点"); |
| | | |
| | | if(businessInspectionTask.getString("taskId").startsWith("-")){ |
| | | //刷新缓存 |
| | | //flushInspectionTaskId(business.getDatas()); |
| | | |
| | | businessInspectionTask.put("taskId",GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_taskId)); |
| | | |
| | | } |
| | | |
| | | businessInspectionTask.put("bId",business.getbId()); |
| | | businessInspectionTask.put("operate", StatusConstant.OPERATE_ADD); |
| | | //保存活动信息 |
| | | inspectionTaskServiceDaoImpl.saveBusinessInspectionTaskInfo(businessInspectionTask); |
| | | |
| | | } |
| | | |
| | | public IInspectionTaskServiceDao getInspectionTaskServiceDaoImpl() { |
| | | return inspectionTaskServiceDaoImpl; |
| | | } |
| | | |
| | | public void setInspectionTaskServiceDaoImpl(IInspectionTaskServiceDao inspectionTaskServiceDaoImpl) { |
| | | this.inspectionTaskServiceDaoImpl = inspectionTaskServiceDaoImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.community.smo.impl; |
| | | |
| | | |
| | | import com.java110.community.dao.IInspectionTaskServiceDao; |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.core.smo.inspectionTask.IInspectionTaskInnerServiceSMO; |
| | | import com.java110.core.smo.user.IUserInnerServiceSMO; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.inspectionTask.InspectionTaskDto; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName FloorInnerServiceSMOImpl |
| | | * @Description 活动内部服务实现类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:20 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @RestController |
| | | public class InspectionTaskInnerServiceSMOImpl extends BaseServiceSMO implements IInspectionTaskInnerServiceSMO { |
| | | |
| | | @Autowired |
| | | private IInspectionTaskServiceDao inspectionTaskServiceDaoImpl; |
| | | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public List<InspectionTaskDto> queryInspectionTasks(@RequestBody InspectionTaskDto inspectionTaskDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = inspectionTaskDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | inspectionTaskDto.setPage((page - 1) * inspectionTaskDto.getRow()); |
| | | } |
| | | |
| | | List<InspectionTaskDto> inspectionTasks = BeanConvertUtil.covertBeanList(inspectionTaskServiceDaoImpl.getInspectionTaskInfo(BeanConvertUtil.beanCovertMap(inspectionTaskDto)), InspectionTaskDto.class); |
| | | |
| | | return inspectionTasks; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int queryInspectionTasksCount(@RequestBody InspectionTaskDto inspectionTaskDto) { |
| | | return inspectionTaskServiceDaoImpl.queryInspectionTasksCount(BeanConvertUtil.beanCovertMap(inspectionTaskDto)); |
| | | } |
| | | |
| | | public IInspectionTaskServiceDao getInspectionTaskServiceDaoImpl() { |
| | | return inspectionTaskServiceDaoImpl; |
| | | } |
| | | |
| | | public void setInspectionTaskServiceDaoImpl(IInspectionTaskServiceDao inspectionTaskServiceDaoImpl) { |
| | | this.inspectionTaskServiceDaoImpl = inspectionTaskServiceDaoImpl; |
| | | } |
| | | |
| | | public IUserInnerServiceSMO getUserInnerServiceSMOImpl() { |
| | | return userInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) { |
| | | this.userInnerServiceSMOImpl = userInnerServiceSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | |
| | | |
| | | **1\. 保存活动** |
| | | ###### 接口功能 |
| | | > API服务做保存活动时调用该接口 |
| | | |
| | | ###### URL |
| | | > [http://inspectionTask-service/inspectionTaskApi/service](http://inspectionTask-service/inspectionTaskApi/service) |
| | | |
| | | ###### 支持格式 |
| | | > JSON |
| | | |
| | | ###### HTTP请求方式 |
| | | > POST |
| | | |
| | | ###### 协议接口 |
| | | |父元素名称|参数名称|约束|类型|长度|描述|取值说明| |
| | | | :-: | :-: | :-: | :-: | :-: | :-: | :-:| |
| | | |-|orders|1|Object|-|订单节点|-| |
| | | |-|business|1|Array|-|业务节点|-| |
| | | |
| | | ###### orders |
| | | |父元素名称|参数名称|约束|类型|长度|描述|取值说明| |
| | | | :-: | :-: | :-: | :-: | :-: | :-: | :-: | |
| | | |-|orders|1|Object|-|订单节点|-| |
| | | |orders|appId|1|String|10|系统ID|由中心服务提供| |
| | | |orders|transactionId|1|String|30|交互流水|appId+'00'+YYYYMMDD+10位序列| |
| | | |orders|userId|1|String|30|用户ID|已有用户ID| |
| | | |orders|orderTypeCd|1|String|4|订单类型|查看订单类型说明| |
| | | |orders|requestTime|1|String|14|请求时间|YYYYMMDDhhmmss| |
| | | |orders|remark|1|String|200|备注|备注| |
| | | |orders|sign|?|String|64|签名|查看加密说明| |
| | | |orders|attrs|?|Array|-|订单属性|-| |
| | | |attrs|specCd|1|String|12|规格编码|由中心服务提供| |
| | | |attrs|value|1|String|50|属性值|-| |
| | | |orders|response|1|Object|-|返回结果节点|-| |
| | | |response|code|1|String|4|返回状态|查看状态说明| |
| | | |response|message|1|String|200|返回状态描述|-| |
| | | |
| | | ###### business |
| | | |父元素名称|参数名称|约束|类型|长度|描述|取值说明| |
| | | | :-: | :-: | :-: | :-: | :-: | :-: | :-: | |
| | | |-|business|?|Array|-|业务节点|-| |
| | | |business|businessTypeCd|1|String|12|业务类型编码|500100030002| |
| | | |business|datas|1|Object|-|数据节点|不同的服务下的节点不一样| |
| | | |datas|businessInspectionTaskInfo|1|Object|-|小区成员|小区成员| |
| | | |businessInspectionTaskInfo|planUserId|1|String|30|-|-| |
| | | |businessInspectionTaskInfo|actInsTime|1|String|30|-|-| |
| | | |businessInspectionTaskInfo|planInsTime|1|String|30|-|-| |
| | | |businessInspectionTaskInfo|actUserName|1|String|30|-|-| |
| | | |businessInspectionTaskInfo|signType|1|String|30|-|-| |
| | | |businessInspectionTaskInfo|inspectionPlanId|1|String|30|-|-| |
| | | |businessInspectionTaskInfo|planUserName|1|String|30|-|-| |
| | | |businessInspectionTaskInfo|communityId|1|String|30|-|-| |
| | | |businessInspectionTaskInfo|actUserId|1|String|30|-|-| |
| | | |businessInspectionTaskInfo|taskId|1|String|30|-|-| |
| | | |
| | | |
| | | ###### 返回协议 |
| | | |
| | | 当http返回状态不为200 时请求处理失败 body内容为失败的原因 |
| | | |
| | | 当http返回状态为200时请求处理成功,body内容为返回内容, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | ###### 举例 |
| | | > 地址:[http://inspectionTask-service/inspectionTaskApi/service](http://inspectionTask-service/inspectionTaskApi/service) |
| | | |
| | | ``` javascript |
| | | 请求头信息: |
| | | Content-Type:application/json |
| | | |
| | | 请求报文: |
| | | |
| | | { |
| | | "orders": { |
| | | "appId": "外系统ID,分配得到", |
| | | "transactionId": "100000000020180409224736000001", |
| | | "userId": "用户ID", |
| | | "orderTypeCd": "订单类型,查询,受理", |
| | | "requestTime": "20180409224736", |
| | | "remark": "备注", |
| | | "sign": "这个服务是否要求MD5签名", |
| | | "businessType":"I", |
| | | "attrs": [{ |
| | | "specCd": "配置的字段ID", |
| | | "value": "具体值" |
| | | }] |
| | | }, |
| | | "business": { |
| | | "businessTypeCd": "530200030001", |
| | | "bId":"1234567892", |
| | | "remark": "备注", |
| | | "datas": { |
| | | "businessInspectionTaskInfo": { |
| | | "planUserId":"填写具体值", |
| | | "actInsTime":"填写具体值", |
| | | "planInsTime":"填写具体值", |
| | | "actUserName":"填写具体值", |
| | | "signType":"填写具体值", |
| | | "inspectionPlanId":"填写具体值", |
| | | "planUserName":"填写具体值", |
| | | "communityId":"填写具体值", |
| | | "actUserId":"填写具体值", |
| | | "taskId":"填写具体值" |
| | | } |
| | | }, |
| | | "attrs": [{ |
| | | "specCd": "配置的字段ID", |
| | | "value": "具体值" |
| | | }] |
| | | } |
| | | } |
| | | |
| | | 返回报文: |
| | | { |
| | | "orderTypeCd": "D", |
| | | "response": { |
| | | "code": "0000", |
| | | "message": "成功" |
| | | }, |
| | | "responseTime": "20190418102004", |
| | | "bId": "202019041810750003", |
| | | "businessType": "B", |
| | | "transactionId": "3a5a411ec65a4c3f895935638aa1d2bc", |
| | | "dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947" |
| | | } |
| | | |
| | | ``` |
| New file |
| | |
| | | package com.java110.dto.inspectionTask; |
| | | |
| | | 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 InspectionTaskDto extends PageDto implements Serializable { |
| | | |
| | | private String planUserId; |
| | | private String actInsTime; |
| | | private String planInsTime; |
| | | private String actUserName; |
| | | private String signType; |
| | | private String inspectionPlanId; |
| | | private String planUserName; |
| | | private String communityId; |
| | | private String actUserId; |
| | | private String inspectionTaskId; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | |
| | | public String getPlanUserId() { |
| | | return planUserId; |
| | | } |
| | | |
| | | public void setPlanUserId(String planUserId) { |
| | | this.planUserId = planUserId; |
| | | } |
| | | |
| | | public String getActInsTime() { |
| | | return actInsTime; |
| | | } |
| | | |
| | | public void setActInsTime(String actInsTime) { |
| | | this.actInsTime = actInsTime; |
| | | } |
| | | |
| | | public String getPlanInsTime() { |
| | | return planInsTime; |
| | | } |
| | | |
| | | public void setPlanInsTime(String planInsTime) { |
| | | this.planInsTime = planInsTime; |
| | | } |
| | | |
| | | public String getActUserName() { |
| | | return actUserName; |
| | | } |
| | | |
| | | public void setActUserName(String actUserName) { |
| | | this.actUserName = actUserName; |
| | | } |
| | | |
| | | public String getSignType() { |
| | | return signType; |
| | | } |
| | | |
| | | public void setSignType(String signType) { |
| | | this.signType = signType; |
| | | } |
| | | |
| | | public String getInspectionPlanId() { |
| | | return inspectionPlanId; |
| | | } |
| | | |
| | | public void setInspectionPlanId(String inspectionPlanId) { |
| | | this.inspectionPlanId = inspectionPlanId; |
| | | } |
| | | |
| | | public String getPlanUserName() { |
| | | return planUserName; |
| | | } |
| | | |
| | | public void setPlanUserName(String planUserName) { |
| | | this.planUserName = planUserName; |
| | | } |
| | | |
| | | public String getCommunityId() { |
| | | return communityId; |
| | | } |
| | | |
| | | public void setCommunityId(String communityId) { |
| | | this.communityId = communityId; |
| | | } |
| | | |
| | | public String getActUserId() { |
| | | return actUserId; |
| | | } |
| | | |
| | | public void setActUserId(String actUserId) { |
| | | this.actUserId = actUserId; |
| | | } |
| | | |
| | | public String getInspectionTaskId() { |
| | | return inspectionTaskId; |
| | | } |
| | | |
| | | public void setInspectionTaskId(String inspectionTaskId) { |
| | | this.inspectionTaskId = inspectionTaskId; |
| | | } |
| | | |
| | | 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.vo.api.inspectionTask; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | public class ApiInspectionTaskDataVo implements Serializable { |
| | | |
| | | private String planUserId; |
| | | private String actInsTime; |
| | | private String planInsTime; |
| | | private String statusCd; |
| | | private String actUserName; |
| | | private String operate; |
| | | private String signType; |
| | | private String inspectionPlanId; |
| | | private String planUserName; |
| | | private String communityId; |
| | | private String bId; |
| | | private String actUserId; |
| | | private String taskId; |
| | | public String getPlanUserId() { |
| | | return planUserId; |
| | | } |
| | | public void setPlanUserId(String planUserId) { |
| | | this.planUserId = planUserId; |
| | | } |
| | | public String getActInsTime() { |
| | | return actInsTime; |
| | | } |
| | | public void setActInsTime(String actInsTime) { |
| | | this.actInsTime = actInsTime; |
| | | } |
| | | public String getPlanInsTime() { |
| | | return planInsTime; |
| | | } |
| | | public void setPlanInsTime(String planInsTime) { |
| | | this.planInsTime = planInsTime; |
| | | } |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | public String getActUserName() { |
| | | return actUserName; |
| | | } |
| | | public void setActUserName(String actUserName) { |
| | | this.actUserName = actUserName; |
| | | } |
| | | public String getOperate() { |
| | | return operate; |
| | | } |
| | | public void setOperate(String operate) { |
| | | this.operate = operate; |
| | | } |
| | | public String getSignType() { |
| | | return signType; |
| | | } |
| | | public void setSignType(String signType) { |
| | | this.signType = signType; |
| | | } |
| | | public String getInspectionPlanId() { |
| | | return inspectionPlanId; |
| | | } |
| | | public void setInspectionPlanId(String inspectionPlanId) { |
| | | this.inspectionPlanId = inspectionPlanId; |
| | | } |
| | | public String getPlanUserName() { |
| | | return planUserName; |
| | | } |
| | | public void setPlanUserName(String planUserName) { |
| | | this.planUserName = planUserName; |
| | | } |
| | | public String getCommunityId() { |
| | | return communityId; |
| | | } |
| | | public void setCommunityId(String communityId) { |
| | | this.communityId = communityId; |
| | | } |
| | | public String getBId() { |
| | | return bId; |
| | | } |
| | | public void setBId(String bId) { |
| | | this.bId = bId; |
| | | } |
| | | public String getActUserId() { |
| | | return actUserId; |
| | | } |
| | | public void setActUserId(String actUserId) { |
| | | this.actUserId = actUserId; |
| | | } |
| | | public String getTaskId() { |
| | | return taskId; |
| | | } |
| | | public void setTaskId(String taskId) { |
| | | this.taskId = taskId; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.vo.api.inspectionTask; |
| | | |
| | | import com.java110.vo.MorePageVo; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | public class ApiInspectionTaskVo extends MorePageVo implements Serializable { |
| | | List<ApiInspectionTaskDataVo> inspectionTasks; |
| | | |
| | | |
| | | public List<ApiInspectionTaskDataVo> getInspectionTasks() { |
| | | return inspectionTasks; |
| | | } |
| | | |
| | | public void setInspectionTasks(List<ApiInspectionTaskDataVo> inspectionTasks) { |
| | | this.inspectionTasks = inspectionTasks; |
| | | } |
| | | } |
| | |
| | | |
| | | GeneratorIInnerServiceSMO generatorIInnerServiceSMO = new GeneratorIInnerServiceSMO(); |
| | | generatorIInnerServiceSMO.generator(data); |
| | | |
| | | GeneratorApiListener generatorApiListener = new GeneratorApiListener(); |
| | | generatorApiListener.generator(data); |
| | | } |
| | | } |
| | |
| | | .replace("@@templateKey@@", data.getId()) |
| | | .replace("@@TemplateKey@@", toUpperCaseFirstOne(data.getId())) |
| | | .replace("@@templateKeyName@@", data.getId()) |
| | | .replace("@@TEMPLATECODE@@", data.getName()) |
| | | .replace("@@TEMPLATECODE@@", data.getName().toUpperCase()) |
| | | .replace("@@searchCode@@", data.getId()) |
| | | .replace("@@searchName@@", data.getId()); |
| | | } |
| | |
| | | genneratorIBmo(data); |
| | | genneratorBmoImpl(data); |
| | | genneratorSaveListener(data); |
| | | genneratorEditListener(data); |
| | | genneratorDeleteListener(data); |
| | | genneratorServiceCodeConstant(data); |
| | | } |
| | | |
| | | /** |
| | |
| | | fileContext = fileContext.replace("@@templateColumns@@", variable + variableGetSet); |
| | | |
| | | String writePath = this.getClass().getResource("/").getPath() |
| | | + "out/api/vo/" +data.getName() + "/Api" + toUpperCaseFirstOne(data.getName()) + "DataVo.java"; |
| | | + "out/api/vo/" + data.getName() + "/Api" + toUpperCaseFirstOne(data.getName()) + "DataVo.java"; |
| | | System.out.printf("writePath: " + writePath); |
| | | writeFile(writePath, |
| | | fileContext); |
| | |
| | | fileContext = super.replaceTemplateContext(fileContext, data); |
| | | |
| | | String writePath = this.getClass().getResource("/").getPath() |
| | | + "out/api/bmo/" + data.getName() + "/impl/I" + toUpperCaseFirstOne(data.getName()) + "BMO.java"; |
| | | + "out/api/bmo/" + data.getName() + "/impl/" + toUpperCaseFirstOne(data.getName()) + "BMOImpl.java"; |
| | | System.out.printf("writePath: " + writePath); |
| | | writeFile(writePath, |
| | | fileContext); |
| | |
| | | StringBuffer validateStr = new StringBuffer(); |
| | | for (String key : data.getRequiredParam()) { |
| | | //JSONObject column = columns.getJSONObject(columnIndex); |
| | | validateStr.append("Assert.hasKeyAndValue(reqJson, \""+key+"\", \"请求报文中未包含"+key+"\");\n"); |
| | | validateStr.append("Assert.hasKeyAndValue(reqJson, \"" + key + "\", \"请求报文中未包含" + key + "\");\n"); |
| | | |
| | | } |
| | | |
| | |
| | | fileContext); |
| | | } |
| | | |
| | | /** |
| | | * 生成API 侦听处理类 |
| | | * |
| | | * @param data |
| | | */ |
| | | private void genneratorEditListener(Data data) { |
| | | StringBuffer sb = readFile(GeneratorStart.class.getResource("/template/UpdateListener.java").getFile()); |
| | | String fileContext = sb.toString(); |
| | | |
| | | fileContext = super.replaceTemplateContext(fileContext, data); |
| | | |
| | | //替换校验部分代码 @@validateTemplateColumns@@ |
| | | StringBuffer validateStr = new StringBuffer(); |
| | | validateStr.append("Assert.hasKeyAndValue(reqJson, \"" + data.getId() + "\", \"" + data.getId() + "不能为空\");\n"); |
| | | for (String key : data.getRequiredParam()) { |
| | | //JSONObject column = columns.getJSONObject(columnIndex); |
| | | validateStr.append("Assert.hasKeyAndValue(reqJson, \"" + key + "\", \"请求报文中未包含" + key + "\");\n"); |
| | | |
| | | } |
| | | |
| | | fileContext = fileContext.replace("@@validateTemplateColumns@@", validateStr.toString()); |
| | | |
| | | |
| | | String writePath = this.getClass().getResource("/").getPath() |
| | | + "out/api/listener/" + data.getName() + "/Update" + toUpperCaseFirstOne(data.getName()) + "Listener.java"; |
| | | System.out.printf("writePath: " + writePath); |
| | | writeFile(writePath, |
| | | fileContext); |
| | | } |
| | | |
| | | /** |
| | | * 生成API 侦听处理类 |
| | | * |
| | | * @param data |
| | | */ |
| | | private void genneratorDeleteListener(Data data) { |
| | | StringBuffer sb = readFile(GeneratorStart.class.getResource("/template/DeleteListener.java").getFile()); |
| | | String fileContext = sb.toString(); |
| | | |
| | | fileContext = super.replaceTemplateContext(fileContext, data); |
| | | |
| | | //替换校验部分代码 @@validateTemplateColumns@@ |
| | | StringBuffer validateStr = new StringBuffer(); |
| | | validateStr.append("Assert.hasKeyAndValue(reqJson, \"" + data.getId() + "\", \"" + data.getId() + "不能为空\");\n"); |
| | | |
| | | fileContext = fileContext.replace("@@validateTemplateColumns@@", validateStr.toString()); |
| | | |
| | | |
| | | String writePath = this.getClass().getResource("/").getPath() |
| | | + "out/api/listener/" + data.getName() + "/Delete" + toUpperCaseFirstOne(data.getName()) + "Listener.java"; |
| | | System.out.printf("writePath: " + writePath); |
| | | writeFile(writePath, |
| | | fileContext); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 生成常量类 |
| | | * |
| | | * @param data |
| | | */ |
| | | private void genneratorServiceCodeConstant(Data data) { |
| | | StringBuffer sb = readFile(GeneratorStart.class.getResource("/template/ServiceCodeConstant.java").getFile()); |
| | | String fileContext = sb.toString(); |
| | | |
| | | fileContext = super.replaceTemplateContext(fileContext, data); |
| | | |
| | | String writePath = this.getClass().getResource("/").getPath() |
| | | + "out/back/constant/" + data.getName() + "/ServiceCode" + toUpperCaseFirstOne(data.getName()) + "Constant.java"; |
| | | System.out.printf("writePath: " + writePath); |
| | | writeFile(writePath, |
| | | fileContext); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | .replace("Store", toUpperCaseFirstOne(data.getName())) |
| | | .replace("商户", data.getDesc()); |
| | | String writePath = this.getClass().getResource("/").getPath() |
| | | + "out/back/smo/impl/" + data.getName() + "/" + toUpperCaseFirstOne(data.getName()) + "InnerServiceSMOImpl.java"; |
| | | + "out/back/smo/impl/" + toUpperCaseFirstOne(data.getName()) + "InnerServiceSMOImpl.java"; |
| | | writeFile(writePath, |
| | | fileContext); |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.@@templateCode@@; |
| | | |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.constant.ServiceCodeConstant; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.utils.constant.ServiceCode |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | @@TemplateCode@@Constant; |
| | | |
| | | /** |
| | | * 保存小区侦听 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("delete@@TemplateCode@@Listener") |
| | | public class Delete@@TemplateCode@@Listener extends AbstractServiceApiListener { |
| | | |
| | | @Autowired |
| | | private I@@TemplateCode@@BMO @@templateCode@@BMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | //Assert.hasKeyAndValue(reqJson, "xxx", "xxx"); |
| | | |
| | | @@validateTemplateColumns@@ |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCode@@TemplateCode@@Constant.DELETE_@@TEMPLATECODE@@; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.constant.ServiceCodeConstant; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.ServiceCode@@TemplateCode@@Constant; |
| | | import com.java110.utils.constant.ServiceCode |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | @@TemplateCode@@Constant; |
| | | |
| | | |
| | | |
| | |
| | | */ |
| | | @Java110Listener("save@@TemplateCode@@Listener") |
| | | public class Save@@TemplateCode@@Listener extends AbstractServiceApiListener { |
| | | |
| | | @Autowired |
| | | private I@@TemplateCode@@BMO @@templateCode@@BMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | //Assert.hasKeyAndValue(reqJson, "xxx", "xxx"); |
| | |
| | | AppService service = event.getAppService(); |
| | | |
| | | //添加单元信息 |
| | | businesses.add(add@@TemplateCode@@(reqJson, context)); |
| | | businesses.add(@@templateCode@@BMOImpl.add@@TemplateCode@@(reqJson, context)); |
| | | |
| | | JSONObject paramInObj = super.restToCenterProtocol(businesses, context.getRequestCurrentHeaders()); |
| | | |
| | | //将 rest header 信息传递到下层服务中去 |
| | | super.freshHttpHeader(header, context.getRequestCurrentHeaders()); |
| | | |
| | | ResponseEntity<String> responseEntity = this.callService(context, service.getServiceCode(), paramInObj); |
| | | ResponseEntity<String> responseEntity = @@templateCode@@BMOImpl.callService(context, service.getServiceCode(), businesses); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | private JSONObject 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; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.utils.constant; |
| | | |
| | | /** |
| | | * @@templateName@@常量类 |
| | | * Created by wuxw on 2017/5/20. |
| | | */ |
| | | public class ServiceCode@@TemplateCode@@Constant { |
| | | |
| | | /** |
| | | * 添加 @@templateName@@ |
| | | */ |
| | | public static final String ADD_@@TEMPLATECODE@@ = "@@templateCode@@.save@@TemplateCode@@"; |
| | | |
| | | |
| | | /** |
| | | * 修改 @@templateName@@ |
| | | */ |
| | | public static final String UPDATE_@@TEMPLATECODE@@ = "@@templateCode@@.update@@TemplateCode@@"; |
| | | /** |
| | | * 删除 @@templateName@@ |
| | | */ |
| | | public static final String DELETE_@@TEMPLATECODE@@ = "@@templateCode@@.delete@@TemplateCode@@"; |
| | | |
| | | |
| | | /** |
| | | * 查询 @@templateName@@ |
| | | */ |
| | | public static final String LIST_@@TEMPLATECODE@@S = "@@templateCode@@.list@@TemplateCode@@s"; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.@@templateCode@@; |
| | | |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.constant.ServiceCodeConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.ServiceCode |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | @@TemplateCode@@Constant; |
| | | |
| | | /** |
| | | * 保存@@templateName@@侦听 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("update@@TemplateCode@@Listener") |
| | | public class Update@@TemplateCode@@Listener extends AbstractServiceApiListener { |
| | | |
| | | @Autowired |
| | | private I@@TemplateCode@@BMO @@templateCode@@BMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | |
| | | @@validateTemplateColumns@@ |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCode@@TemplateCode@@Constant.UPDATE_@@TEMPLATECODE@@; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | } |
| | |
| | | public static final String CODE_PREFIX_inspectionRouteId = "50"; |
| | | public static final String CODE_PREFIX_irpRelId = "51"; |
| | | public static final String CODE_PREFIX_inspectionPlanId = "14"; |
| | | public static final String CODE_PREFIX_taskId = "52"; |
| | | public static final String CODE_PREFIX_applyOrderId = "15"; |
| | | |
| | | |
| New file |
| | |
| | | package com.java110.core.smo.inspectionTask; |
| | | |
| | | import com.java110.core.feign.FeignConfiguration; |
| | | import com.java110.dto.inspectionTask.InspectionTaskDto; |
| | | 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 IInspectionTaskInnerServiceSMO |
| | | * @Description 活动接口类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:04 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @FeignClient(name = "community-service", configuration = {FeignConfiguration.class}) |
| | | @RequestMapping("/inspectionTaskApi") |
| | | public interface IInspectionTaskInnerServiceSMO { |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * @param inspectionTaskDto 数据对象分享 |
| | | * @return InspectionTaskDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/queryInspectionTasks", method = RequestMethod.POST) |
| | | List<InspectionTaskDto> queryInspectionTasks(@RequestBody InspectionTaskDto inspectionTaskDto); |
| | | |
| | | /** |
| | | * 查询<p>小区楼</p>总记录数 |
| | | * |
| | | * @param inspectionTaskDto 数据对象分享 |
| | | * @return 小区下的小区楼记录数 |
| | | */ |
| | | @RequestMapping(value = "/queryInspectionTasksCount", method = RequestMethod.POST) |
| | | int queryInspectionTasksCount(@RequestBody InspectionTaskDto inspectionTaskDto); |
| | | } |
| 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="inspectionTaskServiceDaoImpl"> |
| | | |
| | | <!-- 保存活动信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveBusinessInspectionTaskInfo" parameterType="Map"> |
| | | insert into business_inspection_task( |
| | | plan_user_id,act_ins_time,plan_ins_time,act_user_name,operate,sign_type,inspection_plan_id,plan_user_name,community_id,b_id,act_user_id,task_id |
| | | ) values ( |
| | | #{planUserId},#{actInsTime},#{planInsTime},#{actUserName},#{operate},#{signType},#{inspectionPlanId},#{planUserName},#{communityId},#{bId},#{actUserId},#{taskId} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询活动信息(Business) add by wuxw 2018-07-03 --> |
| | | <select id="getBusinessInspectionTaskInfo" parameterType="Map" resultType="Map"> |
| | | select t.plan_user_id,t.plan_user_id planUserId,t.act_ins_time,t.act_ins_time actInsTime,t.plan_ins_time,t.plan_ins_time planInsTime,t.act_user_name,t.act_user_name actUserName,t.operate,t.sign_type,t.sign_type signType,t.inspection_plan_id,t.inspection_plan_id inspectionPlanId,t.plan_user_name,t.plan_user_name planUserName,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.act_user_id,t.act_user_id actUserId,t.task_id,t.task_id taskId |
| | | from business_inspection_task t |
| | | where 1 =1 |
| | | <if test="planUserId !=null and planUserId != ''"> |
| | | and t.plan_user_id= #{planUserId} |
| | | </if> |
| | | <if test="actInsTime !=null and actInsTime != ''"> |
| | | and t.act_ins_time= #{actInsTime} |
| | | </if> |
| | | <if test="planInsTime !=null and planInsTime != ''"> |
| | | and t.plan_ins_time= #{planInsTime} |
| | | </if> |
| | | <if test="actUserName !=null and actUserName != ''"> |
| | | and t.act_user_name= #{actUserName} |
| | | </if> |
| | | <if test="operate !=null and operate != ''"> |
| | | and t.operate= #{operate} |
| | | </if> |
| | | <if test="signType !=null and signType != ''"> |
| | | and t.sign_type= #{signType} |
| | | </if> |
| | | <if test="inspectionPlanId !=null and inspectionPlanId != ''"> |
| | | and t.inspection_plan_id= #{inspectionPlanId} |
| | | </if> |
| | | <if test="planUserName !=null and planUserName != ''"> |
| | | and t.plan_user_name= #{planUserName} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="actUserId !=null and actUserId != ''"> |
| | | and t.act_user_id= #{actUserId} |
| | | </if> |
| | | <if test="taskId !=null and taskId != ''"> |
| | | and t.task_id= #{taskId} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 保存活动信息至 instance表中 add by wuxw 2018-07-03 --> |
| | | <insert id="saveInspectionTaskInfoInstance" parameterType="Map"> |
| | | insert into inspection_task( |
| | | plan_user_id,act_ins_time,plan_ins_time,status_cd,act_user_name,sign_type,inspection_plan_id,plan_user_name,community_id,b_id,act_user_id,task_id |
| | | ) select t.plan_user_id,t.act_ins_time,t.plan_ins_time,'0',t.act_user_name,t.sign_type,t.inspection_plan_id,t.plan_user_name,t.community_id,t.b_id,t.act_user_id,t.task_id from business_inspection_task t where 1=1 |
| | | <if test="planUserId !=null and planUserId != ''"> |
| | | and t.plan_user_id= #{planUserId} |
| | | </if> |
| | | <if test="actInsTime !=null and actInsTime != ''"> |
| | | and t.act_ins_time= #{actInsTime} |
| | | </if> |
| | | <if test="planInsTime !=null and planInsTime != ''"> |
| | | and t.plan_ins_time= #{planInsTime} |
| | | </if> |
| | | <if test="actUserName !=null and actUserName != ''"> |
| | | and t.act_user_name= #{actUserName} |
| | | </if> |
| | | and t.operate= 'ADD' |
| | | <if test="signType !=null and signType != ''"> |
| | | and t.sign_type= #{signType} |
| | | </if> |
| | | <if test="inspectionPlanId !=null and inspectionPlanId != ''"> |
| | | and t.inspection_plan_id= #{inspectionPlanId} |
| | | </if> |
| | | <if test="planUserName !=null and planUserName != ''"> |
| | | and t.plan_user_name= #{planUserName} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="actUserId !=null and actUserId != ''"> |
| | | and t.act_user_id= #{actUserId} |
| | | </if> |
| | | <if test="taskId !=null and taskId != ''"> |
| | | and t.task_id= #{taskId} |
| | | </if> |
| | | |
| | | </insert> |
| | | |
| | | |
| | | |
| | | <!-- 查询活动信息 add by wuxw 2018-07-03 --> |
| | | <select id="getInspectionTaskInfo" parameterType="Map" resultType="Map"> |
| | | select t.plan_user_id,t.plan_user_id planUserId,t.act_ins_time,t.act_ins_time actInsTime,t.plan_ins_time,t.plan_ins_time planInsTime,t.status_cd,t.status_cd statusCd,t.act_user_name,t.act_user_name actUserName,t.sign_type,t.sign_type signType,t.inspection_plan_id,t.inspection_plan_id inspectionPlanId,t.plan_user_name,t.plan_user_name planUserName,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.act_user_id,t.act_user_id actUserId,t.task_id,t.task_id taskId |
| | | from inspection_task t |
| | | where 1 =1 |
| | | <if test="planUserId !=null and planUserId != ''"> |
| | | and t.plan_user_id= #{planUserId} |
| | | </if> |
| | | <if test="actInsTime !=null and actInsTime != ''"> |
| | | and t.act_ins_time= #{actInsTime} |
| | | </if> |
| | | <if test="planInsTime !=null and planInsTime != ''"> |
| | | and t.plan_ins_time= #{planInsTime} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="actUserName !=null and actUserName != ''"> |
| | | and t.act_user_name= #{actUserName} |
| | | </if> |
| | | <if test="signType !=null and signType != ''"> |
| | | and t.sign_type= #{signType} |
| | | </if> |
| | | <if test="inspectionPlanId !=null and inspectionPlanId != ''"> |
| | | and t.inspection_plan_id= #{inspectionPlanId} |
| | | </if> |
| | | <if test="planUserName !=null and planUserName != ''"> |
| | | and t.plan_user_name= #{planUserName} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="actUserId !=null and actUserId != ''"> |
| | | and t.act_user_id= #{actUserId} |
| | | </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="updateInspectionTaskInfoInstance" parameterType="Map"> |
| | | update inspection_task t set t.status_cd = #{statusCd} |
| | | <if test="newBId != null and newBId != ''"> |
| | | ,t.b_id = #{newBId} |
| | | </if> |
| | | <if test="planUserId !=null and planUserId != ''"> |
| | | , t.plan_user_id= #{planUserId} |
| | | </if> |
| | | <if test="actInsTime !=null and actInsTime != ''"> |
| | | , t.act_ins_time= #{actInsTime} |
| | | </if> |
| | | <if test="planInsTime !=null and planInsTime != ''"> |
| | | , t.plan_ins_time= #{planInsTime} |
| | | </if> |
| | | <if test="actUserName !=null and actUserName != ''"> |
| | | , t.act_user_name= #{actUserName} |
| | | </if> |
| | | <if test="signType !=null and signType != ''"> |
| | | , t.sign_type= #{signType} |
| | | </if> |
| | | <if test="inspectionPlanId !=null and inspectionPlanId != ''"> |
| | | , t.inspection_plan_id= #{inspectionPlanId} |
| | | </if> |
| | | <if test="planUserName !=null and planUserName != ''"> |
| | | , t.plan_user_name= #{planUserName} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | , t.community_id= #{communityId} |
| | | </if> |
| | | <if test="actUserId !=null and actUserId != ''"> |
| | | , t.act_user_id= #{actUserId} |
| | | </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="queryInspectionTasksCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from inspection_task t |
| | | where 1 =1 |
| | | <if test="planUserId !=null and planUserId != ''"> |
| | | and t.plan_user_id= #{planUserId} |
| | | </if> |
| | | <if test="actInsTime !=null and actInsTime != ''"> |
| | | and t.act_ins_time= #{actInsTime} |
| | | </if> |
| | | <if test="planInsTime !=null and planInsTime != ''"> |
| | | and t.plan_ins_time= #{planInsTime} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="actUserName !=null and actUserName != ''"> |
| | | and t.act_user_name= #{actUserName} |
| | | </if> |
| | | <if test="signType !=null and signType != ''"> |
| | | and t.sign_type= #{signType} |
| | | </if> |
| | | <if test="inspectionPlanId !=null and inspectionPlanId != ''"> |
| | | and t.inspection_plan_id= #{inspectionPlanId} |
| | | </if> |
| | | <if test="planUserName !=null and planUserName != ''"> |
| | | and t.plan_user_name= #{planUserName} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="actUserId !=null and actUserId != ''"> |
| | | and t.act_user_id= #{actUserId} |
| | | </if> |
| | | <if test="taskId !=null and taskId != ''"> |
| | | and t.task_id= #{taskId} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package com.java110.utils.constant; |
| | | |
| | | /** |
| | | * 活动常量类 |
| | | * Created by wuxw on 2017/5/20. |
| | | */ |
| | | public class ServiceCodeInspectionTaskConstant { |
| | | |
| | | /** |
| | | * 添加 活动 |
| | | */ |
| | | public static final String ADD_INSPECTIONTASK = "inspectionTask.saveInspectionTask"; |
| | | |
| | | |
| | | /** |
| | | * 修改 活动 |
| | | */ |
| | | public static final String UPDATE_INSPECTIONTASK = "inspectionTask.updateInspectionTask"; |
| | | /** |
| | | * 删除 活动 |
| | | */ |
| | | public static final String DELETE_INSPECTIONTASK = "inspectionTask.deleteInspectionTask"; |
| | | |
| | | |
| | | /** |
| | | * 查询 活动 |
| | | */ |
| | | public static final String LIST_INSPECTIONTASKS = "inspectionTask.listInspectionTasks"; |
| | | |
| | | |
| | | } |