人员添加字符

pg_adapter
20918 9 months ago
parent 833ae3ac7e
commit 0a2c5b49a6

@ -1,18 +1,22 @@
package com.ruoyi.web.controller.system.system;
import java.io.IOException;
import java.util.List;
import java.util.stream.Collectors;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.exception.file.InvalidExtensionException;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.MimeTypeUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
@ -43,6 +47,7 @@ import com.ruoyi.system.service.ISysUserService;
@RequestMapping("/system/user")
public class SysUserController extends BaseController
{
private static final Logger log = LoggerFactory.getLogger(SysUserController.class);
private String prefix = "system/user";
@Autowired
@ -127,8 +132,7 @@ public class SysUserController extends BaseController
@Log(title = "用户管理", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(@Validated SysUser user)
{
public AjaxResult addSave(@Validated SysUser user) {
if (!userService.checkLoginNameUnique(user))
{
return error("新增用户'" + user.getLoginName() + "'失败,登录账号已存在");

@ -167,6 +167,32 @@
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-2 control-label is-required">是否持有护照或港澳通行证:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_yes_no')}">
<input type="radio" th:id="${dict.dictCode}" name="havePassport" th:value="${dict.dictValue}" th:checked="${dict.default}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-2 control-label is-required">是否具有出入境备案:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_yes_no')}">
<input type="radio" th:id="${dict.dictCode}" name="entryexitFiling" th:value="${dict.dictValue}" th:checked="${dict.default}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
@ -188,6 +214,17 @@
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="font-noraml">保密协议签订书</label>
<div class="file-loading">
<input id="singleFile" name="file" type="file">
<input id="cee" name="cee" type="hidden" value="">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
@ -229,6 +266,8 @@
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-fileinput-css" />
<th:block th:include="include :: bootstrap-fileinput-js" />
<script>
var prefix = ctx + "system/user";
@ -343,5 +382,24 @@
});
})
</script>
<script th:inline="javascript">
$(document).ready(function () {
$("#singleFile").fileinput({
uploadUrl: ctx + 'common/upload',
maxFileCount: 1,
autoReplace: true
}).on('fileuploaded', function (event, data, previewId, index) {
var rsp = data.response;
$("#cee").val(rsp.url);
log.info("return url" + rsp.url)
log.info("reutrn fileName" + rsp.fileName)
log.info("reutrn newFileName" + rsp.newFileName)
log.info("return originalFilename" + rsp.originalFilename)
}).on('fileremoved', function (event, id, index) {
$("input[name='" + event.currentTarget.id + "']").val('')
})
});
</script>
</body>
</html>

@ -155,6 +155,30 @@
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">是否持有护照或港澳通行证:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_yes_no')}">
<input type="radio" th:id="${dict.dictCode}" name="havePassport" th:value="${dict.dictValue}" th:field="*{havePassport}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">是否具有出入境备案:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_yes_no')}">
<input type="radio" th:id="${dict.dictCode}" name="entryexitFiling" th:value="${dict.dictValue}" th:field="*{entryexitFiling}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">

@ -218,6 +218,54 @@ public class SysUser extends BaseEntity
@Excel(name = "审核人")
private String examineuser;
/** 是否持有护照和港澳通行证 */
@Excel(name = "是否持有护照和港澳通行证")
private String havePassport;
/** 保密协议书 */
@Excel(name = "保密协议书")
private String confAgreement;
/** 保密协议书文件名 */
@Excel(name = "保密协议书文件名")
private String confName;
public String getConfName() {
return confName;
}
public void setConfName(String confName) {
this.confName = confName;
}
/** 是否出入境备案 */
@Excel(name = "是否具有出入境备案")
private String entryexitFiling;
public String getHavePassport() {
return havePassport;
}
public void setHavePassport(String havePassport) {
this.havePassport = havePassport;
}
public String getConfAgreement() {
return confAgreement;
}
public void setConfAgreement(String confAgreement) {
this.confAgreement = confAgreement;
}
public String getEntryexitFiling() {
return entryexitFiling;
}
public void setEntryexitFiling(String entryexitFiling) {
this.entryexitFiling = entryexitFiling;
}
public String getExaminedate() {
return examinedate;
}
@ -580,6 +628,10 @@ public class SysUser extends BaseEntity
", examine='" + examine + '\'' +
", examinedate='" + examinedate + '\'' +
", examineuser='" + examineuser + '\'' +
", havePassport='" + havePassport + '\'' +
", confAgreement='" + confAgreement + '\'' +
", entryexitFiling='" + entryexitFiling + '\'' +
", confName='" + confName + '\'' +
", dept=" + dept +
", roles=" + roles +
", roleIds=" + Arrays.toString(roleIds) +

@ -38,6 +38,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="examine" column="examine" />
<result property="examinedate" column="examinedate" />
<result property="examineuser" column="examineuser" />
<result property="havePassport" column="have_passport" />
<result property="confAgreement" column="conf_agreement" />
<result property="entryexitFiling" column="entryexit_filing" />
<result property="confName" column="conf_name" />
<association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" />
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
</resultMap>
@ -64,7 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectUserVo">
select u.user_id, u.dept_id, u.login_name, u.user_name, u.user_type, u.email, u.avatar, u.phonenumber, u.sex, u.password, u.salt, u.status, u.del_flag, u.login_ip, u.login_date, u.pwd_update_date, u.create_time, u.remark,userarea, nation, birthday, politics, shemichengdu, graduate, startdate, enddate, helthy,examine,examineuser,examinedate,
select u.user_id, u.dept_id, u.login_name, u.user_name, u.user_type, u.email, u.avatar, u.phonenumber, u.sex, u.password, u.salt, u.status, u.del_flag, u.login_ip, u.login_date, u.pwd_update_date, u.create_time, u.remark,userarea, nation, birthday, politics, shemichengdu, graduate, startdate, enddate, helthy,examine,examineuser,examinedate,have_passport,conf_agreement,entryexit_filing,conf_name,
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
from ${prefix}sys_user u
@ -74,7 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
select u.user_id, u.dept_id, u.login_name, u.user_name, u.user_type, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.salt, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, userarea, nation, birthday, politics, shemichengdu, graduate, startdate, enddate, helthy,examine,examineuser,examinedate,d.dept_name, d.leader from ${prefix}sys_user u
select u.user_id, u.dept_id, u.login_name, u.user_name, u.user_type, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.salt, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, userarea, nation, birthday, politics, shemichengdu, graduate, startdate, enddate, helthy,examine,examineuser,examinedate,have_passport,conf_agreement,entryexit_filing,conf_name,d.dept_name, d.leader from ${prefix}sys_user u
left join ${prefix}sys_dept d on u.dept_id = d.dept_id
where u.del_flag = '0'
<if test="userId != null and userId != 0">
@ -112,7 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
select distinct u.user_id, u.dept_id, u.login_name, u.user_name, u.user_type, u.email, u.avatar, u.phonenumber, u.status, u.create_time,userarea, nation, birthday, politics, shemichengdu, graduate, startdate, enddate, helthy,examine,examineuser,examinedate
select distinct u.user_id, u.dept_id, u.login_name, u.user_name, u.user_type, u.email, u.avatar, u.phonenumber, u.status, u.create_time,userarea, nation, birthday, politics, shemichengdu, graduate, startdate, enddate, helthy,examine,examineuser,examinedate,have_passport,conf_agreement,entryexit_filing,conf_name
from ${prefix}sys_user u
left join ${prefix}sys_dept d on u.dept_id = d.dept_id
left join ${prefix}sys_user_role ur on u.user_id = ur.user_id
@ -129,7 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
select distinct u.user_id, u.dept_id, u.login_name, u.user_name, u.user_type, u.email, u.avatar, u.phonenumber, u.status, u.create_time,userarea, nation, birthday, politics, shemichengdu, graduate, startdate, enddate, helthy,examine,examineuser,examinedate
select distinct u.user_id, u.dept_id, u.login_name, u.user_name, u.user_type, u.email, u.avatar, u.phonenumber, u.status, u.create_time,userarea, nation, birthday, politics, shemichengdu, graduate, startdate, enddate, helthy,examine,examineuser,examinedate,have_passport,conf_agreement,entryexit_filing,conf_name
from ${prefix}sys_user u
left join ${prefix}sys_dept d on u.dept_id = d.dept_id
left join ${prefix}sys_user_role ur on u.user_id = ur.user_id
@ -226,6 +231,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="examine != null">examine = #{examine},</if>
<if test="examineuser != null">examineuser = #{examineuser},</if>
<if test="examinedate != null">examinedate = #{examinedate},</if>
<if test="havePassport != null">have_passport = #{havePassport},</if>
<if test="confAgreement != null">conf_agreement = #{confAgreement},</if>
<if test="confName != null">conf_name = #{confName},</if>
<if test="entryexitFiling != null">entryexit_filing = #{entryexitFiling},</if>
update_time = now()
</set>
where user_id = #{userId}
@ -260,6 +269,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="examine != null">examine,</if>
<if test="examineuser != null">examineuser,</if>
<if test="examinedate != null">examinedate,</if>
<if test="havePassport != null">have_passport,</if>
<if test="confAgreement != null">conf_agreement,</if>
<if test="confName != null">conf_name,</if>
<if test="entryexitFiling != null">entryexit_filing,</if>
create_time
)values(
<if test="userId != null and userId != ''">#{userId},</if>
@ -289,6 +302,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="examine != null">#{examine},</if>
<if test="examineuser != null">#{examineuser},</if>
<if test="examinedate != null">#{examinedate},</if>
<if test="havePassport != null">#{havePassport},</if>
<if test="confAgreement != null">#{confAgreement},</if>
<if test="confName != null">#{confName},</if>
<if test="entryexitFiling != null">#{entryexitFiling},</if>
now()
)
</insert>

Loading…
Cancel
Save