xuzuoyun преди 5 години
родител
ревизия
adde643eca

+ 3 - 12
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/ByteDanceBudgetTemplate.java

@@ -36,18 +36,6 @@ public class ByteDanceBudgetTemplate {
     @ApiModelProperty(value = "id")
     private Long id;
     /**
-     * 广告主id
-     */
-    @Excel(name = "广告主id", width = 15)
-    @ApiModelProperty(value = "广告主id")
-    private String advertiserId;
-    /**
-     * 头条账号id
-     */
-    @Excel(name = "头条账号id", width = 15)
-    @ApiModelProperty(value = "头条账号id")
-    private Long toutiaoId;
-    /**
      * 模板名称
      */
     @Excel(name = "模板名称", width = 15)
@@ -141,4 +129,7 @@ public class ByteDanceBudgetTemplate {
      */
     @ApiModelProperty(value = "updateTime")
     private Date updateTime;
+
+    private String createBy;
+    private String updateBy;
 }

+ 17 - 7
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ByteDanceBudgetTemplateServiceImpl.java

@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -37,14 +38,23 @@ public class ByteDanceBudgetTemplateServiceImpl extends ServiceImpl<ByteDanceBud
     @Override
     public Map<String, Object> insertTemplate(ByteDanceBudgetTemplate template) {
         Map<String, Object> resultMap = new HashMap<>();
-        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        CTopOauthToken token = tokenService.getOAuthTokenByAccountId(user.getId());
-        template.setAdvertiserId(token.getAdvertiserId());
-        template.setToutiaoId(token.getAccountId());
+        QueryWrapper<ByteDanceBudgetTemplate> queryWrapper = new QueryWrapper<ByteDanceBudgetTemplate>();
+        queryWrapper.eq("name", template.getName());
+        queryWrapper.ne("id", template.getId());
+        List<ByteDanceBudgetTemplate> templateExistList = this.list(queryWrapper);
+        if (templateExistList != null && templateExistList.size() > 0) {
+            resultMap.put("success", false);
+            resultMap.put("message", "模板名称已存在,请修改后重试");
+            return resultMap;
+        }
         template.setStatus(1);
-        template.setStartDate(template.getStartDate().substring(0, 10));
-        template.setEndDate(template.getEndDate().substring(0, 10));
-        budgetTemplateMapper.insert(template);
+        if (template.getStartDate() != null) {
+            template.setStartDate(template.getStartDate().substring(0, 10));
+        }
+        if (template.getEndDate() != null) {
+            template.setEndDate(template.getEndDate().substring(0, 10));
+        }
+        this.saveOrUpdate(template);
         resultMap.put("success", true);
         resultMap.put("message", "模板保存成功");
         return resultMap;

+ 1 - 1
jeecg-boot-module-system/src/main/resources/application-dev.yml

@@ -90,7 +90,7 @@ spring:
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
         master:
-          url: jdbc:mysql://192.168.0.23:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          url: jdbc:mysql://192.168.1.21:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
           username: hcst
           password: 123456
           driver-class-name: com.mysql.jdbc.Driver

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/service/impl/KuaishouWebInterfaceServiceImpl.java

@@ -423,7 +423,7 @@ public class KuaishouWebInterfaceServiceImpl implements IKuaishouWebInterfaceSer
     public static void main(String[] args) {
         try {
             KuaishouWebInterfaceServiceImpl i = new KuaishouWebInterfaceServiceImpl();
-            i.adkuaishouWebLogin("18811551872", "a123456");
+            i.adkuaishouWebLogin("17611760019", "a123456");
             Thread.sleep(20000);
             i.deleteAllComment(new HashMap<>());
         } catch (Exception e) {