dao/src/main/java/com/sandu/ximon/dao/domain/LEDProgram.java
@@ -4,12 +4,15 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.io.Serializable; import java.time.LocalDateTime; import lombok.Data; /** * LED节目表 * * @TableName led_program */ @TableName(value ="led_program") @@ -29,6 +32,11 @@ /** * */ private Long clientId; /** * */ private String userName; /** dao/src/main/resources/mapper/LEDProgramMapper.xml
@@ -7,6 +7,7 @@ <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.LEDProgram"> <id property="id" column="id" jdbcType="BIGINT"/> <result property="userId" column="user_id" jdbcType="BIGINT"/> <result property="clientId" column="client_id" jdbcType="BIGINT"/> <result property="userName" column="user_name" jdbcType="VARCHAR"/> <result property="name" column="name" jdbcType="VARCHAR"/> <result property="preview" column="preview" jdbcType="VARCHAR"/> ximon-admin/src/main/java/com/sandu/ximon/admin/controller/LEDProgramController.java
@@ -54,35 +54,35 @@ } PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); LambdaQueryWrapper<LEDProgram> wrapper = ledProgramService.listProgram(); if (null != keyword) { if (!keyword.isEmpty()) { wrapper.like(LEDProgram::getName, keyword); } return ResponseUtil.successPage(ledProgramService.list(wrapper)); } /** * 模糊查询 * * @return */ @GetMapping("/listLike") public ResponseVO<Object> listLikeProgram(@RequestBody ReceiveParam receiveParam) { LambdaQueryWrapper<LEDProgram> wrapper = ledProgramService.listProgram(); if (receiveParam.getKind() != null || receiveParam.getName() != null) { wrapper.like(LEDProgram::getName, receiveParam.getName()) .or( ledProgramLambdaQueryWrapper -> { ledProgramLambdaQueryWrapper.like(LEDProgram::getKind, receiveParam.getKind()); } ); } // List<LEDProgram> list = ledProgramService.list(wrapper); return ResponseUtil.success(ledProgramService.list(wrapper)); } // /** // * 模糊查询 // * // * @return // */ // @GetMapping("/listLike") // public ResponseVO<Object> listLikeProgram(@RequestBody ReceiveParam receiveParam) { // LambdaQueryWrapper<LEDProgram> wrapper = ledProgramService.listProgram(); // if (receiveParam.getKind() != null || receiveParam.getName() != null) { // // wrapper.like(LEDProgram::getName, receiveParam.getName()) // .or( // ledProgramLambdaQueryWrapper -> { // ledProgramLambdaQueryWrapper.like(LEDProgram::getKind, receiveParam.getKind()); // } // ); // // } // // // List<LEDProgram> list = ledProgramService.list(wrapper); // return ResponseUtil.success(ledProgramService.list(wrapper)); // // } } ximon-admin/src/main/java/com/sandu/ximon/admin/controller/XiXunController.java
@@ -115,31 +115,10 @@ if (!permissionConfig.check(MenuEnum.LED_PROGRAM_LIST.getCode())) { return ResponseUtil.fail("缺少对应用户权限"); } LambdaQueryWrapper<PoleXixunPlayerEntity> wrapper = xiXunPlayerService.XixunPlayerList(keyword); PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); LambdaQueryWrapper<PoleXixunPlayerEntity> wrapper = Wrappers.lambdaQuery(PoleXixunPlayerEntity.class).like(PoleXixunPlayerEntity::getProgramName, keyword); // if(AdministratorEnums.CUSTOMER.getCode().equals(SecurityUtils.getAdministratorIdentity())){ // boolean clientId = clientService.findClientId(); // if(clientId){ // wrapper= wrapper.eq(PoleXixunPlayerEntity::getUserId,SecurityUtils.getUserId()); // } // wrapper= wrapper.eq(PoleXixunPlayerEntity::getClientId,clientService.getClientId()); // } // wrapper=Wrappers.lambdaQuery(PoleXixunPlayerEntity.class); // if(StrUtil.isNotBlank(keyword)){ // wrapper.like(PoleXixunPlayerEntity::getLightemitName,keyword).or( // lambdaQueryWrapper -> { // lambdaQueryWrapper.like(PoleXixunPlayerEntity::getLightemitControlCode, keyword); // } // ); // } // return ResponseUtil.success(poleLightemitService.list(wrapper)); if (AdministratorEnums.CUSTOMER.getCode().equals(SecurityUtils.getAdministratorIdentity())) { return ResponseUtil.success(xiXunPlayerService.list(wrapper)); // todo } else { return ResponseUtil.success(xiXunPlayerService.list(wrapper)); } } @@ -303,8 +282,6 @@ } /** * * * @param * @return */ @@ -471,8 +448,6 @@ scheduleService.ledschedulepush(id, lightemitIds); return ResponseUtil.success("设置成功"); } } ximon-admin/src/main/java/com/sandu/ximon/admin/service/LEDProgramService.java
@@ -19,7 +19,6 @@ public class LEDProgramService extends BaseServiceImpl<LEDProgramMapper, LEDProgram> { public boolean addProgram(LEDProgramParam receiveParam) { LEDProgram led = new LEDProgram(); @@ -82,11 +81,13 @@ public LambdaQueryWrapper<LEDProgram> listProgram() { if (SecurityUtils.getClientId() != null) { return Wrappers.lambdaQuery(LEDProgram.class).eq(LEDProgram::getUserId, SecurityUtils.getClientId()); } else { if (SecurityUtils.getClientId() == null) { return Wrappers.lambdaQuery(LEDProgram.class); } else { return Wrappers.lambdaQuery(LEDProgram.class).eq(LEDProgram::getUserId, SecurityUtils.getUserId()) .or(w -> { w.eq(LEDProgram::getClientId, SecurityUtils.getClientId()); }); } } } ximon-admin/src/main/java/com/sandu/ximon/admin/service/XiXunPlayerService.java
@@ -1,6 +1,8 @@ package com.sandu.ximon.admin.service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.sandu.common.execption.BusinessException; @@ -12,6 +14,7 @@ import com.sandu.ximon.admin.utils.JsonUtil; import com.sandu.ximon.admin.utils.LightemitUtils; import com.sandu.ximon.admin.utils.LogUtils; import com.sandu.ximon.dao.domain.LEDProgram; import com.sandu.ximon.dao.domain.LedSFile; import com.sandu.ximon.dao.domain.PoleLightemitEntity; import com.sandu.ximon.dao.domain.PoleXixunPlayerEntity; @@ -39,6 +42,29 @@ private final ClientService clientService; private final LedSFileService xiXunFileService; //熙讯节目列表 public LambdaQueryWrapper<PoleXixunPlayerEntity> XixunPlayerList(String keyword) { if (SecurityUtils.getClientId() == null) { if (keyword.isEmpty()) { return Wrappers.lambdaQuery(PoleXixunPlayerEntity.class); } else { return Wrappers.lambdaQuery(PoleXixunPlayerEntity.class).like(PoleXixunPlayerEntity::getProgramName, keyword); } } else { if (keyword.isEmpty()) { return Wrappers.lambdaQuery(PoleXixunPlayerEntity.class).eq(PoleXixunPlayerEntity::getCreateUserId, SecurityUtils.getUserId()) .or(w -> { w.eq(PoleXixunPlayerEntity::getClientId, SecurityUtils.getClientId()); }); } else { return Wrappers.lambdaQuery(PoleXixunPlayerEntity.class).eq(PoleXixunPlayerEntity::getCreateUserId, SecurityUtils.getUserId()) .or(w -> { w.eq(PoleXixunPlayerEntity::getClientId, SecurityUtils.getClientId()); }).like(PoleXixunPlayerEntity::getProgramName, keyword); } } } public boolean insert(ProgramPro programPro) { String json = JsonUtil.jsonObj2Sting(programPro);