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 0af2edd..2551038 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/EntPostTaskMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntPostTaskMapper.java @@ -28,11 +28,13 @@ public interface EntPostTaskMapper extends BaseMapper { * @param listId 清单id * @param content 内容模糊搜索 * @param taskState 任务状态 + * @param postListId 用户要务id * @return EntPostTask 企业用户清单任务 * */ ListselectEntUserPostTask(@Param("enterpriseId") String enterpriseId, @Param("entUserId")String entUserId, @Param("postId")String postId, @Param("listId")String listId, - @Param("content")String content,@Param("taskState") Integer taskState); + @Param("content")String content,@Param("taskState") Integer taskState, + @Param("postListId")String postListId); /** @@ -80,4 +82,20 @@ public interface EntPostTaskMapper extends BaseMapper { * @param userId 用户id * */ int deleteEntPostTaskList(String userId); + + /** + * 验证履职是否完成 + * @param entPostTaskId + * @return EntPostTask + * */ + EntPostTask verifyCompletion(String entPostTaskId); + + + /** + * 修改工作要务完成状态 + * @param entPostTaskId + * @return int + * */ + int updateTaskState(String entPostTaskId); + } diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/check/BookEntHTMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/check/BookEntHTMapper.java index 9636c7e..73ec618 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/check/BookEntHTMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/check/BookEntHTMapper.java @@ -3,6 +3,7 @@ package com.rzyc.mapper.check; import com.rzyc.bean.bigdata.GetBookEntHT; import com.rzyc.bean.check.DangerExport; import com.rzyc.bean.index.AreaDangerNum; +import com.rzyc.model.DangerStatistic; import com.rzyc.model.check.BookEntHT; import com.rzyc.model.check.BookEntHTExample; import com.rzyc.model.check.DangerCount; @@ -150,7 +151,7 @@ public interface BookEntHTMapper { @Param("areaCode") String areaCode, @Param("htstate") String htstate); - ListdangerDetailByCompanyId(String SysEnterpriseId); + ListdangerDetailByCompanyId(@Param("SysEnterpriseId") String SysEnterpriseId,@Param("htState")String htState); ListdangerListRecord(@Param("title") String title, @Param("entName")String entName, @@ -266,4 +267,11 @@ public interface BookEntHTMapper { /*约谈*/ Integer lawState(@Param("bookEntHTId") String bookEntHTId); + + /** + * 查询企业隐患统计 + * @param enterpriseId 企业id + * @return DangerStatistic 隐患统计对象 + * */ + DangerStatistic selectHalfAYearEntDangerStatistics(String enterpriseId); } diff --git a/inventory-dao/src/main/java/com/rzyc/model/DangerStatistic.java b/inventory-dao/src/main/java/com/rzyc/model/DangerStatistic.java new file mode 100644 index 0000000..32dd9fd --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/model/DangerStatistic.java @@ -0,0 +1,46 @@ +package com.rzyc.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * 隐患数统计 + * @author xuwanxin + * @date 2022/12/9 + * */ +@ApiModel("企业隐患统计") +public class DangerStatistic { + + @ApiModelProperty("整改中") + private long underRectification; + + @ApiModelProperty("未整改") + private long notRectified; + + @ApiModelProperty("已整改") + private long rectified; + + public long getUnderRectification() { + return underRectification; + } + + public void setUnderRectification(long underRectification) { + this.underRectification = underRectification; + } + + public long getNotRectified() { + return notRectified; + } + + public void setNotRectified(long notRectified) { + this.notRectified = notRectified; + } + + public long getRectified() { + return rectified; + } + + public void setRectified(long rectified) { + this.rectified = rectified; + } +} diff --git a/inventory-dao/src/main/java/com/rzyc/model/EntPostListDetail.java b/inventory-dao/src/main/java/com/rzyc/model/EntPostListDetail.java index fe15075..57b3e54 100644 --- a/inventory-dao/src/main/java/com/rzyc/model/EntPostListDetail.java +++ b/inventory-dao/src/main/java/com/rzyc/model/EntPostListDetail.java @@ -5,6 +5,8 @@ import java.util.Date; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -71,6 +73,7 @@ public class EntPostListDetail implements Serializable { @TableField("IsFinish") private String IsFinish; + @JsonFormat(pattern = "yyyy-MM-dd") @ApiModelProperty(value = "完成时间") @TableField("FinishTime") private Date FinishTime; @@ -79,6 +82,10 @@ public class EntPostListDetail implements Serializable { @TableField("del_state") private Integer delState; + @ApiModelProperty(value = "履职任务名") + @TableField(exist = false) + private String itemTitle; + @TableField("CreatedOn") private Date CreatedOn; @@ -91,6 +98,14 @@ public class EntPostListDetail implements Serializable { @TableField("ModifiedBy") private String ModifiedBy; + public String getItemTitle() { + return itemTitle; + } + + public void setItemTitle(String itemTitle) { + this.itemTitle = itemTitle; + } + public String getListDetailId() { return ListDetailId; } diff --git a/inventory-dao/src/main/java/com/rzyc/model/EntPostTask.java b/inventory-dao/src/main/java/com/rzyc/model/EntPostTask.java index c8fbc18..088a74d 100644 --- a/inventory-dao/src/main/java/com/rzyc/model/EntPostTask.java +++ b/inventory-dao/src/main/java/com/rzyc/model/EntPostTask.java @@ -94,6 +94,18 @@ public class EntPostTask implements Serializable { @TableField("modify_by") private String modifyBy; + @ApiModelProperty(value = "履职次数") + @TableField(exist = false) + private Integer numberOfDutyPerformance; + + public Integer getNumberOfDutyPerformance() { + return numberOfDutyPerformance; + } + + public void setNumberOfDutyPerformance(Integer numberOfDutyPerformance) { + this.numberOfDutyPerformance = numberOfDutyPerformance; + } + public String getTaskId() { return taskId; } diff --git a/inventory-dao/src/main/java/com/rzyc/model/dto/EntPostListDetailDto.java b/inventory-dao/src/main/java/com/rzyc/model/dto/EntPostListDetailDto.java index 6647e99..56493d4 100644 --- a/inventory-dao/src/main/java/com/rzyc/model/dto/EntPostListDetailDto.java +++ b/inventory-dao/src/main/java/com/rzyc/model/dto/EntPostListDetailDto.java @@ -14,13 +14,14 @@ import java.util.Date; * */ public class EntPostListDetailDto { + @ApiModelProperty(value = "履职记录id") private String ListDetailId; @ApiModelProperty(value = "履职清单id") private String ListFactorId; - @ApiModelProperty(value = "用户id") + @ApiModelProperty(value = "公司用户id") private String SysUserId; @ApiModelProperty(value = "工作摘要") diff --git a/inventory-dao/src/main/java/com/rzyc/model/dto/EntUserPostTaskDto.java b/inventory-dao/src/main/java/com/rzyc/model/dto/EntUserPostTaskDto.java index 8cc8cf2..22b5ebc 100644 --- a/inventory-dao/src/main/java/com/rzyc/model/dto/EntUserPostTaskDto.java +++ b/inventory-dao/src/main/java/com/rzyc/model/dto/EntUserPostTaskDto.java @@ -38,14 +38,23 @@ public class EntUserPostTaskDto { @ApiModelProperty(value = "任务状态") Integer taskState; + @ApiModelProperty(value = "用户要务id") + String postListId; @ApiModelProperty(value = "页码") Integer page; - @ApiModelProperty(value = "条数") Integer pageSize; + public String getPostListId() { + return postListId; + } + + public void setPostListId(String postListId) { + this.postListId = postListId; + } + public String getEnterpriseId() { return enterpriseId; } diff --git a/inventory-dao/src/main/resources/mapper/EntPostListDetailMapper.xml b/inventory-dao/src/main/resources/mapper/EntPostListDetailMapper.xml index 4649a4d..026c073 100644 --- a/inventory-dao/src/main/resources/mapper/EntPostListDetailMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EntPostListDetailMapper.xml @@ -23,6 +23,7 @@ + @@ -30,7 +31,9 @@ ListDetailId, ListFactorId, SysUserId, WorkTitle, WorkCnt, WorkFile, StartTime, EndTime, OTCType, OTCId, enterprise_id, ent_post_task_id, IsFinish, FinishTime, del_state, CreatedOn, CreatedBy, ModifiedOn, ModifiedBy - select epl.*,sum(case when task_state = 2 then 1 else 0 end)as finishCount from ent_post_list epl left join ent_post_task ept on epl.post_list_id = ept.post_list_id + select epl.*,count(ListDetailId)as finishCount from ent_post_list epl + left join ent_post_list_detail epld on epl.post_list_id = epld.ListFactorId where epl.enterprise_id = #{enterpriseId} and epl.ent_user_id = #{entUserId} and epl.finish_state = #{finishedState} diff --git a/inventory-dao/src/main/resources/mapper/EntPostTaskMapper.xml b/inventory-dao/src/main/resources/mapper/EntPostTaskMapper.xml index 763b5e7..aa09459 100644 --- a/inventory-dao/src/main/resources/mapper/EntPostTaskMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EntPostTaskMapper.xml @@ -29,6 +29,7 @@ task_id, post_id, ent_user_id, enterprise_id, ent_list_id, list_id, post_list_id, item_title, item_content, start_time, ent_time, task_state, frequency, del_state, create_time, create_by, modify_time, modify_by + delete from ent_post_task where ent_user_id = #{entUserId} @@ -50,6 +51,9 @@ and task_state = #{taskState} + + and post_list_id = #{postListId} + + select ept.frequency,count(epld.ListDetailId)as numberOfDutyPerformance from ent_post_task ept + left join ent_post_list_detail epld on ept.task_id = epld.ent_post_task_id + where ent_post_task_id = #{entPostTaskId} + + + + update ent_post_task set task_state = 2 where ent_post_task_id = #{entPostTaskId} + + diff --git a/inventory-dao/src/main/resources/mapper/check/BookEntHTMapper.xml b/inventory-dao/src/main/resources/mapper/check/BookEntHTMapper.xml index 25b4808..3fdabe3 100644 --- a/inventory-dao/src/main/resources/mapper/check/BookEntHTMapper.xml +++ b/inventory-dao/src/main/resources/mapper/check/BookEntHTMapper.xml @@ -1301,6 +1301,9 @@ - + + UPDATE `bookentht` SET talk_state = 2 WHERE BookEntHTId = #{bookEntHTId} @@ -1698,5 +1702,10 @@ UPDATE `bookentht` SET law_state = 2 WHERE BookEntHTId = #{bookEntHTId} + + diff --git a/inventory-ent/src/main/java/com/rzyc/controller/BaseController.java b/inventory-ent/src/main/java/com/rzyc/controller/BaseController.java index 63d14cf..22fe1ee 100644 --- a/inventory-ent/src/main/java/com/rzyc/controller/BaseController.java +++ b/inventory-ent/src/main/java/com/rzyc/controller/BaseController.java @@ -1424,6 +1424,483 @@ public class BaseController { return oaTaskTimes; } + /** + * 回复推送消息 + */ + public class SendMessage implements Runnable{ + + + /** + * 发送者用户id + */ + private String sysUserId; + + /** + * 接收者用户id + */ + private String receiveId; + + /** + * 企业id + */ + private String enterpriseId; + + /** + * 推送类型 : + * 1->新增隐患 + * 2:法人审核隐患整改情况 + * 3:隐患分配整改人员 + * 4:授权签名 + * 5:隐患完成整改 + * 6:推送任务 + * 7:履职提醒 + * 8:推送履职任务 + * 9:推送履职任务 + */ + private Integer type; + + /** + * 任务级别 1:安办 2:部门 + */ + private String tasklevel; + + /** + * 隐患id + */ + private String bookEntHtId; + + /** + * 发送内容 + */ + private String sendMsg; + + /** + * 跳转到企业端检查通知 + * @param enterpriseId + */ + public SendMessage(Integer type,String sendMsg, String enterpriseId) { + this.sendMsg = sendMsg; + this.enterpriseId = enterpriseId; + this.type = type; + } + + /** + * 隐患推送构造方法 + * @param receiveId + * @param type + * @param bookEntHtId + */ + public SendMessage(String receiveId, Integer type, String bookEntHtId) { + this.receiveId = receiveId; + this.type = type; + this.bookEntHtId = bookEntHtId; + } + + public SendMessage(String sysUserId, String receiveId, Integer type, String sendMsg) { + this.sysUserId = sysUserId; + this.receiveId = receiveId; + this.type = type; + this.sendMsg = sendMsg; + } + + public SendMessage(String sysUserId, String receiveId, String enterpriseId, Integer type, String tasklevel) { + this.sysUserId = sysUserId; + this.receiveId = receiveId; + this.enterpriseId = enterpriseId; + this.type = type; + this.tasklevel = tasklevel; + } + + public SendMessage(String sysUserId, String receiveId, String enterpriseId, Integer type) { + this.sysUserId = sysUserId; + this.receiveId = receiveId; + this.enterpriseId = enterpriseId; + this.type = type; + } + + public SendMessage(String sysUserId, String enterpriseId, Integer type) { + this.sysUserId = sysUserId; + this.enterpriseId = enterpriseId; + this.type = type; + } + + public SendMessage() { + } + + @Override + public void run() { + try { + + //分配隐患人员推送 + if(1 == type){ + sendDangerMsg(enterpriseId,sysUserId); + }else if(2 == type){ + sendexamineDangerMsg(enterpriseId,sysUserId); + }else if(3 == type){ + handelDanger(sysUserId,receiveId); + }else if(4 == type){ + autographAuth(sysUserId,receiveId); + }else if(5 == type){ + completeRectification(receiveId,enterpriseId); + }else if(6 == type){ + sendTask(receiveId,sysUserId,tasklevel); + }else if(7 == type){ + sendFactorMsg(receiveId,sysUserId,sendMsg); + }else if(8 == type){ + changeDanger(receiveId,bookEntHtId); + }else if(9 == type){ + sendCheckMsg(enterpriseId,sendMsg); + } + + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + } + + + + /** + * 跳转到企业端检查通知 + * @param enterpriseId + * @param sendMsg + */ + public void sendCheckMsg(String enterpriseId,String sendMsg){ + try { + //推送别名 + String alias = ""; + //获取企业端法人账号 + SysUser sysUser = sysUserMapper.findByEntId(enterpriseId); + if(null != sysUser){ + alias = MD5.md5(sysUser.getSysuserid()); + } + //如果别名不为空 则推送消息 + if(StringUtils.isNotBlank(alias)){ + + String content = sendMsg; + //msg.wav + Map map = new HashMap(); + map.put("type","6");//跳转企业端通知页面 + + Jpush.sendAllNotifications(alias,content,map); + } + + }catch (Exception e){ + e.printStackTrace(); + } + } + + /** + * 推送履职任务 + * @param receiveId + */ + private void changeDanger(String receiveId,String bookEntHtId){ + try { + String alias = ""; + String [] strs = receiveId.split(","); + for (String str : strs){ + if(StringUtils.isNotBlank(alias)){ + alias += ","+MD5.md5(str); + }else{ + alias = MD5.md5(str); + } + } + + String content = "你提交的隐患信息已提交整改资料,请到隐患详情查看整改资料,并闭环。"; + //msg.wav + Map map = new HashMap(); + map.put("type","5");//调整到隐患详情 + map.put("bookEntHtId",bookEntHtId);//隐患id + + Jpush.sendGovAllNotifications(alias,content,map); + + }catch (Exception e){ + e.printStackTrace(); + } + } + + + /** + * 履职任务 + * @param receiveId + * @param sendId + * @param sendMsg + */ + private void sendFactorMsg(String receiveId,String sendId,String sendMsg){ + try { + SysUser sysUser = sysUserMapper.selectByPrimaryKey(sendId); + if(null != sysUser){ + String alias = ""; + String [] strs = receiveId.split(","); + for (String str : strs){ + if(StringUtils.isNotBlank(alias)){ + alias += ","+MD5.md5(str); + }else{ + alias = MD5.md5(str); + } + } + + String content = sendMsg; + //msg.wav + Map map = new HashMap(); + map.put("type","4");//跳转到履职列表 + + Jpush.sendGovAllNotifications(alias,content,map); + } + + }catch (Exception e){ + e.printStackTrace(); + } + } + + /** + * 新增任务推送 + * @param receiveId + * @param sendId + * @param taskLevel + */ + private void sendTask(String receiveId,String sendId,String taskLevel){ + try { + SysUser sysUser = sysUserMapper.selectByPrimaryKey(sendId); + if(null != sysUser){ + String alias = ""; + String [] strs = receiveId.split(","); + for (String str : strs){ + if(StringUtils.isNotBlank(alias)){ + alias += ","+MD5.md5(str); + }else{ + alias = MD5.md5(str); + } + } + String sendUserName = "安办:"; + + if("1".equals(taskLevel)){ + sendUserName += sysUser.getChinaname() + ",发布了新任务,请查看。"; + }else if("2".equals(taskLevel)){ + String unitName = this.getUnitName(sysUser.getSysuserid()); + + sendUserName = unitName+":"+sysUser.getChinaname() + ",发布了新任务,请查看。"; + } + + String content = sendUserName; + //msg.wav + Map map = new HashMap(); + map.put("type","3");//跳转到隐患列表 + + Jpush.sendGovAllNotifications(alias,content,map); + } + + }catch (Exception e){ + e.printStackTrace(); + } + } + + /** + * 完成整改 + */ + private void completeRectification(String receiveId,String enterpriseId){ + try { + String alias = ""; + String [] strs = receiveId.split(","); + for (String str : strs){ + if(StringUtils.isNotBlank(alias)){ + alias += ","+MD5.md5(str); + }else{ + alias = MD5.md5(str); + } + } + String compamyName = "企业"; + SysEnterprise sysEnterprise =sysEnterpriseMapper.selectByPrimaryKey(enterpriseId); + if(null != sysEnterprise){ + compamyName = sysEnterprise.getEntname(); + } + String content = compamyName+"的隐患已完成整改"; + //msg.wav + Map map = new HashMap(); + map.put("type","1");//跳转到隐患列表 + + Jpush.sendGovAllNotifications(alias,content,map); + }catch (Exception e){ + e.printStackTrace(); + } + } + + /** + * 推送隐患消息 + * @param enterpriseId + * @throws Exception + */ + public void sendDangerMsg(String enterpriseId,String sysUserId){ + try { + //推送别名 + String alias = ""; + //获取企业端法人账号 + SysUser sysUser = sysUserMapper.findByEntId(enterpriseId); + if(null != sysUser){ + alias = MD5.md5(sysUser.getSysuserid()); + } + + //获取企业非法人账号别名 + List sysEntUsers = sysEntUserMapper.entUser(enterpriseId); + if(null != sysEntUsers && sysEntUsers.size() > 0){ + for (SysEntUser sysEntUser : sysEntUsers){ + if(StringUtils.isNotBlank(alias)){ + alias += ","+MD5.md5(sysEntUser.getSysentuserid()); + }else{ + alias += MD5.md5(sysEntUser.getSysentuserid()); + } + } + } + + //如果别名不为空 则推送消息 + if(StringUtils.isNotBlank(alias)){ + + String deptName = this.getUnitName(sysUserId); + String content = "收到“"+deptName+"”的隐患整改通知"; + //msg.wav + Map map = new HashMap(); + map.put("type","1"); + + Jpush.sendAllNotifications(alias,content,map); + } + /*SendMessage sendMessage = new SendMessage(); + sendMessage.run();*/ + }catch (Exception e){ + e.printStackTrace(); + } + } + + /** + * 企业端非法人上传隐患整改资料 推行消息给法人账号 + * @param enterpriseId + * @throws Exception + */ + public void sendexamineDangerMsg(String enterpriseId,String sysUserId){ + try { + //推送别名 + String alias = ""; + //获取企业端法人账号 + SysUser sysUser = sysUserMapper.findByEntId(enterpriseId); + if(null != sysUser){ + alias = MD5.md5(sysUser.getSysuserid()); + } + //如果别名不为空 则推送消息 + if(StringUtils.isNotBlank(alias)){ + + String content = "收到隐患整改信息,请审核。"; + //msg.wav + Map map = new HashMap(); + map.put("type","1"); + + Jpush.sendAllNotifications(alias,content,map); + } + /*SendMessage sendMessage = new SendMessage(); + sendMessage.run();*/ + }catch (Exception e){ + e.printStackTrace(); + } + } + + /** + * 隐患分配人员后 推送消息 + */ + private void handelDanger(String sysUserId,String receiveId){ + try { + //推送别名 + String alias = ""; + //获取企业端法人账号 + SysEntUser sysEntUser = sysEntUserMapper.findById(receiveId); + if(null != sysEntUser){ + alias = MD5.md5(sysEntUser.getSysentuserid()); + } + + //如果别名不为空 则推送消息 + if(StringUtils.isNotBlank(alias)){ + + String content = "收到需整改的隐患,请及时处理。"; + //msg.wav + Map map = new HashMap(); + map.put("type","1"); + + Jpush.sendAllNotifications(alias,content,map); + } + }catch (Exception e){ + e.printStackTrace(); + } + } + + /** + * 签名授权通知 + */ + private void autographAuth(String sysUserId,String receiveId){ + try { + if(StringUtils.isNotBlank(receiveId)){ + String alias = ""; + String [] strs = receiveId.split(","); + for (String str : strs){ + if(StringUtils.isNotBlank(alias)){ + alias += ","+MD5.md5(str); + }else{ + alias = MD5.md5(str); + } + } + String deptName = this.getUnitName(sysUserId); + String content = deptName+"的安全检查需要授权签名."; + //msg.wav + Map map = new HashMap(); + map.put("type","2");//调整到签名授权页面 + + Jpush.sendGovAllNotifications(alias,content,map); + } + }catch (Exception e){ + e.printStackTrace(); + } + + + } + + + /** + * 修改企业风险等级 + * @param companyId + * @throws Exception + */ + public void changeEntRiskLevel(String companyId)throws Exception{ + + + Integer score = 100; + List entHts = bookEntHTMapper.notRectifiedDanger(companyId); + if(null != entHts && entHts.size() > 0){ + for (BookEntHT bookEntHT : entHts){ + if(HtlevelType.MAJOR.getType().equals(bookEntHT.getHtlevel())){ + score -= 20; + }else{ + score -= 5; + } + } + } + + //风险等级 + String riskLevel = "重大风险"; + if (score >= 80) { + riskLevel = "低风险"; + } + if (score < 80 & score >= 70) { + riskLevel = "一般风险"; + } + if (score < 70 & score >= 60) { + riskLevel = "较大风险"; + } + + System.out.println("score -> " + score + " & riskLevel -> " + riskLevel); + sysEnterpriseMapper.chnageScore(companyId,score,riskLevel); + + + } + } diff --git a/inventory-ent/src/main/java/com/rzyc/controller/MinWorkController.java b/inventory-ent/src/main/java/com/rzyc/controller/MinWorkController.java new file mode 100644 index 0000000..c423c07 --- /dev/null +++ b/inventory-ent/src/main/java/com/rzyc/controller/MinWorkController.java @@ -0,0 +1,346 @@ +package com.rzyc.controller; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.common.utils.*; +import com.common.utils.jwt.JwtUtil; +import com.common.utils.model.*; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import com.rzyc.advice.LoginAuth; +import com.rzyc.bean.HiddenDanger; +import com.rzyc.bean.SysEnterpriseDo; +import com.rzyc.bean.check.*; +import com.rzyc.bean.check.dto.ListQuotaDto; +import com.rzyc.bean.check.dto.ListWorkDto; +import com.rzyc.bean.check.dto.WorkPageDto; +import com.rzyc.bean.check.vo.WorkPageVo; +import com.rzyc.bean.ent.MinCompaniesDto; +import com.rzyc.enums.DelState; +import com.rzyc.enums.DocumentOtcType; +import com.rzyc.enums.FactorType; +import com.rzyc.enums.ReportSuperior; +import com.rzyc.model.*; +import com.rzyc.model.check.*; +import com.rzyc.model.ent.*; +import com.rzyc.model.user.ListFactor; +import com.rzyc.model.user.ListPerform; +import com.rzyc.model.user.SysUnit; +import com.rzyc.model.user.SysUser; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.beanutils.BeanUtils; +import org.apache.commons.beanutils.ConvertUtils; +import org.apache.commons.beanutils.converters.DateConverter; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.springframework.stereotype.Controller; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.io.*; +import java.math.BigDecimal; +import java.util.*; + +@Api(tags = "小程序") +@CrossOrigin("*") +@RequestMapping("minWork") +@Controller +@Validated +public class MinWorkController extends BaseController{ + + /** + * 小程序企业自查闭环 + * @retrun + * */ + @ApiOperation(value = "小程序企业自查闭环", notes = "小程序企业自查闭环") + @PostMapping("/companySelfBookEntHTClose") + @ApiImplicitParams({ + @ApiImplicitParam(name = "htId", value = "隐患id", required = true, dataType = "string"), + @ApiImplicitParam(name = "entHtState", value = "隐患状态", required = true, dataType = "string"), + @ApiImplicitParam(name = "sysEnterpriseId", value = "企业id", required = false, dataType = "string"), + @ApiImplicitParam(name = "rectifyResult", value = "整改描述", required = false, dataType = "string"), + }) + @ResponseBody + public SingleResult companySelfBookEntHTClose(String htId,String entHtState,String sysEnterpriseId,String rectifyResult){ + SingleResult singleResult = new SingleResult(); + bookenthtCompanyMapper.updateByKey(htId,entHtState,rectifyResult); + return singleResult; + } + + /** + * 小程序企业自查上报隐患 + * @retrun + * */ + @ApiOperation(value = "小程序企业自查上报隐患", notes = "小程序企业自查上报隐患") + @PostMapping("/companySelfBookEntHTSubmit") + @ApiImplicitParams({ + @ApiImplicitParam(name = "sysEnterpriseId", value = "企业id", required = true, dataType = "string"), + @ApiImplicitParam(name = "beCheckedTime", value = "检查时间", required = true, dataType = "string"), + @ApiImplicitParam(name = "hiddenArea", value = "隐患问题所在", required = true, dataType = "string"), + @ApiImplicitParam(name = "rectifyTime", value = "整改时间", required = true, dataType = "string"), + @ApiImplicitParam(name = "htlevel", value = "隐患等级", required = true, dataType = "string"), + @ApiImplicitParam(name = "bookEntHTId", value = "主键id", required = true, dataType = "string"), + + }) + @ResponseBody + public SingleResult companySelfBookEntHTSubmit(String sysEnterpriseId,String beCheckedTime,String hiddenArea,String rectifyTime,String htlevel,String bookEntHTId){ + SingleResult singleResult = new SingleResult(); + SysEnterprise sysEnterprise = sysEnterpriseMapper.selectByPrimaryKey(sysEnterpriseId); + if(null != sysEnterprise){ + BookEntHT bookEntHT = new BookEntHT(); + bookEntHT.setBookenthtid(bookEntHTId); + bookEntHT.setSysenterpriseid(sysEnterpriseId); + bookEntHT.setBecheckedperson(sysEnterprise.getEntname()); + bookEntHT.setHiddenarea(hiddenArea); + bookEntHT.setHtlevel(htlevel); + bookEntHT.setBecheckedtime(new Date()); + bookEntHT.setConfirmtime(DateUtils.parseCalendar2Date(Calendar.getInstance())); + bookEntHT.setHtsource("企业自查"); + bookEntHT.setRectifyperson(sysEnterprise.getLegalrepre()); + bookEntHT.setRectifytime(DateUtils.parseString2Date(rectifyTime,Constants.DATA_MEET)); + bookEntHT.setHtstate("整改中"); + bookEntHT.setCreatedby(sysEnterprise.getEntname()); + bookEntHT.setCreatedon(new Date()); + bookEntHT.setModifiedby(sysEnterprise.getEntname()); + bookEntHT.setModifiedon(new Date()); + bookenthtCompanyMapper.insert(bookEntHT); +// super.addLog(sysUserId,"","BookEntHT",bookEntHtId,"查询",JSONArray.toJSONString(params)); + }else{ + singleResult.setCode(Code.EX_PARAM.getCode()); + singleResult.setMessage(Message.EX_PARAM); + } + + return singleResult; + } + + /** + * 小程序企业自查隐患列表 + * @retrun + * */ + @ApiOperation(value = "小程序企业自查隐患列表", notes = "小程序企业自查隐患列表") + @PostMapping("/companySelfBookEntHT") + @ApiImplicitParams({ + @ApiImplicitParam(name = "HTState", value = "隐患状态", required = false, dataType = "string"), + @ApiImplicitParam(name = "sysEnterpriseId", value = "公司id", required = true, dataType = "string"), + @ApiImplicitParam(name = "page", value = "page", required = true, dataType = "int"), + @ApiImplicitParam(name = "pageSize", value = "pageSize", required = true, dataType = "int") + }) + @ResponseBody + public SingleResult companySelfBookEntHT(String HTState,String sysEnterpriseId,Integer page,Integer pageSize) throws Exception { + SingleResult singleResult = new SingleResult(); + Pager pager = new Pager(); + PageHelper.startPage(page,pageSize); + Page list = (Page)bookenthtCompanyMapper.selectCompanySelfList(HTState,sysEnterpriseId); + getDatePage(pager,list); + singleResult.setData(pager); + return singleResult; + } + + /** + * 小程序政府端闭环隐患 + * */ + @ApiOperation(value = "小程序政府端闭环隐患", notes = "小程序政府端闭环隐患") + @PostMapping("/minProgramDangerClose") + @ApiImplicitParams({ + @ApiImplicitParam(name = "sysUserId", value = "用户id", required = true, dataType = "string"), + @ApiImplicitParam(name = "htId", value = "隐患id", required = true, dataType = "string"), + @ApiImplicitParam(name = "entHtState", value = "隐患状态 整改中 已整改 未整改 审核中 ", required = true, dataType = "string"), + @ApiImplicitParam(name = "rectifyResult", value = "隐患来源 政府部门", required = true, dataType = "string"), + }) + @ResponseBody + public SingleResult minProgramDangerClose(String sysUserId,String htId,String entHtState,String rectifyResult, + HttpServletRequest httpServletRequest) throws Exception { + SingleResult result = new SingleResult(); + if(StringUtils.isNotBlank(htId)){ + BookEntHT bookEntHT = bookEntHTMapper.selectByPrimaryKey(htId); + if(null != bookEntHT){ + if(StringUtils.isNotBlank(entHtState) && !("审核中".equals(entHtState))){ + + List userIds = this.getCheckUserId(htId); + if((null != userIds && userIds.contains(sysUserId)) || StringUtils.isBlank(bookEntHT.getRectifyUserId())){ + String oldHTState = bookEntHT.getHtstate(); + + + //修改状态为未整改 如果未超期 状态变为 整改中 + if("未整改".equals(entHtState)){ + if(Calendar.getInstance().getTimeInMillis() < bookEntHT.getRectifytime().getTime()){ + entHtState = "整改中"; + } + } + + + /** + * 如果整改成功 给政府账号推送一个通知 + * 如果未整改完成 则判断是否分配了整改人员 如果分配了 + * 则推送一条消息 给整改人 + */ + + if(entHtState.equals("已整改")){ + + + + //推送消息给政府端 + /* SendMessage sendMessage = new SendMessage("", bookEntHT.getCreatedby(), bookEntHT.getSysenterpriseid(), 5); + sendMessage.run();*/ + }else if(entHtState.equals("未整改") || entHtState.equals("整改中")){ + //状态变为未整改 或者 整改中 + if(StringUtils.isNotBlank(bookEntHT.getRectifyUserId())){ + //未整改 并且整改人员不为空 则推送 + //推送消息 + SendMessage sendMessage = new SendMessage(bookEntHT.getCreatedby(), bookEntHT.getRectifyUserId(), bookEntHT.getSysenterpriseid(), 3); + Thread thread = new Thread(sendMessage); + thread.start(); + } + + + } + + bookEntHTMapper.changeHTState(htId,entHtState,rectifyResult); + + //修改分数 +/* if("未整改".equals(entHtState) || "已整改".equals(entHtState)){ + String HTStete = entHtState; + super.changeDagerGrage(bookEntHtId,oldHTState,HTStete); + }*/ + + result.setMessage("隐患状态修改成功"); + }else{ + result.setCode(Code.ERROR.getCode()); + result.setMessage("您不是该隐患上传者,暂无权限闭环该隐患。"); + } + + + }else{ + + bookEntHTMapper.changeRectifyResult(htId,rectifyResult); + + //推送给法人 让法人确认 + SendMessage sendMessage = new SendMessage(sysUserId, bookEntHT.getSysenterpriseid(), 2); + Thread thread = new Thread(sendMessage); + thread.start(); + + + result.setMessage("提交审核成功"); + + //推送给政府检查人员 + List chkPeople = chkPersonMapper.findByCheckId(bookEntHT.getBookentcheckid()); + if(null != chkPeople && chkPeople.size() > 0){ + String receiveId = ""; + for (ChkPerson chkPerson : chkPeople){ + if(StringUtils.isNotBlank(receiveId)){ + receiveId += ","+chkPerson.getSysuserid(); + }else{ + receiveId = chkPerson.getSysuserid(); + } + } + + SendMessage dangerSendMsg = new SendMessage(receiveId, 8, bookEntHT.getBookenthtid()); + Thread dangerthread = new Thread(dangerSendMsg); + dangerthread.start(); + } + + //添加通知 + addNotice(bookEntHT.getSysenterpriseid(),bookEntHT.getHiddenarea()); + + + } + + //修改分数 + changeEntRiskLevel(bookEntHT.getSysenterpriseid()); + }else{ + result.setCode(Code.NO_DATA.getCode()); + result.setMessage(Message.NO_DATA); + } + }else{ + result.setCode(Code.EX_PARAM.getCode()); + result.setMessage(Message.EX_PARAM); + } + return result; + } + + /** + * 添加隐患通知 + * @param entId + * @throws Exception + */ + private void addNotice(String entId,String dangerContent)throws Exception{ + List dutyTrees = dutyTreeMapper.findByTargetId(entId); + if(null != dutyTrees && dutyTrees.size() > 0 ){ + List notices = new ArrayList<>(); + String content = ""; + SysEnterprise enterprise = sysEnterpriseMapper.selectByPrimaryKey(entId); + if(null != enterprise){ + content = enterprise.getEntname()+"的"; + } + content += "隐患<"+dangerContent+">,"; + content += "已上传整改信息。"; + + for (DutyTree dutyTree : dutyTrees){ + Notice notice = new Notice(); + notice.setId(RandomNumber.getUUid()); + notice.setTitle("隐患整改"); + notice.setCompanyid(entId); + notice.setCheckuserid(dutyTree.getUserId()); + notice.setContent(content); + notice.setReadState(1+""); + notice.setType(1); + notice.setCreateTime(new Date()); + notices.add(notice); + } + + noticeMapper.insertList(notices); + + } + + } + + + /** + * 获取隐患检查人员id + * @param bookEntHTId + * @return + * @throws Exception + */ + private List getCheckUserId(String bookEntHTId)throws Exception{ + List userIds = new ArrayList<>(); + List chkPeople = chkPersonMapper.findByBookEntHTId(bookEntHTId); + if(null != chkPeople && chkPeople.size() > 0){ + for (ChkPerson chkPerson : chkPeople){ + userIds.add(chkPerson.getSysuserid()); + } + } + return userIds; + } + + /** + * 小程序查看通知 + * @return + * @throws Exception + * */ + @ApiOperation(value = "小程序查看通知", notes = "小程序查看通知") + @PostMapping("/noticeList") + @ApiImplicitParams({ + @ApiImplicitParam(name = "checkUserId", value = "检查人Id", required = true, dataType = "string"), + @ApiImplicitParam(name = "type", value = "类型数组", required = true, dataType = "string"), + }) + @ResponseBody + public SingleResult noticeList(String checkUserId,String type) throws Exception { + SingleResult singleResult = new SingleResult(); + List types = new ArrayList<>(); + if(StringUtils.isNotBlank(type)){ + types = JSONArray.parseArray(type,Integer.class); + } + Listnotices = noticeMapper.selectList(checkUserId,types); + singleResult.setData(notices); + return singleResult; + } + + + +} diff --git a/inventory-ent/src/main/java/com/rzyc/controller/PcCompanyController.java b/inventory-ent/src/main/java/com/rzyc/controller/PcCompanyController.java index de55f8b..b7af299 100644 --- a/inventory-ent/src/main/java/com/rzyc/controller/PcCompanyController.java +++ b/inventory-ent/src/main/java/com/rzyc/controller/PcCompanyController.java @@ -1,10 +1,7 @@ package com.rzyc.controller; import com.alibaba.fastjson.JSONArray; -import com.common.utils.DateUtils; -import com.common.utils.RandomNumber; -import com.common.utils.StringUtils; -import com.common.utils.TypeConversion; +import com.common.utils.*; import com.common.utils.encryption.PasswdFactory; import com.common.utils.excel.ExcelUtils; import com.common.utils.jwt.JwtUtil; @@ -22,6 +19,7 @@ import com.rzyc.bean.ent.*; import com.rzyc.bean.user.dto.LoginDto; import com.rzyc.config.MethodAnnotation; import com.rzyc.model.Accident; +import com.rzyc.model.DangerStatistic; import com.rzyc.model.EntCertificates; import com.rzyc.model.check.*; import com.rzyc.model.ent.EntBillCon; @@ -29,6 +27,7 @@ import com.rzyc.model.ent.InEntList; import com.rzyc.model.ent.SysEnterprise; import com.rzyc.model.user.SysUnit; import com.rzyc.model.user.SysUser; +import com.rzyc.service.MobileBusinessService; import com.rzyc.service.PcBusinessService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -52,10 +51,7 @@ import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.sql.Timestamp; import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.List; +import java.util.*; /** * @author dong @@ -68,9 +64,17 @@ import java.util.List; @Controller @Validated public class PcCompanyController extends BaseController{ - @Autowired + PcBusinessService pcBusinessService; + MobileBusinessService mobileBusinessService; + + @Autowired + public PcCompanyController(PcBusinessService pcBusinessService, MobileBusinessService mobileBusinessService) { + this.pcBusinessService = pcBusinessService; + this.mobileBusinessService = mobileBusinessService; + } + /** * PC企业详细 * @return @@ -265,15 +269,16 @@ public class PcCompanyController extends BaseController{ @ApiImplicitParams({ @ApiImplicitParam(name = "SysEnterpriseId", value = "公司id", required = true, dataType = "string"), @ApiImplicitParam(name = "page", value = "页数", required = true, dataType = "int"), - @ApiImplicitParam(name = "pageSize", value = "条数", required = true, dataType = "int") + @ApiImplicitParam(name = "pageSize", value = "条数", required = true, dataType = "int"), + @ApiImplicitParam(name = "htState", value = "隐患条件", required = false, dataType = "string") }) @PostMapping("/companyDetailDanger") @ResponseBody - public SingleResult> companyDetailDanger(String SysEnterpriseId, Integer page, Integer pageSize)throws Exception { + public SingleResult> companyDetailDanger(String SysEnterpriseId, Integer page, Integer pageSize,String htState)throws Exception { SingleResult singleResult = new SingleResult(); Pager pager = new Pager<>(); PageHelper.startPage(page, pageSize); - ListbookEntHTS = bookEntHTMapper.dangerDetailByCompanyId(SysEnterpriseId); + ListbookEntHTS = bookEntHTMapper.dangerDetailByCompanyId(SysEnterpriseId,htState); PagebookEnt =(Page) bookEntHTS; getDatePage(pager,bookEnt); if (bookEntHTS != null){ @@ -917,6 +922,88 @@ public class PcCompanyController extends BaseController{ } + /** + * 企业半年统计隐患 + * @return list + * @throws Exception + */ + @ApiOperation(value = "企业半年统计隐患", notes = "企业半年统计隐患") + @GetMapping(value = "/entDangerStatistics") + @ApiImplicitParams({ + @ApiImplicitParam(name = "enterpriseId", value = "企业id",required = true, dataType = "string"), + }) + @ResponseBody + public SingleResult entDangerStatistics(@RequestParam(required = true)String enterpriseId)throws Exception{ + return mobileBusinessService.entDangerStatistics(enterpriseId); + } + + + /** + * 小程序企业自查闭环 + * @retrun + * */ + @ApiOperation(value = "小程序企业自查闭环", notes = "小程序企业自查闭环") + @PostMapping("/companySelfBookEntHTClose") + @ApiImplicitParams({ + @ApiImplicitParam(name = "htId", value = "隐患id", required = true, dataType = "string"), + @ApiImplicitParam(name = "entHtState", value = "隐患状态", required = true, dataType = "string"), + @ApiImplicitParam(name = "sysEnterpriseId", value = "企业id", required = false, dataType = "string"), + @ApiImplicitParam(name = "rectifyResult", value = "整改描述", required = false, dataType = "string"), + }) + @ResponseBody + public SingleResult companySelfBookEntHTClose(String htId,String entHtState,String sysEnterpriseId,String rectifyResult){ + SingleResult singleResult = new SingleResult(); + bookenthtCompanyMapper.updateByKey(htId,entHtState,rectifyResult); + return singleResult; + } + + /** + * 小程序企业自查上报隐患 + * @retrun + * */ + @ApiOperation(value = "小程序企业自查上报隐患", notes = "小程序企业自查上报隐患") + @PostMapping("/companySelfBookEntHTSubmit") + @ApiImplicitParams({ + @ApiImplicitParam(name = "sysEnterpriseId", value = "企业id", required = true, dataType = "string"), + @ApiImplicitParam(name = "beCheckedTime", value = "检查时间", required = true, dataType = "string"), + @ApiImplicitParam(name = "hiddenArea", value = "隐患问题所在", required = true, dataType = "string"), + @ApiImplicitParam(name = "rectifyTime", value = "整改时间", required = true, dataType = "string"), + @ApiImplicitParam(name = "htlevel", value = "隐患等级", required = true, dataType = "string"), + @ApiImplicitParam(name = "bookEntHTId", value = "主键id", required = true, dataType = "string"), + + }) + @ResponseBody + public SingleResult companySelfBookEntHTSubmit(String sysEnterpriseId,String beCheckedTime,String hiddenArea,String rectifyTime,String htlevel,String bookEntHTId){ + SingleResult singleResult = new SingleResult(); + SysEnterprise sysEnterprise = sysEnterpriseMapper.selectByPrimaryKey(sysEnterpriseId); + if(null != sysEnterprise){ + BookEntHT bookEntHT = new BookEntHT(); + bookEntHT.setBookenthtid(bookEntHTId); + bookEntHT.setSysenterpriseid(sysEnterpriseId); + bookEntHT.setBecheckedperson(sysEnterprise.getEntname()); + bookEntHT.setHiddenarea(hiddenArea); + bookEntHT.setHtlevel(htlevel); + bookEntHT.setBecheckedtime(new Date()); + bookEntHT.setConfirmtime(DateUtils.parseCalendar2Date(Calendar.getInstance())); + bookEntHT.setHtsource("企业自查"); + bookEntHT.setRectifyperson(sysEnterprise.getLegalrepre()); + bookEntHT.setRectifytime(DateUtils.parseString2Date(rectifyTime, Constants.DATA_MEET)); + bookEntHT.setHtstate("整改中"); + bookEntHT.setCreatedby(sysEnterprise.getEntname()); + bookEntHT.setCreatedon(new Date()); + bookEntHT.setModifiedby(sysEnterprise.getEntname()); + bookEntHT.setModifiedon(new Date()); + bookenthtCompanyMapper.insert(bookEntHT); +// super.addLog(sysUserId,"","BookEntHT",bookEntHtId,"查询",JSONArray.toJSONString(params)); + }else{ + singleResult.setCode(Code.EX_PARAM.getCode()); + singleResult.setMessage(Message.EX_PARAM); + } + + return singleResult; + } + + } diff --git a/inventory-ent/src/main/java/com/rzyc/controller/PersonalController.java b/inventory-ent/src/main/java/com/rzyc/controller/PersonalController.java index c5e8505..6aa9bee 100644 --- a/inventory-ent/src/main/java/com/rzyc/controller/PersonalController.java +++ b/inventory-ent/src/main/java/com/rzyc/controller/PersonalController.java @@ -427,8 +427,8 @@ public class PersonalController extends BaseController{ @PreAuthorize("hasAnyAuthority('entPostListDetail:update')") @MethodAnnotation(authorizations = {"entPostListDetail:update"},name = "查询履职记录列表") @ResponseBody - public SingleResult selectPostListDetail(String postListId,String userId)throws Exception{ - return pcBusinessService.selectPostListDetail(postListId,userId); + public SingleResult selectPostListDetail(String postListId,String userId,Integer page,Integer pageSize)throws Exception{ + return pcBusinessService.selectPostListDetail(postListId,userId,page,pageSize); } @@ -546,4 +546,7 @@ public class PersonalController extends BaseController{ + + + } diff --git a/inventory-ent/src/main/java/com/rzyc/controller/UploadController.java b/inventory-ent/src/main/java/com/rzyc/controller/UploadController.java index 574bf0f..685ecd6 100644 --- a/inventory-ent/src/main/java/com/rzyc/controller/UploadController.java +++ b/inventory-ent/src/main/java/com/rzyc/controller/UploadController.java @@ -171,17 +171,22 @@ public class UploadController extends com.rzyc.controller.BaseController { @ApiImplicitParams({ @ApiImplicitParam(name = "userId", value = "用户id", required = true, dataType = "string"), @ApiImplicitParam(name = "OTCId", value = "目标uuid", required = true, dataType = "string"), - @ApiImplicitParam(name = "OTCType", value = "文件类型", required = true, dataType = "string") + @ApiImplicitParam(name = "OTCType", value = "文件类型", required = true, dataType = "string"), + @ApiImplicitParam(name = "trueName", value = "文件名", required = false, dataType = "string") }) @ResponseBody @RequestMapping(value = "/upload", method = RequestMethod.POST) - public FileResult upload(String userId, String OTCId, String OTCType, MultipartFile file) { + public FileResult upload(String userId, String OTCId, String OTCType,String trueName, MultipartFile file) { FileResult fileResult = new FileResult(); Boolean success = false; + //赋值 + String fileName = trueName; try { String url = ""; - String fileName = file.getOriginalFilename(); + if (StringUtils.isBlank(fileName)) { + fileName = file.getOriginalFilename(); + } System.out.println("file name is -> "+fileName); String suffix = fileName.substring(fileName.lastIndexOf(".")+1,fileName.length()); suffix = suffix.toLowerCase(); diff --git a/inventory-ent/src/main/java/com/rzyc/service/MobileBusinessService.java b/inventory-ent/src/main/java/com/rzyc/service/MobileBusinessService.java index 34ff9ea..04038bb 100644 --- a/inventory-ent/src/main/java/com/rzyc/service/MobileBusinessService.java +++ b/inventory-ent/src/main/java/com/rzyc/service/MobileBusinessService.java @@ -4,6 +4,7 @@ package com.rzyc.service; import com.common.utils.model.SingleResult; import com.common.utils.pager.PageOperation; import com.rzyc.controller.BaseController; +import com.rzyc.model.DangerStatistic; import com.rzyc.model.EntDevice; import org.springframework.stereotype.Service; @@ -25,5 +26,12 @@ public class MobileBusinessService extends BaseController { return singleResult; } + public SingleResult entDangerStatistics(String enterpriseId){ + SingleResult singleResult = new SingleResult(); + DangerStatistic dangerStatistic = bookEntHTMapper.selectHalfAYearEntDangerStatistics(enterpriseId); + singleResult.setData(dangerStatistic); + return singleResult; + } + } diff --git a/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java b/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java index e0e54da..9edabfc 100644 --- a/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java +++ b/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java @@ -14,6 +14,7 @@ import com.rzyc.config.RedisUtil; import com.rzyc.controller.BaseController; import com.rzyc.enums.DelState; import com.rzyc.enums.RedisKeys; +import com.rzyc.mapper.EntPostTaskMapper; import com.rzyc.model.*; import com.rzyc.model.dto.*; import com.rzyc.model.ent.EntPost; @@ -141,7 +142,7 @@ public class PcBusinessService extends BaseController { } //EntPostTask Listlist = entPostTaskMapper.selectEntUserPostTask(entUserPostTaskDto.getEnterpriseId(),entUserPostTaskDto.getEntUserId(),entUserPostTaskDto.getPostId() - ,entUserPostTaskDto.getListId(),entUserPostTaskDto.getContent(),entUserPostTaskDto.getTaskState()); + ,entUserPostTaskDto.getListId(),entUserPostTaskDto.getContent(),entUserPostTaskDto.getTaskState(),entUserPostTaskDto.getPostListId()); return list; } @@ -1177,10 +1178,18 @@ public class PcBusinessService extends BaseController { singleResult.setCode(Code.ERROR.getCode()); singleResult.setMessage(Message.ERROR); } + //判断任务是否完成,完成则修改为完成状态 + if (null != entPostListDetailDto.getEntPostTaskId()){ + EntPostTask entPostTask = entPostTaskMapper.verifyCompletion(entPostListDetailDto.getEntPostTaskId()); + if (entPostTask.getNumberOfDutyPerformance().equals(entPostTask.getFrequency())){ + entPostTaskMapper.updateTaskState(entPostListDetailDto.getEntPostTaskId()); + } + } return singleResult; } - public SingleResult selectPostListDetail(String postListId,String userId){ + @PageOperation + public SingleResult selectPostListDetail(String postListId,String userId,Integer page,Integer pageSize){ SingleResult singleResult = new SingleResult(); List list = entPostListDetailMapper.selectListDetail(postListId,userId); singleResult.setData(list);