Browse Source

重要事件上报

develop
lau572 7 months ago
parent
commit
770cb0ef64
  1. 12
      zc-business/src/main/java/com/zc/business/domain/DcEventImportantFile.java
  2. 33
      zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java
  3. 9
      zc-business/src/main/resources/mapper/business/DcEventImportantFileMapper.xml

12
zc-business/src/main/java/com/zc/business/domain/DcEventImportantFile.java

@ -56,6 +56,10 @@ public class DcEventImportantFile
@Excel(name = "类型 1:初报,2续报,3终报") @Excel(name = "类型 1:初报,2续报,3终报")
private String type; private String type;
/** 是否上报 0:否,1:是 */
@Excel(name = "是否上报 0:否,1:是")
private String status;
public Long getId() { public Long getId() {
return id; return id;
} }
@ -155,6 +159,14 @@ public class DcEventImportantFile
return type; return type;
} }
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

33
zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java

@ -6,6 +6,7 @@ import java.util.List;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.zc.business.domain.DcEventProcess; import com.zc.business.domain.DcEventProcess;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -62,22 +63,24 @@ public class DcEventImportantFileServiceImpl implements IDcEventImportantFileSer
{ {
int i = dcEventImportantFileMapper.insertDcEventImportantFile(dcEventImportantFile); int i = dcEventImportantFileMapper.insertDcEventImportantFile(dcEventImportantFile);
if (i > 0){ if (i > 0){
if (StringUtils.isNotEmpty(dcEventImportantFile.getStatus()) && "1".equals(dcEventImportantFile.getStatus())) {
DcEventProcess dcEventProcess = new DcEventProcess(); DcEventProcess dcEventProcess = new DcEventProcess();
dcEventProcess.setEventId(dcEventImportantFile.getEventId()); dcEventProcess.setEventId(dcEventImportantFile.getEventId());
dcEventProcess.setSource(1); dcEventProcess.setSource(1);
dcEventProcess.setProcessType(4); dcEventProcess.setProcessType(4);
dcEventProcess.setProcessId(dcEventImportantFile.getId()); dcEventProcess.setProcessId(dcEventImportantFile.getId());
String context = "重要事件"; String context = "重要事件";
if ("1".equals(dcEventImportantFile.getType())){ if ("1".equals(dcEventImportantFile.getType())) {
context = "重要事件初报"; context = "重要事件初报";
} else if ("2".equals(dcEventImportantFile.getType())){ } else if ("2".equals(dcEventImportantFile.getType())) {
context = "重要事件续报"; context = "重要事件续报";
} else if ("3".equals(dcEventImportantFile.getType())){ } else if ("3".equals(dcEventImportantFile.getType())) {
context = "重要事件终报"; context = "重要事件终报";
} }
dcEventProcess.setContext(context); dcEventProcess.setContext(context);
dcEventProcessService.insertDcEventProcess(dcEventProcess); dcEventProcessService.insertDcEventProcess(dcEventProcess);
}
} }
return i; return i;
} }
@ -91,7 +94,27 @@ public class DcEventImportantFileServiceImpl implements IDcEventImportantFileSer
@Override @Override
public int updateDcEventImportantFile(DcEventImportantFile dcEventImportantFile) public int updateDcEventImportantFile(DcEventImportantFile dcEventImportantFile)
{ {
return dcEventImportantFileMapper.updateDcEventImportantFile(dcEventImportantFile); int i = dcEventImportantFileMapper.updateDcEventImportantFile(dcEventImportantFile);
if (i > 0){
if (StringUtils.isNotEmpty(dcEventImportantFile.getStatus()) && "1".equals(dcEventImportantFile.getStatus())){
DcEventProcess dcEventProcess = new DcEventProcess();
dcEventProcess.setEventId(dcEventImportantFile.getEventId());
dcEventProcess.setSource(1);
dcEventProcess.setProcessType(4);
dcEventProcess.setProcessId(dcEventImportantFile.getId());
String context = "重要事件";
if ("1".equals(dcEventImportantFile.getType())){
context = "重要事件初报";
} else if ("2".equals(dcEventImportantFile.getType())){
context = "重要事件续报";
} else if ("3".equals(dcEventImportantFile.getType())){
context = "重要事件终报";
}
dcEventProcess.setContext(context);
dcEventProcessService.insertDcEventProcess(dcEventProcess);
}
}
return i;
} }
/** /**

9
zc-business/src/main/resources/mapper/business/DcEventImportantFileMapper.xml

@ -16,10 +16,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="phoneNumber" column="phone_number" /> <result property="phoneNumber" column="phone_number" />
<result property="issued" column="issued" /> <result property="issued" column="issued" />
<result property="type" column="type" /> <result property="type" column="type" />
<result property="status" column="status" />
</resultMap> </resultMap>
<sql id="selectDcEventImportantFileVo"> <sql id="selectDcEventImportantFileVo">
select id,event_id, from_dept, create_time, title, to_dept, content, create_name, phone_number, issued, type from dc_event_important_file select id,event_id, from_dept, create_time, title, to_dept, content, create_name, phone_number, issued, type,status from dc_event_important_file
</sql> </sql>
<select id="selectDcEventImportantFileList" parameterType="DcEventImportantFile" resultMap="DcEventImportantFileResult"> <select id="selectDcEventImportantFileList" parameterType="DcEventImportantFile" resultMap="DcEventImportantFileResult">
@ -34,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="phoneNumber != null and phoneNumber != ''"> and phone_number = #{phoneNumber}</if> <if test="phoneNumber != null and phoneNumber != ''"> and phone_number = #{phoneNumber}</if>
<if test="issued != null and issued != ''"> and issued = #{issued}</if> <if test="issued != null and issued != ''"> and issued = #{issued}</if>
<if test="type != null and type != ''"> and type = #{type}</if> <if test="type != null and type != ''"> and type = #{type}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where> </where>
</select> </select>
@ -44,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getImportantFileStatus" resultType="java.lang.Integer"> <select id="getImportantFileStatus" resultType="java.lang.Integer">
SELECT IFNULL(max(type),0) type SELECT IFNULL(max(type),0) type
FROM `dc_event_important_file` FROM `dc_event_important_file`
where event_id = #{eventId} where event_id = #{eventId} and status = '1'
</select> </select>
<insert id="insertDcEventImportantFile" parameterType="DcEventImportantFile" useGeneratedKeys="true" keyProperty="id"> <insert id="insertDcEventImportantFile" parameterType="DcEventImportantFile" useGeneratedKeys="true" keyProperty="id">
@ -60,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="phoneNumber != null">phone_number,</if> <if test="phoneNumber != null">phone_number,</if>
<if test="issued != null">issued,</if> <if test="issued != null">issued,</if>
<if test="type != null">type,</if> <if test="type != null">type,</if>
<if test="status != null">status,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="eventId != null">#{eventId},</if> <if test="eventId != null">#{eventId},</if>
@ -72,6 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="phoneNumber != null">#{phoneNumber},</if> <if test="phoneNumber != null">#{phoneNumber},</if>
<if test="issued != null">#{issued},</if> <if test="issued != null">#{issued},</if>
<if test="type != null">#{type},</if> <if test="type != null">#{type},</if>
<if test="status != null">#{status},</if>
</trim> </trim>
</insert> </insert>
@ -89,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="phoneNumber != null">phone_number = #{phoneNumber},</if> <if test="phoneNumber != null">phone_number = #{phoneNumber},</if>
<if test="issued != null">issued = #{issued},</if> <if test="issued != null">issued = #{issued},</if>
<if test="type != null">type = #{type},</if> <if test="type != null">type = #{type},</if>
<if test="status != null">status = #{status},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>

Loading…
Cancel
Save