企业清单未落实预警开发
This commit is contained in:
parent
1b7f9a70da
commit
2b111c41cb
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.rzyc.bean.setting;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author dong
|
||||||
|
* @date 2023-03-31 13:34
|
||||||
|
* @Version V1.0
|
||||||
|
*/
|
||||||
|
@ApiModel("")
|
||||||
|
public class UnitInClassChangeDto {
|
||||||
|
|
||||||
|
@NotNull(message = "单位不能为空")
|
||||||
|
@ApiModelProperty(value = "单位id",required = true)
|
||||||
|
private String unitId;
|
||||||
|
|
||||||
|
@ApiModelProperty("行业id 多个逗号隔开")
|
||||||
|
private String inClassIds;
|
||||||
|
|
||||||
|
public String getUnitId() {
|
||||||
|
return unitId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUnitId(String unitId) {
|
||||||
|
this.unitId = unitId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInClassIds() {
|
||||||
|
return inClassIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInClassIds(String inClassIds) {
|
||||||
|
this.inClassIds = inClassIds;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -99,4 +99,6 @@ public interface EntPostTaskMapper extends BaseMapper<EntPostTask> {
|
||||||
* */
|
* */
|
||||||
int updateTaskState(String entPostTaskId);
|
int updateTaskState(String entPostTaskId);
|
||||||
|
|
||||||
|
/*企业未完成任务*/
|
||||||
|
List<EntPostTask> notCompleteTask();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.rzyc.mapper;
|
||||||
|
|
||||||
import com.rzyc.model.SysUnitTrade;
|
import com.rzyc.model.SysUnitTrade;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -15,4 +16,7 @@ import org.springframework.stereotype.Repository;
|
||||||
@Repository
|
@Repository
|
||||||
public interface SysUnitTradeMapper extends BaseMapper<SysUnitTrade> {
|
public interface SysUnitTradeMapper extends BaseMapper<SysUnitTrade> {
|
||||||
|
|
||||||
|
/*删除部门行业监管*/
|
||||||
|
Integer delByUnitId(@Param("unitId") String unitId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -196,4 +196,7 @@ public interface SysUserMapper {
|
||||||
/*岗位用户*/
|
/*岗位用户*/
|
||||||
List<SysUser> findBySysTitle(@Param("sysTitles") List<String> sysTitles);
|
List<SysUser> findBySysTitle(@Param("sysTitles") List<String> sysTitles);
|
||||||
|
|
||||||
|
/*行业监管部门用户列表*/
|
||||||
|
List<SysUser> inClassUser(@Param("inClassId") String inClassId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -155,6 +155,17 @@
|
||||||
update ent_post_task set task_state = 2 where task_id = #{entPostTaskId}
|
update ent_post_task set task_state = 2 where task_id = #{entPostTaskId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<!--企业未完成任务-->
|
||||||
|
<select id="notCompleteTask" resultMap="BaseResultMap">
|
||||||
|
SELECT pt.*
|
||||||
|
FROM `ent_post_task` pt
|
||||||
|
LEFT JOIN `sysenterprise` se ON pt.`enterprise_id` = se.`SysEnterpriseId`
|
||||||
|
WHERE pt.task_state != 2
|
||||||
|
AND se.`State` = '启用'
|
||||||
|
AND YEAR(pt.`start_time`) =YEAR(NOW())
|
||||||
|
AND pt.`ent_time` < NOW();
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -16,4 +16,9 @@
|
||||||
unit_trade_id, unit_id, in_class_id, create_time, create_by
|
unit_trade_id, unit_id, in_class_id, create_time, create_by
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
<!--删除部门行业监管-->
|
||||||
|
<delete id="delByUnitId">
|
||||||
|
DELETE FROM sys_unit_trade WHERE unit_id = #{unitId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -1439,6 +1439,15 @@
|
||||||
#{sysTitle}
|
#{sysTitle}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<!--行业监管部门用户列表-->
|
||||||
|
<select id="inClassUser" resultMap="BaseResultMap">
|
||||||
|
SELECT su.*
|
||||||
|
FROM SysUser su
|
||||||
|
LEFT JOIN sysunit st ON su.`SysUnitOrEntId` = st.`SysUnitId`
|
||||||
|
LEFT JOIN `sys_unit_trade` ut ON ut.`unit_id` = st.`SysUnitId`
|
||||||
|
WHERE ut.`in_class_id` = #{inClassId}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,14 @@ 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;
|
||||||
|
import com.rzyc.bean.setting.UnitInClassChangeDto;
|
||||||
import com.rzyc.bean.user.*;
|
import com.rzyc.bean.user.*;
|
||||||
import com.rzyc.bean.user.dto.UnitAuthChangeDto;
|
import com.rzyc.bean.user.dto.UnitAuthChangeDto;
|
||||||
import com.rzyc.enums.AreaLevel;
|
import com.rzyc.enums.AreaLevel;
|
||||||
|
import com.rzyc.mapper.SysUnitTradeMapper;
|
||||||
import com.rzyc.model.SysDocumenttemp;
|
import com.rzyc.model.SysDocumenttemp;
|
||||||
import com.rzyc.model.SysOrg;
|
import com.rzyc.model.SysOrg;
|
||||||
|
import com.rzyc.model.SysUnitTrade;
|
||||||
import com.rzyc.model.ent.BaseInClass;
|
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;
|
||||||
|
|
@ -1217,12 +1220,12 @@ public class SettingController extends BaseController{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门行业树形结构
|
* 部门监管行业树形结构
|
||||||
* @version v1.0
|
* @version v1.0
|
||||||
* @author dong
|
* @author dong
|
||||||
* @date 2023/3/31 11:26
|
* @date 2023/3/31 11:26
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "部门行业树形结构", notes = "部门行业树形结构")
|
@ApiOperation(value = "部门监管行业树形结构", notes = "部门监管行业树形结构")
|
||||||
@GetMapping("unitInClass")
|
@GetMapping("unitInClass")
|
||||||
@ApiImplicitParam(name = "unitId",value = "部门id",required = true)
|
@ApiImplicitParam(name = "unitId",value = "部门id",required = true)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|
@ -1245,4 +1248,36 @@ public class SettingController extends BaseController{
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门监管行业树形结构
|
||||||
|
* @version v1.0
|
||||||
|
* @author dong
|
||||||
|
* @date 2023/3/31 13:34
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "部门监管行业修改", notes = "部门监管行业修改")
|
||||||
|
@PostMapping("unitInClassChange")
|
||||||
|
@ResponseBody
|
||||||
|
public SingleResult<String> unitInClassChange(@Valid UnitInClassChangeDto unitInClassChangeDto)throws Exception{
|
||||||
|
SingleResult<String> result = new SingleResult<>();
|
||||||
|
|
||||||
|
//先删除所有行业监管信息
|
||||||
|
sysUnitTradeMapper.delByUnitId(unitInClassChangeDto.getUnitId());
|
||||||
|
|
||||||
|
if(StringUtils.isNotBlank(unitInClassChangeDto.getInClassIds())){
|
||||||
|
String[] strs = unitInClassChangeDto.getInClassIds().split(",");
|
||||||
|
for (String str : strs){
|
||||||
|
SysUnitTrade unitTrade = new SysUnitTrade();
|
||||||
|
unitTrade.setUnitId(unitInClassChangeDto.getUnitId());
|
||||||
|
unitTrade.setUnitTradeId(RandomNumber.getUUid());
|
||||||
|
unitTrade.setInClassId(str);
|
||||||
|
unitTrade.setCreateBy(getUserId());
|
||||||
|
unitTrade.setCreateTime(new Date());
|
||||||
|
sysUnitTradeMapper.insert(unitTrade);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,8 @@ public class TaskService extends BaseController {
|
||||||
addTaskWarn();
|
addTaskWarn();
|
||||||
//下级未履行上级任务预警
|
//下级未履行上级任务预警
|
||||||
addSubordinateTaskWarn();
|
addSubordinateTaskWarn();
|
||||||
|
//企业清单未落实预警
|
||||||
|
addEntTask();
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
@ -382,4 +384,57 @@ public class TaskService extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业清单未落实预警
|
||||||
|
* @version v1.0
|
||||||
|
* @author dong
|
||||||
|
* @date 2023/3/31 14:13
|
||||||
|
*/
|
||||||
|
public void addEntTask()throws Exception{
|
||||||
|
List<EntPostTask> postTasks = entPostTaskMapper.notCompleteTask();
|
||||||
|
if(null != postTasks && postTasks.size() > 0){
|
||||||
|
for(EntPostTask postTask : postTasks){
|
||||||
|
|
||||||
|
|
||||||
|
//查询是否预警
|
||||||
|
Integer warnNum = sysWarningMapper.countByTargetId(postTask.getTaskId(),WarnTypeEnum.NET_LIST.getType());
|
||||||
|
if(0 == warnNum){
|
||||||
|
//查询企业信息
|
||||||
|
SysEnterprise enterprise = sysEnterpriseMapper.selectByPrimaryKey(postTask.getEnterpriseId());
|
||||||
|
if(null != enterprise){
|
||||||
|
|
||||||
|
String warnInfo = enterprise.getEntname()+"的履职任务<"+postTask.getItemTitle()+">未按时完成";
|
||||||
|
SysWarning warning = new SysWarning();
|
||||||
|
warning.setWarningId(RandomNumber.getUUid());
|
||||||
|
warning.setTargetId(postTask.getTaskId());
|
||||||
|
warning.setWarningInfo(warnInfo);
|
||||||
|
warning.setWarningTime(new Date());
|
||||||
|
warning.setTypeId(WarnTypeEnum.NET_LIST.getType());
|
||||||
|
warning.setDelState(DelState.NOT_DEL.getState());
|
||||||
|
warning.setCreateTime(new Date());
|
||||||
|
warning.setModifyTime(new Date());
|
||||||
|
sysWarningMapper.insert(warning);
|
||||||
|
|
||||||
|
//接收预警用户列表
|
||||||
|
List<SysUser> sysUsers = sysUserMapper.inClassUser(enterprise.getWorkClassId());
|
||||||
|
if(null != sysUsers && sysUsers.size() > 0){
|
||||||
|
for (SysUser sysUser : sysUsers){
|
||||||
|
SysWarningUser warningUser = new SysWarningUser();
|
||||||
|
warningUser.setWarningUserId(RandomNumber.getUUid());
|
||||||
|
warningUser.setWarningId(warning.getWarningId());
|
||||||
|
warningUser.setUserId(sysUser.getSysuserid());
|
||||||
|
warningUser.setTypeId(WarnTypeEnum.NET_LIST.getType());
|
||||||
|
warningUser.setState(1);
|
||||||
|
warningUser.setDelState(DelState.NOT_DEL.getState());
|
||||||
|
warningUser.setCreateTime(new Date());
|
||||||
|
warningUser.setModifyTime(new Date());
|
||||||
|
sysWarningUserMapper.insert(warningUser);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user