Explorar el Código

Merge remote-tracking branch 'origin/master'

xubh hace 4 años
padre
commit
9d1be9855f

+ 41 - 12
src/main/java/com/minpay/shouhuo/PersManageAction.java

@@ -84,7 +84,7 @@ public class PersManageAction implements IMINAction {
 	@MINAction(value = PERSON_QUERY)
 	@MINAction(value = PERSON_QUERY)
 	public MINActionResult personQuery(
 	public MINActionResult personQuery(
 			@MINParam(key = "page", defaultValue = "1") int page,
 			@MINParam(key = "page", defaultValue = "1") int page,
-			@MINParam(key = "limit", defaultValue = "3") int limit,
+			@MINParam(key = "limit", defaultValue = "10") int limit,
 			@MINParam(key = "dates") String dates,
 			@MINParam(key = "dates") String dates,
 			@MINParam(key = "perName") String perName,
 			@MINParam(key = "perName") String perName,
 			@MINParam(key = "state") String state,
 			@MINParam(key = "state") String state,
@@ -101,7 +101,7 @@ public class PersManageAction implements IMINAction {
 		p.put("dates", dates);     		// 创建日期
 		p.put("dates", dates);     		// 创建日期
 		p.put("perName", perName); 		//用户名称
 		p.put("perName", perName); 		//用户名称
 		p.put("state", state);     		//状态
 		p.put("state", state);     		//状态
-		if(!u.getBranchId().equals(Constant.ADMINISTRATION_SYSTEM_NUMBER)){
+		if(!Constant.ADMINISTRATION_SYSTEM_NUMBER.equals(u.getBranchId())){
 			p.put("branchId", u.getBranchId());
 			p.put("branchId", u.getBranchId());
 		}
 		}
 		p.put("channel", u.getChannel());//渠道
 		p.put("channel", u.getChannel());//渠道
@@ -132,18 +132,33 @@ public class PersManageAction implements IMINAction {
 	@MINAction(value = PERSON_CANCELLATION)
 	@MINAction(value = PERSON_CANCELLATION)
 	public MINActionResult personCancellation(
 	public MINActionResult personCancellation(
 			MINSession session,
 			MINSession session,
-			@MINParam(key = "id") String id
+			@MINParam(key = "id") String id,
+			@MINParam(key = "riId") String riId
 			) throws MINBusinessException {
 			) throws MINBusinessException {
 		//获取当前用户
 		//获取当前用户
 		User user = session.getUser();
 		User user = session.getUser();
 		MINActionResult res = new MINActionResult();
 		MINActionResult res = new MINActionResult();
+		//用户基本信息
 		VmPersonInf   ps = new VmPersonInf();
 		VmPersonInf   ps = new VmPersonInf();
-		  ps.setId(id);
-		  ps.setStatus("01");//冻结
-		  ps.setModifyTime(DateUtil.getCurrentDateTimeString());//修改时间
-		  ps.setModifyUser(session.getUser().getId());          //修改人
+		ps.setId(id);
+		ps.setStatus("01");//冻结
+		ps.setModifyTime(DateUtil.getCurrentDateTimeString());//修改时间
+		ps.setModifyUser(session.getUser().getId());          //修改人
 		Service.lookup(IMINDataBaseService.class)
 		Service.lookup(IMINDataBaseService.class)
 				.getMybatisMapper(VmPersonInfMapper.class).updateByPrimaryKeySelective(ps);
 				.getMybatisMapper(VmPersonInfMapper.class).updateByPrimaryKeySelective(ps);
+		//关联表
+		VmPersonRoleInf pi = new VmPersonRoleInf();
+		pi.setState("01");
+		pi.setId(riId);
+		//条件
+//		VmPersonRoleInfExample pe = new VmPersonRoleInfExample();
+//		pe.createCriteria().andPersonIdEqualTo(id);
+//		//更新状态
+//		Service.lookup(IMINDataBaseService.class)
+//				.getMybatisMapper(VmPersonRoleInfMapper.class).updateByExampleSelective(pi, pe);
+		Service.lookup(IMINDataBaseService.class)
+				.getMybatisMapper(VmPersonRoleInfMapper.class).updateByPrimaryKeySelective(pi);
+
 		String logInfo = "操作员:"+user.getName()+",注销用户,id:"+id;
 		String logInfo = "操作员:"+user.getName()+",注销用户,id:"+id;
 		Service.lookup(ILogService.class).logging(session, logInfo);
 		Service.lookup(ILogService.class).logging(session, logInfo);
 		return res;
 		return res;
@@ -159,18 +174,32 @@ public class PersManageAction implements IMINAction {
 	@MINAction(value = PERSON_THAW)
 	@MINAction(value = PERSON_THAW)
 	public MINActionResult personThaw(
 	public MINActionResult personThaw(
 			MINSession session,
 			MINSession session,
-			@MINParam(key = "id") String id
+			@MINParam(key = "id") String id,
+			@MINParam(key = "riId") String riId
 			) throws MINBusinessException {
 			) throws MINBusinessException {
 		//获取当前用户
 		//获取当前用户
 		User user = session.getUser();
 		User user = session.getUser();
 		MINActionResult res = new MINActionResult();
 		MINActionResult res = new MINActionResult();
 		VmPersonInf   ps = new VmPersonInf();
 		VmPersonInf   ps = new VmPersonInf();
-		  ps.setId(id);
-		  ps.setStatus("00");//正常
-		  ps.setModifyTime(DateUtil.getCurrentDateTimeString());//修改时间
-		  ps.setModifyUser(session.getUser().getId());          //修改人
+		ps.setId(id);
+		ps.setStatus("00");//正常
+		ps.setModifyTime(DateUtil.getCurrentDateTimeString());//修改时间
+		ps.setModifyUser(session.getUser().getId());          //修改人
 		Service.lookup(IMINDataBaseService.class)
 		Service.lookup(IMINDataBaseService.class)
 				.getMybatisMapper(VmPersonInfMapper.class).updateByPrimaryKeySelective(ps);
 				.getMybatisMapper(VmPersonInfMapper.class).updateByPrimaryKeySelective(ps);
+		//关联表
+		VmPersonRoleInf pi = new VmPersonRoleInf();
+		pi.setState("00");
+		pi.setId(riId);
+//		//条件
+//		VmPersonRoleInfExample pe = new VmPersonRoleInfExample();
+//		pe.createCriteria().andPersonIdEqualTo(id);
+//		//更新状态
+//		Service.lookup(IMINDataBaseService.class)
+//				.getMybatisMapper(VmPersonRoleInfMapper.class).updateByExampleSelective(pi, pe);
+		Service.lookup(IMINDataBaseService.class)
+				.getMybatisMapper(VmPersonRoleInfMapper.class).updateByPrimaryKeySelective(pi);
+
 		String logInfo = "操作员:"+user.getName()+",解冻用户,id:"+id;
 		String logInfo = "操作员:"+user.getName()+",解冻用户,id:"+id;
 		Service.lookup(ILogService.class).logging(session, logInfo);
 		Service.lookup(ILogService.class).logging(session, logInfo);
 		return res;
 		return res;

+ 37 - 33
src/main/resources/com/minpay/db/table/own/mapper/PersonManageMapper.xml

@@ -3,48 +3,52 @@
 <mapper namespace="com.minpay.db.table.own.mapper.PersonManageMapper">
 <mapper namespace="com.minpay.db.table.own.mapper.PersonManageMapper">
 	<select id="personQuery" resultType="hashmap" parameterType="java.lang.String">
 	<select id="personQuery" resultType="hashmap" parameterType="java.lang.String">
 		SELECT
 		SELECT
-			         per.VCI_ID    			"id",
-			         per.VCI_CHANNEL    	"channel",
-			         per.VCI_NAME       	"perName",
-			         per.VCI_TYPE       	"type",
-			         per.VCI_PHONE          "phone",
-			         per.VCI_OPENID     	"openId",
-			         per.VCI_STATUS     	"state",
-			         per.VCI_CREATE_TIME    "createTime",
-			         per.VCI_MODIFY_TIME    "modifyTime",
-			         u.USR_NAME             "createUser",
-			         e.USR_NAME             "modifyUser",
-					per.VCI_ROLE             "role",
-					per.VCI_USER_ID          "branchId",
-					ib.BRH_NAME			 "branchName"
-		  FROM  vm_person_inf  per
-		  left  join im_user    u
-		  on    u.USR_ID = per.VCI_CREATE_USER
-		  left  join im_user    e
-		  on    e.USR_ID = per.VCI_MODIFY_USER
+			per.VCI_ID    			"id",
+			per.VCI_CHANNEL    		"channel",
+			per.VCI_NAME       		"perName",
+			per.VCI_TYPE       		"type",
+			per.VCI_PHONE			"phone",
+			per.VCI_OPENID     		"openId",
+			ri.VPR_STATE     		"state",
+			per.VCI_CREATE_TIME    	"createTime",
+			per.VCI_MODIFY_TIME    	"modifyTime",
+			u.USR_NAME             	"createUser",
+			e.USR_NAME             	"modifyUser",
+			ri.VPR_ROLE				"role",
+			ri.VPR_BRANCH_ID		"branchId",
+			ib.BRH_NAME				"branchName",
+			VPR_ID					"riId"
+	  	FROM vm_person_inf  per
+	  	join vm_person_role_inf ri
+	  	on per.VCI_ID = ri.VPR_PERSON_ID
+	  	left  join im_user    u
+	  	on    u.USR_ID = per.VCI_CREATE_USER
+		left  join im_user    e
+		on    e.USR_ID = per.VCI_MODIFY_USER
 		left  join im_branch    ib
 		left  join im_branch    ib
-		on    ib.BRH_ID = per.VCI_USER_ID
-		  where 1=1 and per.VCI_IS_USER ='1'
-		<if test="branchId!=null  and branchId != ''">
+		on    ib.BRH_ID = ri.VPR_BRANCH_ID
+		where 1=1
+		and per.VCI_IS_USER ='1'
+		<if test="branchId!=null and branchId != ''">
 			and   (per.VCI_USER_ID   =  #{branchId,jdbcType=VARCHAR})
 			and   (per.VCI_USER_ID   =  #{branchId,jdbcType=VARCHAR})
 		</if>
 		</if>
-		  <if test="perName!=null  and perName != ''">
+		<if test="perName!=null  and perName != ''">
 	     	and   (per.VCI_NAME  like  concat('%', #{perName,jdbcType=VARCHAR},'%'))
 	     	and   (per.VCI_NAME  like  concat('%', #{perName,jdbcType=VARCHAR},'%'))
-	   		</if>
-		 <if test="state!=null  and state != ''">
-	     	and   (per.VCI_STATUS =  #{state,jdbcType=VARCHAR})
-	   	 	</if>
-	   	 <if test="channel!=null  and channel != ''">
+		</if>
+		<if test="state!=null  and state != ''">
+	     	and   (ri.VPR_STATE =  #{state,jdbcType=VARCHAR})
+		</if>
+		<if test="channel!=null  and channel != ''">
 	     	and   (per.VCI_CHANNEL =  #{channel,jdbcType=VARCHAR})
 	     	and   (per.VCI_CHANNEL =  #{channel,jdbcType=VARCHAR})
-	   	 	</if>
+		</if>
 		<if test="roleid!=null  and roleid != ''">
 		<if test="roleid!=null  and roleid != ''">
-			and   (per.VCI_ROLE  =  #{roleid,jdbcType=VARCHAR})
+			and   (ri.VPR_ROLE  =  #{roleid,jdbcType=VARCHAR})
 		</if>
 		</if>
-	   	 <if test="dates!=null  and dates != ''">
+		<if test="dates!=null  and dates != ''">
 	     	and substr(per.VCI_CREATE_TIME ,1,8) between substr((#{dates,jdbcType=VARCHAR}),1,8)
 	     	and substr(per.VCI_CREATE_TIME ,1,8) between substr((#{dates,jdbcType=VARCHAR}),1,8)
 	       		and substr((#{dates,jdbcType=VARCHAR}),12,19)
 	       		and substr((#{dates,jdbcType=VARCHAR}),12,19)
-	   	 	</if>	
-		  order by per.VCI_CREATE_TIME desc
+		</if>
+		order by per.VCI_CREATE_TIME desc
 	</select>
 	</select>
 	
 	
 </mapper>
 </mapper>

+ 6 - 3
src/main/webapp/admin/wxuserManage/wxuserManage.html

@@ -80,7 +80,8 @@
 		    ,page: true //开启分页
 		    ,page: true //开启分页
 		    ,cols: [[ //表头
 		    ,cols: [[ //表头
 			{type:'numbers',title: '序号',width:"5%"}
 			{type:'numbers',title: '序号',width:"5%"}
-			, {field: 'id', title: '用户编号', width:"10%", sort: true}
+			,{field: 'id', title: '用户编号', width:"10%", sort: true}
+			,{field: 'riId',title: 'ID', hide:true, width:"0%"}
 			,{field: 'perName', title: '微信号', width:"12%"}
 			,{field: 'perName', title: '微信号', width:"12%"}
 			,{field: 'channelDesc', title: '渠道', width:"9%"}
 			,{field: 'channelDesc', title: '渠道', width:"9%"}
 			,{field: 'roleDesc', title: '角色', width:"12%"}
 			,{field: 'roleDesc', title: '角色', width:"12%"}
@@ -105,6 +106,7 @@
 		    var layEvent = obj.event; //获得 lay-event 对应的值(也可以是表头的 event 参数对应的值)
 		    var layEvent = obj.event; //获得 lay-event 对应的值(也可以是表头的 event 参数对应的值)
 		    var tr = obj.tr; //获得当前行 tr 的DOM对象
 		    var tr = obj.tr; //获得当前行 tr 的DOM对象
 		    var id = data.id;
 		    var id = data.id;
+		    var riId = data.riId;
 		    if(layEvent == 'detail'){ //查看
 		    if(layEvent == 'detail'){ //查看
 		    	showDetail(data);
 		    	showDetail(data);
 		    } else if(layEvent == 'del'){ //删除
 		    } else if(layEvent == 'del'){ //删除
@@ -112,7 +114,8 @@
 			    	$.request({
 			    	$.request({
 						action : '../../PersManageAction/personCancellation',
 						action : '../../PersManageAction/personCancellation',
 						data : {
 						data : {
-							id : id //用户名
+							id : id,
+							riId : riId
 						},
 						},
 						success : function(data) {
 						success : function(data) {
 							 //成功后刷新
 							 //成功后刷新
@@ -137,7 +140,7 @@
 						action : '../../PersManageAction/personThaw',
 						action : '../../PersManageAction/personThaw',
 						data : {
 						data : {
 							id : id,
 							id : id,
-							state : '0'
+							riId : riId
 						},
 						},
 						success : function(data) {
 						success : function(data) {
 							//成功后刷新
 							//成功后刷新