Explorar o código

Merge remote-tracking branch 'origin/master'

syh %!s(int64=5) %!d(string=hai) anos
pai
achega
9579881a79

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CallbackController.java

@@ -84,6 +84,8 @@ public class CallbackController {
                     userAllocation.setDepartmentId(departmentId);
                     userAllocation.setOperationName(realName);
                     userAllocation.setAccountId(accountId);
+                    userAllocation.setCreateTime(new Date());
+                    userAllocation.setUpdateTime(new Date());
                     allocationMapper.deleteById(userAllocation.getId());
                     Map<String, Object> deleteUserMap = new HashMap<>();
                     deleteUserMap.put("advertiser_id", advertiser_id);
@@ -141,6 +143,7 @@ public class CallbackController {
 
     @Autowired
     private IByteDanceAdvertiserDataService advertiserDataService;
+
     public Map<String, Object> getByteDanceAccessToken(String authCode, String state) {
         Map<String, Object> param = new HashMap<String, Object>();
         param.put("app_id", PropertiesUtils.getValue("bytedance_config", "bytedance_appid"));
@@ -195,6 +198,8 @@ public class CallbackController {
             userAllocation.setMediaId(mediaId);
             userAllocation.setAuthName(advertiserData.getName());
             userAllocation.setAdvertiserId(advertiser_id);
+            userAllocation.setCreateTime(new Date());
+            userAllocation.setUpdateTime(new Date());
             allocationMapper.deleteById(userAllocation.getId());
             Map<String, Object> deleteUserMap = new HashMap<>();
             deleteUserMap.put("advertiser_id", advertiser_id);

+ 4 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/UserAllocationController.java

@@ -7,9 +7,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.ctop.entity.UserAllocation;
 import org.jeecg.modules.ctop.service.IUserAllocationService;
@@ -64,7 +66,9 @@ public class UserAllocationController {
                                                        @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                        HttpServletRequest req) {
         Result<IPage<UserAllocation>> result = new Result<IPage<UserAllocation>>();
+        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         QueryWrapper<UserAllocation> queryWrapper = QueryGenerator.initQueryWrapper(userAllocation, req.getParameterMap());
+        queryWrapper.eq("user_id", user.getId());
         Page<UserAllocation> page = new Page<UserAllocation>(pageNo, pageSize);
         IPage<UserAllocation> pageList = userAllocationService.page(page, queryWrapper);
         result.setSuccess(true);

+ 0 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/UserAllocation.java

@@ -128,8 +128,4 @@ public class UserAllocation {
     @ApiModelProperty(value = "平台类型 1 头条 2快手")
     private String mediaId;
 
-    public UserAllocation() {
-        this.createTime = new Date();
-        this.updateTime = new Date();
-    }
 }