Jelajahi Sumber

Merge branch 'test' of http://git.tjyourong.com.cn/ctop/adsp-boot into test

hcst_sunzhen 5 tahun lalu
induk
melakukan
c50b5c7a7c
14 mengubah file dengan 600 tambahan dan 2 penghapusan
  1. 157 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ReleaseRecordController.java
  2. 171 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ReleaseViewRecordController.java
  3. 46 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/ReleaseRecord.java
  4. 46 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/ReleaseViewRecord.java
  5. 14 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/ReleaseRecordMapper.java
  6. 14 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/ReleaseViewRecordMapper.java
  7. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/ReleaseRecordMapper.xml
  8. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/ReleaseViewRecordMapper.xml
  9. 14 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IReleaseRecordService.java
  10. 20 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IReleaseViewRecordService.java
  11. 25 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ReleaseRecordServiceImpl.java
  12. 77 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ReleaseViewRecordServiceImpl.java
  13. 1 0
      module-common/src/main/java/cn/com/ctop/common/module/utils/StatusCode.java
  14. 5 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceAccountReportServiceImpl.java

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

@@ -0,0 +1,157 @@
+package org.jeecg.modules.ctop.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+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.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.modules.ctop.entity.ReleaseRecord;
+import org.jeecg.modules.ctop.service.IReleaseRecordService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+
+ /**
+ * 发版记录信息
+ * @author jeecg-boot
+ * @date   2020-06-10
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="发版记录信息")
+@RestController
+@RequestMapping("/ctop/releaseRecord")
+public class ReleaseRecordController {
+	@Autowired
+	private IReleaseRecordService releaseRecordService;
+
+	/**
+	  * 分页列表查询
+	 * @param releaseRecord
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@AutoLog(value = "发版记录信息-分页列表查询")
+	@ApiOperation(value="发版记录信息-分页列表查询", notes="发版记录信息-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<ReleaseRecord>> queryPageList(ReleaseRecord releaseRecord,
+													  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+													  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+													  HttpServletRequest req) {
+		Result<IPage<ReleaseRecord>> result = new Result<>();
+		QueryWrapper<ReleaseRecord> queryWrapper = QueryGenerator.initQueryWrapper(releaseRecord, req.getParameterMap());
+		Page<ReleaseRecord> page = new Page<ReleaseRecord>(pageNo, pageSize);
+		IPage<ReleaseRecord> pageList = releaseRecordService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param releaseRecord
+	 * @return
+	 */
+	@AutoLog(value = "发版记录信息-添加")
+	@ApiOperation(value="发版记录信息-添加", notes="发版记录信息-添加")
+	@PostMapping(value = "/add")
+	public Result<ReleaseRecord> add(@RequestBody ReleaseRecord releaseRecord) {
+		Result<ReleaseRecord> result = new Result<>();
+		try {
+			releaseRecordService.save(releaseRecord);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param releaseRecord
+	 * @return
+	 */
+	@AutoLog(value = "发版记录信息-编辑")
+	@ApiOperation(value="发版记录信息-编辑", notes="发版记录信息-编辑")
+	@PutMapping(value = "/edit")
+	public Result<ReleaseRecord> edit(@RequestBody ReleaseRecord releaseRecord) {
+		Result<ReleaseRecord> result = new Result<ReleaseRecord>();
+		ReleaseRecord releaseRecordEntity = releaseRecordService.getById(releaseRecord.getId());
+		if(releaseRecordEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = releaseRecordService.updateById(releaseRecord);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "发版记录信息-通过id删除")
+	@ApiOperation(value="发版记录信息-通过id删除", notes="发版记录信息-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			releaseRecordService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "发版记录信息-批量删除")
+	@ApiOperation(value="发版记录信息-批量删除", notes="发版记录信息-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<ReleaseRecord> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<ReleaseRecord> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.releaseRecordService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "发版记录信息-通过id查询")
+	@ApiOperation(value="发版记录信息-通过id查询", notes="发版记录信息-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<ReleaseRecord> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<ReleaseRecord> result = new Result<>();
+		ReleaseRecord releaseRecord = releaseRecordService.getById(id);
+		if(releaseRecord==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(releaseRecord);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+}

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

@@ -0,0 +1,171 @@
+package org.jeecg.modules.ctop.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+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.modules.ctop.entity.ReleaseViewRecord;
+import org.jeecg.modules.ctop.service.IReleaseViewRecordService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+import java.util.Map;
+
+/**
+ * 发版记录信息
+ * @author jeecg-boot
+ * @date   2020-06-10
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="发版记录信息")
+@RestController
+@RequestMapping("/ctop/releaseViewRecord")
+public class ReleaseViewRecordController {
+	@Autowired
+	private IReleaseViewRecordService releaseViewRecordService;
+
+	@PostMapping("check")
+	public Map<String,Object>check(){
+		LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+		return releaseViewRecordService.check(user.getId());
+	}
+	@PostMapping("view")
+	public Map<String,Object>view(@RequestBody JSONObject data){
+		LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+		return releaseViewRecordService.view(user.getId(),data);
+	}
+	/**
+	  * 分页列表查询
+	 * @param releaseViewRecord
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@AutoLog(value = "发版记录信息-分页列表查询")
+	@ApiOperation(value="发版记录信息-分页列表查询", notes="发版记录信息-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<ReleaseViewRecord>> queryPageList(ReleaseViewRecord releaseViewRecord,
+														  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+														  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+														  HttpServletRequest req) {
+		Result<IPage<ReleaseViewRecord>> result = new Result<>();
+		QueryWrapper<ReleaseViewRecord> queryWrapper = QueryGenerator.initQueryWrapper(releaseViewRecord, req.getParameterMap());
+		Page<ReleaseViewRecord> page = new Page<>(pageNo, pageSize);
+		IPage<ReleaseViewRecord> pageList = releaseViewRecordService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param releaseViewRecord
+	 * @return
+	 */
+	@AutoLog(value = "发版记录信息-添加")
+	@ApiOperation(value="发版记录信息-添加", notes="发版记录信息-添加")
+	@PostMapping(value = "/add")
+	public Result<ReleaseViewRecord> add(@RequestBody ReleaseViewRecord releaseViewRecord) {
+		Result<ReleaseViewRecord> result = new Result<>();
+		try {
+			releaseViewRecordService.save(releaseViewRecord);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param releaseViewRecord
+	 * @return
+	 */
+	@AutoLog(value = "发版记录信息-编辑")
+	@ApiOperation(value="发版记录信息-编辑", notes="发版记录信息-编辑")
+	@PutMapping(value = "/edit")
+	public Result<ReleaseViewRecord> edit(@RequestBody ReleaseViewRecord releaseViewRecord) {
+		Result<ReleaseViewRecord> result = new Result<>();
+		ReleaseViewRecord releaseViewRecordEntity = releaseViewRecordService.getById(releaseViewRecord.getId());
+		if(releaseViewRecordEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = releaseViewRecordService.updateById(releaseViewRecord);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "发版记录信息-通过id删除")
+	@ApiOperation(value="发版记录信息-通过id删除", notes="发版记录信息-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			releaseViewRecordService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "发版记录信息-批量删除")
+	@ApiOperation(value="发版记录信息-批量删除", notes="发版记录信息-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<ReleaseViewRecord> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<ReleaseViewRecord> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.releaseViewRecordService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "发版记录信息-通过id查询")
+	@ApiOperation(value="发版记录信息-通过id查询", notes="发版记录信息-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<ReleaseViewRecord> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<ReleaseViewRecord> result = new Result<>();
+		ReleaseViewRecord releaseViewRecord = releaseViewRecordService.getById(id);
+		if(releaseViewRecord==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(releaseViewRecord);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+}

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

@@ -0,0 +1,46 @@
+package org.jeecg.modules.ctop.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 发版记录信息
+ * @author jeecg-boot
+ * @date   2020-06-10
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_release_record")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ctop_release_record对象", description="发版记录信息")
+public class ReleaseRecord {
+
+	/**id*/
+	@TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+	private Long id;
+	/**版本号*/
+	@Excel(name = "版本号", width = 15)
+    @ApiModelProperty(value = "版本号")
+	private String version;
+	/**更新详情*/
+	@Excel(name = "更新详情", width = 15)
+    @ApiModelProperty(value = "更新详情")
+	private String detail;
+	/**createTime*/
+    @ApiModelProperty(value = "createTime")
+	private Date createTime;
+	/**updateTime*/
+    @ApiModelProperty(value = "updateTime")
+	private Date updateTime;
+}

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

@@ -0,0 +1,46 @@
+package org.jeecg.modules.ctop.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 发版记录信息
+ * @author jeecg-boot
+ * @date   2020-06-10
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_release_view_record")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ctop_release_view_record对象", description="发版记录信息")
+public class ReleaseViewRecord {
+
+	/**id*/
+	@TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+	private Long id;
+	/**userId*/
+	@Excel(name = "userId", width = 15)
+    @ApiModelProperty(value = "userId")
+	private String userId;
+	/**版本id*/
+	@Excel(name = "版本id", width = 15)
+    @ApiModelProperty(value = "版本id")
+	private Long releaseId;
+	/**createTime*/
+    @ApiModelProperty(value = "createTime")
+	private Date createTime;
+	/**updateTime*/
+    @ApiModelProperty(value = "updateTime")
+	private Date updateTime;
+}

+ 14 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/ReleaseRecordMapper.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.ctop.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.ctop.entity.ReleaseRecord;
+
+/**
+ * 发版记录信息
+ * @author: jeecg-boot
+ * @date:   2020-06-10
+ * @cersion: V1.0
+ */
+public interface ReleaseRecordMapper extends BaseMapper<ReleaseRecord> {
+
+}

+ 14 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/ReleaseViewRecordMapper.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.ctop.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.ctop.entity.ReleaseViewRecord;
+
+/**
+ * 发版记录信息
+ * @author: jeecg-boot
+ * @date:   2020-06-10
+ * @cersion: V1.0
+ */
+public interface ReleaseViewRecordMapper extends BaseMapper<ReleaseViewRecord> {
+
+}

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/ReleaseRecordMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.ctop.mapper.ReleaseRecordMapper">
+
+</mapper>

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/ReleaseViewRecordMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.ctop.mapper.ReleaseViewRecordMapper">
+
+</mapper>

+ 14 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IReleaseRecordService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.ctop.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.ctop.entity.ReleaseRecord;
+
+/**
+ * 发版记录信息
+ * @author jeecg-boot
+ * @date   2020-06-10
+ * @version V1.0
+ */
+public interface IReleaseRecordService extends IService<ReleaseRecord> {
+    ReleaseRecord getLastRecord();
+}

+ 20 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IReleaseViewRecordService.java

@@ -0,0 +1,20 @@
+package org.jeecg.modules.ctop.service;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.ctop.entity.ReleaseViewRecord;
+
+import java.util.Map;
+
+/**
+ * 发版记录信息
+ * @author jeecg-boot
+ * @date   2020-06-10
+ * @version V1.0
+ */
+public interface IReleaseViewRecordService extends IService<ReleaseViewRecord> {
+
+    Map<String, Object> check(String userId);
+
+    Map<String, Object> view(String userId, JSONObject data);
+}

+ 25 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ReleaseRecordServiceImpl.java

@@ -0,0 +1,25 @@
+package org.jeecg.modules.ctop.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.modules.ctop.entity.ReleaseRecord;
+import org.jeecg.modules.ctop.mapper.ReleaseRecordMapper;
+import org.jeecg.modules.ctop.service.IReleaseRecordService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 发版记录信息
+ * @author jeecg-boot
+ * @date   2020-06-10
+ * @version V1.0
+ */
+@Service
+public class ReleaseRecordServiceImpl extends ServiceImpl<ReleaseRecordMapper, ReleaseRecord> implements IReleaseRecordService {
+
+    @Override
+    public ReleaseRecord getLastRecord() {
+        QueryWrapper<ReleaseRecord>queryWrapper = new QueryWrapper<>();
+        queryWrapper.orderByDesc("id").last("limit 1");
+        return this.getOne(queryWrapper);
+    }
+}

+ 77 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ReleaseViewRecordServiceImpl.java

@@ -0,0 +1,77 @@
+package org.jeecg.modules.ctop.service.impl;
+
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.modules.ctop.entity.ReleaseRecord;
+import org.jeecg.modules.ctop.entity.ReleaseViewRecord;
+import org.jeecg.modules.ctop.mapper.ReleaseViewRecordMapper;
+import org.jeecg.modules.ctop.service.IReleaseRecordService;
+import org.jeecg.modules.ctop.service.IReleaseViewRecordService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 发版记录信息
+ * @author jeecg-boot
+ * @date   2020-06-10
+ * @version V1.0
+ */
+@Service
+public class ReleaseViewRecordServiceImpl extends ServiceImpl<ReleaseViewRecordMapper, ReleaseViewRecord> implements IReleaseViewRecordService {
+    @Autowired
+    private IReleaseRecordService releaseRecordService;
+    @Override
+    public Map<String, Object> check(String userId) {
+        Map<String,Object>result = new HashMap<>();
+        ReleaseRecord releaseRecord = releaseRecordService.getLastRecord();
+        if(null==releaseRecord){
+            result.put("showPopup",false);
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+            return result;
+        }
+        ReleaseViewRecord releaseViewRecord = getRecordByParams(userId,releaseRecord.getId());
+        if(null!=releaseViewRecord){
+            result.put("showPopup",false);
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+            return result;
+        }
+        result.put("showPopup",true);
+        result.put("data",releaseRecord);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+        return result;
+    }
+
+    @Override
+    public Map<String, Object> view(String userId, JSONObject data) {
+        Map<String,Object>result = new HashMap<>();
+        Long versionId = data.getLong("versionId");
+        if(null == versionId||versionId == 0){
+            ResultMapUtils.setResultMap(result,StatusCode.COMMON_VERSION_NOT_EXIST);
+            return result;
+        }
+        ReleaseViewRecord releaseViewRecord = new ReleaseViewRecord();
+        releaseViewRecord.setUserId(userId);
+        releaseViewRecord.setReleaseId(versionId);
+        this.save(releaseViewRecord);
+        ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
+        return result;
+    }
+
+    public ReleaseViewRecord getRecordByParams(String userId,Long releaseId){
+        QueryWrapper<ReleaseViewRecord> queryWrapper = new QueryWrapper<>();
+        if(null!=userId&&!userId.trim().equals("")){
+            queryWrapper.eq("user_id",userId);
+        }
+        if(null!=releaseId&&releaseId!=0){
+            queryWrapper.eq("release_id",userId);
+        }
+        queryWrapper.orderByDesc("id").last("limit 1");
+        return this.getOne(queryWrapper);
+    }
+}

+ 1 - 0
module-common/src/main/java/cn/com/ctop/common/module/utils/StatusCode.java

@@ -21,6 +21,7 @@ public enum StatusCode {
     COMMON_SUCCESS("success", 0, true),
     COMMON_PARAM_ERROR("参数异常", -1, false),
     COMMON_DATA_NOT_EXIST("数据不存在或者已经被删除", -101, false),
+    COMMON_VERSION_NOT_EXIST("版本号不存在", -102, false),
     BYTEDANCE_VIDEO_UPLOAD_FAIL("今日头条视频文件上传失败", -201, false),
     MATERIAL_UPLOAD_FAIL("素材文件上传失败", -201, false),
     IMAGE_NUMBER_SHORTAGE("今日头条图片文件上传失败", -202, false),

+ 5 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceAccountReportServiceImpl.java

@@ -39,6 +39,9 @@ public class BytedanceAccountReportServiceImpl implements IBytedanceAccountRepor
                 return result;
             }
             before = bytedanceAccountReportMapper.queryTodaySumByHour(DateUtils.getAnotherDay(SystemDateConstant.yyyy_MM_dd, startDate, -1), after.getInteger("maxHour"), accounts);
+            if(before==null){
+                return result;
+            }
         } else {
             after = bytedanceAccountReportMapper.querySumByStartEndDate(endDate, startDate, accounts);
             if(after==null){
@@ -56,11 +59,11 @@ public class BytedanceAccountReportServiceImpl implements IBytedanceAccountRepor
         String filedAll = JsonResourceUtil.joinAllFiled();
         if (startDate.equals(endDate)) {
             List<JSONObject> after = bytedanceAccountReportMapper.queryTodayDetailReportBy(filedAll, startDate, accounts);
-            if(after==null){
+            List<JSONObject> before = bytedanceAccountReportMapper.queryTodayDetailReportBy(filedAll, DateUtils.getAnotherDay(SystemDateConstant.yyyy_MM_dd, startDate, -1), accounts);
+            if(after==null||before==null){
                 return result;
             }
             List<JSONObject> afterDis = this.countDiscountCost(mediaId, discount, after);
-            List<JSONObject> before = bytedanceAccountReportMapper.queryTodayDetailReportBy(filedAll, DateUtils.getAnotherDay(SystemDateConstant.yyyy_MM_dd, startDate, -1), accounts);
             List<JSONObject> beforeDis = this.countDiscountCost(mediaId, discount, before);
             result = LinkUtils.getCompareDate(beforeDis, afterDis, "statHour");
         } else {