Commit b02342fb by liulianglang

联络员管理

parent 89e947e2
......@@ -3,16 +3,21 @@ package org.springblade.founder.ztrxyj.controller;
import io.swagger.annotations.ApiOperation;
import org.springblade.founder.tjfx.entity.AjtjParam;
import org.springblade.founder.tjfx.entity.LianTj;
import org.springblade.founder.utils.EasyUIPage;
import org.springblade.founder.utils.R;
import org.springblade.founder.ztrxyj.entity.ZtryBksj;
import org.springblade.founder.ztrxyj.entity.Ztryyjxx;
import org.springblade.founder.ztrxyj.service.ztgjService;
import org.springblade.modules.system.entity.SysNewUser;
import org.springframework.beans.factory.annotation.Autowired;
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.RestController;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/ztgj")
......@@ -75,4 +80,45 @@ public class gjcxController {
}
}
@PostMapping("/selectUserNewList")
public R selectUserNewList(SysNewUser sysNewUser){
try {
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(sysNewUser.getPage());
easyUIPage.setPagePara(sysNewUser.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
sysNewUser.setBegin(begin);
sysNewUser.setEnd(end);
Map<String,Object> map = new HashMap<>();
List<SysNewUser> list = ztService.getUserNewList(sysNewUser);
if(list == null){
return R.error("无权限查看");
}else{
int count = ztService.getUserNewCount(sysNewUser);
map.put("rows",list);
map.put("total",count);
return R.ok().data(map);
}
} catch (Exception e) {
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("/insertUserQh")
@ResponseBody
@ApiOperation(value = "给用户分配区划", notes = "给用户分配区划")
public R insertUserQh(String userIds,String qdIds){
try {
ztService.insertUserQh(userIds,qdIds);
return R.ok();
} catch (Exception e) {
e.printStackTrace();
return R.error(e.getMessage());
}
}
}
package org.springblade.founder.ztrxyj.entity;
import lombok.Data;
import org.springblade.founder.utils.BaseModel;
@Data
public class SysUserLlyqh extends BaseModel {
private String id; //照片
private String userId;
private String qhId;
}
......@@ -2,9 +2,12 @@ package org.springblade.founder.ztrxyj.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.founder.ztrxyj.entity.SysUserLlyqh;
import org.springblade.founder.ztrxyj.entity.ZtryBksj;
import org.springblade.founder.ztrxyj.entity.ZtryYjYhcz;
import org.springblade.founder.ztrxyj.entity.Ztryyjxx;
import org.springblade.modules.system.entity.SysNewUser;
import org.springblade.modules.system.entity.SysUserRolesNew;
import org.springframework.stereotype.Component;
import java.util.List;
......@@ -30,4 +33,17 @@ public interface ztgjMapper {
int insertYjYhcz(ZtryYjYhcz ztryYjYhcz);
int updateYjsc(String xxzjbh);
// 获取用户 个数
int getUserNewCount(SysNewUser sysNewUser)throws Exception;
// 获取用户 列表
List<SysNewUser> getUserNewList(SysNewUser sysNewUser)throws Exception;
List<String> getUserqh(String id);
void deleteUserqh(SysUserLlyqh sysUserLlyqh)throws Exception;
//给用户分配角色
int insertUserqh(SysUserLlyqh SysUserLlyqh )throws Exception;
}
......@@ -6,6 +6,11 @@
values (#{xxzjbh},#{glxxzjbh}, #{xxdjryXm}, #{xxdjryLxdh}, #{xxdjdwGajgmc}, #{xxdjryGmsfhm}, #{xxdjdwGajgjgdm}, now(), #{czlx})
</insert>
<insert id="insertUserqh">
insert into sys_user_llyqh(id,user_id, qh_id, xxsc_pdbz, xxdjdw_gajgjgdm, xxdjdw_gajgmc, xxdjry_xm, xxdjry_gmsfhm, xxdjry_lxdh, djsj, xxczdw_gajgjgdm, xxczdw_gajgmc, xxczry_xm, xxczry_gmsfhm, gxsj)
values (#{id},#{userId}, #{qhId},'0', #{xxdjdwGajgjgdm}, #{xxdjdwGajgmc}, #{xxdjryXm}, #{xxdjryGmsfhm}, #{xxdjryLxdh}, now(), #{xxczdwGajgjgdm}, #{xxczdwGajgmc}, #{xxczryXm}, #{xxczryGmsfhm}, now())
</insert>
<update id="updatesftsZtzp">
update tb_ry_maztryzp set sfts = '3' ,gxsj=now()
where identitycard=#{ certNo , jdbcType=VARCHAR }
......@@ -14,6 +19,26 @@
<update id="updateYjsc">
update tb_maztry_yj set scbz='1',gxsj=now() where xxzjbh = #{xxzjbh}
</update>
<update id="deleteUserqh">
UPDATE sys_user_llyqh SET
gxsj = now(),
<if test="xxczdwGajgjgdm != null and xxczdwGajgjgdm != ''">
xxczdw_gajgjgdm = #{xxczdwGajgjgdm},
</if>
<if test="xxczdwGajgmc != null and xxczdwGajgmc != ''">
xxczdw_gajgmc = #{xxczdwGajgmc},
</if>
<if test="xxczryXm != null and xxczryXm != ''">
xxczry_xm = #{xxczryXm},
</if>
<if test="xxczryGmsfhm != null and xxczryGmsfhm != ''">
xxczry_gmsfhm = #{xxczryGmsfhm},
</if>
xxsc_pdbz = '1'
WHERE
user_id = #{ userId , jdbcType=VARCHAR }
</update>
<select id="getListYjgj" resultType="org.springblade.founder.ztrxyj.entity.Ztryyjxx">
......@@ -272,6 +297,104 @@
select ztry.xm as name,ztry.identitycard as certNo ,ztry.ckzp as imgFace from tb_ry_maztryzp ztry
where ztry.identitycard=#{certNo}
</select>
<select id="getUserNewList" resultType="org.springblade.modules.system.entity.SysNewUser">
SELECT
us.id as id,
(select name from sys_dictitem where groupid='QGCODE_UNIT' AND code=us.unitcode) as unitcode,
us.username as username,
us.password as password,
us.true_name as trueName,
us.open_flag as openFlag,
us.default_model as defaultModel,
us.remark as remark,
us.lrr as lrr,
us.lrsj as lrsj,
us.gxr as gxr,
us.gxsj as gxsj,
us.lrdwdm as lrdwdm,
us.lrdwmc as lrdwmc,
us.identitycard as identitycard,
(select name from sys_dictitem where groupid='CODE_XB' AND code=us.sex) as sex,
us.birthday as birthday,
us.telephone as telephone,
<!--(select name from sys_dictitem where groupid='CODE_UNIT' AND code=us.unitcode) as unitname,-->
(SELECT name FROM sys_dictitem_xz WHERE code = us.unitcode) as unitname,
us.scbz as scbz,
us.ip as ip,
us.grade as grade,
us.policemanid as policemanid,
(select (select name from sys_dictitem where groupid='CODE_XZQH' AND code=lqh.qh_id) as mc from sys_user_llyqh lqh where lqh.user_id=us.id AND lqh.xxsc_pdbz = '0' limit 1 ) qhmc
FROM sys_user us
LEFT JOIN sys_dictitem_xz xz ON us.unitcode = xz.code
<if test="roleId != null and roleId != ''">
RIGHT JOIN (
SELECT DISTINCT
ur.user_id id
FROM
sys_user_llyqh ur
WHERE
ur.qh_id = #{roleId}
AND ur.xxsc_pdbz = '0'
) a ON us.id = a.id
</if>
<include refid="user-where"/>
order by us.lrsj desc
limit #{begin}, #{end}
</select>
<select id="getUserNewCount" resultType="java.lang.Integer">
SELECT count(*)
FROM sys_user us
LEFT JOIN sys_dictitem_xz xz ON us.unitcode = xz.code
<if test="roleId != null and roleId != ''">
RIGHT JOIN (
SELECT DISTINCT
ur.user_id id
FROM
sys_user_llyqh ur
WHERE
ur.qh_id = #{roleId}
AND ur.xxsc_pdbz = '0'
) a ON us.id = a.id
</if>
<include refid="user-where"/>
</select>
<select id="getUserqh" resultType="java.lang.String">
SELECT
urole.qh_id
FROM sys_user_llyqh urole
where urole.xxsc_pdbz='0' and urole.user_id=#{ id , jdbcType=VARCHAR }
</select>
<sql id="user-where">
WHERE
us.scbz = '0'
and xz.${codeLevCol} = #{userUnitCode}
<if test="username != null and username != ''">
and us.username LIKE concat('%',#{username},'%')
</if>
<if test="trueName != null and trueName != ''">
and us.true_name LIKE concat('%',#{trueName},'%')
</if>
<if test="policemanid != null and policemanid != ''">
and us.policemanid = #{ policemanid , jdbcType=VARCHAR }
</if>
<if test="openFlag != null and openFlag != ''">
and us.open_flag = #{ openFlag, jdbcType=VARCHAR }
</if>
<if test="unitcode != null and unitcode != ''">
and us.unitcode = #{ unitcode, jdbcType=VARCHAR }
</if>
<if test="sfjg != null and sfjg != ''">
and ${sfzsjgsql}
</if>
</sql>
</mapper>
......@@ -3,7 +3,9 @@ package org.springblade.founder.ztrxyj.service;
import org.springblade.founder.ztrxyj.entity.ZtryBksj;
import org.springblade.founder.ztrxyj.entity.Ztryyjxx;
import org.springblade.modules.system.entity.SysNewUser;
import java.util.List;
import java.util.Map;
public interface ztgjService {
......@@ -17,4 +19,14 @@ public interface ztgjService {
Map<String, Object> deleteBkzp(String certNo);
Map<String, Object> deleteYjjl(String xxzjbh);
// 获取用户 列表
List<SysNewUser> getUserNewList(SysNewUser sysNewUser)throws Exception;
// 获取用户 个数
int getUserNewCount(SysNewUser sysNewUser)throws Exception;
//给用户分配角色
void insertUserQh(String userIds,String qdIds)throws Exception;
}
......@@ -2,10 +2,13 @@ package org.springblade.modules.auth.utils;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.codec.binary.Base64;
import org.springblade.founder.utils.NumberUtil;
import org.springblade.modules.system.entity.User;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import java.math.RoundingMode;
import java.text.DecimalFormat;
/**
* @author szLi
......@@ -49,5 +52,15 @@ public class SecurityUtil {
jsonObj.put("policemanid","100001");
String userToken = SecurityUtil.encrypt(JSONObject.toJSONString(jsonObj),"xzeq2021@zhyy#54");
System.out.println(userToken);
System.out.println(NumberUtil.getTbhb(603,772));
double sajeZs=4600;
DecimalFormat df = new DecimalFormat("0.##");
df.setRoundingMode(RoundingMode.HALF_UP);
String zwje;
double yy = sajeZs / 100000000;
zwje = df.format(yy) ;
System.out.println(zwje);
}
}
......@@ -21,7 +21,10 @@ public class SysNewUser extends BaseModel {
private String oldPassword;
private String newPassword;
private String newPassword1;
private String sfbhxj; //是否包含下级(包含-1,不包含-0或者不选)
private String sfjg;
private String sfzsjgsql;
private String qhmc;
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
......
####################云天励飞请求token配置参数##开始#################
token_url=http://26.3.12.56:8083/api/oauth/token
#header
Authorization=Basic Y2xpZW50YXBwOjEyMzQ1Ng==
Content-Type=application/x-www-form-urlencoded
#body
username=fzuser
password=5397cc0fe5a1ef4b6be36b6352012787
grant_type=password
scope=read write
client_secret=123456
client_id=clientapp
#token\u503C
token=
#\u8FC7\u671F\u65F6\u95F4
expiration=
####################云天励飞请求token配置参数##结束#################
####################海南凯亚请求token配置参数##开始#################
token_urlKy=http://74.10.30.174:18093
#body
usernameKy=xingjdj
#token\u503C
tokenKy=
#\u8FC7\u671F\u65F6\u95F4
expirationKy=
####################海南凯亚请求token配置参数##结束#################
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment