Browse Source

送码入企功能

v5
庄锐波 6 months ago
parent
commit
b07479e7bb
  1. 28
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnterprisePubQrcode.java
  2. 32
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterprisePubQrcodeServiceImpl.java
  3. 10
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnterprisePubQrcodeMapper.xml

28
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnterprisePubQrcode.java

@ -72,6 +72,12 @@ public class EnterprisePubQrcode extends BaseDomain
/** 备注 */
private String remark;
/** 父级存在zoneid的部门id */
private String zoneDeptId;
/** 父级存在zoneid的部门名称 */
private String zoneDeptName;
/** 匹配到的目标类型 */
private String matchingToType;
@ -258,6 +264,26 @@ public class EnterprisePubQrcode extends BaseDomain
return remark;
}
public void setZoneDeptId(String zoneDeptId)
{
this.zoneDeptId = zoneDeptId;
}
public String getZoneDeptId()
{
return zoneDeptId;
}
public void setZoneDeptName(String zoneDeptName)
{
this.zoneDeptName = zoneDeptName;
}
public String getZoneDeptName()
{
return zoneDeptName;
}
public void setMatchingToType(String matchingToType)
{
this.matchingToType = matchingToType;
@ -305,6 +331,8 @@ public class EnterprisePubQrcode extends BaseDomain
.append("remark", getRemark())
.append("matchingToType", getMatchingToType())
.append("matchingToId", getMatchingToId())
.append("zoneDeptId", getZoneDeptId())
.append("zoneDeptName", getZoneDeptName())
.toString();
}
}

32
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterprisePubQrcodeServiceImpl.java

@ -374,6 +374,13 @@ public class EnterprisePubQrcodeServiceImpl implements IEnterprisePubQrcodeServi
item.setCreateBy(currentUser.getUserName());
item.setDeptName(currentUser.getDept().getDeptName());
item.setDeptId(currentUser.getDeptId());
// 递归查找父级存在zone值的部门(最多4级)
Dept zoneDept = findParentDeptWithZone(currentUser.getDeptId(), 4);
if (zoneDept != null)
{
item.setZoneDeptId(zoneDept.getDeptId());
item.setZoneDeptName(zoneDept.getDeptName());
}
enterprisePubQrcodeMapper.insertEnterprisePubQrcode(item);
insertCount++;
}
@ -952,6 +959,31 @@ public class EnterprisePubQrcodeServiceImpl implements IEnterprisePubQrcodeServi
return enterprisePubQrcodeMapper.selectEnterprisePubQrcodeQueryList(enterprisePubQrcode);
}
/**
* 递归查找父级部门中存在zone值的部门(最多向上查找4级)
*
* @param deptId 当前部门ID
* @param maxDepth 最大递归深度
* @return 存在zone值的部门,未找到返回null
*/
private Dept findParentDeptWithZone(String deptId, int maxDepth)
{
if (maxDepth <= 0 || StrUtil.isBlank(deptId))
{
return null;
}
Dept dept = deptMapper.selectDeptById(deptId);
if (dept == null)
{
return null;
}
if (dept.getZone() != null)
{
return dept;
}
return findParentDeptWithZone(dept.getParentId(), maxDepth - 1);
}
/**
* 数据范围校验:根据当前用户角色的dataScope判断可查询的数据范围
* 参考 EnterpriseInformationServiceImpl.check 方法

10
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnterprisePubQrcodeMapper.xml

@ -29,6 +29,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="remark" column="remark" />
<result property="matchingToType" column="matching_to_type" />
<result property="matchingToId" column="matching_to_id" />
<result property="zoneDeptId" column="zone_dept_id" />
<result property="zoneDeptName" column="zone_dept_name" />
</resultMap>
<sql id="selectEnterprisePubQrcodeVo">
@ -36,7 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
matching_status, matching_message, download_status, dept_name, dept_id, user_name, user_id,
create_time, create_by, qr_code_path, last_qr_code_time,
import_row_num, import_file_name, import_file_id, remark,
matching_to_type, matching_to_id
matching_to_type, matching_to_id, zone_dept_id, zone_dept_name
from enterprise_pub_qrcode
</sql>
@ -140,6 +142,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null and remark != ''">remark,</if>
<if test="matchingToType != null and matchingToType != ''">matching_to_type,</if>
<if test="matchingToId != null and matchingToId != ''">matching_to_id,</if>
<if test="zoneDeptId != null and zoneDeptId != ''">zone_dept_id,</if>
<if test="zoneDeptName != null and zoneDeptName != ''">zone_dept_name,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">#{id},</if>
@ -166,6 +170,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null and remark != ''">#{remark},</if>
<if test="matchingToType != null and matchingToType != ''">#{matchingToType},</if>
<if test="matchingToId != null and matchingToId != ''">#{matchingToId},</if>
<if test="zoneDeptId != null and zoneDeptId != ''">#{zoneDeptId},</if>
<if test="zoneDeptName != null and zoneDeptName != ''">#{zoneDeptName},</if>
</trim>
</insert>
@ -195,6 +201,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="matchingToType != null and matchingToType != ''">matching_to_type = #{matchingToType},</if>
<if test="matchingToId != null and matchingToId != ''">matching_to_id = #{matchingToId},</if>
<if test="zoneDeptId != null and zoneDeptId != ''">zone_dept_id = #{zoneDeptId},</if>
<if test="zoneDeptName != null and zoneDeptName != ''">zone_dept_name = #{zoneDeptName},</if>
</trim>
where id = #{id}
</update>

Loading…
Cancel
Save