部门行业监管

This commit is contained in:
韩国东 2023-03-31 11:45:34 +08:00
parent 5b23c9c831
commit 1b7f9a70da
17 changed files with 308 additions and 12 deletions

View File

@ -1,5 +1,7 @@
package com.rzyc.bean; package com.rzyc.bean;
import io.swagger.annotations.ApiModelProperty;
import java.util.List; import java.util.List;
public class TreeModel { public class TreeModel {
@ -11,8 +13,30 @@ public class TreeModel {
private String code; private String code;
@ApiModelProperty("关联id")
private String unitTradeId;
@ApiModelProperty("是否选中 1:选中 2未选中")
private Integer isSelect;
private List<TreeModel>children; private List<TreeModel>children;
public String getUnitTradeId() {
return unitTradeId;
}
public void setUnitTradeId(String unitTradeId) {
this.unitTradeId = unitTradeId;
}
public Integer getIsSelect() {
return isSelect;
}
public void setIsSelect(Integer isSelect) {
this.isSelect = isSelect;
}
public String getCode() { public String getCode() {
return code; return code;
} }

View File

@ -0,0 +1,18 @@
package com.rzyc.mapper;
import com.rzyc.model.SysUnitTrade;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 部门行业监管 Mapper 接口
* </p>
*
* @author
* @since 2023-03-31
*/
@Repository
public interface SysUnitTradeMapper extends BaseMapper<SysUnitTrade> {
}

View File

@ -17,6 +17,7 @@ import org.springframework.stereotype.Repository;
public interface SysWarningMapper extends BaseMapper<SysWarning> { public interface SysWarningMapper extends BaseMapper<SysWarning> {
/*查询预警数量*/ /*查询预警数量*/
Integer countByTargetId(@Param("targetId") String targetId); Integer countByTargetId(@Param("targetId") String targetId,
@Param("typeId") String typeId);
} }

View File

@ -40,6 +40,9 @@ public interface BaseInClassMapper {
/*行业树形结构*/ /*行业树形结构*/
List<TreeModel>findInClass(); List<TreeModel>findInClass();
/*单位行业监管信息*/
List<TreeModel>unitTradeList(@Param("unitId") String unitId);
/*查询所有*/ /*查询所有*/
List<BaseInClass>findAll(); List<BaseInClass>findAll();

View File

@ -130,4 +130,7 @@ public interface ListPerformMapper {
List<UnitList> communityPerformInfo(@Param("areaCode") String areaCode, List<UnitList> communityPerformInfo(@Param("areaCode") String areaCode,
@Param("sysYear") String sysYear); @Param("sysYear") String sysYear);
/*上级岗位*/
List<ListPerform> topListperformList(@Param("listperformId") String listperformId);
} }

View File

@ -194,6 +194,6 @@ public interface SysUserMapper {
List<UserVo> selectTransferor(); List<UserVo> selectTransferor();
/*岗位用户*/ /*岗位用户*/
List<SysUser> findBySysTitle(@Param("sysTitle") String sysTitle); List<SysUser> findBySysTitle(@Param("sysTitles") List<String> sysTitles);
} }

View File

@ -0,0 +1,91 @@
package com.rzyc.model;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* <p>
* 部门行业监管
* </p>
*
* @author
* @since 2023-03-31
*/
@TableName("sys_unit_trade")
@ApiModel(value="SysUnitTrade对象", description="部门行业监管")
public class SysUnitTrade implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "部门行业监管id")
@TableId("unit_trade_id")
private String unitTradeId;
@ApiModelProperty(value = "部门id")
@TableField("unit_id")
private String unitId;
@ApiModelProperty(value = "行业id")
@TableField("in_class_id")
private String inClassId;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "创建人")
@TableField("create_by")
private String createBy;
public String getUnitTradeId() {
return unitTradeId;
}
public void setUnitTradeId(String unitTradeId) {
this.unitTradeId = unitTradeId;
}
public String getUnitId() {
return unitId;
}
public void setUnitId(String unitId) {
this.unitId = unitId;
}
public String getInClassId() {
return inClassId;
}
public void setInClassId(String inClassId) {
this.inClassId = inClassId;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
@Override
public String toString() {
return "SysUnitTrade{" +
"unitTradeId=" + unitTradeId +
", unitId=" + unitId +
", inClassId=" + inClassId +
", createTime=" + createTime +
", createBy=" + createBy +
"}";
}
}

View File

@ -51,6 +51,8 @@ public class BaseInClass implements Serializable {
private String modifiedby; private String modifiedby;
private String unitTradeId;
private List<BaseInClass> baseInClassList; private List<BaseInClass> baseInClassList;
public Integer getInType() { public Integer getInType() {

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.rzyc.mapper.SysUnitTradeMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.rzyc.model.SysUnitTrade">
<id column="unit_trade_id" property="unitTradeId" />
<result column="unit_id" property="unitId" />
<result column="in_class_id" property="inClassId" />
<result column="create_time" property="createTime" />
<result column="create_by" property="createBy" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
unit_trade_id, unit_id, in_class_id, create_time, create_by
</sql>
</mapper>

View File

@ -24,8 +24,10 @@
<!--查询是否预警--> <!--查询是否预警-->
<select id="countByTargetId" resultType="java.lang.Integer"> <select id="countByTargetId" resultType="java.lang.Integer">
SELECT COUNT(*) FROM`sys_warning` sw SELECT COUNT(*)
FROM`sys_warning` sw
WHERE sw.`target_id` = #{targetId} WHERE sw.`target_id` = #{targetId}
AND sw.type_id = #{typeId}
</select> </select>
</mapper> </mapper>

View File

@ -364,6 +364,7 @@
<result column="ClassCode" jdbcType="VARCHAR" property="code" /> <result column="ClassCode" jdbcType="VARCHAR" property="code" />
<result column="IndustryClassName" jdbcType="VARCHAR" property="label" /> <result column="IndustryClassName" jdbcType="VARCHAR" property="label" />
<result column="SuperInId" jdbcType="VARCHAR" property="parentId" /> <result column="SuperInId" jdbcType="VARCHAR" property="parentId" />
<result column="unit_trade_id" jdbcType="VARCHAR" property="unitTradeId" />
</resultMap> </resultMap>
<!--行业树形结构--> <!--行业树形结构-->
@ -372,6 +373,16 @@
from BaseInClass t1 from BaseInClass t1
</select> </select>
<!--单位行业监管信息-->
<select id="unitTradeList" resultMap="InClassMap">
SELECT ut.`unit_trade_id`, bc.*
FROM `baseinclass` bc
LEFT JOIN `sys_unit_trade` ut
ON bc.`BaseInClassId` = ut.`in_class_id`
AND ut.`unit_id` = #{unitId}
</select>
<select id="findAll" resultMap="BaseResultMap"> <select id="findAll" resultMap="BaseResultMap">
select * from BaseInClass bc select * from BaseInClass bc
</select> </select>

View File

@ -868,4 +868,10 @@
order by su.community_code asc,lf.PerformClassCode asc order by su.community_code asc,lf.PerformClassCode asc
</select> </select>
<!--上级岗位-->
<select id="topListperformList" resultMap="BaseResultMap">
SELECT * FROM listperform lf
WHERE FIND_IN_SET(#{listperformId},lf.`ViewJurisdiction`);
</select>
</mapper> </mapper>

View File

@ -1431,6 +1431,14 @@
<!--通过岗位id查询用户--> <!--通过岗位id查询用户-->
<select id="findBySysTitle" resultMap="BaseResultMap"> <select id="findBySysTitle" resultMap="BaseResultMap">
select * from sysuser su where su.SysTitle = #{sysTitle} select * from sysuser su
where 1 = 1
and su.SysTitle in
<if test="null != sysTitles and sysTitles.size() > 0 ">
<foreach collection="sysTitles" open="(" close=")" separator="," item="sysTitle">
#{sysTitle}
</foreach>
</if>
</select> </select>
</mapper> </mapper>

View File

@ -556,6 +556,10 @@ public class BaseController {
@Autowired @Autowired
protected EntPostListMapper entPostListMapper; protected EntPostListMapper entPostListMapper;
//部门行业关联
@Autowired
protected SysUnitTradeMapper sysUnitTradeMapper;
/** /**
* 岗位不需要的字符串 * 岗位不需要的字符串
@ -1778,7 +1782,7 @@ public class BaseController {
* @return * @return
* @throws Exception * @throws Exception
*/ */
private JSONArray handleTreeModel(List<TreeModel> treeModels)throws Exception{ public JSONArray handleTreeModel(List<TreeModel> treeModels)throws Exception{
List<Map<String,Object>> data = new ArrayList<>(); List<Map<String,Object>> data = new ArrayList<>();
for(TreeModel treeModel : treeModels){ for(TreeModel treeModel : treeModels){
if(StringUtils.isBlank(treeModel.getParentId())){ if(StringUtils.isBlank(treeModel.getParentId())){
@ -1789,6 +1793,7 @@ public class BaseController {
entUserMap.put("id",treeModel.getId()); entUserMap.put("id",treeModel.getId());
entUserMap.put("parentId",treeModel.getParentId()); entUserMap.put("parentId",treeModel.getParentId());
entUserMap.put("code",treeModel.getCode()); entUserMap.put("code",treeModel.getCode());
entUserMap.put("isSelect",treeModel.getIsSelect());
data.add(entUserMap); data.add(entUserMap);
} }

View File

@ -2693,4 +2693,5 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
return result; return result;
} }
} }

View File

@ -8,6 +8,7 @@ import com.common.utils.model.*;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.rzyc.advice.LoginAuth; import com.rzyc.advice.LoginAuth;
import com.rzyc.bean.TreeModel;
import com.rzyc.bean.ent.*; import com.rzyc.bean.ent.*;
import com.rzyc.bean.setting.AreaPageDto; import com.rzyc.bean.setting.AreaPageDto;
import com.rzyc.bean.setting.ChangeAreaDto; import com.rzyc.bean.setting.ChangeAreaDto;
@ -16,6 +17,7 @@ import com.rzyc.bean.user.dto.UnitAuthChangeDto;
import com.rzyc.enums.AreaLevel; import com.rzyc.enums.AreaLevel;
import com.rzyc.model.SysDocumenttemp; import com.rzyc.model.SysDocumenttemp;
import com.rzyc.model.SysOrg; import com.rzyc.model.SysOrg;
import com.rzyc.model.ent.BaseInClass;
import com.rzyc.model.user.SysAuth; import com.rzyc.model.user.SysAuth;
import com.rzyc.model.user.SysUnitRole; import com.rzyc.model.user.SysUnitRole;
import com.rzyc.model.user.SysUser; import com.rzyc.model.user.SysUser;
@ -1214,4 +1216,33 @@ public class SettingController extends BaseController{
return result; return result;
} }
/**
* 部门行业树形结构
* @version v1.0
* @author dong
* @date 2023/3/31 11:26
*/
@ApiOperation(value = "部门行业树形结构", notes = "部门行业树形结构")
@GetMapping("unitInClass")
@ApiImplicitParam(name = "unitId",value = "部门id",required = true)
@ResponseBody
public MultiResult<TreeModel> unitInClass(String unitId)throws Exception{
MultiResult<TreeModel> result = new MultiResult<>();
List<TreeModel> treeModels = baseInClassMapper.unitTradeList(unitId);
if(null != treeModels && treeModels.size() > 0){
for (TreeModel treeModel : treeModels){
if(StringUtils.isNotBlank(treeModel.getUnitTradeId())){
treeModel.setIsSelect(1);
}else{
treeModel.setIsSelect(2);
}
}
}
JSONArray jsonArray = handleTreeModel(treeModels);
List<TreeModel> treeModelList = JSONArray.parseArray(jsonArray.toJSONString(),TreeModel.class);
result.setData(treeModelList);
return result;
}
} }

View File

@ -13,6 +13,7 @@ import com.rzyc.model.check.BookenthtCompany;
import com.rzyc.model.check.ChkPerson; import com.rzyc.model.check.ChkPerson;
import com.rzyc.model.ent.SysEnterprise; import com.rzyc.model.ent.SysEnterprise;
import com.rzyc.model.user.ListFactor; import com.rzyc.model.user.ListFactor;
import com.rzyc.model.user.ListPerform;
import com.rzyc.model.user.SysUser; import com.rzyc.model.user.SysUser;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -43,6 +44,8 @@ public class TaskService extends BaseController {
configureTasksEditDanger(); configureTasksEditDanger();
//未完成履职任务提醒 //未完成履职任务提醒
addTaskWarn(); addTaskWarn();
//下级未履行上级任务预警
addSubordinateTaskWarn();
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
} }
@ -205,7 +208,7 @@ public class TaskService extends BaseController {
public void addTroubleWarn(BookEntHT entHT)throws Exception{ public void addTroubleWarn(BookEntHT entHT)throws Exception{
//查询是否预警 //查询是否预警
Integer warnNum = sysWarningMapper.countByTargetId(entHT.getBookenthtid()); Integer warnNum = sysWarningMapper.countByTargetId(entHT.getBookenthtid(),WarnTypeEnum.TROUBLE.getType());
if(0 == warnNum){ if(0 == warnNum){
//未预警过就新增预警 //未预警过就新增预警
List<ChkPerson> chkPeople = chkPersonMapper.findByCheckIdAll(entHT.getBookentcheckid()); List<ChkPerson> chkPeople = chkPersonMapper.findByCheckIdAll(entHT.getBookentcheckid());
@ -262,14 +265,17 @@ public class TaskService extends BaseController {
if(null != oaTasks && oaTasks.size() > 0){ if(null != oaTasks && oaTasks.size() > 0){
for (OATask oaTask : oaTasks){ for (OATask oaTask : oaTasks){
//查询是否预警 //查询是否预警
Integer warnNum = sysWarningMapper.countByTargetId(oaTask.getOataskid()); Integer warnNum = sysWarningMapper.countByTargetId(oaTask.getOataskid(),WarnTypeEnum.GOV_LIST.getType());
if(0 == warnNum){ if(0 == warnNum){
ListFactor listFactor = listFactorMapper.selectByPrimaryKey(oaTask.getOtcid()); ListFactor listFactor = listFactorMapper.selectByPrimaryKey(oaTask.getOtcid());
if(null != listFactor){ if(null != listFactor){
List<String> sysTitles = new ArrayList<>();
sysTitles.add(listFactor.getListperformid());
//查询任务用户 //查询任务用户
List<SysUser> sysUsers = sysUserMapper.findBySysTitle(listFactor.getListperformid()); List<SysUser> sysUsers = sysUserMapper.findBySysTitle(sysTitles);
if(null != sysUsers && sysUsers.size() > 0){ if(null != sysUsers && sysUsers.size() > 0){
String warnInfo = "您的履职任务:<"+oaTask.getSubject()+">超期未完成。"; String warnInfo = "您的履职任务:<"+oaTask.getSubject()+">超期未完成。";
@ -299,14 +305,79 @@ public class TaskService extends BaseController {
} }
} }
} }
}
}
}
/**
* 下级未履行上级任务预警
* @version v1.0
* @author dong
* @date 2023/3/31 9:48
*/
public void addSubordinateTaskWarn()throws Exception{
//未完成履职任务
List<OATask> oaTasks = oaTaskMapper.notCompleteTask();
if(null != oaTasks && oaTasks.size() > 0){
for (OATask oaTask : oaTasks){
//查询是否预警
Integer warnNum = sysWarningMapper.countByTargetId(oaTask.getOataskid(),WarnTypeEnum.TASK.getType());
if(0 == warnNum){
ListFactor listFactor = listFactorMapper.selectByPrimaryKey(oaTask.getOtcid());
if(null != listFactor){
List<String> sysTitles = new ArrayList<>();
List<ListPerform> listPerforms = listPerformMapper.topListperformList(listFactor.getListperformid());
if(null != listPerforms && listPerforms.size() > 0){
for (ListPerform listPerform : listPerforms){
sysTitles.add(listPerform.getListperformid());
}
//查询任务用户
List<SysUser> sysUsers = sysUserMapper.findBySysTitle(sysTitles);
if(null != sysUsers && sysUsers.size() > 0){
String warnInfo = "";
ListPerform listPerform = listPerformMapper.selectListPerformDetail(listFactor.getListperformid());
if(null != listPerform){
ListPerform topPerform = listPerformMapper.selectByPrimaryKey(listPerform.getSupclassid());
if(null != topPerform){
warnInfo = topPerform.getPerformclassname()+listPerform.getPerformclassname();
}
}
warnInfo = warnInfo + "的履职任务:<"+oaTask.getSubject()+">超期未完成。";
SysWarning warning = new SysWarning();
warning.setWarningId(RandomNumber.getUUid());
warning.setTargetId(oaTask.getOataskid());
warning.setWarningInfo(warnInfo);
warning.setWarningTime(new Date());
warning.setTypeId(WarnTypeEnum.TASK.getType());
warning.setDelState(DelState.NOT_DEL.getState());
warning.setCreateTime(new Date());
warning.setModifyTime(new Date());
sysWarningMapper.insert(warning);
for (SysUser sysUser : sysUsers){
SysWarningUser warningUser = new SysWarningUser();
warningUser.setWarningUserId(RandomNumber.getUUid());
warningUser.setWarningId(warning.getWarningId());
warningUser.setUserId(sysUser.getSysuserid());
warningUser.setTypeId(WarnTypeEnum.TASK.getType());
warningUser.setState(1);
warningUser.setDelState(DelState.NOT_DEL.getState());
warningUser.setCreateTime(new Date());
warningUser.setModifyTime(new Date());
sysWarningUserMapper.insert(warningUser);
}
}
}
}
}
} }
} }
} }