Browse Source

新增重要事件文件逻辑

develop
lau572 6 months ago
parent
commit
06803eb960
  1. 11
      zc-business/src/main/java/com/zc/business/mapper/DcEventImportantFileMapper.java
  2. 4
      zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java
  3. 3
      zc-business/src/main/resources/mapper/business/DcEventImportantFileMapper.xml

11
zc-business/src/main/java/com/zc/business/mapper/DcEventImportantFileMapper.java

@ -4,6 +4,7 @@ import java.util.List;
import com.ruoyi.common.core.domain.AjaxResult;
import com.zc.business.domain.DcEventImportantFile;
import org.apache.ibatis.annotations.Param;
/**
* 重要事件文件内容Mapper接口
@ -61,6 +62,16 @@ public interface DcEventImportantFileMapper
*/
int deleteDcEventImportantFileByEventIds(String[] ids);
/**
* 删除重要事件文件内容
*
* @param eventId 事件id
* @param type 类型
* @return 结果
*/
int deleteDcEventImportantFile(@Param("eventId") String eventId, @Param("type") String type);
/**
* 获取重要事件状态
*

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

@ -86,6 +86,10 @@ public class DcEventImportantFileServiceImpl implements IDcEventImportantFileSer
if (StringUtils.isEmpty(dcEventImportantFile.getEventId())){
return AjaxResult.error("事件id不能为空!");
}
if ("1".equals(dcEventImportantFile.getType()) || "3".equals(dcEventImportantFile.getType())){
dcEventImportantFileMapper.deleteDcEventImportantFile(dcEventImportantFile.getEventId(),dcEventImportantFile.getType());
}
dcEventImportantFileMapper.selectDcEventImportantFileList(dcEventImportantFile);
int i = dcEventImportantFileMapper.insertDcEventImportantFile(dcEventImportantFile);
if (i > 0){
if (StringUtils.isNotEmpty(dcEventImportantFile.getStatus()) && "1".equals(dcEventImportantFile.getStatus())) {

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

@ -111,4 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<delete id="deleteDcEventImportantFile">
delete from dc_event_important_file where event_id = #{eventId} and type = #{type}
</delete>
</mapper>
Loading…
Cancel
Save