Răsfoiți Sursa

对接修改

车车 3 luni în urmă
părinte
comite
4f3784111c

+ 3 - 6
yudao-module-iscs/src/main/java/cn/iocoder/yudao/module/iscs/controller/admin/sop/vo/SopExecutionPlanPageReqVO.java

@@ -1,10 +1,10 @@
 package cn.iocoder.yudao.module.iscs.controller.admin.sop.vo;
 
-import lombok.*;
-import java.util.*;
-import io.swagger.v3.oas.annotations.media.Schema;
 import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
+
 import java.time.LocalDateTime;
 
 import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@@ -16,9 +16,6 @@ public class SopExecutionPlanPageReqVO extends PageParam {
     @Schema(description = "SOPID", example = "5810")
     private Long sopId;
 
-    @Schema(description = "启用状态(0正常 1停用)", example = "2")
-    private Integer status;
-
     @Schema(description = "执行频率单位(0-年 1-月 2-周 3-天)")
     private Integer frequencyUnit;
 

+ 0 - 4
yudao-module-iscs/src/main/java/cn/iocoder/yudao/module/iscs/controller/admin/sop/vo/SopExecutionPlanRespVO.java

@@ -21,10 +21,6 @@ public class SopExecutionPlanRespVO {
     @ExcelProperty("SOPID")
     private Long sopId;
 
-    @Schema(description = "启用状态(0正常 1停用)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
-    @ExcelProperty("启用状态(0正常 1停用)")
-    private Integer status;
-
     @Schema(description = "执行频率单位(0-年 1-月 2-周 3-天)", requiredMode = Schema.RequiredMode.REQUIRED)
     @ExcelProperty("执行频率单位(0-年 1-月 2-周 3-天)")
     private Integer frequencyUnit;

+ 3 - 4
yudao-module-iscs/src/main/java/cn/iocoder/yudao/module/iscs/controller/admin/sop/vo/SopExecutionPlanSaveReqVO.java

@@ -17,10 +17,6 @@ public class SopExecutionPlanSaveReqVO {
     @NotNull(message = "SOPID不能为空")
     private Long sopId;
 
-    @Schema(description = "启用状态(0正常 1停用)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
-    @NotNull(message = "启用状态(0正常 1停用)不能为空")
-    private Integer status;
-
     @Schema(description = "执行频率单位(0-年 1-月 2-周 3-天)", requiredMode = Schema.RequiredMode.REQUIRED)
     @NotNull(message = "执行频率单位(0-年 1-月 2-周 3-天)不能为空")
     private Integer frequencyUnit;
@@ -69,4 +65,7 @@ public class SopExecutionPlanSaveReqVO {
     @Schema(description = "开始时间")
     private LocalDateTime createTime;
 
+    @Schema(description = "启用执行计划(0不启用 1启用)")
+    private Integer enableExecutionPlan;
+
 }

+ 0 - 4
yudao-module-iscs/src/main/java/cn/iocoder/yudao/module/iscs/dal/dataobject/sop/SopExecutionPlanDO.java

@@ -30,10 +30,6 @@ public class SopExecutionPlanDO extends BaseDO {
      * SOPID
      */
     private Long sopId;
-    /**
-     * 启用状态(0正常 1停用)
-     */
-    private Integer status;
     /**
      * 执行频率单位(0-年 1-月 2-周 3-天)
      */

+ 0 - 1
yudao-module-iscs/src/main/java/cn/iocoder/yudao/module/iscs/dal/mysql/sop/SopExecutionPlanMapper.java

@@ -23,7 +23,6 @@ public interface SopExecutionPlanMapper extends BaseMapperX<SopExecutionPlanDO>
     default PageResult<SopExecutionPlanDO> selectPage(SopExecutionPlanPageReqVO reqVO) {
         return selectPage(reqVO, new LambdaQueryWrapperX<SopExecutionPlanDO>()
                 .eqIfPresent(SopExecutionPlanDO::getSopId, reqVO.getSopId())
-                .eqIfPresent(SopExecutionPlanDO::getStatus, reqVO.getStatus())
                 .eqIfPresent(SopExecutionPlanDO::getFrequencyUnit, reqVO.getFrequencyUnit())
                 .eqIfPresent(SopExecutionPlanDO::getFrequency, reqVO.getFrequency())
                 .eqIfPresent(SopExecutionPlanDO::getTimePoint, reqVO.getTimePoint())

+ 14 - 1
yudao-module-iscs/src/main/java/cn/iocoder/yudao/module/iscs/service/sop/SopExecutionPlanServiceImpl.java

@@ -5,6 +5,7 @@ import cn.hutool.core.lang.Assert;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
 import cn.iocoder.yudao.module.iscs.controller.admin.sop.vo.*;
+import cn.iocoder.yudao.module.iscs.dal.dataobject.sop.SopDO;
 import cn.iocoder.yudao.module.iscs.dal.dataobject.sop.SopExecutionPlanDO;
 import cn.iocoder.yudao.module.iscs.dal.mysql.sop.SopExecutionPlanMapper;
 import cn.iocoder.yudao.module.iscs.utils.SuperDateUtils;
@@ -78,6 +79,13 @@ public class SopExecutionPlanServiceImpl extends ServiceImpl<SopExecutionPlanMap
         // 更新
         SopExecutionPlanDO updateObj = BeanUtils.toBean(updateReqVO, SopExecutionPlanDO.class);
         sopExecutionPlanMapper.updateById(updateObj);
+
+        // 修改sop的执行计划开启或关闭状态
+        if (updateReqVO.getSopId() != null && updateReqVO.getEnableExecutionPlan() != null) {
+            sopService.update(Wrappers.<SopDO>lambdaUpdate()
+                    .eq(SopDO::getId, updateReqVO.getSopId())
+                    .set(SopDO::getEnableExecutionPlan, updateReqVO.getEnableExecutionPlan()));
+        }
     }
 
     private List<String> getPreviewDateList(String effectiveTime, Integer frequencyUnit, Integer frequency, String timePoint) {
@@ -260,7 +268,12 @@ public class SopExecutionPlanServiceImpl extends ServiceImpl<SopExecutionPlanMap
         if (sopExecutionPlanDO == null) {
             return null;
         }
-        return getSopExecutionPlan(sopExecutionPlanDO.getId());
+        SopRespVO sop = sopService.getSop(sopId);
+        SopExecutionPlanRespVO sopExecutionPlan = getSopExecutionPlan(sopExecutionPlanDO.getId());
+        if (sop != null) {
+            sopExecutionPlan.setEnableExecutionPlan(sop.getEnableExecutionPlan());
+        }
+        return sopExecutionPlan;
     }
 
     @Override

+ 3 - 0
yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/message/NotifyMessageMyPageReqVO.java

@@ -24,4 +24,7 @@ public class NotifyMessageMyPageReqVO extends PageParam {
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     private LocalDateTime[] createTime;
 
+    @Schema(description = "标题", example = "true")
+    private String title;
+
 }

+ 3 - 0
yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/message/NotifyMessageRespVO.java

@@ -46,4 +46,7 @@ public class NotifyMessageRespVO {
     @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
     private LocalDateTime createTime;
 
+    @Schema(description = "标题")
+    private String title;
+
 }

+ 3 - 2
yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/notify/NotifyMessageDO.java

@@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.system.dal.dataobject.notify;
 
 import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
 import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
-import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO;
 import com.baomidou.mybatisplus.annotation.KeySequence;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -11,7 +10,6 @@ import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
 import lombok.*;
 
 import java.time.LocalDateTime;
-import java.util.Date;
 import java.util.Map;
 
 /**
@@ -98,4 +96,7 @@ public class NotifyMessageDO extends BaseDO {
      */
     private LocalDateTime readTime;
 
+    @TableField(exist = false)
+    private String title;
+
 }

+ 16 - 1
yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/notify/NotifyMessageMapper.java

@@ -3,10 +3,12 @@ package cn.iocoder.yudao.module.system.dal.mysql.notify;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
 import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX;
 import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
 import cn.iocoder.yudao.module.system.controller.admin.notify.vo.message.NotifyMessageMyPageReqVO;
 import cn.iocoder.yudao.module.system.controller.admin.notify.vo.message.NotifyMessagePageReqVO;
 import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyMessageDO;
+import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyTemplateDO;
 import org.apache.ibatis.annotations.Mapper;
 
 import java.time.LocalDateTime;
@@ -26,13 +28,26 @@ public interface NotifyMessageMapper extends BaseMapperX<NotifyMessageDO> {
                 .orderByDesc(NotifyMessageDO::getId));
     }
 
-    default PageResult<NotifyMessageDO> selectPage(NotifyMessageMyPageReqVO reqVO, Long userId, Integer userType) {
+    /*default PageResult<NotifyMessageDO> selectPage(NotifyMessageMyPageReqVO reqVO, Long userId, Integer userType) {
         return selectPage(reqVO, new LambdaQueryWrapperX<NotifyMessageDO>()
                 .eqIfPresent(NotifyMessageDO::getReadStatus, reqVO.getReadStatus())
                 .betweenIfPresent(NotifyMessageDO::getCreateTime, reqVO.getCreateTime())
                 .eq(NotifyMessageDO::getUserId, userId)
                 .eq(NotifyMessageDO::getUserType, userType)
                 .orderByDesc(NotifyMessageDO::getId));
+    }*/
+
+    default PageResult<NotifyMessageDO> selectPage(NotifyMessageMyPageReqVO reqVO, Long userId, Integer userType) {
+        return selectPage(reqVO, new MPJLambdaWrapperX<NotifyMessageDO>()
+                .eqIfPresent(NotifyMessageDO::getReadStatus, reqVO.getReadStatus())
+                .betweenIfPresent(NotifyMessageDO::getCreateTime, reqVO.getCreateTime())
+                .eq(NotifyMessageDO::getUserId, userId)
+                .eq(NotifyMessageDO::getUserType, userType)
+                .orderByDesc(NotifyMessageDO::getId)
+                .leftJoin(NotifyTemplateDO.class, NotifyTemplateDO::getCode, NotifyMessageDO::getTemplateCode)
+                .likeIfPresent(NotifyTemplateDO::getName, reqVO.getTitle())
+                .selectAll(NotifyMessageDO.class)
+                .selectAs(NotifyTemplateDO::getName, "title"));
     }
 
     default int updateListRead(Collection<Long> ids, Long userId, Integer userType) {