Commit 3771a7e7 by Guojunfeng

1、侦查角色表改物理删除

2、修复分享侦查专项未审批就能看到的bug
3、分享添加不能重复分享同一单位限制(待审批或已分享状态)
parent b544cc7a
......@@ -185,13 +185,15 @@ public class ApproveController extends ApiController {
String auditStatus = approveDto.getAuditStatus();//审批状态
//如果审批类型是“侦查专项取消分享审批” 且 审批状态是“审批通过”,去侦查专项角色表(tb_wh_zczx_role)把对应的分享数据删掉
if (StringUtils.isNotBlank(auditType) && auditType.equals("9") && StringUtils.isNotBlank(auditStatus) && auditStatus.equals("2")) {
UpdateWrapper<ZczxRole> zczxRoleUpdateWrapper = new UpdateWrapper<>();
zczxRoleUpdateWrapper.eq("id", approveDto.getFlowNo());//审批编号(连接具体业务表的数据主键)
ZczxRole zczxRole = new ZczxRole();
zczxRole.setXxscPdbz("1");
zczxRoleService.update(zczxRole, zczxRoleUpdateWrapper);
// String flowNo = approveDto.getFlowNo();//审批编号(连接具体业务表的数据主键)
// zczxRoleService.removeById(flowNo);
// UpdateWrapper<ZczxRole> zczxRoleUpdateWrapper = new UpdateWrapper<>();
// zczxRoleUpdateWrapper.eq("id", approveDto.getFlowNo());//审批编号(连接具体业务表的数据主键)
// ZczxRole zczxRole = new ZczxRole();
// zczxRole.setXxscPdbz("1");
// zczxRoleService.update(zczxRole, zczxRoleUpdateWrapper);
//物理删除,避免太多冗余数据
String flowNo = approveDto.getFlowNo();//审批编号(连接具体业务表的数据主键)
zczxRoleService.removeById(flowNo);
}
//如果审批类型时"移交" 且 审批状态是 "审批通过",去子任务表(tb_wh_subtask)把接收人等字段覆盖掉
......
......@@ -98,17 +98,19 @@ public class XcrwController extends ApiController {
//根据不同的类型,设置推送给不同的接收人(单位账号)
if (StringUtils.isNotBlank(xcrwlx) && "1".equals(xcrwlx)) {
zczx.setSffqjzypPdbz("1");
xcrw.setXcrwjsrzh("441917000000");//技侦网合
xcrw.setXcrwjsrzh("441917000000");//市局技侦网合
xcrw.setXcrwjsrdwdm("441917000000");//接收人单位代码
} else if (StringUtils.isNotBlank(xcrwlx) && "2".equals(xcrwlx)) {
zczx.setSffqsjwjwhPdbz("1");
xcrw.setXcrwjsrzh("441905000000");//网警网合
xcrw.setXcrwjsrzh("441905000000");//市局网警网合
xcrw.setXcrwjsrdwdm("441905000000");//接收人单位代码
} else if (StringUtils.isNotBlank(xcrwlx) && "3".equals(xcrwlx)) {
zczx.setSffqsjqbwhPdbz("1");
xcrw.setXcrwjsrzh("441933020000");//情报网合
xcrw.setXcrwjsrzh("441933020000");//市局情报网合
xcrw.setXcrwjsrdwdm("441933020000");//接收人单位代码
} else if (StringUtils.isNotBlank(xcrwlx) && "4".equals(xcrwlx)) {
//分局网合也是指定的接收账号,用户表新建各分局的分局网合公共账号,还没确定字典和用户入库!!!!!!!!
zczx.setSffqfjwhPdbz("1");//分局网合
String substring = unitcode.substring(0, 6);
substring = substring + "000000";//不是在循环体内不考虑并发
......
......@@ -2,7 +2,6 @@ package com.founder.publicapi.controller.ZczxService;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.api.ApiController;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -28,6 +27,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;
/**
* @author Godffy
......@@ -143,6 +143,27 @@ public class ZczxController extends ApiController {
public MapRestResult share(@RequestBody ZczxDto zczxDto) {
//分享给某单位时,提供一个接口告诉前端哪些单位分享过,分享过的灰色不能选中,不要重复插入(包括未审批的)
//分享申请单提交前,要先查一下数据库里,专项角色表中有没有这条数据.
QueryWrapper<ZczxRole> qw = new QueryWrapper<>();
// 按专项编号查询
qw.eq(StringUtils.isNotBlank(zczxDto.getZxbh()), "ZXBH", zczxDto.getZxbh());
// 按分享状态查询
qw.eq("ZCZX_FXZT", "1");
qw.eq("xxsc_pdbz", "0");
qw.orderByDesc("RKSJ");
List<ZczxRole> list = this.zczxRoleService.list(qw);
//角色表中有这条数据证明该分享单位已处于待审批或已分享状态
String targetUnitCode = zczxDto.getTargetUnitCode();//目标分享单位代码
String targetUnitName = zczxDto.getTargetUnitName();//目标分享单位名称
for (int i = 0; i < list.size(); i++) {
ZczxRole zczxRole = list.get(i);
String unitcode = zczxRole.getUnitcode();
if (unitcode.equals(targetUnitCode)) {
return new MapRestResult(201, "该侦查专项分享至【"+targetUnitName+"】已处于待审批状态或已分享状态!", null);
}
}
//当前登陆人的信息
ServletRequestAttributes requestAttributes =
(ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
......@@ -219,7 +240,7 @@ public class ZczxController extends ApiController {
qw.eq("audit_status", "1");
Approve one = approveService.getOne(qw);
if (one != null) {
return new MapRestResult(201,"该单位的取消分享已处于待审批状态,不能重复取消分享!",null);
return new MapRestResult(201, "该单位的取消分享已处于待审批状态,不能重复取消分享!", null);
}
//当前登陆人的信息
......@@ -339,27 +360,28 @@ public class ZczxController extends ApiController {
String unitcode = user.getUnitcode();
String unitname = user.getUnitname();
// QueryWrapper<ZczxRole> qw = new QueryWrapper<>();
// // 按专项编号查询
// qw.eq("zxbh", zxbh);
// // 按警号查询
// qw.eq("policemanid", policemanid);
// // 查收藏状态为“1”的数据
// qw.eq("zczx_sczt", "1");
// this.zczxRoleService.remove(qw);
UpdateWrapper<ZczxRole> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("zxbh", zxbh);//专项编号
updateWrapper.eq("policemanid", policemanid);//警号
updateWrapper.eq("zczx_sczt","1");//收藏状态为"1"的数据
ZczxRole zczxRole = new ZczxRole();
zczxRole.setGxr(trueName);
zczxRole.setGxrjh(policemanid);
zczxRole.setGxrdwdm(unitcode);
zczxRole.setGxrdwmc(unitname);
zczxRole.setGxsj(new Date());
zczxRole.setXxscPdbz("1");
zczxRoleService.update(zczxRole, updateWrapper);
//物理删除,避免太多冗余数据
QueryWrapper<ZczxRole> qw = new QueryWrapper<>();
// 按专项编号查询
qw.eq("zxbh", zxbh);
// 按警号查询
qw.eq("policemanid", policemanid);
// 查收藏状态为“1”的数据
qw.eq("zczx_sczt", "1");
this.zczxRoleService.remove(qw);
// UpdateWrapper<ZczxRole> updateWrapper = new UpdateWrapper<>();
// updateWrapper.eq("zxbh", zxbh);//专项编号
// updateWrapper.eq("policemanid", policemanid);//警号
// updateWrapper.eq("zczx_sczt","1");//收藏状态为"1"的数据
// ZczxRole zczxRole = new ZczxRole();
// zczxRole.setGxr(trueName);
// zczxRole.setGxrjh(policemanid);
// zczxRole.setGxrdwdm(unitcode);
// zczxRole.setGxrdwmc(unitname);
// zczxRole.setGxsj(new Date());
// zczxRole.setXxscPdbz("1");
// zczxRoleService.update(zczxRole, updateWrapper);
return new MapRestResult();
}
......
......@@ -2,7 +2,6 @@ package com.founder.publicapi.controller.ZczxService;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.founder.commonutils.model.PageSimpleVO;
......@@ -24,6 +23,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
......@@ -156,24 +156,25 @@ public class ZczxRoleController {
String unitname = user.getUnitname();
String[] role_ids = zczxRoleDto.getIds();
for (int i = 0; i < role_ids.length; i++) {
String id = role_ids[i];
UpdateWrapper<ZczxRole> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("id",id);
ZczxRole zczxRole = new ZczxRole();
//基本信息
zczxRole.setGxr(trueName);
zczxRole.setGxrjh(policemanid);
zczxRole.setGxrdwdm(unitcode);
zczxRole.setGxrdwmc(unitname);
zczxRole.setGxsj(new Date());
//删除判断标志
zczxRole.setXxscPdbz("1");
zczxRoleService.update(zczxRole, updateWrapper);
}
// String[] role_ids = zczxRoleDto.getIds();
// List<String> ids = Arrays.asList(role_ids);
// this.zczxRoleService.removeByIds(ids);
// for (int i = 0; i < role_ids.length; i++) {
// String id = role_ids[i];
// UpdateWrapper<ZczxRole> updateWrapper = new UpdateWrapper<>();
// updateWrapper.eq("id",id);
// ZczxRole zczxRole = new ZczxRole();
// //基本信息
// zczxRole.setGxr(trueName);
// zczxRole.setGxrjh(policemanid);
// zczxRole.setGxrdwdm(unitcode);
// zczxRole.setGxrdwmc(unitname);
// zczxRole.setGxsj(new Date());
// //删除判断标志
// zczxRole.setXxscPdbz("1");
// zczxRoleService.update(zczxRole, updateWrapper);
// }
//物理删除,避免太多冗余数据
List<String> ids = Arrays.asList(role_ids);
this.zczxRoleService.removeByIds(ids);
return new MapRestResult();
}
......@@ -194,6 +195,7 @@ public class ZczxRoleController {
qw.eq(StringUtils.isNotBlank(zczxRoleDto.getZczxCyzt()), "ZCZX_CYZT", zczxRoleDto.getZczxCyzt());
// 按分享状态查询
qw.eq(StringUtils.isNotBlank(zczxRoleDto.getZczxFxzt()), "ZCZX_FXZT", zczxRoleDto.getZczxFxzt());
qw.eq("xxsc_pdbz","0");
qw.orderByDesc("RKSJ");
List<ZczxRole> list = this.zczxRoleService.list(qw);
return new MapRestResult(200, "查询成功!", list.size(), list);
......
......@@ -82,14 +82,17 @@
<if test="xcrwDto.zxbh!=null and xcrwDto.zxbh!=''">
AND x.zxbh = #{xcrwDto.zxbh , jdbcType=VARCHAR }
</if>
<choose>
<when test="xcrwDto.xcrwjsrzh!=null and xcrwDto.xcrwjsrzh!='' and xcrwDto.xcrwjsrzh.length() == 12">
AND x.xcrwjsrzh like SUBSTR(#{xcrwDto.xcrwjsrzh , jdbcType=VARCHAR },1,6) || '%'
</when>
<when test="xcrwDto.xcrwjsrzh!=null and xcrwDto.xcrwjsrzh!='' and xcrwDto.xcrwjsrzh.length() != 12">
AND x.xcrwjsrzh = #{xcrwDto.xcrwjsrzh , jdbcType=VARCHAR }
</when>
</choose>
<if test="xcrwDto.xcrwjsrzh!=null and xcrwDto.xcrwjsrzh!=''">
AND x.xcrwjsrzh = #{xcrwDto.xcrwjsrzh , jdbcType=VARCHAR }
</if>
<!-- <choose>-->
<!-- <when test="xcrwDto.xcrwjsrzh!=null and xcrwDto.xcrwjsrzh!='' and xcrwDto.xcrwjsrzh.length() == 12">-->
<!-- AND x.xcrwjsrzh like SUBSTR(#{xcrwDto.xcrwjsrzh , jdbcType=VARCHAR },1,6) || '%'-->
<!-- </when>-->
<!-- <when test="xcrwDto.xcrwjsrzh!=null and xcrwDto.xcrwjsrzh!='' and xcrwDto.xcrwjsrzh.length() != 12">-->
<!-- AND x.xcrwjsrzh = #{xcrwDto.xcrwjsrzh , jdbcType=VARCHAR }-->
<!-- </when>-->
<!-- </choose>-->
<if test="xcrwDto.auditStatus!=null and xcrwDto.auditStatus!=''">
AND a.audit_status = #{xcrwDto.auditStatus , jdbcType=VARCHAR }
</if>
......
......@@ -459,7 +459,8 @@
r.role_name,
r.zczx_cyzt,
r.zczx_sczt,
a.audit_type as auditType
a.audit_type as auditType,
a.audit_status
from tb_wh_zczx z
left join tb_xw_asj_110jq q on z.jqbh = q.jjdbh
left join tb_st_asj j on z.asjbh = j.asjbh
......@@ -471,15 +472,15 @@
AND r.xxsc_pdbz = '0'
<if test="zczxDto.cxlx!=null and zczxDto.cxlx=='2'.toString()">
AND r.unitcode like #{zczxDto.unitcode , jdbcType=VARCHAR } ||'%'
AND r.zczx_fxzt = '0'
</if>
<if test="zczxDto.cxlx!=null and zczxDto.cxlx=='3'.toString()">
AND r.unitcode = #{zczxDto.unitcode , jdbcType=VARCHAR }
AND r.zczx_fxzt = '0'
</if>
<if test="zczxDto.cxlx!=null and zczxDto.cxlx=='6'.toString()">
AND r.zczx_fxzt = '1'
<if test="zczxDto.auditStatus!=null and zczxDto.auditStatus!=''">
AND a.audit_status = #{zczxDto.auditStatus , jdbcType=VARCHAR }
</if>
AND a.audit_status = '2'
</if>
<if test="zczxDto.zxbh!=null and zczxDto.zxbh!=''">
AND z.zxbh = #{zczxDto.zxbh , jdbcType=VARCHAR }
......
......@@ -238,42 +238,44 @@ public class ZczxServiceImpl extends ServiceImpl<ZczxMapper, Zczx> implements Zc
result.setRecords(records);
return result;
}
//分享至本人的
if (StringUtils.isNotBlank(zczxDto.getCxlx()) && "7".equals(zczxDto.getCxlx()) && StringUtils.isNotBlank(policemanid)) {
zczxDto.setZxdlrjh(policemanid);
IPage<Zczx> result = this.zczxMapper.listZczxForPageByCode(page, zczxDto);
List<Zczx> records = result.getRecords();
for (int i = 0; i < records.size(); i++) {
Zczx zczx = records.get(i);
String zxbh = zczx.getZxbh();
//参与状态
QueryWrapper<ZczxRole> qw = new QueryWrapper<>();
qw.eq(StringUtils.isNotBlank(zxbh), "zxbh", zxbh);
qw.eq(StringUtils.isNotBlank(policemanid), "policemanid", policemanid);
qw.eq("zczx_cyzt", "1");
qw.eq("xxsc_pdbz", "0");
ZczxRole cyzt = zczxRoleMapper.selectOne(qw);
if (cyzt != null) {
zczx.setRoleNo(cyzt.getId());
zczx.setZczxCyzt(cyzt.getZczxCyzt());
zczx.setRoleId(cyzt.getRoleId());
zczx.setRoleName(cyzt.getRoleName());
}
//收藏状态
QueryWrapper<ZczxRole> qw2 = new QueryWrapper<>();
qw2.eq(StringUtils.isNotBlank(zxbh), "zxbh", zxbh);
qw2.eq(StringUtils.isNotBlank(policemanid), "policemanid", policemanid);
qw2.eq("zczx_sczt", "1");
qw2.eq("xxsc_pdbz", "0");
ZczxRole sczt = zczxRoleMapper.selectOne(qw2);
if (sczt != null) {
zczx.setZczxSczt(sczt.getZczxSczt());
}
records.set(i, zczx);
}
result.setRecords(records);
return result;
}
//分享至本人的 取消掉了!!!!!!!!!!
// if (StringUtils.isNotBlank(zczxDto.getCxlx()) && "7".equals(zczxDto.getCxlx()) && StringUtils.isNotBlank(policemanid)) {
// zczxDto.setZxdlrjh(policemanid);
// IPage<Zczx> result = this.zczxMapper.listZczxForPageByCode(page, zczxDto);
// List<Zczx> records = result.getRecords();
// for (int i = 0; i < records.size(); i++) {
// Zczx zczx = records.get(i);
// String zxbh = zczx.getZxbh();
// //参与状态
// QueryWrapper<ZczxRole> qw = new QueryWrapper<>();
// qw.eq(StringUtils.isNotBlank(zxbh), "zxbh", zxbh);
// qw.eq(StringUtils.isNotBlank(policemanid), "policemanid", policemanid);
// qw.eq("zczx_cyzt", "1");
// qw.eq("xxsc_pdbz", "0");
// ZczxRole cyzt = zczxRoleMapper.selectOne(qw);
// if (cyzt != null) {
// zczx.setRoleNo(cyzt.getId());
// zczx.setZczxCyzt(cyzt.getZczxCyzt());
// zczx.setRoleId(cyzt.getRoleId());
// zczx.setRoleName(cyzt.getRoleName());
// }
// //收藏状态
// QueryWrapper<ZczxRole> qw2 = new QueryWrapper<>();
// qw2.eq(StringUtils.isNotBlank(zxbh), "zxbh", zxbh);
// qw2.eq(StringUtils.isNotBlank(policemanid), "policemanid", policemanid);
// qw2.eq("zczx_sczt", "1");
// qw2.eq("xxsc_pdbz", "0");
// ZczxRole sczt = zczxRoleMapper.selectOne(qw2);
// if (sczt != null) {
// zczx.setZczxSczt(sczt.getZczxSczt());
// }
// records.set(i, zczx);
// }
// result.setRecords(records);
// return result;
// }
return null;
}
......
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