修改页面样式,删除多余字段,增加微信接口

This commit is contained in:
liuwu 2023-08-30 10:08:20 +08:00
parent eb60f6ffec
commit 215f4525ae
7 changed files with 127 additions and 25 deletions

View File

@ -40,6 +40,15 @@ public class TAmentPersonnel extends BaseEntity
/** 部门ID */
@Excel(name = "部门ID")
private Long deptId;
private String deptName;
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
/** 手机号码 */
@Excel(name = "手机号码")

View File

@ -6,9 +6,15 @@ import com.cyx.common.core.domain.AjaxResult;
import com.cyx.common.core.domain.entity.SysUser;
import com.cyx.common.core.page.TableDataInfo;
import com.cyx.common.enums.BusinessType;
import com.cyx.common.utils.StringUtils;
import com.cyx.system.service.ISysUserService;
import com.cyx.web.base.domain.*;
import com.cyx.web.base.service.*;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@ -30,6 +36,34 @@ public class WechatController extends BaseController {
private ITAmentCommitHisService commitHisService;
@Autowired
private ITAmentReviewedHisService reviewedHisService;
@Autowired
private ISysUserService userService;
/**
* 微信小程序获取openId
* @param code
* @return
*/
@GetMapping(value = "/getUserInfo")
public AjaxResult getUserInfo(String code){
SysUser user = userService.selectUserById(1L);
UsernamePasswordToken token = new UsernamePasswordToken(user.getUserName(), user.getPassword(), true);
Subject subject = SecurityUtils.getSubject();
try
{
subject.login(token);
return success();
}
catch (AuthenticationException e)
{
String msg = "用户或密码错误";
if (StringUtils.isNotEmpty(e.getMessage()))
{
msg = e.getMessage();
}
return error(msg);
}
}
/**
* 任务预警

View File

@ -20,6 +20,15 @@
<input name="name" class="form-control" type="text">
</div>
</div>
<div class="form-group col-sm-6 col-md-6">
<label class="col-sm-4 control-label">性别:</label>
<div class="col-sm-8">
<select required name="sex" id="sex" class="form-control ">
<option value="1"></option>
<option value="2"></option>
</select>
</div>
</div>
<div class="form-group col-sm-6 col-md-6">
<label class="col-sm-4 control-label">民族:</label>
<div class="col-sm-8">
@ -27,9 +36,12 @@
</div>
</div>
<div class="form-group col-sm-6 col-md-6">
<label class="col-sm-4 control-label">部门ID</label>
<label class="col-sm-4 control-label">部门:</label>
<div class="col-sm-8">
<input name="deptId" class="form-control" type="text">
<select name="deptId" id="deptId" class="form-control">
<option value="">请选择</option>
</select>
<!-- <input name="deptId" class="form-control" type="text">-->
</div>
</div>
<div class="form-group col-sm-6 col-md-6">
@ -92,9 +104,9 @@
<input name="partyDuties" class="form-control" type="text">
</div>
</div>
<div class="form-group col-sm-6 col-md-6">
<label class="col-sm-4 control-label">备注:</label>
<div class="col-sm-8">
<div class="form-group col-sm-12 col-md-12">
<label class="col-sm-2 control-label">备注:</label>
<div class="col-sm-9">
<textarea name="remark" class="form-control"></textarea>
</div>
</div>
@ -109,6 +121,20 @@
focusCleanup: true
});
$.ajax({
type: "post",
url: ctx + "base/personnel/deptList",
data: {
},
success: function(data) {
var opt = '<option value="">请选择</option>';
data.data.forEach(d=>{
opt += '<option value="'+d.deptId+'">'+d.deptName+'</option>';
})
$("#deptId")[0].innerHTML=opt;
}
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-personnel-add').serialize());

View File

@ -27,9 +27,10 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">部门ID</label>
<label class="col-sm-3 control-label">部门:</label>
<div class="col-sm-8">
<input name="deptId" th:field="*{deptId}" class="form-control" type="text">
<select name="deptId" th:field="*{deptId}" id="deptId" class="form-control">
</select>
</div>
</div>
<div class="form-group">
@ -114,6 +115,24 @@
focusCleanup: true
});
refresh()
function refresh(){
$.ajax({
type: "post",
url: ctx + "base/personnel/deptList",
data: {
},
success: function(data) {
var opt = '<option value="">请选择</option>';
data.data.forEach(d=>{
opt += '<option value="'+d.deptId+'">'+d.deptName+'</option>';
})
$("#deptId")[0].innerHTML=opt;
}
});
}
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-personnel-edit').serialize());

View File

@ -78,14 +78,21 @@
},
{
field: 'sex',
title: '性别'
title: '性别',
formatter: function(value, row, index) {
if(row.sex === '1'){
return '男'
}else if (row.sex === '2'){
return '女'
}
}
},
{
field: 'nation',
title: '民族'
},
{
field: 'deptId',
field: 'deptName',
title: '部门'
},
{

View File

@ -288,6 +288,7 @@ public class ShiroConfig
filterChainDefinitionMap.put("/ajax/**", "anon");
filterChainDefinitionMap.put("/js/**", "anon");
filterChainDefinitionMap.put("/ruoyi/**", "anon");
filterChainDefinitionMap.put("/wx/**", "anon");
filterChainDefinitionMap.put("/captcha/captchaImage**", "anon");
// 退出 logout地址shiro去清除session
filterChainDefinitionMap.put("/logout", "logout");

View File

@ -11,6 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="sex" column="sex" />
<result property="nation" column="nation" />
<result property="deptId" column="dept_id" />
<result property="deptName" column="dept_name" />
<result property="mphone" column="mphone" />
<result property="email" column="email" />
<result property="nativePlace" column="native_place" />
@ -34,23 +35,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectTAmentPersonnelList" parameterType="TAmentPersonnel" resultMap="TAmentPersonnelResult">
<include refid="selectTAmentPersonnelVo"/>
SELECT
b.dept_name,
a.*
FROM
t_ament_personnel a
LEFT JOIN sys_dept b ON a.dept_id = b.dept_id
<where>
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="sex != null and sex != ''"> and sex = #{sex}</if>
<if test="nation != null and nation != ''"> and nation = #{nation}</if>
<if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="mphone != null and mphone != ''"> and mphone = #{mphone}</if>
<if test="email != null and email != ''"> and email = #{email}</if>
<if test="nativePlace != null and nativePlace != ''"> and native_place = #{nativePlace}</if>
<if test="post != null and post != ''"> and post = #{post}</if>
<if test="duties != null and duties != ''"> and duties = #{duties}</if>
<if test="title != null and title != ''"> and title = #{title}</if>
<if test="workDate != null "> and work_date = #{workDate}</if>
<if test="branchId != null "> and branch_id = #{branchId}</if>
<if test="partyDate != null "> and party_date = #{partyDate}</if>
<if test="partyDuties != null and partyDuties != ''"> and party_duties = #{partyDuties}</if>
<if test="unit != null and unit != ''"> and a.unit = #{unit}</if>
<if test="name != null and name != ''"> and a.name like concat('%', #{name}, '%')</if>
<if test="sex != null and sex != ''"> and a.sex = #{sex}</if>
<if test="nation != null and nation != ''"> and a.nation = #{nation}</if>
<if test="deptId != null "> and a.dept_id = #{deptId}</if>
<if test="mphone != null and mphone != ''"> and a.mphone = #{mphone}</if>
<if test="email != null and email != ''"> and a.email = #{email}</if>
<if test="nativePlace != null and nativePlace != ''"> and a.native_place = #{nativePlace}</if>
<if test="post != null and post != ''"> and a.post = #{post}</if>
<if test="duties != null and duties != ''"> and a.duties = #{duties}</if>
<if test="title != null and title != ''"> and a.title = #{title}</if>
<if test="workDate != null "> and a.work_date = #{workDate}</if>
<if test="branchId != null "> and a.branch_id = #{branchId}</if>
<if test="partyDate != null "> and a.party_date = #{partyDate}</if>
<if test="partyDuties != null and partyDuties != ''"> and a.party_duties = #{partyDuties}</if>
</where>
</select>