Commit c50c0c19 authored by 吴卿华's avatar 吴卿华

正元app消息模块

parent 87649777
......@@ -12,7 +12,7 @@ import org.springframework.format.annotation.DateTimeFormat;
/**
* 隐患台账对象 t_staning_book
*
*
* @author zehong
* @date 2022-10-07
*/
......@@ -66,9 +66,12 @@ public class TStaningBook extends BaseEntity
/** 整改建议 */
@Excel(name = "整改建议")
private String proposal;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date rectificationTerm;
/** 投入费用 */
@Excel(name = "投入费用")
private String investmentCost;
......@@ -218,241 +221,241 @@ public class TStaningBook extends BaseEntity
this.bookId = bookId;
}
public Long getBookId()
public Long getBookId()
{
return bookId;
}
public void setTroubleName(String troubleName)
public void setTroubleName(String troubleName)
{
this.troubleName = troubleName;
}
public String getTroubleName()
public String getTroubleName()
{
return troubleName;
}
public void setTroubleType(Integer troubleType)
public void setTroubleType(Integer troubleType)
{
this.troubleType = troubleType;
}
public Integer getTroubleType()
public Integer getTroubleType()
{
return troubleType;
}
public void setTroubleLevel(Integer troubleLevel)
public void setTroubleLevel(Integer troubleLevel)
{
this.troubleLevel = troubleLevel;
}
public Integer getTroubleLevel()
public Integer getTroubleLevel()
{
return troubleLevel;
}
public void setMeasures(String measures)
public void setMeasures(String measures)
{
this.measures = measures;
}
public String getMeasures()
public String getMeasures()
{
return measures;
}
public void setTroubleHarm(String troubleHarm)
public void setTroubleHarm(String troubleHarm)
{
this.troubleHarm = troubleHarm;
}
public String getTroubleHarm()
public String getTroubleHarm()
{
return troubleHarm;
}
public void setEscalation(Long escalation)
public void setEscalation(Long escalation)
{
this.escalation = escalation;
}
public Long getEscalation()
public Long getEscalation()
{
return escalation;
}
public void setFindTime(Date findTime)
public void setFindTime(Date findTime)
{
this.findTime = findTime;
}
public Date getFindTime()
public Date getFindTime()
{
return findTime;
}
public void setPicture(String picture)
public void setPicture(String picture)
{
this.picture = picture;
}
public String getPicture()
public String getPicture()
{
return picture;
}
public void setEnclosure(String enclosure)
public void setEnclosure(String enclosure)
{
this.enclosure = enclosure;
}
public String getEnclosure()
public String getEnclosure()
{
return enclosure;
}
public void setProposal(String proposal)
public void setProposal(String proposal)
{
this.proposal = proposal;
}
public String getProposal()
public String getProposal()
{
return proposal;
}
public void setInvestmentCost(String investmentCost)
public void setInvestmentCost(String investmentCost)
{
this.investmentCost = investmentCost;
}
public String getInvestmentCost()
public String getInvestmentCost()
{
return investmentCost;
}
public void setInvestmentMaterial(String investmentMaterial)
public void setInvestmentMaterial(String investmentMaterial)
{
this.investmentMaterial = investmentMaterial;
}
public String getInvestmentMaterial()
public String getInvestmentMaterial()
{
return investmentMaterial;
}
public void setRectification(Long rectification)
public void setRectification(Long rectification)
{
this.rectification = rectification;
}
public Long getRectification()
public Long getRectification()
{
return rectification;
}
public void setRectificationPictrue(String rectificationPictrue)
public void setRectificationPictrue(String rectificationPictrue)
{
this.rectificationPictrue = rectificationPictrue;
}
public String getRectificationPictrue()
public String getRectificationPictrue()
{
return rectificationPictrue;
}
public void setRectificationText(String rectificationText)
public void setRectificationText(String rectificationText)
{
this.rectificationText = rectificationText;
}
public String getRectificationText()
public String getRectificationText()
{
return rectificationText;
}
public void setRectificationTime(Date rectificationTime)
public void setRectificationTime(Date rectificationTime)
{
this.rectificationTime = rectificationTime;
}
public Date getRectificationTime()
public Date getRectificationTime()
{
return rectificationTime;
}
public void setRemarks(String remarks)
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
public String getRemarks()
{
return remarks;
}
public void setFinishDay(Long finishDay)
public void setFinishDay(Long finishDay)
{
this.finishDay = finishDay;
}
public Long getFinishDay()
public Long getFinishDay()
{
return finishDay;
}
public void setInspectPictrue(String inspectPictrue)
public void setInspectPictrue(String inspectPictrue)
{
this.inspectPictrue = inspectPictrue;
}
public String getInspectPictrue()
public String getInspectPictrue()
{
return inspectPictrue;
}
public void setInspectTime(Date inspectTime)
public void setInspectTime(Date inspectTime)
{
this.inspectTime = inspectTime;
}
public Date getInspectTime()
public Date getInspectTime()
{
return inspectTime;
}
public void setInspectResult(String inspectResult)
public void setInspectResult(String inspectResult)
{
this.inspectResult = inspectResult;
}
public String getInspectResult()
public String getInspectResult()
{
return inspectResult;
}
public void setPersonLiable(Long personLiable)
public void setPersonLiable(Long personLiable)
{
this.personLiable = personLiable;
}
public Long getPersonLiable()
public Long getPersonLiable()
{
return personLiable;
}
public void setState(Integer state)
public void setState(Integer state)
{
this.state = state;
}
public Integer getState()
public Integer getState()
{
return state;
}
public void setDeptId(Long deptId)
public void setDeptId(Long deptId)
{
this.deptId = deptId;
}
public Long getDeptId()
public Long getDeptId()
{
return deptId;
}
public void setWorkId(Long workId)
public void setWorkId(Long workId)
{
this.workId = workId;
}
public Long getWorkId()
public Long getWorkId()
{
return workId;
}
public void setIsDel(Integer isDel)
public void setIsDel(Integer isDel)
{
this.isDel = isDel;
}
public Integer getIsDel()
public Integer getIsDel()
{
return isDel;
}
......
......@@ -115,4 +115,9 @@ public interface TTrainCourseMapper
* @return
*/
int updateReadStatus(Long newsId);
/**
* 查询接收人姓名
*/
String selectRecipient(Long userid);
}
......@@ -91,14 +91,16 @@ public class TStaningBookServiceImpl implements ITStaningBookService
public int insertTStaningBook(TStaningBook tStaningBook)
{
tStaningBook.setCreateTime(DateUtils.getNowDate());
/** 手机端消息新封装类 */
TNews tNews=new TNews();
/**设置所属模块*/
tNews.setModule(2);
//查询接收人姓名
// String nickName = tTrainCourseMapper.selectRecipient(tStaningBook.getRectification());
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String myDate = simpleDateFormat.format(tStaningBook.getRectificationTerm());
/**设置内容*/
tNews.setMessageContent("您有一条新的隐患整改信息");
tNews.setMessageContent("隐患排查:"+tStaningBook.getTroubleName()+",请于"+myDate+"前整改完毕。");
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
Long userId = user.getUserId();
......
......@@ -22,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
......@@ -69,7 +70,6 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService
return 0;
}
List<String> userIds = tTrainPlanMapper.selectAlluserByplanId(course.getCourseType());
System.out.println(userIds);
//异常数据
if(userIds==null||userIds.size()==0){
return 0;
......@@ -81,9 +81,11 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService
TNews tNews=new TNews();
/**设置所属模块*/
tNews.setModule(Integer.valueOf(tTrainCourse1.getDataKind()));
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String myDate = simpleDateFormat.format(tTrainCourse1.getTestEndTime());
if ("0".equals(tTrainCourse1.getDataKind())){
/**设置消息内容*/
tNews.setMessageContent("您有一场新的培训课程");
tNews.setMessageContent("培训课程:"+tTrainCourse1.getCourseName()+",已发布,请于"+myDate+"前进行学习");
}else {
SecurityUtils.getUsername();
tNews.setMessageContent("您有一场新的试卷考试");
......@@ -390,12 +392,13 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService
TNews tNews=new TNews();
/**设置所属模块*/
tNews.setModule(Integer.valueOf(tTrainCourse1.getDataKind()));
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String myDate = simpleDateFormat.format(tTrainCourse1.getTestEndTime());
if ("0".equals(tTrainCourse1.getDataKind())){
/**设置消息内容*/
tNews.setMessageContent("您有一场新的培训课程");
tNews.setMessageContent("培训课程:"+tTrainCourse1.getCourseName()+"已发布,请于"+myDate+"前进行学习");
}else {
SecurityUtils.getUsername();
tNews.setMessageContent("您有一场新的试卷考试");
tNews.setMessageContent("考试:"+tTrainCourse1.getCourseName()+"已发布,请于"+myDate+"前进行学习");
}
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
......
......@@ -256,9 +256,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select * from t_news where read_status='1' and recipient_id=#{recipientId} order by release_time desc
</select>
<!--修改消息状态为已读-->
<update id="updateReadStatus">
update t_news set read_status='1' where news_id=#{newsId}
</update>
<!--查询接收人姓名-->
<select id="selectRecipient" resultType="java.lang.String">
select nick_name from sys_user where user_id=#{userid}
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment