瀏覽代碼

素材信息下线

yangzian 4 年之前
父節點
當前提交
437a5afb51

+ 2 - 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java

@@ -129,7 +129,8 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/vxeSocket/**", "anon");//JVxeTable无痕刷新示例
         filterChainDefinitionMap.put("/eoaSocket/**","anon");//我的聊天
 
-        filterChainDefinitionMap.put("/advertiser/aiBytedanceAdvertiserStrategy/**","anon");//
+        //filterChainDefinitionMap.put("/advertiser/aiBytedanceAdvertiserStrategy/**","anon");//
+        filterChainDefinitionMap.put("/advertiser/**","anon");//
         filterChainDefinitionMap.put("/file/**","anon");//
 
         filterChainDefinitionMap.put("/sys/dict/**","anon");//

+ 6 - 0
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/common/mapper/MaterialInfoMapper.java

@@ -35,4 +35,10 @@ public interface MaterialInfoMapper extends BaseMapper<MaterialInfo> {
     List<MaterialInfo> getListByDate(@Param("startDate") String startDate,@Param("endDate") String endDate);
 
     List<MaterialInfo> getListByParams(@Param("tagCode")String tagCode,@Param("type")String type, @Param("status")Integer status, @Param("projectIds")List<Long> projectIds, @Param("materialName")String materialName, @Param("code")String code, @Param("startDate")String startDate, @Param("endDate")String endDate, @Param("userId")String userId);
+
+    Integer updMaterialOfflineById(@Param("id") String id,@Param("offlineFlag") Integer offlineFlag);
+
+
+
+
 }

+ 19 - 0
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/common/mapper/xml/MaterialInfoMapper.xml

@@ -136,4 +136,23 @@
     </select>
 
 
+
+    <!-- 素材信息 下线 -->
+    <update id="updMaterialOfflineById">
+        update ctop_material_info
+        <set>
+            <if test="offlineFlag != null">
+                offline_flag = #{offlineFlag},
+            </if>
+        </set>
+        WHERE
+        id = #{id}
+    </update>
+
+
+
+
+
+
+
 </mapper>

+ 7 - 0
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/common/service/IMaterialInfoService.java

@@ -1,8 +1,11 @@
 package org.jeecg.modules.bytedance.common.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.common.api.vo.Result;
 import org.jeecg.modules.bytedance.common.entity.MaterialInfo;
 
+import java.util.List;
+
 /**
  * 素材信息
  *
@@ -12,4 +15,8 @@ import org.jeecg.modules.bytedance.common.entity.MaterialInfo;
  */
 public interface IMaterialInfoService extends IService<MaterialInfo> {
     MaterialInfo getParams(String signature, Integer status);
+
+
+    Result updMaterialOfflineById(List<String> ids, Integer offlineFlag);
+
 }

+ 29 - 0
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/common/service/impl/MaterialInfoServiceImpl.java

@@ -3,11 +3,16 @@ package org.jeecg.modules.bytedance.common.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
 import org.jeecg.modules.bytedance.common.entity.MaterialInfo;
 import org.jeecg.modules.bytedance.common.mapper.MaterialInfoMapper;
 import org.jeecg.modules.bytedance.common.service.IMaterialInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Arrays;
+import java.util.List;
+
 /**
  * 素材信息
  *
@@ -19,6 +24,10 @@ import org.springframework.stereotype.Service;
 @Service
 public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, MaterialInfo> implements IMaterialInfoService {
 
+    @Autowired
+    private MaterialInfoMapper materialInfoMapper;
+
+
     @Override
     public MaterialInfo getParams(String signature, Integer status) {
         QueryWrapper<MaterialInfo>queryWrapper = new QueryWrapper<>();
@@ -31,6 +40,26 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
         queryWrapper.orderByDesc("create_time").last("limit 1");
         return this.getOne(queryWrapper);
     }
+
+
+    /**
+     *
+     * @description: 素材下线
+     *
+     * @param ids
+     * @param offlineFlag
+     * @return: org.jeecg.common.api.vo.Result
+     * @author: zianY
+     */
+    @Override
+    public Result updMaterialOfflineById(List<String> ids, Integer offlineFlag){
+        ids.forEach(id ->{
+            materialInfoMapper.updMaterialOfflineById(id,offlineFlag);
+        });
+        return Result.successMsg("素材下线成功。", null);
+    }
+
+
 }
 
 

+ 56 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/bytedance/advertise/controller/MaterialInfoController.java

@@ -0,0 +1,56 @@
+package org.jeecg.modules.bytedance.advertise.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.modules.bytedance.common.service.IMaterialInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 头条智能投放账户配置信息表
+ * @author jeecg-boot
+ * @date   2021-04-20
+ * @version V1.0
+ */
+@RestController
+@RequestMapping("/advertiser/materialInfoController")
+@Api(tags="视频素材")
+@Slf4j
+public class MaterialInfoController {
+	@Autowired
+	private IMaterialInfoService materialInfoService;
+
+
+
+	@ApiOperation(value="素材下线", notes="素材下线")
+	@GetMapping(value = "/updMaterialOfflineById")
+	public Result updMaterialOfflineById(@RequestParam("id") String id,
+								  		@RequestParam("offlineFlag") Integer offlineFlag) {
+		try {
+			List<String> listIds = Arrays.asList(id.split(","));
+			if (listIds.size() > 8){
+				return Result.errorMsg("已选视频素材最多支持8个。");
+			}
+			return materialInfoService.updMaterialOfflineById(listIds,offlineFlag);
+		}catch (Exception e){
+			log.error("素材下线异常",e);
+			return Result.error("请求失败,请联系开发人员!");
+		}
+	}
+
+
+
+
+
+
+
+
+
+
+
+}