Prechádzať zdrojové kódy

bugfix:
1、内容管理-内容发布-发布信息需要添加非空校验
2、设备管理-添加模糊搜索

lihao16 5 mesiacov pred
rodič
commit
06ae6b3446

+ 2 - 2
smsb-modules/smsb-device/src/main/java/com/inspur/device/service/impl/SmsbDeviceServiceImpl.java

@@ -146,8 +146,8 @@ public class SmsbDeviceServiceImpl implements ISmsbDeviceService {
         LambdaQueryWrapper<SmsbDevice> lqw = Wrappers.lambdaQuery();
         lqw.eq(StringUtils.isNotBlank(bo.getIdentifier()), SmsbDevice::getIdentifier, bo.getIdentifier());
         lqw.like(StringUtils.isNotBlank(bo.getName()), SmsbDevice::getName, bo.getName());
-        lqw.eq(StringUtils.isNotBlank(bo.getSerialNumber()), SmsbDevice::getSerialNumber, bo.getSerialNumber());
-        lqw.eq(StringUtils.isNotBlank(bo.getMac()), SmsbDevice::getMac, bo.getMac());
+        lqw.like(StringUtils.isNotBlank(bo.getSerialNumber()), SmsbDevice::getSerialNumber, bo.getSerialNumber());
+        lqw.like(StringUtils.isNotBlank(bo.getMac()), SmsbDevice::getMac, bo.getMac());
         lqw.eq(bo.getRegisterTime() != null, SmsbDevice::getRegisterTime, bo.getRegisterTime());
         lqw.eq(bo.getIsDel() != null, SmsbDevice::getIsDel, bo.getIsDel());
         lqw.eq(bo.getOnlineStatus() != null, SmsbDevice::getOnlineStatus, bo.getOnlineStatus());

+ 19 - 1
smsb-modules/smsb-source/src/main/java/com/inspur/source/service/impl/SmsbItemPushServiceImpl.java

@@ -240,7 +240,7 @@ public class SmsbItemPushServiceImpl implements ISmsbItemPushService {
 
     @Override
     public R<ResponseBaseBean> validateTime(SmsbItemPushBo bo) {
-
+        validateSaveNull(bo);
         ResponseBaseBean result = new ResponseBaseBean();
         result.setCode(HttpStatus.SUCCESS);
         List<ValidatePushTimeVo> validatePushTimeVos = new ArrayList<>();
@@ -268,6 +268,24 @@ public class SmsbItemPushServiceImpl implements ISmsbItemPushService {
         return R.ok(result);
     }
 
+    private void validateSaveNull(SmsbItemPushBo bo) {
+        if (CollectionUtil.isEmpty(bo.getDeviceIds())) {
+            throw new ServiceException("至少选择一个设备进行内容发布!");
+        }
+        if (StringUtils.isEmpty(bo.getName())) {
+            throw new ServiceException("内容发布名称不能为空!");
+        }
+        if (CollectionUtil.isEmpty(bo.getDateRange())) {
+            throw new ServiceException("开始日期和结束日期不能为空!");
+        }
+        if (CollectionUtil.isEmpty(bo.getTimeRange())) {
+            throw new ServiceException("请添加至少一个播放时间段!");
+        }
+        if (CollectionUtil.isEmpty(bo.getItemIds())) {
+            throw new ServiceException("请选择需要发布的内容!");
+        }
+    }
+
     /**
      * 新增内容发布
      *

+ 1 - 1
smsb-plus-ui/src/views/smsb/device/index.vue

@@ -94,7 +94,7 @@
           <el-table-column label="设备名称" align="left" prop="name" width="300" :show-overflow-tooltip="true" />
 -->
           <el-table-column label="设备型号" align="left" prop="deviceModel" width="120" :show-overflow-tooltip="true" />
-          <el-table-column label="设备SN" align="left" prop="serialNumber" width="180" :show-overflow-tooltip="true" />
+          <el-table-column label="设备SN" align="left" prop="serialNumber" width="220" :show-overflow-tooltip="true" />
           <el-table-column label="设备MAC" align="left" prop="mac" width="180" />
           <el-table-column label="设备标识" align="left" prop="identifier" width="220" :show-overflow-tooltip="true" />
           <el-table-column label="分辨率" align="left" prop="resolution" width="100" />

+ 2 - 1
smsb-plus-ui/src/views/smsb/itemPush/index.vue

@@ -606,6 +606,7 @@ const handleAdd = () => {
   reset();
   dialog.visible = true;
   dialog.title = '添加内容发布';
+  selectedRowId.value = null;
   getDeviceList();
 };
 
@@ -629,7 +630,7 @@ const submitForm = () => {
         await updateItemPush(form.value).finally(() => (buttonLoading.value = false));
       } else {
         // 校验时间冲突
-        const resTime = await validateTime(form.value);
+        const resTime = await validateTime(form.value).finally(() => (buttonLoading.value = false));
         if (resTime.data.code !== 200) {
           await proxy?.$modal.confirm("排期时间存在冲突,是否覆盖之前排期").finally(() => (buttonLoading.value = false));
           console.log(resTime.data)