Browse Source

文档、环境清单

master
陈裕财 4 years ago
parent
commit
22f9a0894d
  1. 4
      xm-core/src/main/java/com/xm/core/ctrl/XmEnvListController.java
  2. 26
      xm-core/src/main/java/com/xm/core/ctrl/XmFileController.java
  3. 28
      xm-core/src/main/java/com/xm/core/entity/XmEnvList.java
  4. 19
      xm-core/src/main/java/com/xm/core/entity/XmFile.java
  5. 10
      xm-core/src/main/java/com/xm/core/service/XmFileService.java
  6. 44
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmEnvListMapper.xml
  7. 32
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmFileMapper.xml

4
xm-core/src/main/java/com/xm/core/ctrl/XmEnvListController.java

@ -14,6 +14,7 @@ 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.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
@ -82,6 +83,9 @@ public class XmEnvListController {
Map<String,Object> m = new HashMap<>();
Tips tips=new Tips("成功新增一条数据");
try{
if(StringUtils.hasText(xmEnvList.get)){
}
xmEnvListService.addEnv(xmEnvList);
m.put("data",xmEnvList);
}catch (BizException e) {

26
xm-core/src/main/java/com/xm/core/ctrl/XmFileController.java

@ -5,11 +5,16 @@ 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.core.utils.ResponseHelper;
import com.mdp.mybatis.PageUtils;
import com.mdp.qx.HasQx;
import com.mdp.safe.client.entity.User;
import com.mdp.safe.client.utils.LoginUtils;
import com.mdp.swagger.ApiEntityParams;
import com.xm.core.entity.XmFile;
import com.xm.core.service.XmFileService;
import com.xm.core.service.XmGroupService;
import com.xm.core.service.XmProjectService;
import com.xm.core.vo.XmFileVo;
import io.swagger.annotations.*;
import org.apache.commons.logging.Log;
@ -42,8 +47,12 @@ public class XmFileController {
@Autowired
private XmFileService xmFileService;
@Autowired
XmProjectService xmProjectService;
@Autowired
XmGroupService xmGroupService;
@ApiOperation( value = "查询xm_file信息列表",notes="listXmFile,条件之间是 and关系,模糊查询写法如 {studentName:'%才哥%'}")
@ -105,6 +114,19 @@ public class XmFileController {
Map<String,Object> m = new HashMap<>();
Tips tips=new Tips("成功删除一条数据");
try{
User user= LoginUtils.getCurrentUserInfo();
XmFile file=this.xmFileService.selectOneById(xmFile.getId());
if(file==null){
return ResponseHelper.failed("data-0","数据已不存在");
}
if(!user.getUserid().equals(file.getCreateUserid()) ){
Tips isHead=xmGroupService.checkIsAdmOrTeamHeadOrAss(user,file.getCreateUserid(),file.getProjectId());
if(!isHead.isOk()){
return ResponseHelper.failed("no-qx","您只能删除自己创建的文档");
}
}
xmFileService.deleteFile(xmFile);
}catch (BizException e) {
tips=e.getTips();

28
xm-core/src/main/java/com/xm/core/entity/XmEnvList.java

@ -9,7 +9,7 @@ import java.math.BigDecimal;
/**
* 组织 com 顶级模块 xm 大模块 core 小模块 <br>
* 实体 XmEnvList所有属性名: <br>
* "id","主键","remark","备注说明","ipAddress","内网ip地址","port","内网访问端口","branchId","归属机构","accessUserid","访问用户编号","accessPassword","访问密码","effect","作用说明","accessUrl","访问链接","supplier","供应商","webIpAddress","外网ip地址","webPort","外网端口","otherRemark","其它说明","createUserid","添加人员","createUsername","添加人员姓名","createTime","添加时间","envState","状态0不可用1已启用2已过期","startTime","有效日期开始","endTime","有效日期结束","feeAmount","费用","feeRule","计费规则","bizProcInstId","当前流程实例编号","bizFlowState","当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除";<br>
* "id","主键","remark","备注说明","ipAddress","内网ip地址","port","内网访问端口","branchId","归属机构","accessUserid","访问用户编号","accessPassword","访问密码","accessUrl","访问链接","supplier","供应商","webIpAddress","外网ip地址","webPort","外网端口","createUserid","添加人员","createUsername","添加人员姓名","createTime","添加时间","envState","状态0不可用1已启用2已过期","startTime","有效日期开始","endTime","有效日期结束","feeAmount","费用","feeRule","计费规则","projectId","归属项目编号","readQx","0-全部可看,1-同机构可看,2-同机构同项目可看,3-同项目上级可看,9-仅自己可看","writeQx","0-全部可写,1-同机构可写,2-同机构同项目可写,3-同项目上级可写,9-仅自己可修改","ltime","修改时间","luserid","修改人编号","lusername","修改人姓名";<br>
* 当前主键(包括多主键):<br>
* id;<br>
*/
@ -41,9 +41,6 @@ public class XmEnvList implements java.io.Serializable {
@ApiModelProperty(notes="访问密码",allowEmptyValue=true,example="",allowableValues="")
String accessPassword;
@ApiModelProperty(notes="作用说明",allowEmptyValue=true,example="",allowableValues="")
String effect;
@ApiModelProperty(notes="访问链接",allowEmptyValue=true,example="",allowableValues="")
String accessUrl;
@ -56,9 +53,6 @@ public class XmEnvList implements java.io.Serializable {
@ApiModelProperty(notes="外网端口",allowEmptyValue=true,example="",allowableValues="")
String webPort;
@ApiModelProperty(notes="其它说明",allowEmptyValue=true,example="",allowableValues="")
String otherRemark;
@ApiModelProperty(notes="添加人员",allowEmptyValue=true,example="",allowableValues="")
String createUserid;
@ -83,11 +77,23 @@ public class XmEnvList implements java.io.Serializable {
@ApiModelProperty(notes="计费规则",allowEmptyValue=true,example="",allowableValues="")
String feeRule;
@ApiModelProperty(notes="当前流程实例编号",allowEmptyValue=true,example="",allowableValues="")
String bizProcInstId;
@ApiModelProperty(notes="归属项目编号",allowEmptyValue=true,example="",allowableValues="")
String projectId;
@ApiModelProperty(notes="0-全部可看,1-同机构可看,2-同机构同项目可看,3-同项目上级可看,9-仅自己可看",allowEmptyValue=true,example="",allowableValues="")
String readQx;
@ApiModelProperty(notes="0-全部可写,1-同机构可写,2-同机构同项目可写,3-同项目上级可写,9-仅自己可修改",allowEmptyValue=true,example="",allowableValues="")
String writeQx;
@ApiModelProperty(notes="修改时间",allowEmptyValue=true,example="",allowableValues="")
Date ltime;
@ApiModelProperty(notes="修改人编号",allowEmptyValue=true,example="",allowableValues="")
String luserid;
@ApiModelProperty(notes="当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除",allowEmptyValue=true,example="",allowableValues="")
String bizFlowState;
@ApiModelProperty(notes="修改人姓名",allowEmptyValue=true,example="",allowableValues="")
String lusername;
/**
*主键

19
xm-core/src/main/java/com/xm/core/entity/XmFile.java

@ -8,7 +8,7 @@ import java.util.Date;
/**
* 组织 com 顶级模块 xm 大模块 core 小模块 <br>
* 实体 XmFile所有属性名: <br>
* "id","文档编号","name","文件名称","projectId","项目编号","projectName","项目名称","description","文件说明","createUserid","创建人编号","createUsername","创建人","createTime","创建时间","bizProcInstId","当前流程实例编号","bizFlowState","当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除";<br>
* "id","文档编号","name","文件名称","projectId","项目编号","projectName","项目名称","description","文件说明","createUserid","创建人编号","createUsername","创建人","createTime","创建时间","readQx","0-全部可看,1-同机构可看,2-同机构同项目可看,3-同项目上级可看,9-仅自己可看","writeQx","0-全部可写,1-同机构可写,2-同机构同项目可写,3-同项目上级可写,9-仅自己可修改","ltime","修改时间","luserid","修改人编号","lusername","修改人姓名";<br>
* 当前主键(包括多主键):<br>
* id;<br>
*/
@ -43,11 +43,20 @@ public class XmFile implements java.io.Serializable {
@ApiModelProperty(notes="创建时间",allowEmptyValue=true,example="",allowableValues="")
Date createTime;
@ApiModelProperty(notes="当前流程实例编号",allowEmptyValue=true,example="",allowableValues="")
String bizProcInstId;
@ApiModelProperty(notes="0-全部可看,1-同机构可看,2-同机构同项目可看,3-同项目上级可看,9-仅自己可看",allowEmptyValue=true,example="",allowableValues="")
String readQx;
@ApiModelProperty(notes="当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除",allowEmptyValue=true,example="",allowableValues="")
String bizFlowState;
@ApiModelProperty(notes="0-全部可写,1-同机构可写,2-同机构同项目可写,3-同项目上级可写,9-仅自己可修改",allowEmptyValue=true,example="",allowableValues="")
String writeQx;
@ApiModelProperty(notes="修改时间",allowEmptyValue=true,example="",allowableValues="")
Date ltime;
@ApiModelProperty(notes="修改人编号",allowEmptyValue=true,example="",allowableValues="")
String luserid;
@ApiModelProperty(notes="修改人姓名",allowEmptyValue=true,example="",allowableValues="")
String lusername;
/**
*文档编号

10
xm-core/src/main/java/com/xm/core/service/XmFileService.java

@ -45,7 +45,9 @@ public class XmFileService extends BaseService {
XmFile xmFile = new XmFile();
BeanUtils.copyProperties(xmFileVo,xmFile);
this.updateSomeFieldByPk(xmFile);
xmAttachmentService.insertOrUpdate(xmFileVo.getId(),Type,xmFileVo.getAttachment());
if(xmFileVo.getAttachment()!=null && xmFileVo.getAttachment().size()>0){
xmAttachmentService.insertOrUpdate(xmFileVo.getId(),Type,xmFileVo.getAttachment());
}
return null;
}
@ -70,9 +72,9 @@ public class XmFileService extends BaseService {
XmFile xmFile = new XmFile();
BeanUtils.copyProperties(xmFileVo,xmFile);
this.insert(xmFile);
xmAttachmentService.insertOrUpdate(xmFileVo.getId(),Type,xmFileVo.getAttachment());
if(xmFileVo.getAttachment()!=null && xmFileVo.getAttachment().size()>0){
xmAttachmentService.insertOrUpdate(xmFileVo.getId(),Type,xmFileVo.getAttachment());
}
xmRecordService.addXmProjectRecord(xmFileVo.getProjectId(), "项目-增加文档", "增加文档"+xmFile.getName());
return xmFileVo;
}

44
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmEnvListMapper.xml

@ -70,7 +70,7 @@
insert into xm_env_list(
<include refid="columns"/>
) values (
#{id},#{remark},#{ipAddress},#{port},#{branchId},#{accessUserid},#{accessPassword},#{effect},#{accessUrl},#{supplier},#{webIpAddress},#{webPort},#{otherRemark},#{createUserid},#{createUsername},#{createTime},#{envState},#{startTime},#{endTime},#{feeAmount},#{feeRule},#{bizProcInstId},#{bizFlowState}
#{id},#{remark},#{ipAddress},#{port},#{branchId},#{accessUserid},#{accessPassword},#{accessUrl},#{supplier},#{webIpAddress},#{webPort},#{createUserid},#{createUsername},#{createTime},#{envState},#{startTime},#{endTime},#{feeAmount},#{feeRule},#{projectId},#{readQx},#{writeQx},#{ltime},#{luserid},#{lusername}
)
</insert>
@ -145,7 +145,7 @@
<!--sql片段 列-->
<sql id="columns">
id,remark,ip_address,port,branch_id,access_userid,access_password,effect,access_url,supplier,web_ip_address,web_port,other_remark,create_userid,create_username,create_time,env_state,start_time,end_time,fee_amount,fee_rule,biz_proc_inst_id,biz_flow_state
id,remark,ip_address,port,branch_id,access_userid,access_password,access_url,supplier,web_ip_address,web_port,create_userid,create_username,create_time,env_state,start_time,end_time,fee_amount,fee_rule,project_id,read_qx,write_qx,ltime,luserid,lusername
</sql>
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS-->
@ -157,12 +157,10 @@
<if test="branchId != null and branchId != ''"> and res.branch_id = #{branchId} </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="supplier != null and supplier != ''"> and res.supplier = #{supplier} </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 date_format(res.create_time,'%Y-%m-%d') = date_format(#{createTime},'%Y-%m-%d') </if>
@ -171,8 +169,12 @@
<if test="endTime != null"> and date_format(res.end_time,'%Y-%m-%d') = date_format(#{endTime},'%Y-%m-%d') </if>
<if test="feeAmount != null and feeAmount != ''"> and res.fee_amount = #{feeAmount} </if>
<if test="feeRule != null and feeRule != ''"> and res.fee_rule = #{feeRule} </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>
<if test="projectId != null and projectId != ''"> and res.project_id = #{projectId} </if>
<if test="readQx != null and readQx != ''"> and res.read_qx = #{readQx} </if>
<if test="writeQx != null and writeQx != ''"> and res.write_qx = #{writeQx} </if>
<if test="ltime != null"> and date_format(res.ltime,'%Y-%m-%d') = date_format(#{ltime},'%Y-%m-%d') </if>
<if test="luserid != null and luserid != ''"> and res.luserid = #{luserid} </if>
<if test="lusername != null and lusername != ''"> and res.lusername = #{lusername} </if>
</sql>
<!--sql片段 更新字段 -->
<sql id="set">
@ -182,12 +184,10 @@
branch_id = #{branchId},
access_userid = #{accessUserid},
access_password = #{accessPassword},
effect = #{effect},
access_url = #{accessUrl},
supplier = #{supplier},
web_ip_address = #{webIpAddress},
web_port = #{webPort},
other_remark = #{otherRemark},
create_userid = #{createUserid},
create_username = #{createUsername},
create_time = #{createTime},
@ -196,8 +196,12 @@
end_time = #{endTime},
fee_amount = #{feeAmount},
fee_rule = #{feeRule},
biz_proc_inst_id = #{bizProcInstId},
biz_flow_state = #{bizFlowState}
project_id = #{projectId},
read_qx = #{readQx},
write_qx = #{writeQx},
ltime = #{ltime},
luserid = #{luserid},
lusername = #{lusername}
</sql>
<sql id="someFieldSet">
<if test="remark != null and remark != ''"> remark = #{remark}, </if>
@ -206,12 +210,10 @@
<if test="branchId != null and branchId != ''"> branch_id = #{branchId}, </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="supplier != null and supplier != ''"> supplier = #{supplier}, </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>
@ -220,8 +222,12 @@
<if test="endTime != null"> end_time = #{endTime}, </if>
<if test="feeAmount != null and feeAmount != ''"> fee_amount = #{feeAmount}, </if>
<if test="feeRule != null and feeRule != ''"> fee_rule = #{feeRule}, </if>
<if test="bizProcInstId != null and bizProcInstId != ''"> biz_proc_inst_id = #{bizProcInstId}, </if>
<if test="bizFlowState != null and bizFlowState != ''"> biz_flow_state = #{bizFlowState}, </if>
<if test="projectId != null and projectId != ''"> project_id = #{projectId}, </if>
<if test="readQx != null and readQx != ''"> read_qx = #{readQx}, </if>
<if test="writeQx != null and writeQx != ''"> write_qx = #{writeQx}, </if>
<if test="ltime != null"> ltime = #{ltime}, </if>
<if test="luserid != null and luserid != ''"> luserid = #{luserid}, </if>
<if test="lusername != null and lusername != ''"> lusername = #{lusername}, </if>
</sql>
<!--sql片段 批量更新 -->
<sql id="batchSet">
@ -231,12 +237,10 @@
branch_id = #{item.branchId},
access_userid = #{item.accessUserid},
access_password = #{item.accessPassword},
effect = #{item.effect},
access_url = #{item.accessUrl},
supplier = #{item.supplier},
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},
@ -245,7 +249,11 @@
end_time = #{item.endTime},
fee_amount = #{item.feeAmount},
fee_rule = #{item.feeRule},
biz_proc_inst_id = #{item.bizProcInstId},
biz_flow_state = #{item.bizFlowState}
project_id = #{item.projectId},
read_qx = #{item.readQx},
write_qx = #{item.writeQx},
ltime = #{item.ltime},
luserid = #{item.luserid},
lusername = #{item.lusername}
</sql>
</mapper>

32
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmFileMapper.xml

@ -67,7 +67,7 @@
insert into xm_file(
<include refid="columns"/>
) values (
#{id},#{name},#{projectId},#{projectName},#{description},#{createUserid},#{createUsername},#{createTime},#{bizProcInstId},#{bizFlowState}
#{id},#{name},#{projectId},#{projectName},#{description},#{createUserid},#{createUsername},#{createTime},#{readQx},#{writeQx},#{ltime},#{luserid},#{lusername}
)
</insert>
@ -142,7 +142,7 @@
<!--sql片段 列-->
<sql id="columns">
id,name,project_id,project_name,description,create_userid,create_username,create_time,biz_proc_inst_id,biz_flow_state
id,name,project_id,project_name,description,create_userid,create_username,create_time,read_qx,write_qx,ltime,luserid,lusername
</sql>
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS-->
@ -155,8 +155,11 @@
<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 date_format(res.create_time,'%Y-%m-%d') = date_format(#{createTime},'%Y-%m-%d') </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>
<if test="readQx != null and readQx != ''"> and res.read_qx = #{readQx} </if>
<if test="writeQx != null and writeQx != ''"> and res.write_qx = #{writeQx} </if>
<if test="ltime != null"> and date_format(res.ltime,'%Y-%m-%d') = date_format(#{ltime},'%Y-%m-%d') </if>
<if test="luserid != null and luserid != ''"> and res.luserid = #{luserid} </if>
<if test="lusername != null and lusername != ''"> and res.lusername = #{lusername} </if>
</sql>
<!--sql片段 更新字段 -->
<sql id="set">
@ -167,8 +170,11 @@
create_userid = #{createUserid},
create_username = #{createUsername},
create_time = #{createTime},
biz_proc_inst_id = #{bizProcInstId},
biz_flow_state = #{bizFlowState}
read_qx = #{readQx},
write_qx = #{writeQx},
ltime = #{ltime},
luserid = #{luserid},
lusername = #{lusername}
</sql>
<sql id="someFieldSet">
<if test="name != null and name != ''"> name = #{name}, </if>
@ -178,8 +184,11 @@
<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>
<if test="readQx != null and readQx != ''"> read_qx = #{readQx}, </if>
<if test="writeQx != null and writeQx != ''"> write_qx = #{writeQx}, </if>
<if test="ltime != null"> ltime = #{ltime}, </if>
<if test="luserid != null and luserid != ''"> luserid = #{luserid}, </if>
<if test="lusername != null and lusername != ''"> lusername = #{lusername}, </if>
</sql>
<!--sql片段 批量更新 -->
<sql id="batchSet">
@ -190,7 +199,10 @@
create_userid = #{item.createUserid},
create_username = #{item.createUsername},
create_time = #{item.createTime},
biz_proc_inst_id = #{item.bizProcInstId},
biz_flow_state = #{item.bizFlowState}
read_qx = #{item.readQx},
write_qx = #{item.writeQx},
ltime = #{item.ltime},
luserid = #{item.luserid},
lusername = #{item.lusername}
</sql>
</mapper>
Loading…
Cancel
Save