5 changed files with 74 additions and 871 deletions
-
79xm-core/src/main/java/com/xm/core/ctrl/XmEnvListController.java
-
225xm-core/src/main/java/com/xm/core/ctrl/XmProjectEnvListController.java
-
304xm-core/src/main/java/com/xm/core/entity/XmProjectEnvList.java
-
124xm-core/src/main/java/com/xm/core/service/XmProjectEnvListService.java
-
213xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProjectEnvListMapper.xml
@ -1,225 +0,0 @@ |
|||||
package com.xm.core.ctrl; |
|
||||
|
|
||||
import com.mdp.audit.log.client.annotation.AuditLog; |
|
||||
import com.mdp.audit.log.client.annotation.OperType; |
|
||||
import com.mdp.core.entity.Tips; |
|
||||
import com.mdp.core.err.BizException; |
|
||||
import com.mdp.core.utils.RequestUtils; |
|
||||
import com.mdp.mybatis.PageUtils; |
|
||||
import com.xm.core.entity.XmProjectEnvList; |
|
||||
import com.xm.core.service.XmProjectEnvListService; |
|
||||
import io.swagger.annotations.*; |
|
||||
import org.apache.commons.logging.Log; |
|
||||
import org.apache.commons.logging.LogFactory; |
|
||||
import org.springframework.beans.factory.annotation.Autowired; |
|
||||
import org.springframework.web.bind.annotation.*; |
|
||||
import springfox.documentation.annotations.ApiIgnore; |
|
||||
|
|
||||
import java.util.HashMap; |
|
||||
import java.util.List; |
|
||||
import java.util.Map; |
|
||||
|
|
||||
/** |
|
||||
* url编制采用rest风格,如对XM.xm_project_env_list xm_project_env_list的操作有增删改查,对应的url分别为:<br> |
|
||||
* 新增: xm/xmProjectEnvList/add <br> |
|
||||
* 查询: xm/xmProjectEnvList/list<br> |
|
||||
* 模糊查询: xm/xmProjectEnvList/listKey<br> |
|
||||
* 修改: xm/xmProjectEnvList/edit <br> |
|
||||
* 删除: xm/xmProjectEnvList/del<br> |
|
||||
* 批量删除: xm/xmProjectEnvList/batchDel<br> |
|
||||
* 组织 com.qqkj 顶级模块 oa 大模块 xm 小模块 <br> |
|
||||
* 实体 XmProjectEnvList 表 XM.xm_project_env_list 当前主键(包括多主键): id; |
|
||||
***/ |
|
||||
@RestController("xm.core.xmProjectEnvListController") |
|
||||
@RequestMapping(value="/**/xm/core/xmProjectEnvList") |
|
||||
@Api(tags={"xm_project_env_list操作接口"}) |
|
||||
public class XmProjectEnvListController { |
|
||||
|
|
||||
static Log logger=LogFactory.getLog(XmProjectEnvListController.class); |
|
||||
|
|
||||
@Autowired |
|
||||
private XmProjectEnvListService xmProjectEnvListService; |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
@ApiOperation( value = "查询xm_project_env_list信息列表",notes="listXmProjectEnvList,条件之间是 and关系,模糊查询写法如 {studentName:'%才哥%'}") |
|
||||
@ApiImplicitParams({ |
|
||||
@ApiImplicitParam(name="id",value="主键,主键",required=false), |
|
||||
@ApiImplicitParam(name="remark",value="备注说明",required=false), |
|
||||
@ApiImplicitParam(name="ipAddress",value="ip地址",required=false), |
|
||||
@ApiImplicitParam(name="port",value="访问端口",required=false), |
|
||||
@ApiImplicitParam(name="projectId",value="归属项目组",required=false), |
|
||||
@ApiImplicitParam(name="projectName",value="归属项目组名称",required=false), |
|
||||
@ApiImplicitParam(name="accessUserid",value="访问用户编号",required=false), |
|
||||
@ApiImplicitParam(name="accessPassword",value="访问密码",required=false), |
|
||||
@ApiImplicitParam(name="effect",value="作用说明",required=false), |
|
||||
@ApiImplicitParam(name="accessUrl",value="访问链接",required=false), |
|
||||
@ApiImplicitParam(name="webIpAddress",value="外网ip地址",required=false), |
|
||||
@ApiImplicitParam(name="webPort",value="外网端口",required=false), |
|
||||
@ApiImplicitParam(name="otherRemark",value="其它说明",required=false), |
|
||||
@ApiImplicitParam(name="createUserid",value="添加人员",required=false), |
|
||||
@ApiImplicitParam(name="createUsername",value="添加人员姓名",required=false), |
|
||||
@ApiImplicitParam(name="createTime",value="添加时间",required=false), |
|
||||
@ApiImplicitParam(name="pageSize",value="每页记录数",required=false), |
|
||||
@ApiImplicitParam(name="pageNum",value="当前页码,从1开始",required=false), |
|
||||
@ApiImplicitParam(name="total",value="总记录数,服务器端收到0时,会自动计算总记录数,如果上传>0的不自动计算",required=false), |
|
||||
@ApiImplicitParam(name="orderBy",value="排序列 如性别、学生编号排序 orderBy = sex desc,student_id desc",required=false), |
|
||||
@ApiImplicitParam(name="count",value="是否进行总条数计算,count=true|false",required=false) |
|
||||
}) |
|
||||
@ApiResponses({ |
|
||||
@ApiResponse(code = 200,response= XmProjectEnvList.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'错误码'},total:总记录数,data:[数据对象1,数据对象2,...]}") |
|
||||
}) |
|
||||
@RequestMapping(value="/list",method=RequestMethod.GET) |
|
||||
public Map<String,Object> listXmProjectEnvList( @ApiIgnore @RequestParam Map<String,Object> xmProjectEnvList){ |
|
||||
Map<String,Object> m = new HashMap<>(); |
|
||||
RequestUtils.transformArray(xmProjectEnvList, "ids"); |
|
||||
PageUtils.startPage(xmProjectEnvList); |
|
||||
List<Map<String,Object>> xmProjectEnvListList = xmProjectEnvListService.selectListMapByWhere(xmProjectEnvList); //列出XmProjectEnvList列表 |
|
||||
PageUtils.responePage(m, xmProjectEnvListList); |
|
||||
m.put("data",xmProjectEnvListList); |
|
||||
Tips tips=new Tips("查询成功"); |
|
||||
m.put("tips", tips); |
|
||||
return m; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
@ApiOperation( value = "新增一条xm_project_env_list信息",notes="addXmProjectEnvList,主键如果为空,后台自动生成") |
|
||||
@ApiResponses({ |
|
||||
@ApiResponse(code = 200,response=XmProjectEnvList.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") |
|
||||
}) |
|
||||
@RequestMapping(value="/add",method=RequestMethod.POST) |
|
||||
public Map<String,Object> addXmProjectEnvList(@RequestBody XmProjectEnvList xmProjectEnvList) { |
|
||||
Map<String,Object> m = new HashMap<>(); |
|
||||
Tips tips=new Tips("成功新增一条数据"); |
|
||||
try{ |
|
||||
xmProjectEnvListService.addEnvList(xmProjectEnvList); |
|
||||
// if(StringUtils.isEmpty(xmProjectEnvList.getId())) { |
|
||||
// xmProjectEnvList.setId(xmProjectEnvListService.createKey("id")); |
|
||||
// }else{ |
|
||||
// XmProjectEnvList xmProjectEnvListQuery = new XmProjectEnvList(xmProjectEnvList.getId()); |
|
||||
// if(xmProjectEnvListService.countByWhere(xmProjectEnvListQuery)>0){ |
|
||||
// tips.setFailureMsg("编号重复,请修改编号再提交"); |
|
||||
// m.put("tips", tips); |
|
||||
// return m; |
|
||||
// } |
|
||||
// } |
|
||||
// xmProjectEnvListService.insert(xmProjectEnvList); |
|
||||
m.put("data",xmProjectEnvList); |
|
||||
}catch (BizException e) { |
|
||||
tips=e.getTips(); |
|
||||
logger.error("",e); |
|
||||
}catch (Exception e) { |
|
||||
tips.setFailureMsg(e.getMessage()); |
|
||||
logger.error("",e); |
|
||||
} |
|
||||
m.put("tips", tips); |
|
||||
return m; |
|
||||
} |
|
||||
|
|
||||
@ApiOperation( value = "删除一条xm_project_env_list信息",notes="delXmProjectEnvList,仅需要上传主键字段") |
|
||||
@ApiResponses({ |
|
||||
@ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}}") |
|
||||
}) |
|
||||
@RequestMapping(value="/del",method=RequestMethod.POST) |
|
||||
public Map<String,Object> delXmProjectEnvList(@RequestBody XmProjectEnvList xmProjectEnvList){ |
|
||||
Map<String,Object> m = new HashMap<>(); |
|
||||
Tips tips=new Tips("成功删除一条数据"); |
|
||||
try{ |
|
||||
xmProjectEnvListService.deleteByPk(xmProjectEnvList); |
|
||||
}catch (BizException e) { |
|
||||
tips=e.getTips(); |
|
||||
logger.error("",e); |
|
||||
}catch (Exception e) { |
|
||||
tips.setFailureMsg(e.getMessage()); |
|
||||
logger.error("",e); |
|
||||
} |
|
||||
m.put("tips", tips); |
|
||||
return m; |
|
||||
} |
|
||||
|
|
||||
@ApiOperation( value = "根据主键修改一条xm_project_env_list信息",notes="editXmProjectEnvList") |
|
||||
@ApiResponses({ |
|
||||
@ApiResponse(code = 200,response=XmProjectEnvList.class, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") |
|
||||
}) |
|
||||
@RequestMapping(value="/edit",method=RequestMethod.POST) |
|
||||
public Map<String,Object> editXmProjectEnvList(@RequestBody XmProjectEnvList xmProjectEnvList) { |
|
||||
Map<String,Object> m = new HashMap<>(); |
|
||||
Tips tips=new Tips("成功更新一条数据"); |
|
||||
try{ |
|
||||
xmProjectEnvListService.updateByPk(xmProjectEnvList); |
|
||||
m.put("data",xmProjectEnvList); |
|
||||
}catch (BizException e) { |
|
||||
tips=e.getTips(); |
|
||||
logger.error("",e); |
|
||||
}catch (Exception e) { |
|
||||
tips.setFailureMsg(e.getMessage()); |
|
||||
logger.error("",e); |
|
||||
} |
|
||||
m.put("tips", tips); |
|
||||
return m; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
@ApiOperation( value = "根据主键列表批量删除xm_project_env_list信息",notes="batchDelXmProjectEnvList,仅需要上传主键字段") |
|
||||
@ApiResponses({ |
|
||||
@ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}") |
|
||||
}) |
|
||||
@RequestMapping(value="/batchDel",method=RequestMethod.POST) |
|
||||
public Map<String,Object> batchDelXmProjectEnvList(@RequestBody List<XmProjectEnvList> xmProjectEnvLists) { |
|
||||
Map<String,Object> m = new HashMap<>(); |
|
||||
Tips tips=new Tips("成功删除"+xmProjectEnvLists.size()+"条数据"); |
|
||||
try{ |
|
||||
xmProjectEnvListService.batchDelete(xmProjectEnvLists); |
|
||||
}catch (BizException e) { |
|
||||
tips=e.getTips(); |
|
||||
logger.error("",e); |
|
||||
}catch (Exception e) { |
|
||||
tips.setFailureMsg(e.getMessage()); |
|
||||
logger.error("",e); |
|
||||
} |
|
||||
m.put("tips", tips); |
|
||||
return m; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
/** |
|
||||
* 流程审批过程中回调该接口,更新业务数据 |
|
||||
* 如果发起流程时上送了restUrl,则无论流程中是否配置了监听器都会在流程发生以下事件时推送数据过来 |
|
||||
* eventName: PROCESS_STARTED 流程启动完成 全局 |
|
||||
* PROCESS_COMPLETED 流程正常结束 全局 |
|
||||
* PROCESS_CANCELLED 流程删除 全局 |
|
||||
* create 人工任务启动 |
|
||||
* complete 人工任务完成 |
|
||||
* assignment 人工任务分配给了具体的人 |
|
||||
* delete 人工任务被删除 |
|
||||
* |
|
||||
* 其中 create/complete/assignment/delete事件是需要在模型中人工节点上配置了委托代理表达式 ${taskBizCallListener}才会推送过来。 |
|
||||
* 在人工任务节点上配置 任务监听器 建议事件为 complete,其它assignment/create/complete/delete也可以,一般建议在complete,委托代理表达式 ${taskBizCallListener} |
|
||||
* |
|
||||
* @param flowVars {flowBranchId,agree,procInstId,assignee,actId,taskName,mainTitle,branchId,bizKey,commentMsg,eventName,modelKey} 等 |
|
||||
* @return 如果tips.isOk==false,将影响流程提交 |
|
||||
**/ |
|
||||
@AuditLog(firstMenu="办公平台",secondMenu="项目环境清单",func="processApprova",funcDesc="环境配置审核",operType=OperType.UPDATE) |
|
||||
@RequestMapping(value="/processApprova",method=RequestMethod.POST) |
|
||||
public Map<String,Object> processApprova( @RequestBody Map<String,Object> flowVars){ |
|
||||
Map<String,Object> m = new HashMap<>(); |
|
||||
Tips tips=new Tips("成功新增一条数据"); |
|
||||
|
|
||||
try{ |
|
||||
|
|
||||
this.xmProjectEnvListService.processApprova(flowVars); |
|
||||
logger.debug("procInstId====="+flowVars.get("procInstId")); |
|
||||
}catch (BizException e) { |
|
||||
tips=e.getTips(); |
|
||||
logger.error("执行异常",e); |
|
||||
}catch (Exception e) { |
|
||||
tips.setFailureMsg(e.getMessage()); |
|
||||
logger.error("执行异常",e); |
|
||||
} |
|
||||
m.put("tips", tips); |
|
||||
return m; |
|
||||
} |
|
||||
} |
|
||||
@ -1,304 +0,0 @@ |
|||||
package com.xm.core.entity; |
|
||||
|
|
||||
import io.swagger.annotations.ApiModel; |
|
||||
import io.swagger.annotations.ApiModelProperty; |
|
||||
|
|
||||
import java.util.Date; |
|
||||
|
|
||||
/** |
|
||||
* 组织 com.qqkj 顶级模块 oa 大模块 xm 小模块 <br> |
|
||||
* 实体 XmProjectEnvList所有属性名: <br> |
|
||||
* id,remark,ipAddress,port,projectId,projectName,accessUserid,accessPassword,effect,accessUrl,webIpAddress,webPort,otherRemark,createUserid,createUsername,createTime,bizProcInstId,bizFlowState;<br> |
|
||||
* 表 XM.xm_project_env_list xm_project_env_list的所有字段名: <br> |
|
||||
* id,remark,ip_address,port,project_id,project_name,access_userid,access_password,effect,access_url,web_ip_address,web_port,other_remark,create_userid,create_username,create_time,biz_proc_inst_id,biz_flow_state;<br> |
|
||||
* 当前主键(包括多主键):<br> |
|
||||
* id;<br> |
|
||||
*/ |
|
||||
@ApiModel(description="xm_project_env_list") |
|
||||
public class XmProjectEnvList implements java.io.Serializable { |
|
||||
|
|
||||
private static final long serialVersionUID = 1L; |
|
||||
|
|
||||
@ApiModelProperty(notes="主键,主键",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String id; |
|
||||
|
|
||||
|
|
||||
@ApiModelProperty(notes="备注说明",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String remark; |
|
||||
|
|
||||
@ApiModelProperty(notes="ip地址",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String ipAddress; |
|
||||
|
|
||||
@ApiModelProperty(notes="访问端口",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String port; |
|
||||
|
|
||||
@ApiModelProperty(notes="归属项目组",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String projectId; |
|
||||
|
|
||||
@ApiModelProperty(notes="归属项目组名称",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String projectName; |
|
||||
|
|
||||
@ApiModelProperty(notes="访问用户编号",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String accessUserid; |
|
||||
|
|
||||
@ApiModelProperty(notes="访问密码",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String accessPassword; |
|
||||
|
|
||||
@ApiModelProperty(notes="作用说明",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String effect; |
|
||||
|
|
||||
@ApiModelProperty(notes="访问链接",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String accessUrl; |
|
||||
|
|
||||
@ApiModelProperty(notes="外网ip地址",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String webIpAddress; |
|
||||
|
|
||||
@ApiModelProperty(notes="外网端口",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String webPort; |
|
||||
|
|
||||
@ApiModelProperty(notes="其它说明",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String otherRemark; |
|
||||
|
|
||||
@ApiModelProperty(notes="添加人员",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String createUserid; |
|
||||
|
|
||||
@ApiModelProperty(notes="添加人员姓名",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String createUsername; |
|
||||
|
|
||||
@ApiModelProperty(notes="添加时间",allowEmptyValue=true,example="",allowableValues="") |
|
||||
Date createTime; |
|
||||
|
|
||||
@ApiModelProperty(notes="当前流程实例编号",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String bizProcInstId; |
|
||||
|
|
||||
@ApiModelProperty(notes="当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String bizFlowState; |
|
||||
|
|
||||
/**主键**/ |
|
||||
public XmProjectEnvList(String id) { |
|
||||
this.id = id; |
|
||||
} |
|
||||
|
|
||||
/**xm_project_env_list**/ |
|
||||
public XmProjectEnvList() { |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 主键 |
|
||||
**/ |
|
||||
public void setId(String id) { |
|
||||
this.id = id; |
|
||||
} |
|
||||
/** |
|
||||
* 备注说明 |
|
||||
**/ |
|
||||
public void setRemark(String remark) { |
|
||||
this.remark = remark; |
|
||||
} |
|
||||
/** |
|
||||
* ip地址 |
|
||||
**/ |
|
||||
public void setIpAddress(String ipAddress) { |
|
||||
this.ipAddress = ipAddress; |
|
||||
} |
|
||||
/** |
|
||||
* 访问端口 |
|
||||
**/ |
|
||||
public void setPort(String port) { |
|
||||
this.port = port; |
|
||||
} |
|
||||
/** |
|
||||
* 归属项目组 |
|
||||
**/ |
|
||||
public void setProjectId(String projectId) { |
|
||||
this.projectId = projectId; |
|
||||
} |
|
||||
/** |
|
||||
* 归属项目组名称 |
|
||||
**/ |
|
||||
public void setProjectName(String projectName) { |
|
||||
this.projectName = projectName; |
|
||||
} |
|
||||
/** |
|
||||
* 访问用户编号 |
|
||||
**/ |
|
||||
public void setAccessUserid(String accessUserid) { |
|
||||
this.accessUserid = accessUserid; |
|
||||
} |
|
||||
/** |
|
||||
* 访问密码 |
|
||||
**/ |
|
||||
public void setAccessPassword(String accessPassword) { |
|
||||
this.accessPassword = accessPassword; |
|
||||
} |
|
||||
/** |
|
||||
* 作用说明 |
|
||||
**/ |
|
||||
public void setEffect(String effect) { |
|
||||
this.effect = effect; |
|
||||
} |
|
||||
/** |
|
||||
* 访问链接 |
|
||||
**/ |
|
||||
public void setAccessUrl(String accessUrl) { |
|
||||
this.accessUrl = accessUrl; |
|
||||
} |
|
||||
/** |
|
||||
* 外网ip地址 |
|
||||
**/ |
|
||||
public void setWebIpAddress(String webIpAddress) { |
|
||||
this.webIpAddress = webIpAddress; |
|
||||
} |
|
||||
/** |
|
||||
* 外网端口 |
|
||||
**/ |
|
||||
public void setWebPort(String webPort) { |
|
||||
this.webPort = webPort; |
|
||||
} |
|
||||
/** |
|
||||
* 其它说明 |
|
||||
**/ |
|
||||
public void setOtherRemark(String otherRemark) { |
|
||||
this.otherRemark = otherRemark; |
|
||||
} |
|
||||
/** |
|
||||
* 添加人员 |
|
||||
**/ |
|
||||
public void setCreateUserid(String createUserid) { |
|
||||
this.createUserid = createUserid; |
|
||||
} |
|
||||
/** |
|
||||
* 添加人员姓名 |
|
||||
**/ |
|
||||
public void setCreateUsername(String createUsername) { |
|
||||
this.createUsername = createUsername; |
|
||||
} |
|
||||
/** |
|
||||
* 添加时间 |
|
||||
**/ |
|
||||
public void setCreateTime(Date createTime) { |
|
||||
this.createTime = createTime; |
|
||||
} |
|
||||
/** |
|
||||
* 当前流程实例编号 |
|
||||
**/ |
|
||||
public void setBizProcInstId(String bizProcInstId) { |
|
||||
this.bizProcInstId = bizProcInstId; |
|
||||
} |
|
||||
/** |
|
||||
* 当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除 |
|
||||
**/ |
|
||||
public void setBizFlowState(String bizFlowState) { |
|
||||
this.bizFlowState = bizFlowState; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 主键 |
|
||||
**/ |
|
||||
public String getId() { |
|
||||
return this.id; |
|
||||
} |
|
||||
/** |
|
||||
* 备注说明 |
|
||||
**/ |
|
||||
public String getRemark() { |
|
||||
return this.remark; |
|
||||
} |
|
||||
/** |
|
||||
* ip地址 |
|
||||
**/ |
|
||||
public String getIpAddress() { |
|
||||
return this.ipAddress; |
|
||||
} |
|
||||
/** |
|
||||
* 访问端口 |
|
||||
**/ |
|
||||
public String getPort() { |
|
||||
return this.port; |
|
||||
} |
|
||||
/** |
|
||||
* 归属项目组 |
|
||||
**/ |
|
||||
public String getProjectId() { |
|
||||
return this.projectId; |
|
||||
} |
|
||||
/** |
|
||||
* 归属项目组名称 |
|
||||
**/ |
|
||||
public String getProjectName() { |
|
||||
return this.projectName; |
|
||||
} |
|
||||
/** |
|
||||
* 访问用户编号 |
|
||||
**/ |
|
||||
public String getAccessUserid() { |
|
||||
return this.accessUserid; |
|
||||
} |
|
||||
/** |
|
||||
* 访问密码 |
|
||||
**/ |
|
||||
public String getAccessPassword() { |
|
||||
return this.accessPassword; |
|
||||
} |
|
||||
/** |
|
||||
* 作用说明 |
|
||||
**/ |
|
||||
public String getEffect() { |
|
||||
return this.effect; |
|
||||
} |
|
||||
/** |
|
||||
* 访问链接 |
|
||||
**/ |
|
||||
public String getAccessUrl() { |
|
||||
return this.accessUrl; |
|
||||
} |
|
||||
/** |
|
||||
* 外网ip地址 |
|
||||
**/ |
|
||||
public String getWebIpAddress() { |
|
||||
return this.webIpAddress; |
|
||||
} |
|
||||
/** |
|
||||
* 外网端口 |
|
||||
**/ |
|
||||
public String getWebPort() { |
|
||||
return this.webPort; |
|
||||
} |
|
||||
/** |
|
||||
* 其它说明 |
|
||||
**/ |
|
||||
public String getOtherRemark() { |
|
||||
return this.otherRemark; |
|
||||
} |
|
||||
/** |
|
||||
* 添加人员 |
|
||||
**/ |
|
||||
public String getCreateUserid() { |
|
||||
return this.createUserid; |
|
||||
} |
|
||||
/** |
|
||||
* 添加人员姓名 |
|
||||
**/ |
|
||||
public String getCreateUsername() { |
|
||||
return this.createUsername; |
|
||||
} |
|
||||
/** |
|
||||
* 添加时间 |
|
||||
**/ |
|
||||
public Date getCreateTime() { |
|
||||
return this.createTime; |
|
||||
} |
|
||||
/** |
|
||||
* 当前流程实例编号 |
|
||||
**/ |
|
||||
public String getBizProcInstId() { |
|
||||
return this.bizProcInstId; |
|
||||
} |
|
||||
/** |
|
||||
* 当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除 |
|
||||
**/ |
|
||||
public String getBizFlowState() { |
|
||||
return this.bizFlowState; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
@ -1,124 +0,0 @@ |
|||||
package com.xm.core.service; |
|
||||
|
|
||||
import com.mdp.core.err.BizException; |
|
||||
import com.mdp.core.service.BaseService; |
|
||||
import com.mdp.safe.client.entity.User; |
|
||||
import com.mdp.safe.client.utils.LoginUtils; |
|
||||
import com.xm.core.entity.XmProjectEnvList; |
|
||||
import org.springframework.beans.factory.annotation.Autowired; |
|
||||
import org.springframework.stereotype.Service; |
|
||||
import org.springframework.util.StringUtils; |
|
||||
|
|
||||
import java.util.Date; |
|
||||
import java.util.HashMap; |
|
||||
import java.util.List; |
|
||||
import java.util.Map; |
|
||||
/** |
|
||||
* 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.<br> |
|
||||
* 组织 com.qqkj 顶级模块 oa 大模块 xm 小模块 <br> |
|
||||
* 实体 XmProjectEnvList 表 XM.xm_project_env_list 当前主键(包括多主键): id; |
|
||||
***/ |
|
||||
@Service("xm.core.xmProjectEnvListService") |
|
||||
public class XmProjectEnvListService extends BaseService { |
|
||||
|
|
||||
|
|
||||
@Autowired |
|
||||
XmRecordService xmRecordService; |
|
||||
|
|
||||
/** 请在此类添加自定义函数 */ |
|
||||
|
|
||||
public void addEnvList(XmProjectEnvList xmProjectEnvList) { |
|
||||
xmProjectEnvList.setId(this.createKey("id")); |
|
||||
User user = LoginUtils.getCurrentUserInfo(); |
|
||||
xmProjectEnvList.setCreateUserid(user.getUserid()); |
|
||||
xmProjectEnvList.setCreateUsername(user.getUsername()); |
|
||||
xmProjectEnvList.setCreateTime(new Date()); |
|
||||
this.insert(xmProjectEnvList); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
/** |
|
||||
* 流程审批过程中回调该接口,更新业务数据 |
|
||||
* 如果发起流程时上送了restUrl,则无论流程中是否配置了监听器都会在流程发生以下事件时推送数据过来 |
|
||||
* eventName: PROCESS_STARTED 流程启动完成 全局 |
|
||||
* PROCESS_COMPLETED 流程正常结束 全局 |
|
||||
* PROCESS_CANCELLED 流程删除 全局 |
|
||||
* create 人工任务启动 |
|
||||
* complete 人工任务完成 |
|
||||
* assignment 人工任务分配给了具体的人 |
|
||||
* delete 人工任务被删除 |
|
||||
* TASK_COMPLETED_FORM_DATA_UPDATE 人工任务提交完成后,智能表单数据更新 |
|
||||
* |
|
||||
* 其中 create/complete/assignment/delete事件是需要在模型中人工节点上配置了委托代理表达式 ${taskBizCallListener}才会推送过来。 |
|
||||
* 在人工任务节点上配置 任务监听器 建议事件为 complete,其它assignment/create/complete/delete也可以,一般建议在complete,委托代理表达式 ${taskBizCallListener} |
|
||||
* |
|
||||
* @param flowVars {flowBranchId,agree,procInstId,startUserid,assignee,actId,taskName,mainTitle,branchId,bizKey,commentMsg,eventName,modelKey} 等 |
|
||||
* @return 如果tips.isOk==false,将影响流程提交 |
|
||||
**/ |
|
||||
public void processApprova(Map<String, Object> flowVars) { |
|
||||
String eventName=(String) flowVars.get("eventName"); |
|
||||
String agree=(String) flowVars.get("agree"); |
|
||||
String branchId=(String) flowVars.get("branchId"); |
|
||||
String envId=(String) flowVars.get("envId"); |
|
||||
String bizKey=(String) flowVars.get("bizKey"); |
|
||||
if("xm_project_env_list_approva".equals(bizKey) ) { |
|
||||
}else { |
|
||||
throw new BizException("不支持的业务,请上送业务编码【bizKey】参数"); |
|
||||
} |
|
||||
if("complete".equals(eventName)) { |
|
||||
if("1".equals(agree)) { |
|
||||
this.updateFlowStateByProcInst("", flowVars); |
|
||||
}else { |
|
||||
this.updateFlowStateByProcInst("", flowVars); |
|
||||
} |
|
||||
}else { |
|
||||
if("PROCESS_STARTED".equals(eventName)) { |
|
||||
Map<String,Object> bizQuery=new HashMap<>(); |
|
||||
bizQuery.put("envId", envId); |
|
||||
if(StringUtils.isEmpty(envId)) { |
|
||||
throw new BizException("请上送envId"); |
|
||||
} |
|
||||
if(StringUtils.isEmpty(branchId)) { |
|
||||
throw new BizException("请上送branchId"); |
|
||||
} |
|
||||
List<Map<String,Object>> bizList=this.selectListMapByWhere(bizQuery); |
|
||||
if(bizList==null || bizList.size()==0) { |
|
||||
throw new BizException("没有找到对应环境清单,环境清单为【"+envId+"】"); |
|
||||
}else { |
|
||||
Map<String,Object> bizObject=bizList.get(0); |
|
||||
if("1".equals(bizObject.get("bizFlowState"))) { |
|
||||
throw new BizException("该环境清单正在审批中,不能再发起审批"); |
|
||||
} |
|
||||
} |
|
||||
flowVars.put("id", this.createKey("id")); |
|
||||
this.insert("insertProcessApprova", flowVars); |
|
||||
this.updateFlowStateByProcInst("1", flowVars); |
|
||||
}else if("PROCESS_COMPLETED".equals(eventName)) { |
|
||||
if("1".equals(agree)) { |
|
||||
this.updateFlowStateByProcInst("2", flowVars); |
|
||||
|
|
||||
}else { |
|
||||
this.updateFlowStateByProcInst("3", flowVars); |
|
||||
} |
|
||||
}else if("PROCESS_CANCELLED".equals(eventName)) { |
|
||||
this.updateFlowStateByProcInst("4", flowVars); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
private void updateFlowStateByProcInstForDeleteSuccess(Map<String, Object> flowVars) { |
|
||||
this.update("updateFlowStateByProcInstForDeleteSuccess", flowVars); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public void updateFlowStateByProcInst(String flowState,Map<String, Object> flowVars) { |
|
||||
flowVars.put("flowState", flowState); |
|
||||
flowVars.put("bizFlowState", flowState); |
|
||||
if("1".equals(flowState)) { |
|
||||
flowVars.put("bizProcInstId", flowVars.get("procInstId")); |
|
||||
} |
|
||||
this.update("updateProcessApprova", flowVars); |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
@ -1,213 +0,0 @@ |
|||||
<?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="com.xm.core.entity.XmProjectEnvList"> |
|
||||
|
|
||||
|
|
||||
<!--开始 自定sql函数区域 --> |
|
||||
|
|
||||
<!--结束 自定义sql函数区域--> |
|
||||
|
|
||||
|
|
||||
|
|
||||
<!-- 通过条件查询获取数据列表 返回list<map> --> |
|
||||
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap"> |
|
||||
select res.* from xm_project_env_list res |
|
||||
|
|
||||
<where> |
|
||||
<if test="ids != null"> and |
|
||||
id in |
|
||||
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|
||||
#{item} |
|
||||
</foreach> |
|
||||
</if> |
|
||||
<include refid="where"/> |
|
||||
<if test="key != null and key !='' "> </if> |
|
||||
<if test="fuzzy != null and key != ''"> and |
|
||||
(ip_address like #{fuzzy} or |
|
||||
port like #{fuzzy} or |
|
||||
access_url like #{fuzzy} or |
|
||||
web_ip_address like #{fuzzy} or |
|
||||
web_port like #{fuzzy}) |
|
||||
</if> |
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<!-- 通过条件查询获取数据列表 不分页 返回 list<Object> --> |
|
||||
<select id="selectListByWhere" parameterType="com.xm.core.entity.XmProjectEnvList" resultType="com.xm.core.entity.XmProjectEnvList"> |
|
||||
select * from xm_project_env_list res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<!-- 通过主键查询获取数据对象 返回object --> |
|
||||
<select id="selectOneObject" parameterType="com.xm.core.entity.XmProjectEnvList" resultType="com.xm.core.entity.XmProjectEnvList"> |
|
||||
select * from xm_project_env_list res |
|
||||
where |
|
||||
res.id = #{id} |
|
||||
</select> |
|
||||
|
|
||||
<!-- 通过主键查询获取数据对象 返回map--> |
|
||||
<select id="selectOneMap" parameterType="HashMap" resultType="HashMap"> |
|
||||
select * from xm_project_env_list res |
|
||||
where |
|
||||
res.id = #{id} |
|
||||
</select> |
|
||||
<!-- 获取数据条目 返回long --> |
|
||||
<select id="countByWhere" parameterType="com.xm.core.entity.XmProjectEnvList" resultType="long"> |
|
||||
select count(1) from xm_project_env_list res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</select> |
|
||||
<!-- 新增一条记录 主键id,--> |
|
||||
<insert id="insert" parameterType="com.xm.core.entity.XmProjectEnvList" useGeneratedKeys="false" keyProperty="id"> |
|
||||
insert into xm_project_env_list( |
|
||||
<include refid="columns"/> |
|
||||
) values ( |
|
||||
#{id},#{remark},#{ipAddress},#{port},#{projectId},#{projectName},#{accessUserid},#{accessPassword},#{effect},#{accessUrl},#{webIpAddress},#{webPort},#{otherRemark},#{createUserid},#{createUsername},#{createTime},#{bizProcInstId},#{bizFlowState} |
|
||||
) |
|
||||
</insert> |
|
||||
|
|
||||
<!-- 按条件删除若干条记录--> |
|
||||
<delete id="deleteByWhere" parameterType="com.xm.core.entity.XmProjectEnvList"> |
|
||||
delete from xm_project_env_list res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</delete> |
|
||||
|
|
||||
<!-- 按主键删除一条记录--> |
|
||||
<delete id="deleteByPk" parameterType="com.xm.core.entity.XmProjectEnvList"> |
|
||||
delete from xm_project_env_list |
|
||||
where id = #{id} |
|
||||
</delete> |
|
||||
|
|
||||
<!-- 根据条件修改若干条记录 --> |
|
||||
<update id="updateSomeFieldByPk" parameterType="com.xm.core.entity.XmProjectEnvList"> |
|
||||
update xm_project_env_list |
|
||||
<set> |
|
||||
<include refid="someFieldSet"/> |
|
||||
</set> |
|
||||
where id = #{id} |
|
||||
</update> |
|
||||
|
|
||||
<!-- 根据主键修改一条记录 --> |
|
||||
<update id="updateByPk" parameterType="com.xm.core.entity.XmProjectEnvList"> |
|
||||
update xm_project_env_list |
|
||||
<set> |
|
||||
<include refid="set"/> |
|
||||
</set> |
|
||||
where id = #{id} |
|
||||
</update> |
|
||||
|
|
||||
<!-- 批量新增 批量插入 借用insert 循环插入实现 |
|
||||
<insert id="batchInsert" parameterType="List"> |
|
||||
</insert> |
|
||||
--> |
|
||||
|
|
||||
<!-- 批量更新 --> |
|
||||
<update id="batchUpdate" parameterType="List"> |
|
||||
<foreach collection="list" item="item" index="index" separator=";" > |
|
||||
update xm_project_env_list |
|
||||
set |
|
||||
<include refid="batchSet"/> |
|
||||
where id = #{item.id} |
|
||||
</foreach> |
|
||||
</update> |
|
||||
<!-- 批量删除 --> |
|
||||
<delete id="batchDelete" parameterType="List"> |
|
||||
delete from xm_project_env_list |
|
||||
where id in |
|
||||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
||||
#{item.id } |
|
||||
</foreach> |
|
||||
</delete> |
|
||||
|
|
||||
|
|
||||
<!--sql片段 列--> |
|
||||
<sql id="columns"> |
|
||||
id,remark,ip_address,port,project_id,project_name,access_userid,access_password,effect,access_url,web_ip_address,web_port,other_remark,create_userid,create_username,create_time,biz_proc_inst_id,biz_flow_state |
|
||||
</sql> |
|
||||
|
|
||||
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> |
|
||||
<sql id="where"> |
|
||||
<if test="id != null and id != ''"> and res.id = #{id} </if> |
|
||||
<if test="remark != null and remark != ''"> and res.remark = #{remark} </if> |
|
||||
<if test="ipAddress != null and ipAddress != ''"> and res.ip_address = #{ipAddress} </if> |
|
||||
<if test="port != null and port != ''"> and res.port = #{port} </if> |
|
||||
<if test="projectId != null and projectId != ''"> and res.project_id = #{projectId} </if> |
|
||||
<if test="projectName != null and projectName != ''"> and res.project_name = #{projectName} </if> |
|
||||
<if test="accessUserid != null and accessUserid != ''"> and res.access_userid = #{accessUserid} </if> |
|
||||
<if test="accessPassword != null and accessPassword != ''"> and res.access_password = #{accessPassword} </if> |
|
||||
<if test="effect != null and effect != ''"> and res.effect = #{effect} </if> |
|
||||
<if test="accessUrl != null and accessUrl != ''"> and res.access_url = #{accessUrl} </if> |
|
||||
<if test="webIpAddress != null and webIpAddress != ''"> and res.web_ip_address = #{webIpAddress} </if> |
|
||||
<if test="webPort != null and webPort != ''"> and res.web_port = #{webPort} </if> |
|
||||
<if test="otherRemark != null and otherRemark != ''"> and res.other_remark = #{otherRemark} </if> |
|
||||
<if test="createUserid != null and createUserid != ''"> and res.create_userid = #{createUserid} </if> |
|
||||
<if test="createUsername != null and createUsername != ''"> and res.create_username = #{createUsername} </if> |
|
||||
<if test="createTime != null"> and TO_CHAR(res.create_time,'YYYY-MM-DD') = TO_CHAR(#{createTime},'YYYY-MM-DD') </if> |
|
||||
<if test="bizProcInstId != null and bizProcInstId != ''"> and res.biz_proc_inst_id = #{bizProcInstId} </if> |
|
||||
<if test="bizFlowState != null and bizFlowState != ''"> and res.biz_flow_state = #{bizFlowState} </if> |
|
||||
</sql> |
|
||||
<!--sql片段 更新字段 --> |
|
||||
<sql id="set"> |
|
||||
remark = #{remark}, |
|
||||
ip_address = #{ipAddress}, |
|
||||
port = #{port}, |
|
||||
project_id = #{projectId}, |
|
||||
project_name = #{projectName}, |
|
||||
access_userid = #{accessUserid}, |
|
||||
access_password = #{accessPassword}, |
|
||||
effect = #{effect}, |
|
||||
access_url = #{accessUrl}, |
|
||||
web_ip_address = #{webIpAddress}, |
|
||||
web_port = #{webPort}, |
|
||||
other_remark = #{otherRemark}, |
|
||||
create_userid = #{createUserid}, |
|
||||
create_username = #{createUsername}, |
|
||||
create_time = #{createTime}, |
|
||||
biz_proc_inst_id = #{bizProcInstId}, |
|
||||
biz_flow_state = #{bizFlowState} |
|
||||
</sql> |
|
||||
<sql id="someFieldSet"> |
|
||||
<if test="remark != null and remark != ''"> remark = #{remark}, </if> |
|
||||
<if test="ipAddress != null and ipAddress != ''"> ip_address = #{ipAddress}, </if> |
|
||||
<if test="port != null and port != ''"> port = #{port}, </if> |
|
||||
<if test="projectId != null and projectId != ''"> project_id = #{projectId}, </if> |
|
||||
<if test="projectName != null and projectName != ''"> project_name = #{projectName}, </if> |
|
||||
<if test="accessUserid != null and accessUserid != ''"> access_userid = #{accessUserid}, </if> |
|
||||
<if test="accessPassword != null and accessPassword != ''"> access_password = #{accessPassword}, </if> |
|
||||
<if test="effect != null and effect != ''"> effect = #{effect}, </if> |
|
||||
<if test="accessUrl != null and accessUrl != ''"> access_url = #{accessUrl}, </if> |
|
||||
<if test="webIpAddress != null and webIpAddress != ''"> web_ip_address = #{webIpAddress}, </if> |
|
||||
<if test="webPort != null and webPort != ''"> web_port = #{webPort}, </if> |
|
||||
<if test="otherRemark != null and otherRemark != ''"> other_remark = #{otherRemark}, </if> |
|
||||
<if test="createUserid != null and createUserid != ''"> create_userid = #{createUserid}, </if> |
|
||||
<if test="createUsername != null and createUsername != ''"> create_username = #{createUsername}, </if> |
|
||||
<if test="createTime != null"> create_time = #{createTime}, </if> |
|
||||
<if test="bizProcInstId != null and bizProcInstId != ''"> biz_proc_inst_id = #{bizProcInstId}, </if> |
|
||||
<if test="bizFlowState != null and bizFlowState != ''"> biz_flow_state = #{bizFlowState}, </if> |
|
||||
</sql> |
|
||||
<!--sql片段 批量更新 --> |
|
||||
<sql id="batchSet"> |
|
||||
remark = #{item.remark}, |
|
||||
ip_address = #{item.ipAddress}, |
|
||||
port = #{item.port}, |
|
||||
project_id = #{item.projectId}, |
|
||||
project_name = #{item.projectName}, |
|
||||
access_userid = #{item.accessUserid}, |
|
||||
access_password = #{item.accessPassword}, |
|
||||
effect = #{item.effect}, |
|
||||
access_url = #{item.accessUrl}, |
|
||||
web_ip_address = #{item.webIpAddress}, |
|
||||
web_port = #{item.webPort}, |
|
||||
other_remark = #{item.otherRemark}, |
|
||||
create_userid = #{item.createUserid}, |
|
||||
create_username = #{item.createUsername}, |
|
||||
create_time = #{item.createTime}, |
|
||||
biz_proc_inst_id = #{item.bizProcInstId}, |
|
||||
biz_flow_state = #{item.bizFlowState} |
|
||||
</sql> |
|
||||
</mapper> |
|
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue