Browse Source

重要事件上报

develop
lau572 7 months ago
parent
commit
770cb0ef64
  1. 12
      zc-business/src/main/java/com/zc/business/domain/DcEventImportantFile.java
  2. 55
      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终报")
private String type;
/** 是否上报 0:否,1:是 */
@Excel(name = "是否上报 0:否,1:是")
private String status;
public Long getId() {
return id;
}
@ -155,6 +159,14 @@ public class DcEventImportantFile
return type;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

55
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.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.zc.business.domain.DcEventProcess;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -62,22 +63,24 @@ public class DcEventImportantFileServiceImpl implements IDcEventImportantFileSer
{
int i = dcEventImportantFileMapper.insertDcEventImportantFile(dcEventImportantFile);
if (i > 0){
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);
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;
}
@ -91,7 +94,27 @@ public class DcEventImportantFileServiceImpl implements IDcEventImportantFileSer
@Override
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="issued" column="issued" />
<result property="type" column="type" />
<result property="status" column="status" />
</resultMap>
<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>
<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="issued != null and issued != ''"> and issued = #{issued}</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
</select>
@ -44,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getImportantFileStatus" resultType="java.lang.Integer">
SELECT IFNULL(max(type),0) type
FROM `dc_event_important_file`
where event_id = #{eventId}
where event_id = #{eventId} and status = '1'
</select>
<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="issued != null">issued,</if>
<if test="type != null">type,</if>
<if test="status != null">status,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<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="issued != null">#{issued},</if>
<if test="type != null">#{type},</if>
<if test="status != null">#{status},</if>
</trim>
</insert>
@ -89,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="phoneNumber != null">phone_number = #{phoneNumber},</if>
<if test="issued != null">issued = #{issued},</if>
<if test="type != null">type = #{type},</if>
<if test="status != null">status = #{status},</if>
</trim>
where id = #{id}
</update>

Loading…
Cancel
Save