Commit b7eb77e8 by mayunfei

联络员新增类型

parent 2e18e6e8
...@@ -50,6 +50,16 @@ public class TbYwZczlLly extends BaseModel{ ...@@ -50,6 +50,16 @@ public class TbYwZczlLly extends BaseModel{
private Date gxsj = null;//更新时间 private Date gxsj = null;//更新时间
private String ywlx = null;
public String getYwlx() {
return ywlx;
}
public void setYwlx(String ywlx) {
this.ywlx = ywlx;
}
public String getXxzjbh() { public String getXxzjbh() {
return xxzjbh; return xxzjbh;
} }
......
...@@ -715,15 +715,17 @@ public class ZczlController { ...@@ -715,15 +715,17 @@ public class ZczlController {
*/ */
@RequestMapping("/queryLlys") @RequestMapping("/queryLlys")
@ResponseBody @ResponseBody
public String queryLlys(@RequestParam(value = "unitcodes") String unitcodes,HttpServletRequest request){ public String queryLlys(@RequestParam(value = "unitcodes") String unitcodes,
@RequestParam(value = "ywlx") String ywlx,
HttpServletRequest request){
String message = "1"; String message = "1";
if(unitcodes!=null&&!"".equals(unitcodes.trim())){ if(unitcodes!=null&&!"".equals(unitcodes.trim())){
String[] unitArr = unitcodes.split(","); String[] unitArr = unitcodes.split(",");
if(unitArr!=null&&unitArr.length>0){ if(unitArr!=null&&unitArr.length>0){
for(int i=0;i<unitArr.length;i++){ for(int i=0;i<unitArr.length;i++){
String unit = unitArr[i]; String unit = unitArr[i];
//判断该单位是否存在联络员 //判断该单位是否存在该类型的联络员
boolean bool = zczlService.ifCzlly(unit); boolean bool = zczlService.ifCzlly(unit,ywlx);
//不存在 //不存在
if(!bool){ if(!bool){
//根据单位代码查询该单位的单位名 //根据单位代码查询该单位的单位名
...@@ -1029,9 +1031,9 @@ public class ZczlController { ...@@ -1029,9 +1031,9 @@ public class ZczlController {
} }
}else{ }else{
//不存在联络员或联络员个数小于2 //不存在联络员或联络员个数小于2
if(tbYwZczlLlyList==null||tbYwZczlLlyList.size()<2){ //if(tbYwZczlLlyList==null||tbYwZczlLlyList.size()<2){
bool = true; bool = true;
} //}
} }
if(bool){ if(bool){
message = "1";//可以设置联络员 message = "1";//可以设置联络员
...@@ -3324,6 +3326,20 @@ public class ZczlController { ...@@ -3324,6 +3326,20 @@ public class ZczlController {
} }
/** /**
* 拿到对应人员的联络员权限
* @return
*/
@RequestMapping("/getLlyqxByUserId")
@ResponseBody
public JSONArray getLlyqxByUserId(String userId){
List<String> qxList = new ArrayList<>();
Map map = zczlService.getLlyqxByUserId(userId);
qxList = (List)map.get("qxList");
JSONArray jsonArray = JSONArray.fromObject(qxList);
return jsonArray;
}
/**
* 权限分配 * 权限分配
* @return * @return
*/ */
...@@ -3345,6 +3361,18 @@ public class ZczlController { ...@@ -3345,6 +3361,18 @@ public class ZczlController {
return flag; return flag;
} }
/**
* 权限分配
* @return
*/
@RequestMapping("/doLlyQxfp")
@ResponseBody
public String doLlyQxfp(TbYwZczlLly tbYwZczlLly){
String flag = "0";
flag = zczlService.doLlyQxfp(tbYwZczlLly);
return flag;
}
//审批权限查询与设置--end //审批权限查询与设置--end
} }
......
...@@ -17,6 +17,8 @@ public interface ZczlDao { ...@@ -17,6 +17,8 @@ public interface ZczlDao {
List<TbYwZczlLly> getLlysPolicemanId(String unitcode); List<TbYwZczlLly> getLlysPolicemanId(String unitcode);
List<TbYwZczlLly> getLlysByMap(Map map);
List<TbYwZczl> toQueryAllWfzdzczl(TbYwZczl tbYwZczl); List<TbYwZczl> toQueryAllWfzdzczl(TbYwZczl tbYwZczl);
Integer toQueryAllWfzdzczlForTotal(TbYwZczl tbYwZczl); Integer toQueryAllWfzdzczlForTotal(TbYwZczl tbYwZczl);
...@@ -155,9 +157,13 @@ public interface ZczlDao { ...@@ -155,9 +157,13 @@ public interface ZczlDao {
TbYwZczlSpqx getFpqxxxByUserId(String userId); TbYwZczlSpqx getFpqxxxByUserId(String userId);
TbYwZczlLly getLlyqxByUserId(String userId);
void insertQxfp(TbYwZczlSpqx tbYwZczlSpqx); void insertQxfp(TbYwZczlSpqx tbYwZczlSpqx);
int updateQxfp(TbYwZczlSpqx tbYwZczlSpqx); int updateQxfp(TbYwZczlSpqx tbYwZczlSpqx);
int updateLlyQxfp(TbYwZczlLly tbYwZczlLly);
List<String> queryAllUserIdByYwlx(String startId); List<String> queryAllUserIdByYwlx(String startId);
} }
...@@ -68,7 +68,7 @@ public interface IZczlService { ...@@ -68,7 +68,7 @@ public interface IZczlService {
boolean tqspOrDel(TbYwZczl tbYwZczl); boolean tqspOrDel(TbYwZczl tbYwZczl);
boolean ifCzlly(String unit); boolean ifCzlly(String unit,String ywlx);
String getUnitnameByUnitcode(String unit); String getUnitnameByUnitcode(String unit);
...@@ -146,5 +146,9 @@ public interface IZczlService { ...@@ -146,5 +146,9 @@ public interface IZczlService {
Map getFpqxxxByUserId(String userId); Map getFpqxxxByUserId(String userId);
Map getLlyqxByUserId(String userId);
String doQxfp(TbYwZczlSpqx tbYwZczlSpqx); String doQxfp(TbYwZczlSpqx tbYwZczlSpqx);
String doLlyQxfp(TbYwZczlLly tbYwZczlLly);
} }
...@@ -569,6 +569,7 @@ public class ZczlService implements IZczlService { ...@@ -569,6 +569,7 @@ public class ZczlService implements IZczlService {
}else{ }else{
//遍历list,拼接单位的字符串 //遍历list,拼接单位的字符串
for(int i=0;i<list.size();i++){ for(int i=0;i<list.size();i++){
if(i<500){ if(i<500){
if(i==0){ if(i==0){
inString = "('"+list.get(i)+"'"; inString = "('"+list.get(i)+"'";
...@@ -578,15 +579,16 @@ public class ZczlService implements IZczlService { ...@@ -578,15 +579,16 @@ public class ZczlService implements IZczlService {
inString = inString+",'"+list.get(i)+"')"; inString = inString+",'"+list.get(i)+"')";
} }
}else{ }else{
if(i==500){ if(i == list.size() -1 && i % 500 == 0){
inString = inString + "or UNITCODE in ('"+list.get(i)+"'"; inString = inString + "or UNITCODE in ('"+list.get(i)+"'";
}else if(i!=list.size()-1){ }else if(i % 500 == 0){
inString = inString + "or UNITCODE in ('"+list.get(i)+"'";
}else if((i+1) % 500 != 0 && i!=list.size()-1){
inString = inString+",'"+list.get(i)+"'"; inString = inString+",'"+list.get(i)+"'";
}else{ }else{
inString = inString+",'"+list.get(i)+"')"; inString = inString+",'"+list.get(i)+"')";
} }
} }
} }
} }
searchUnitcode = inString; searchUnitcode = inString;
...@@ -774,11 +776,14 @@ public class ZczlService implements IZczlService { ...@@ -774,11 +776,14 @@ public class ZczlService implements IZczlService {
* @return * @return
*/ */
@Override @Override
public boolean ifCzlly(String unit) { public boolean ifCzlly(String unit,String ywlx) {
boolean bool = false; boolean bool = false;
Map map = new HashMap();
map.put("unitcode",unit);
map.put("ywlx",ywlx);
try{ try{
List<TbYwZczlLly> llyxx = null; List<TbYwZczlLly> llyxx = null;
llyxx = zczlDao.getLlysPolicemanId(unit); llyxx = zczlDao.getLlysByMap(map);
if(llyxx!=null&&llyxx.size()>0){ if(llyxx!=null&&llyxx.size()>0){
bool = true; bool = true;
} }
...@@ -1883,6 +1888,26 @@ public class ZczlService implements IZczlService { ...@@ -1883,6 +1888,26 @@ public class ZczlService implements IZczlService {
return map; return map;
} }
@Override
public Map getLlyqxByUserId(String userId) {
List<String> qxList = new ArrayList<>();
String qxStr = null;
TbYwZczlLly llyqx = zczlDao.getLlyqxByUserId(userId);
if(llyqx!=null){
qxStr = llyqx.getYwlx();
if(qxStr!=null&&!"".equals(qxStr.trim())){//权限不为空
String[] qxArr = qxStr.split(",");
for(int i=0;i<qxArr.length;i++){
qxList.add(qxArr[i]);
}
}
}
Map map = new HashMap();
map.put("qxStr",qxStr);
map.put("qxList",qxList);
return map;
}
/** /**
* 新增或更新权限信息 * 新增或更新权限信息
* @param tbYwZczlSpqx * @param tbYwZczlSpqx
...@@ -1914,5 +1939,22 @@ public class ZczlService implements IZczlService { ...@@ -1914,5 +1939,22 @@ public class ZczlService implements IZczlService {
return flag; return flag;
} }
/**
* 新增或更新权限信息
* @param tbYwZczlLly
* @return
*/
@Override
public String doLlyQxfp(TbYwZczlLly tbYwZczlLly){
String flag = "0";
try{
int t = zczlDao.updateLlyQxfp(tbYwZczlLly);
flag = ""+t;
} catch (Exception e) {
throw new BaseException("修改审批权限出错!",e);
}
return flag;
}
//审批权限查询与设置--end //审批权限查询与设置--end
} }
spring.datasource.url=jdbc:oracle:thin:@192.168.0.108:1521:XZXT spring.datasource.url=jdbc:oracle:thin:@192.168.0.103:1521:XZXT
spring.datasource.username=XZXT spring.datasource.username=XZXT
spring.datasource.password=XZXT spring.datasource.password=XZXT
spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
......
...@@ -7,6 +7,15 @@ ...@@ -7,6 +7,15 @@
select * from TB_YW_ZCZL_LLY where unitcode= #{unitcode, jdbcType=VARCHAR} and xxscpdbz='0' select * from TB_YW_ZCZL_LLY where unitcode= #{unitcode, jdbcType=VARCHAR} and xxscpdbz='0'
</select> </select>
<!-- 拿到本单位类型联络员 -->
<select id="getLlysByMap" parameterType="java.util.Map" resultType="com.founder.model.TbYwZczlLly">
select * from TB_YW_ZCZL_LLY
where
unitcode=#{unitcode, jdbcType=VARCHAR}
and instr(ywlx,#{ywlx, jdbcType=VARCHAR}) > 0
and xxscpdbz='0'
</select>
<sql id="wfzdzczl-where"> <sql id="wfzdzczl-where">
<if test="zlwh!=null and zlwh!=''">and zczl.zlwh like '%'||#{zlwh, jdbcType=VARCHAR}||'%'</if> <if test="zlwh!=null and zlwh!=''">and zczl.zlwh like '%'||#{zlwh, jdbcType=VARCHAR}||'%'</if>
<if test="zczlbh!=null and zczlbh!=''">and zczl.zczlbh like '%'||#{zczlbh, jdbcType=VARCHAR}||'%'</if> <if test="zczlbh!=null and zczlbh!=''">and zczl.zczlbh like '%'||#{zczlbh, jdbcType=VARCHAR}||'%'</if>
...@@ -199,6 +208,7 @@ ...@@ -199,6 +208,7 @@
zczl.ZDSPRJH zdsprjh, zczl.ZDSPRJH zdsprjh,
zczl.SPYJ spyj zczl.SPYJ spyj
from TB_YW_ZCZL zczl where 1=1 and zczl.xxscpdbz = '0' from TB_YW_ZCZL zczl where 1=1 and zczl.xxscpdbz = '0'
and instr((select ywlx from TB_YW_ZCZL_LLY lly where lly.sfzh = #{qsrgmsfhm, jdbcType=VARCHAR} and lly.xxscpdbz = 0 ),zczl.ywlx) > 0
<include refid="wfzdzczl-where"/> <include refid="wfzdzczl-where"/>
) t ) t
WHERE ROWNUM <![CDATA[<=]]> #{end} WHERE ROWNUM <![CDATA[<=]]> #{end}
...@@ -207,6 +217,7 @@ ...@@ -207,6 +217,7 @@
<select id="toQueryAllWfzdzczlForTotal" parameterType="com.founder.model.TbYwZczl" resultType="java.lang.Integer"> <select id="toQueryAllWfzdzczlForTotal" parameterType="com.founder.model.TbYwZczl" resultType="java.lang.Integer">
select count(*) from TB_YW_ZCZL zczl where 1=1 and zczl.xxscpdbz = '0' select count(*) from TB_YW_ZCZL zczl where 1=1 and zczl.xxscpdbz = '0'
and instr((select ywlx from TB_YW_ZCZL_LLY lly where lly.sfzh = #{qsrgmsfhm, jdbcType=VARCHAR} and lly.xxscpdbz = 0 ),zczl.ywlx) > 0
<include refid="wfzdzczl-where"/> <include refid="wfzdzczl-where"/>
</select> </select>
...@@ -699,6 +710,7 @@ ...@@ -699,6 +710,7 @@
TRUENAME truename, TRUENAME truename,
TELEPHONE telephone, TELEPHONE telephone,
XXDJRYXM xxdjryxm, XXDJRYXM xxdjryxm,
ywlx ywlx,
(select name from sys_dictitem where groupid='CODE_UNIT' and code=XXDJDWGAJGJGDM) as xxdjdwgajgjgdm, (select name from sys_dictitem where groupid='CODE_UNIT' and code=XXDJDWGAJGJGDM) as xxdjdwgajgjgdm,
to_char(DJSJ,'yyyy-MM-dd hh24:mi:ss') as djsj to_char(DJSJ,'yyyy-MM-dd hh24:mi:ss') as djsj
from TB_YW_ZCZL_LLY where 1=1 and XXSCPDBZ = '0' from TB_YW_ZCZL_LLY where 1=1 and XXSCPDBZ = '0'
...@@ -1772,6 +1784,13 @@ ...@@ -1772,6 +1784,13 @@
<include refid="spqx-where"/> <include refid="spqx-where"/>
</select> </select>
<select id="getLlyqxByUserId" parameterType="java.lang.String" resultType="com.founder.model.TbYwZczlLly">
select XXZJBH as xxzjbh,
USERID as userId,
YWLX as ywlx
from TB_YW_ZCZL_LLY where XXSCPDBZ=0 and USERID= #{userId, jdbcType=VARCHAR}
</select>
<select id="getFpqxxxByUserId" parameterType="java.lang.String" resultType="com.founder.model.TbYwZczlSpqx"> <select id="getFpqxxxByUserId" parameterType="java.lang.String" resultType="com.founder.model.TbYwZczlSpqx">
select XXZJBH as xxzjbh, select XXZJBH as xxzjbh,
USERID as userId, USERID as userId,
...@@ -1843,6 +1862,14 @@ ...@@ -1843,6 +1862,14 @@
where USERID=#{userId,jdbcType=VARCHAR} where USERID=#{userId,jdbcType=VARCHAR}
</update> </update>
<update id="updateLlyQxfp" parameterType="com.founder.model.TbYwZczlSpqx" >
update TB_YW_ZCZL_LLY
set
GXSJ = sysdate
,YWLX =#{ywlx,jdbcType=VARCHAR}
where XXSCPDBZ=0 and USERID=#{userId,jdbcType=VARCHAR}
</update>
<select id="queryAllUserIdByYwlx" parameterType="java.lang.String" resultType="java.lang.String"> <select id="queryAllUserIdByYwlx" parameterType="java.lang.String" resultType="java.lang.String">
select USERID as userId select USERID as userId
from TB_YW_ZCZL_SPQX spqx ,SYS_USER u where spqx.xxsc_pdbz=0 and spqx.ywlx like '%'||#{startId, jdbcType=VARCHAR}||'%' from TB_YW_ZCZL_SPQX spqx ,SYS_USER u where spqx.xxsc_pdbz=0 and spqx.ywlx like '%'||#{startId, jdbcType=VARCHAR}||'%'
......
$(function(){ $(function(){
doQuery(); doQuery();
getAllYwlx();
}) })
function getColumn(row){ function getColumn(row){
var str = ""; var str = "";
if(row.sflly=='1'){ if(row.sflly=='1'){
str = "<a href=\"#\" onclick=\"del('"+row.xxzjbh+"');\" class=\"cz\"><span style='color: #f70909;'>删除</span></a>"; str = "<a href=\"#\" onclick=\"del('"+row.xxzjbh+"');\" class=\"cz\"><span style='color: #f70909;'>删除</span></a>";
str = str + " <a href=\"#\" onclick=\"yj_tk(this,event,'"+row.xxzjbh+"');\" class=\"cz pos\"><span style='color: #7fd015;'>移交</span><div class=\"right_po\"><table><thead><tr><th width=\"100%\">联络员姓名</th></tr></thead><tbody></tbody></tbody></table></div></a>" str += " <a href=\"#\" onclick=\"getQx('"+row.userId+"');\" class=\"cz\"><span style='color: #7fd015;'>设置联络员类型</span></a>"
}else{ }else{
str = "<a href=\"#\" onclick=\"setLly('"+row.userId+"');\" class=\"cz\"><span style='color: #7fd015;'>设置联络员</span></a>" str = "<a href=\"#\" onclick=\"setLly('"+row.userId+"');\" class=\"cz\"><span style='color: #7fd015;'>设置联络员</span></a>"
} }
...@@ -14,6 +15,116 @@ function getColumn(row){ ...@@ -14,6 +15,116 @@ function getColumn(row){
return str; return str;
} }
//显示设置权限界面
function getQx(userId){
$('.mask').show();
$('.layout').fadeIn(800);
$("#userId").val(userId);
//通过该人的userId查询具有的业务
var index = layer.load(1, {
content: '数据加载中...',
shade: [0.35,'#fff'],
success: function(layero) {
/*layero.css('padding-left', '30px');*/
layero.find('.layui-layer-content').css({
'padding-top': '40px',
'width': '70px',
'background-position-x': '16px'
});
}
});
$.ajax({
url:'/getLlyqxByUserId?userId='+userId,
type:"post",
success:function (data) {
layer.close(index);
if(data.length>0){
for(var i=0;i<data.length;i++){
var id = "ywlx"+data[i];
$('#'+id).prop("checked",true);
}
}
}
});
}
//分配权限
function doQxfp(){
var length = $('input[type=checkbox]:checked').length;
if(length<=0){
layer.alert("分配权限必选!","提示");
return;
}
var index = layer.load(1, {
content: '数据加载中...',
shade: [0.35,'#fff'],
success: function(layer) {
/*layer.css('padding-left', '30px');*/
layer.find('.layui-layer-content').css({
'padding-top': '40px',
'width': '70px',
'background-position-x': '16px'
});
}
});
$.ajax({
type: "POST",//方法类型
dataType: "json",//预期服务器返回的数据类型
url: "/doLlyQxfp",
data: $('#qxForm').serialize(),
success: function (data) {
layer.close(index);
if(data==0){
layer.alert('分配权限失败',"提示",function(res){
if(res){
layer.closeAll();
}
});
}else if(data==1){
layer.alert('分配权限成功',"提示",function(res){
if(res){
doBack();
doQuery();
layer.closeAll();
}
});
}
},
error : function() {
layer.close(index);
layer.alert('分配权限失败',"提示",function(res){
if(res){
layer.closeAll();
}
});
}
});
}
function doBack(){
$("#userId").val("");
$('.mask').hide();
$('.layout').fadeOut(500);
//清空所有选项
$('#checkboxTd').find("input[name='ywlx']").prop("checked",false);;
}
function getAllYwlx(){
$.ajax({
url:'/getAllYwlx',
type:"post",
success:function (data) {
var nr="";
for(var i=0;i<data.length;i++){
nr = nr +' <input class="ywlxClass" type=\"checkbox\" name=\"ywlx\" id="ywlx'+data[i].code+'" value="'+data[i].code+'" style=\"width: auto;zoom:150%;margin-top: 0px;\">'+data[i].name;
}
$("#checkboxTd").append(nr);
}
});
}
function yj_tk(el,event,xxzjbh) { function yj_tk(el,event,xxzjbh) {
//查询出本单位的联络员信息 //查询出本单位的联络员信息
var index = layer.load(1, { var index = layer.load(1, {
...@@ -218,7 +329,6 @@ function setLly(userId){ ...@@ -218,7 +329,6 @@ function setLly(userId){
} }
}); });
} }
} }
}); });
} }
......
...@@ -209,5 +209,34 @@ ...@@ -209,5 +209,34 @@
openCombotree('unitcode'); openCombotree('unitcode');
</script> </script>
</body> </body>
<div class="mask"></div>
<div class="layout">
<div class="layout_header">
<span>权限信息</span>
<%--<a class="close_x fr" id="close_x"><i class="fa fa-times"></i></a>--%>
</div>
<form name="qxForm" id="qxForm">
<input name="userId" id="userId" type="hidden">
<div class="layout_content">
<table class="layout_table">
<tr>
<td class="ar" width="15%">权限:</td>
<td colspan="3" style="color: #f60;" id="checkboxTd">
</td>
</tr>
<tr>
<td class="empty" colspan="4"></td>
</tr>
<tr>
<td colspan="4" style="text-align:center;">
<a class="btn_a btn_add" onclick="doQxfp()">分配</a>
<a class="btn_a btn_search" onclick="doBack()">返回</a>
</td>
</tr>
</table>
</div>
</form>
</div>
</html> </html>
\ No newline at end of file
...@@ -398,7 +398,7 @@ ...@@ -398,7 +398,7 @@
} }
//判断单位是否存在联络员 //判断单位是否存在联络员
$.ajax({ $.ajax({
url:'/queryLlys?unitcodes='+zljsdwdm, url:'/queryLlys?unitcodes='+zljsdwdm+"&ywlx="+ywlx,
type:"post", type:"post",
success:function (data) { success:function (data) {
layer.close(index); layer.close(index);
...@@ -468,7 +468,7 @@ ...@@ -468,7 +468,7 @@
//判断单位是否存在联络员 //判断单位是否存在联络员
$.ajax({ $.ajax({
url:'/queryLlys?unitcodes='+zljsdwdm, url:'/queryLlys?unitcodes='+zljsdwdm+"&ywlx="+ywlx,
type:"post", type:"post",
success:function (data) { success:function (data) {
layer.close(index); layer.close(index);
......
...@@ -421,7 +421,7 @@ ...@@ -421,7 +421,7 @@
} }
//判断单位是否存在联络员 //判断单位是否存在联络员
$.ajax({ $.ajax({
url:'/queryLlys?unitcodes='+zljsdwdm, url:'/queryLlys?unitcodes='+zljsdwdm+"&ywlx="+ywlx,
type:"post", type:"post",
success:function (data) { success:function (data) {
layer.close(index); layer.close(index);
...@@ -491,7 +491,7 @@ ...@@ -491,7 +491,7 @@
//判断单位是否存在联络员 //判断单位是否存在联络员
$.ajax({ $.ajax({
url:'/queryLlys?unitcodes='+zljsdwdm, url:'/queryLlys?unitcodes='+zljsdwdm+"&ywlx="+ywlx,
type:"post", type:"post",
success:function (data) { success:function (data) {
layer.close(index); layer.close(index);
......
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