From 2b111c41cb8df1e05ab5a5e6f3e551e504f7733d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9F=A9=E5=9B=BD=E4=B8=9C?= Date: Fri, 31 Mar 2023 14:29:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E6=B8=85=E5=8D=95=E6=9C=AA?= =?UTF-8?q?=E8=90=BD=E5=AE=9E=E9=A2=84=E8=AD=A6=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bean/setting/UnitInClassChangeDto.java | 38 +++++++++++++ .../com/rzyc/mapper/EntPostTaskMapper.java | 4 +- .../com/rzyc/mapper/SysUnitTradeMapper.java | 4 ++ .../com/rzyc/mapper/user/SysUserMapper.java | 3 + .../resources/mapper/EntPostTaskMapper.xml | 11 ++++ .../resources/mapper/SysUnitTradeMapper.xml | 5 ++ .../resources/mapper/user/SysUserMapper.xml | 9 +++ .../rzyc/controller/SettingController.java | 39 ++++++++++++- .../java/com/rzyc/service/TaskService.java | 55 +++++++++++++++++++ 9 files changed, 165 insertions(+), 3 deletions(-) create mode 100644 inventory-dao/src/main/java/com/rzyc/bean/setting/UnitInClassChangeDto.java diff --git a/inventory-dao/src/main/java/com/rzyc/bean/setting/UnitInClassChangeDto.java b/inventory-dao/src/main/java/com/rzyc/bean/setting/UnitInClassChangeDto.java new file mode 100644 index 0000000..ee3d456 --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/bean/setting/UnitInClassChangeDto.java @@ -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; + } +} diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntPostTaskMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntPostTaskMapper.java index 5856c43..cb1e6e0 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/EntPostTaskMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntPostTaskMapper.java @@ -13,7 +13,7 @@ import java.util.List; * Mapper 接口 *

* - * @author + * @author * @since 2022-10-09 */ @Repository @@ -99,4 +99,6 @@ public interface EntPostTaskMapper extends BaseMapper { * */ int updateTaskState(String entPostTaskId); + /*企业未完成任务*/ + List notCompleteTask(); } diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/SysUnitTradeMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/SysUnitTradeMapper.java index b2ff0c1..a184f86 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/SysUnitTradeMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/SysUnitTradeMapper.java @@ -2,6 +2,7 @@ package com.rzyc.mapper; import com.rzyc.model.SysUnitTrade; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; /** @@ -15,4 +16,7 @@ import org.springframework.stereotype.Repository; @Repository public interface SysUnitTradeMapper extends BaseMapper { + /*删除部门行业监管*/ + Integer delByUnitId(@Param("unitId") String unitId); + } diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/user/SysUserMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/user/SysUserMapper.java index ee0058b..5a0bb7e 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/user/SysUserMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/user/SysUserMapper.java @@ -196,4 +196,7 @@ public interface SysUserMapper { /*岗位用户*/ List findBySysTitle(@Param("sysTitles") List sysTitles); + /*行业监管部门用户列表*/ + List inClassUser(@Param("inClassId") String inClassId); + } diff --git a/inventory-dao/src/main/resources/mapper/EntPostTaskMapper.xml b/inventory-dao/src/main/resources/mapper/EntPostTaskMapper.xml index 7781c82..3a8a4aa 100644 --- a/inventory-dao/src/main/resources/mapper/EntPostTaskMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EntPostTaskMapper.xml @@ -155,6 +155,17 @@ update ent_post_task set task_state = 2 where task_id = #{entPostTaskId} + + + diff --git a/inventory-dao/src/main/resources/mapper/SysUnitTradeMapper.xml b/inventory-dao/src/main/resources/mapper/SysUnitTradeMapper.xml index 7fdbdcf..acd0258 100644 --- a/inventory-dao/src/main/resources/mapper/SysUnitTradeMapper.xml +++ b/inventory-dao/src/main/resources/mapper/SysUnitTradeMapper.xml @@ -16,4 +16,9 @@ unit_trade_id, unit_id, in_class_id, create_time, create_by + + + DELETE FROM sys_unit_trade WHERE unit_id = #{unitId} + + diff --git a/inventory-dao/src/main/resources/mapper/user/SysUserMapper.xml b/inventory-dao/src/main/resources/mapper/user/SysUserMapper.xml index d084c90..766a522 100644 --- a/inventory-dao/src/main/resources/mapper/user/SysUserMapper.xml +++ b/inventory-dao/src/main/resources/mapper/user/SysUserMapper.xml @@ -1439,6 +1439,15 @@ #{sysTitle} + + + + diff --git a/inventory-gov/src/main/java/com/rzyc/controller/SettingController.java b/inventory-gov/src/main/java/com/rzyc/controller/SettingController.java index 76c94f8..1c355f6 100644 --- a/inventory-gov/src/main/java/com/rzyc/controller/SettingController.java +++ b/inventory-gov/src/main/java/com/rzyc/controller/SettingController.java @@ -12,11 +12,14 @@ import com.rzyc.bean.TreeModel; import com.rzyc.bean.ent.*; import com.rzyc.bean.setting.AreaPageDto; import com.rzyc.bean.setting.ChangeAreaDto; +import com.rzyc.bean.setting.UnitInClassChangeDto; import com.rzyc.bean.user.*; import com.rzyc.bean.user.dto.UnitAuthChangeDto; import com.rzyc.enums.AreaLevel; +import com.rzyc.mapper.SysUnitTradeMapper; import com.rzyc.model.SysDocumenttemp; import com.rzyc.model.SysOrg; +import com.rzyc.model.SysUnitTrade; import com.rzyc.model.ent.BaseInClass; import com.rzyc.model.user.SysAuth; import com.rzyc.model.user.SysUnitRole; @@ -1217,12 +1220,12 @@ public class SettingController extends BaseController{ } /** - * 部门行业树形结构 + * 部门监管行业树形结构 * @version v1.0 * @author dong * @date 2023/3/31 11:26 */ - @ApiOperation(value = "部门行业树形结构", notes = "部门行业树形结构") + @ApiOperation(value = "部门监管行业树形结构", notes = "部门监管行业树形结构") @GetMapping("unitInClass") @ApiImplicitParam(name = "unitId",value = "部门id",required = true) @ResponseBody @@ -1245,4 +1248,36 @@ public class SettingController extends BaseController{ return result; } + /** + * 部门监管行业树形结构 + * @version v1.0 + * @author dong + * @date 2023/3/31 13:34 + */ + @ApiOperation(value = "部门监管行业修改", notes = "部门监管行业修改") + @PostMapping("unitInClassChange") + @ResponseBody + public SingleResult unitInClassChange(@Valid UnitInClassChangeDto unitInClassChangeDto)throws Exception{ + SingleResult 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; + } + } diff --git a/inventory-gov/src/main/java/com/rzyc/service/TaskService.java b/inventory-gov/src/main/java/com/rzyc/service/TaskService.java index 7c56122..bf5542b 100644 --- a/inventory-gov/src/main/java/com/rzyc/service/TaskService.java +++ b/inventory-gov/src/main/java/com/rzyc/service/TaskService.java @@ -46,6 +46,8 @@ public class TaskService extends BaseController { addTaskWarn(); //下级未履行上级任务预警 addSubordinateTaskWarn(); + //企业清单未落实预警 + addEntTask(); }catch (Exception e){ 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 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 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); + } + } + } + } + } + } + } + }