Commit c3c1541d by 陶光胜

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-platform-enterprise into developer

 Conflicts:
	gic-platform-enterprise-service/src/main/resources/dubbo-gic-platform-enterprise-service.xml
parents 6d3866c6 cc91c630
package com.gic.enterprise.constant;
/**
* 情报
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/5/18 2:38 PM

*/
public enum ProductMarketTypeEnum {
/**
* 功能更新
*/
FUNCTION_UPDATE("功能更新", 1),
/**
* 产品推广
*/
PRODUCT_PROMOTION("产品推广", 2),
/**
* 成功案例
*/
SUCCESS_STORIES("成功案例", 3);
private String name;
private int code;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
private ProductMarketTypeEnum(String name, int code) {
this.name = name;
this.code = code;
}
/**
* 用于switch
* @param code
* @return
*/
public static ProductMarketTypeEnum getByCode(int code){
for(ProductMarketTypeEnum transactType : values()){
if (transactType.getCode() == code) {
return transactType;
}
}
return null;
}
}
package com.gic.enterprise.dto;
import java.io.Serializable;
import java.util.Date;
/**
* 达摩情报销商户黑名单
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/5/18 3:31 PM

*/
public class BlackListDTO implements Serializable{
private static final long serialVersionUID = 9182488694825156872L;
/**
*
*/
private Integer blackListId;
/**
* 商户ID
*/
private Integer enterpriseId;
/**
* 商户名称
*/
private String enterpriseName;
/**
* 公司名称
*/
private String companyName;
/**
* 状态(0:正常;1:删除)
*/
private Integer deleteFlag;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
public Integer getBlackListId() {
return blackListId;
}
public BlackListDTO setBlackListId(Integer blackListId) {
this.blackListId = blackListId;
return this;
}
public Integer getEnterpriseId() {
return enterpriseId;
}
public BlackListDTO setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
return this;
}
public String getEnterpriseName() {
return enterpriseName;
}
public BlackListDTO setEnterpriseName(String enterpriseName) {
this.enterpriseName = enterpriseName;
return this;
}
public String getCompanyName() {
return companyName;
}
public BlackListDTO setCompanyName(String companyName) {
this.companyName = companyName;
return this;
}
public Integer getDeleteFlag() {
return deleteFlag;
}
public BlackListDTO setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
return createTime;
}
public BlackListDTO setCreateTime(Date createTime) {
this.createTime = createTime;
return this;
}
public Date getUpdateTime() {
return updateTime;
}
public BlackListDTO setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
return this;
}
@Override
public String toString() {
return "BlackListDTO{" +
"blackListId=" + blackListId +
", enterpriseId=" + enterpriseId +
", enterpriseName='" + enterpriseName + '\'' +
", companyName='" + companyName + '\'' +
", deleteFlag=" + deleteFlag +
", createTime=" + createTime +
", updateTime=" + updateTime +
'}';
}
}
package com.gic.enterprise.dto;
import java.io.Serializable;
import java.util.Date;
/**
* 达摩产品情报站
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/5/17 5:02 PM

*/
public class ProductMarketDTO implements Serializable{
private static final long serialVersionUID = -1488266149086925629L;
/**
*
*/
private Integer productMarketId;
/**
* 标题
*/
private String title;
/**
* 类型(1 功能更新、2 产品推广、3 成功案例)
*/
private Integer infoType;
/**
* 超链接
*/
private String hyperLink;
/**
* 发布时间
*/
private Date releaseTime;
/**
* 状态(0:正常;1:删除)
*/
private Integer deleteFlag;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
public Integer getProductMarketId() {
return productMarketId;
}
public ProductMarketDTO setProductMarketId(Integer productMarketId) {
this.productMarketId = productMarketId;
return this;
}
public String getTitle() {
return title;
}
public ProductMarketDTO setTitle(String title) {
this.title = title;
return this;
}
public Integer getInfoType() {
return infoType;
}
public ProductMarketDTO setInfoType(Integer infoType) {
this.infoType = infoType;
return this;
}
public String getHyperLink() {
return hyperLink;
}
public ProductMarketDTO setHyperLink(String hyperLink) {
this.hyperLink = hyperLink;
return this;
}
public Date getReleaseTime() {
return releaseTime;
}
public ProductMarketDTO setReleaseTime(Date releaseTime) {
this.releaseTime = releaseTime;
return this;
}
public Integer getDeleteFlag() {
return deleteFlag;
}
public ProductMarketDTO setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
return createTime;
}
public ProductMarketDTO setCreateTime(Date createTime) {
this.createTime = createTime;
return this;
}
public Date getUpdateTime() {
return updateTime;
}
public ProductMarketDTO setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
return this;
}
@Override
public String toString() {
return "ProductMarketDTO{" +
"productMarketId=" + productMarketId +
", title='" + title + '\'' +
", infoType=" + infoType +
", hyperLink='" + hyperLink + '\'' +
", releaseTime=" + releaseTime +
", deleteFlag=" + deleteFlag +
", createTime=" + createTime +
", updateTime=" + updateTime +
'}';
}
}
package com.gic.enterprise.qo;
import java.io.Serializable;
/**
* 达摩产品情报站
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/5/18 11:03 AM

*/
public class ProductMarketQO implements Serializable{
private static final long serialVersionUID = 5426587736244141621L;
/**
* 标题
*/
private String title;
/**
* 类型(1 功能更新、2 产品推广、3 成功案例)
*/
private Integer infoType;
private Integer pageNum;
private Integer pageSize;
/**
* 是否显示在gic后台的,如果是,则发布时间小于等于此刻的数据 1:是
*/
private Integer isShowGic;
public String getTitle() {
return title;
}
public ProductMarketQO setTitle(String title) {
this.title = title;
return this;
}
public Integer getInfoType() {
return infoType;
}
public ProductMarketQO setInfoType(Integer infoType) {
this.infoType = infoType;
return this;
}
public Integer getPageNum() {
if (pageNum == null) {
return 1;
}
return pageNum;
}
public ProductMarketQO setPageNum(Integer pageNum) {
this.pageNum = pageNum;
return this;
}
public Integer getPageSize() {
if (pageSize == null) {
return 20;
}
return pageSize;
}
public ProductMarketQO setPageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
public Integer getShowGic() {
return isShowGic;
}
public ProductMarketQO setShowGic(Integer showGic) {
isShowGic = showGic;
return this;
}
@Override
public String toString() {
return "ProductMarketQO{" +
"title='" + title + '\'' +
", infoType=" + infoType +
", pageNum=" + pageNum +
", pageSize=" + pageSize +
", isShowGic=" + isShowGic +
'}';
}
}
package com.gic.enterprise.service;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.enterprise.dto.BlackListDTO;
import java.util.List;
/**
* 达摩情报销商户黑名单
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/5/18 3:41 PM

*/
public interface BlackListApiService {
/**
* 新增黑名单
* @return
*/
ServiceResponse<Void> saveBlackList(Integer enterpriseId);
/**
* 解除黑名单
* @param blackListId
* @return
*/
ServiceResponse<Void> deleteBlackList(Integer blackListId);
/**
* 分页查询
* @param search 商户名称/公司名称
* @param pageNum 默认1
* @param pageSize 默认20
* @return
*/
ServiceResponse<Page<BlackListDTO>> pageBlackList(String search, Integer pageNum, Integer pageSize);
/**
* 查询黑名单的商户列表
* @return
*/
ServiceResponse<List<Integer>> getBlankListEnterprise();
}
package com.gic.enterprise.service;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.enterprise.dto.ProductMarketDTO;
import com.gic.enterprise.qo.ProductMarketQO;
import javax.validation.constraints.NotNull;
/**
* 达摩产品情报站
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/5/17 5:11 PM

*/
public interface ProductMarketApiService {
/**
*
* @param productMarketDTO
* @return
*/
ServiceResponse<Void> saveProductMarket(ProductMarketDTO productMarketDTO);
/**
* 更新情报
* @param productMarketDTO
* @return
*/
ServiceResponse<Void> updateProductMarket(ProductMarketDTO productMarketDTO);
/**
* 删除情报
* @param productMarketId
* @return
*/
ServiceResponse<Void> deleteProductMarket(Integer productMarketId);
/**
* 查询情报
* @param productMarketId
* @return
*/
ServiceResponse<ProductMarketDTO> getProductMarket(@NotNull Integer productMarketId);
/**
* 分页查询
* @param params
* @return
*/
ServiceResponse<Page<ProductMarketDTO>> pageProductMarket(ProductMarketQO params);
/**
* 首页前端是否需要弹窗
* @param enterpriseId
* @param userId
* @return
*/
ServiceResponse<Boolean> isNeedToPopup(Integer enterpriseId, Integer userId);
}
package com.gic.enterprise.dao.mapper;
import com.gic.enterprise.entity.TabBlackList;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 达摩情报商户黑名单
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/5/18 4:05 PM

*/
public interface TabBlackListMapper {
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insert(TabBlackList record);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insertSelective(TabBlackList record);
/**
* 根据主键查询
*
* @param blackListId 主键
* @return 实体对象
*/
TabBlackList selectByPrimaryKey(Integer blackListId);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeySelective(TabBlackList record);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKey(TabBlackList record);
/**
* 查询列表
* @return
*/
List<TabBlackList> listBlackList(@Param("search") String search);
}
\ No newline at end of file
package com.gic.enterprise.dao.mapper;
import com.gic.enterprise.entity.TabProductMarket;
import com.gic.enterprise.qo.ProductMarketQO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 达摩产品情报站
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/5/18 9:38 AM

*/
public interface TabProductMarketMapper {
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insert(TabProductMarket record);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insertSelective(TabProductMarket record);
/**
* 根据主键查询
*
* @param productMarketId 主键
* @return 实体对象
*/
TabProductMarket selectByPrimaryKey(Integer productMarketId);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeySelective(TabProductMarket record);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKey(TabProductMarket record);
/**
* 查询列表
* @param params
* @return
*/
List<TabProductMarket> pageProductMarket(ProductMarketQO params);
/**
* 是否有新消息(当天发布,并且时间小于当前时间,精确到秒)
* @return
*/
Integer countNewInfo(@Param("today") String today);
}
\ No newline at end of file
package com.gic.enterprise.entity;
import java.util.Date;
/**
* 达摩情报销商户黑名单
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/5/18 3:30 PM

*/
public class TabBlackList {
/**
*
*/
private Integer blackListId;
/**
* 商户ID
*/
private Integer enterpriseId;
/**
* 商户名称
*/
private String enterpriseName;
/**
* 公司名称
*/
private String companyName;
/**
* 状态(0:正常;1:删除)
*/
private Integer deleteFlag;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
public Integer getBlackListId() {
return blackListId;
}
public TabBlackList setBlackListId(Integer blackListId) {
this.blackListId = blackListId;
return this;
}
public Integer getEnterpriseId() {
return enterpriseId;
}
public TabBlackList setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
return this;
}
public String getEnterpriseName() {
return enterpriseName;
}
public TabBlackList setEnterpriseName(String enterpriseName) {
this.enterpriseName = enterpriseName;
return this;
}
public String getCompanyName() {
return companyName;
}
public TabBlackList setCompanyName(String companyName) {
this.companyName = companyName;
return this;
}
public Integer getDeleteFlag() {
return deleteFlag;
}
public TabBlackList setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
return createTime;
}
public TabBlackList setCreateTime(Date createTime) {
this.createTime = createTime;
return this;
}
public Date getUpdateTime() {
return updateTime;
}
public TabBlackList setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
return this;
}
}
\ No newline at end of file
package com.gic.enterprise.entity;
import java.util.Date;
/**
* 达摩产品情报站
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/5/17 5:00 PM

*/
public class TabProductMarket {
/**
*
*/
private Integer productMarketId;
/**
* 标题
*/
private String title;
/**
* 类型(1 功能更新、2 产品推广、3 成功案例)
*/
private Integer infoType;
/**
* 超链接
*/
private String hyperLink;
/**
* 发布时间
*/
private Date releaseTime;
/**
* 状态(0:正常;1:删除)
*/
private Integer deleteFlag;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
public Integer getProductMarketId() {
return productMarketId;
}
public TabProductMarket setProductMarketId(Integer productMarketId) {
this.productMarketId = productMarketId;
return this;
}
public String getTitle() {
return title;
}
public TabProductMarket setTitle(String title) {
this.title = title;
return this;
}
public Integer getInfoType() {
return infoType;
}
public TabProductMarket setInfoType(Integer infoType) {
this.infoType = infoType;
return this;
}
public String getHyperLink() {
return hyperLink;
}
public TabProductMarket setHyperLink(String hyperLink) {
this.hyperLink = hyperLink;
return this;
}
public Date getReleaseTime() {
return releaseTime;
}
public TabProductMarket setReleaseTime(Date releaseTime) {
this.releaseTime = releaseTime;
return this;
}
public Integer getDeleteFlag() {
return deleteFlag;
}
public TabProductMarket setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
return createTime;
}
public TabProductMarket setCreateTime(Date createTime) {
this.createTime = createTime;
return this;
}
public Date getUpdateTime() {
return updateTime;
}
public TabProductMarket setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
return this;
}
}
\ No newline at end of file
package com.gic.enterprise.service;
import com.gic.enterprise.dto.BlackListDTO;
import com.gic.enterprise.entity.TabBlackList;
import com.gic.enterprise.entity.TabEnterprise;
import com.github.pagehelper.Page;
import java.util.List;
/**
* 达摩情报销商户黑名单
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/5/18 4:02 PM

*/
public interface BlackListService {
/**
* 新增黑名单
* @param enterprise
*/
void saveBlackList(TabEnterprise enterprise);
/**
* 移除黑名单
* @param blackListId
*/
void deleteBlackList(Integer blackListId);
/**
* 分页查询
* @param search
* @param pageNum
* @param pageSize
* @return
*/
Page<TabBlackList> pageBlackList(String search, Integer pageNum, Integer pageSize);
/**
* 黑名单商户列表
* @return
*/
List<TabBlackList> getBlankListEnterprise();
}
package com.gic.enterprise.service;
import com.gic.enterprise.dto.ProductMarketDTO;
import com.gic.enterprise.entity.TabProductMarket;
import com.gic.enterprise.qo.ProductMarketQO;
import com.github.pagehelper.Page;
/**
* 达摩产品情报站
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/5/18 9:28 AM

*/
public interface ProductMarketService {
/**
* 新增情报
* @param productMarketDTO
*/
void saveProductMarket(ProductMarketDTO productMarketDTO);
/**
* 更新情报
* @param productMarketDTO
*/
void updateProductMarket(ProductMarketDTO productMarketDTO);
/**
* 详情
* @param productMarketId
* @return
*/
TabProductMarket getProductMarket(Integer productMarketId);
/**
* 分页查询
* @param params
* @return
*/
Page<TabProductMarket> pageProductMarket(ProductMarketQO params);
/**
* 是否有新消息(当天发布,并且时间小于当前时间,精确到秒)
* @return
*/
Boolean hasNewInfo();
}
package com.gic.enterprise.service.impl;
import com.gic.enterprise.constant.DeleteFlagConstants;
import com.gic.enterprise.dao.mapper.TabBlackListMapper;
import com.gic.enterprise.entity.TabBlackList;
import com.gic.enterprise.entity.TabEnterprise;
import com.gic.enterprise.service.BlackListService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* 达摩情报商户黑名单
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/5/18 4:04 PM

*/
@Service("blackListService")
public class BlackListServiceImpl implements BlackListService{
@Autowired
private TabBlackListMapper tabBlackListMapper;
@Override
public void saveBlackList(TabEnterprise enterprise) {
TabBlackList record = new TabBlackList();
record.setEnterpriseId(enterprise.getEnterpriseId());
record.setEnterpriseName(enterprise.getEnterpriseName());
record.setCompanyName(enterprise.getCompanyName());
record.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
Date now = new Date();
record.setCreateTime(now);
record.setUpdateTime(now);
tabBlackListMapper.insert(record);
}
@Override
public void deleteBlackList(Integer blackListId) {
TabBlackList record = new TabBlackList();
record.setUpdateTime(new Date());
record.setDeleteFlag(DeleteFlagConstants.DELETE_STATUS);
record.setBlackListId(blackListId);
tabBlackListMapper.updateByPrimaryKeySelective(record);
}
@Override
public Page<TabBlackList> pageBlackList(String search, Integer pageNum, Integer pageSize) {
if (pageNum == null) {
pageNum = 1;
}
if (pageSize == null) {
pageSize = 20;
}
PageHelper.startPage(pageNum, pageSize);
List<TabBlackList> list = tabBlackListMapper.listBlackList(search);
return (Page<TabBlackList>) list;
}
@Override
public List<TabBlackList> getBlankListEnterprise() {
return tabBlackListMapper.listBlackList(null);
}
}
package com.gic.enterprise.service.impl;
import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.constant.DeleteFlagConstants;
import com.gic.enterprise.dao.mapper.TabProductMarketMapper;
import com.gic.enterprise.dto.ProductMarketDTO;
import com.gic.enterprise.entity.TabProductMarket;
import com.gic.enterprise.qo.ProductMarketQO;
import com.gic.enterprise.service.ProductMarketService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 达摩产品情报站
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/5/18 9:37 AM

*/
@Service("productMarketService")
public class ProductMarketServiceImpl implements ProductMarketService{
@Autowired
private TabProductMarketMapper tabProductMarketMapper;
@Override
public void saveProductMarket(ProductMarketDTO productMarketDTO) {
TabProductMarket record = EntityUtil.changeEntityNew(TabProductMarket.class, productMarketDTO);
Date now = new Date();
record.setUpdateTime(now);
record.setCreateTime(now);
record.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
tabProductMarketMapper.insert(record);
}
@Override
public void updateProductMarket(ProductMarketDTO productMarketDTO) {
TabProductMarket record = EntityUtil.changeEntityNew(TabProductMarket.class, productMarketDTO);
record.setUpdateTime(new Date());
tabProductMarketMapper.updateByPrimaryKeySelective(record);
}
@Override
public TabProductMarket getProductMarket(Integer productMarketId) {
return tabProductMarketMapper.selectByPrimaryKey(productMarketId);
}
@Override
public Page<TabProductMarket> pageProductMarket(ProductMarketQO params) {
PageHelper.startPage(params.getPageNum(), params.getPageSize());
List<TabProductMarket> list = tabProductMarketMapper.pageProductMarket(params);
return (Page<TabProductMarket>) list;
}
@Override
public Boolean hasNewInfo() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String today = sdf.format(new Date());
Integer count = tabProductMarketMapper.countNewInfo(today);
if (count != null && count > 0) {
return true;
}
return false;
}
}
package com.gic.enterprise.service.outer.impl;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.PageHelperUtils;
import com.gic.enterprise.dto.BlackListDTO;
import com.gic.enterprise.entity.TabBlackList;
import com.gic.enterprise.entity.TabEnterprise;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.exception.CommonException;
import com.gic.enterprise.service.BlackListApiService;
import com.gic.enterprise.service.BlackListService;
import com.gic.enterprise.service.EnterpriseService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
/**
* 达摩情报销商户黑名单
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/5/18 3:47 PM

*/
@Service("blackListApiService")
public class BlackListApiServiceImpl implements BlackListApiService{
@Autowired
private BlackListService blackListService;
@Autowired
private EnterpriseService enterpriseService;
@Override
public ServiceResponse<Void> saveBlackList(Integer enterpriseId) {
TabEnterprise enterprise = getEnterprise(enterpriseId);
blackListService.saveBlackList(enterprise);
return ServiceResponse.success();
}
@Override
public ServiceResponse<Void> deleteBlackList(Integer blackListId) {
blackListService.deleteBlackList(blackListId);
return ServiceResponse.success();
}
@Override
public ServiceResponse<Page<BlackListDTO>> pageBlackList(String search, Integer pageNum, Integer pageSize) {
com.github.pagehelper.Page<TabBlackList> page = blackListService.pageBlackList(search, pageNum, pageSize);
Page<BlackListDTO> result = PageHelperUtils.changePageHelperToCurrentPage(page, BlackListDTO.class);
return ServiceResponse.success(result);
}
@Override
public ServiceResponse<List<Integer>> getBlankListEnterprise() {
List<TabBlackList> list = blackListService.getBlankListEnterprise();
if (CollectionUtils.isNotEmpty(list)) {
return ServiceResponse.success(list.stream().map(e -> e.getEnterpriseId()).collect(Collectors.toList()));
}
return ServiceResponse.success(Collections.EMPTY_LIST);
}
private TabEnterprise getEnterprise(Integer enterpriseId) {
TabEnterprise record = enterpriseService.getEnterpriseById(enterpriseId);
if (record == null) {
throw new CommonException(ErrorCode.PARAMETER_ERROR.getCode(), "商户不存在");
}
return record;
}
}
package com.gic.enterprise.service.outer.impl;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.PageHelperUtils;
import com.gic.enterprise.constant.DeleteFlagConstants;
import com.gic.enterprise.dto.ProductMarketDTO;
import com.gic.enterprise.entity.TabProductMarket;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.exception.CommonException;
import com.gic.enterprise.qo.ProductMarketQO;
import com.gic.enterprise.service.ProductMarketApiService;
import com.gic.enterprise.service.ProductMarketService;
import com.gic.redis.data.util.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.validation.constraints.NotNull;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.concurrent.TimeUnit;
/**
* 达摩产品情报站
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/5/18 9:26 AM

*/
@Service("productMarketApiService")
public class ProductMarketApiServiceImpl implements ProductMarketApiService{
@Autowired
private ProductMarketService productMarketService;
@Override
public ServiceResponse<Void> saveProductMarket(ProductMarketDTO productMarketDTO) {
validParam(productMarketDTO);
productMarketService.saveProductMarket(productMarketDTO);
return ServiceResponse.success();
}
@Override
public ServiceResponse<Void> updateProductMarket(ProductMarketDTO productMarketDTO) {
validParam(productMarketDTO);
productMarketService.updateProductMarket(productMarketDTO);
return ServiceResponse.success();
}
@Override
public ServiceResponse<Void> deleteProductMarket(Integer productMarketId) {
exist(productMarketId);
productMarketService.updateProductMarket(new ProductMarketDTO()
.setProductMarketId(productMarketId)
.setDeleteFlag(DeleteFlagConstants.DELETE_STATUS));
return ServiceResponse.success();
}
@Override
public ServiceResponse<ProductMarketDTO> getProductMarket(@NotNull Integer productMarketId) {
TabProductMarket record = exist(productMarketId);
return ServiceResponse.success(EntityUtil.changeEntityNew(ProductMarketDTO.class, record));
}
@Override
public ServiceResponse<Page<ProductMarketDTO>> pageProductMarket(ProductMarketQO params) {
com.github.pagehelper.Page<TabProductMarket> page = productMarketService.pageProductMarket(params);
Page<ProductMarketDTO> result = PageHelperUtils.changePageHelperToCurrentPage(page, ProductMarketDTO.class);
return ServiceResponse.success(result);
}
@Override
public ServiceResponse<Boolean> isNeedToPopup(Integer enterpriseId, Integer userId) {
Boolean hasNewInfo = productMarketService.hasNewInfo();
if (hasNewInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String today = sdf.format(new Date());
//是否已经弹窗提示过,一天只提示一次
String redisKey = "enterprise:product:market:" + today + ":" + userId;
Object obj = RedisUtil.getCache(redisKey);
if(obj != null){
//已经提示过,不需要再次提示
return ServiceResponse.success(false);
} else {
RedisUtil.setCache(redisKey, redisKey, 24L, TimeUnit.HOURS);
return ServiceResponse.success(true);
}
}
//没有新发布的数据,不需要提示
return ServiceResponse.success(false);
}
private void validParam(ProductMarketDTO productMarketDTO) {
Integer productMarketId = productMarketDTO.getProductMarketId();
boolean isEdit = productMarketId != null;
if (isEdit) {
exist(productMarketId);
}
}
private TabProductMarket exist(Integer productMarketId) {
TabProductMarket record = productMarketService.getProductMarket(productMarketId);
if (record == null) {
throw new CommonException(ErrorCode.PARAMETER_ERROR.getCode(), "情报不存在");
}
return record;
}
}
......@@ -134,6 +134,8 @@
<dubbo:service interface="com.gic.enterprise.service.UnionEnterpriseAuthApiService" ref="unionEnterpriseAuthApiService" timeout="6000" />
<dubbo:service interface="com.gic.enterprise.service.UnionEnterpriseAuthResDetailApiService" ref="unionEnterpriseAuthResDetailApiService" timeout="6000" />
<dubbo:service interface="com.gic.enterprise.service.TableSettingApiService" ref="tableSettingApiService" timeout="6000" />
<dubbo:service interface="com.gic.enterprise.service.ProductMarketApiService" ref="productMarketApiService" timeout="6000" />
<dubbo:service interface="com.gic.enterprise.service.BlackListApiService" ref="blackListApiService" timeout="6000" />
<dubbo:reference interface="com.gic.mall.share.api.service.ShopApiService" id="shopApiService" timeout="6000" />
......
<?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="com.gic.enterprise.dao.mapper.TabBlackListMapper">
<resultMap id="BaseResultMap" type="com.gic.enterprise.entity.TabBlackList">
<id column="black_list_id" jdbcType="INTEGER" property="blackListId" />
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
<result column="enterprise_name" jdbcType="VARCHAR" property="enterpriseName" />
<result column="company_name" jdbcType="VARCHAR" property="companyName" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
black_list_id, enterprise_id, enterprise_name, company_name, delete_flag, create_time,
update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_black_list
where black_list_id = #{blackListId,jdbcType=INTEGER}
</select>
<insert id="insert" parameterType="com.gic.enterprise.entity.TabBlackList">
insert into tab_black_list (black_list_id, enterprise_id, enterprise_name,
company_name, delete_flag, create_time,
update_time)
values (#{blackListId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{enterpriseName,jdbcType=VARCHAR},
#{companyName,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.enterprise.entity.TabBlackList">
insert into tab_black_list
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="blackListId != null">
black_list_id,
</if>
<if test="enterpriseId != null">
enterprise_id,
</if>
<if test="enterpriseName != null">
enterprise_name,
</if>
<if test="companyName != null">
company_name,
</if>
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="blackListId != null">
#{blackListId,jdbcType=INTEGER},
</if>
<if test="enterpriseId != null">
#{enterpriseId,jdbcType=INTEGER},
</if>
<if test="enterpriseName != null">
#{enterpriseName,jdbcType=VARCHAR},
</if>
<if test="companyName != null">
#{companyName,jdbcType=VARCHAR},
</if>
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.enterprise.entity.TabBlackList">
update tab_black_list
<set>
<if test="enterpriseId != null">
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
</if>
<if test="enterpriseName != null">
enterprise_name = #{enterpriseName,jdbcType=VARCHAR},
</if>
<if test="companyName != null">
company_name = #{companyName,jdbcType=VARCHAR},
</if>
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where black_list_id = #{blackListId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.enterprise.entity.TabBlackList">
update tab_black_list
set enterprise_id = #{enterpriseId,jdbcType=INTEGER},
enterprise_name = #{enterpriseName,jdbcType=VARCHAR},
company_name = #{companyName,jdbcType=VARCHAR},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where black_list_id = #{blackListId,jdbcType=INTEGER}
</update>
<select id="listBlackList" resultMap="BaseResultMap">
select <include refid="Base_Column_List"></include>
from tab_black_list
where delete_flag = 0
<if test="search != null and search != ''">
and (enterprise_name like concat('%', #{search}, '%') or company_name like concat('%', #{search}, '%'))
</if>
order by create_time desc
</select>
</mapper>
\ No newline at end of file
......@@ -222,7 +222,12 @@
and create_time &gt; #{endTime}
</if>
<if test="dataType != null ">
<if test="dataType == 3 || dataType == 1">
and data_type in (1, 3)
</if>
<if test="dataType != 3 and dataType != 1">
and data_type = #{dataType}
</if>
</if>
<if test="search != null and search != '' ">
and (
......
......@@ -328,7 +328,12 @@
and create_time &lt; #{endTime}
</if>
<if test="dataType != null ">
<if test="dataType == 3 || dataType == 1">
and data_type in (1, 3)
</if>
<if test="dataType != 3 and dataType != 1">
and data_type = #{dataType}
</if>
</if>
<if test="auditResult != null ">
and audit_result = #{auditResult}
......
<?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="com.gic.enterprise.dao.mapper.TabProductMarketMapper">
<resultMap id="BaseResultMap" type="com.gic.enterprise.entity.TabProductMarket">
<id column="product_market_id" jdbcType="INTEGER" property="productMarketId" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="info_type" jdbcType="INTEGER" property="infoType" />
<result column="hyper_link" jdbcType="VARCHAR" property="hyperLink" />
<result column="release_time" jdbcType="TIMESTAMP" property="releaseTime" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
product_market_id, title, info_type, hyper_link, release_time, delete_flag, create_time,
update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_product_market
where product_market_id = #{productMarketId,jdbcType=INTEGER}
</select>
<insert id="insert" parameterType="com.gic.enterprise.entity.TabProductMarket">
insert into tab_product_market (product_market_id, title, info_type,
hyper_link, release_time, delete_flag,
create_time, update_time)
values (#{productMarketId,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{infoType,jdbcType=INTEGER},
#{hyperLink,jdbcType=VARCHAR}, #{releaseTime,jdbcType=TIMESTAMP}, #{deleteFlag,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.enterprise.entity.TabProductMarket">
insert into tab_product_market
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="productMarketId != null">
product_market_id,
</if>
<if test="title != null">
title,
</if>
<if test="infoType != null">
info_type,
</if>
<if test="hyperLink != null">
hyper_link,
</if>
<if test="releaseTime != null">
release_time,
</if>
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="productMarketId != null">
#{productMarketId,jdbcType=INTEGER},
</if>
<if test="title != null">
#{title,jdbcType=VARCHAR},
</if>
<if test="infoType != null">
#{infoType,jdbcType=INTEGER},
</if>
<if test="hyperLink != null">
#{hyperLink,jdbcType=VARCHAR},
</if>
<if test="releaseTime != null">
#{releaseTime,jdbcType=TIMESTAMP},
</if>
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.enterprise.entity.TabProductMarket">
update tab_product_market
<set>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="infoType != null">
info_type = #{infoType,jdbcType=INTEGER},
</if>
<if test="hyperLink != null">
hyper_link = #{hyperLink,jdbcType=VARCHAR},
</if>
<if test="releaseTime != null">
release_time = #{releaseTime,jdbcType=TIMESTAMP},
</if>
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where product_market_id = #{productMarketId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.enterprise.entity.TabProductMarket">
update tab_product_market
set title = #{title,jdbcType=VARCHAR},
info_type = #{infoType,jdbcType=INTEGER},
hyper_link = #{hyperLink,jdbcType=VARCHAR},
release_time = #{releaseTime,jdbcType=TIMESTAMP},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where product_market_id = #{productMarketId,jdbcType=INTEGER}
</update>
<select id="pageProductMarket" resultMap="BaseResultMap" parameterType="com.gic.enterprise.qo.ProductMarketQO">
select <include refid="Base_Column_List"></include>
from tab_product_market
where delete_flag = 0
<if test="title != null and title != ''">
and title like concat('%', #{title}, '%')
</if>
<if test="infoType != null">
and info_type = #{infoType}
</if>
<if test="isShowGic != null and isShowGic == 1">
and release_time &lt;=now()
</if>
order by release_time desc
</select>
<select id="countNewInfo" resultType="int">
select count(1) from tab_product_market
where delete_flag = 0
and date(release_time) =:today
and timestamp(release_time) &lt;= now()
</select>
</mapper>
\ No newline at end of file
......@@ -8,6 +8,7 @@ import com.gic.enterprise.qo.DownloadLogQO;
import com.gic.enterprise.service.DownloadLogApiService;
import com.gic.enterprise.utils.ResultControllerUtils;
import com.gic.enterprise.utils.UserDetailUtils;
import com.gic.enterprise.web.vo.DownloadLogVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -29,7 +30,7 @@ public class DownloadLogController {
public RestResponse listDownloadLog(@Validated({DownloadLogQO.SelectValidView.class}) DownloadLogQO downloadLogQO) {
downloadLogQO.setEnterpriseId(UserDetailUtils.getUserDetail().getEnterpriseId());
ServiceResponse<Page<DownloadLogDTO>> serviceResponse = downloadLogApiService.listDownload(downloadLogQO);
return ResultControllerUtils.commonResult(serviceResponse);
return ResultControllerUtils.commonPageResult(serviceResponse, DownloadLogVO.class);
}
}
......@@ -9,6 +9,7 @@ import com.gic.enterprise.qo.DownloadReportQO;
import com.gic.enterprise.service.DownloadReportApiService;
import com.gic.enterprise.utils.ResultControllerUtils;
import com.gic.enterprise.utils.UserDetailUtils;
import com.gic.enterprise.web.vo.DownloadReportVO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
......@@ -37,7 +38,7 @@ public class DownloadReportController {
downloadReportQO.setEndTime(downloadReportQO.getEndTime() + " 23:59:59");
}
ServiceResponse<Page<DownloadReportDTO>> serviceResponse = downloadReportApiService.listDownloadReport(downloadReportQO);
return ResultControllerUtils.commonResult(serviceResponse);
return ResultControllerUtils.commonPageResult(serviceResponse, DownloadReportVO.class);
}
@RequestMapping("/get-download-report-url")
......
package com.gic.enterprise.web.controller;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.constant.ProductMarketTypeEnum;
import com.gic.enterprise.dto.ProductMarketDTO;
import com.gic.enterprise.qo.ProductMarketQO;
import com.gic.enterprise.service.BlackListApiService;
import com.gic.enterprise.service.ProductMarketApiService;
import com.gic.enterprise.utils.ResultControllerUtils;
import com.gic.enterprise.utils.UserDetailUtils;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 达摩产品情报站
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/5/18 2:35 PM

*/
@RestController
@RequestMapping("/product-market")
public class ProductMarketController {
@Autowired
private ProductMarketApiService productMarketApiService;
@Autowired
private BlackListApiService blackListApiService;
@RequestMapping("query-product-market")
public RestResponse queryProductMarket(Integer showCount) {
Map<String, List<ProductMarketDTO>> result = new HashMap<>(8);
//功能更新
ProductMarketQO params = new ProductMarketQO();
if (showCount == null) {
showCount = 5;
}
params.setShowGic(1);
params.setPageNum(1);
params.setPageSize(showCount);
params.setInfoType(ProductMarketTypeEnum.FUNCTION_UPDATE.getCode());
ServiceResponse<Page<ProductMarketDTO>> functionUpdate = productMarketApiService.pageProductMarket(params);
if (isNotEmptyList(functionUpdate)) {
result.put("functionUpdate", functionUpdate.getResult().getResult());
} else {
result.put("functionUpdate", Collections.EMPTY_LIST);
}
//
params.setInfoType(ProductMarketTypeEnum.PRODUCT_PROMOTION.getCode());
ServiceResponse<Page<ProductMarketDTO>> productPromotion = productMarketApiService.pageProductMarket(params);
if (isNotEmptyList(productPromotion)) {
result.put("productPromotion", productPromotion.getResult().getResult());
} else {
result.put("productPromotion", Collections.EMPTY_LIST);
}
//
params.setInfoType(ProductMarketTypeEnum.SUCCESS_STORIES.getCode());
ServiceResponse<Page<ProductMarketDTO>> successStories = productMarketApiService.pageProductMarket(params);
if (isNotEmptyList(successStories)) {
result.put("successStories", successStories.getResult().getResult());
} else {
result.put("successStories", Collections.EMPTY_LIST);
}
return RestResponse.success(result);
}
/**
* 首页前端是否需要弹窗
* @return
*/
@RequestMapping("is-need-to-popup")
public RestResponse isNeedToPopup() {
return ResultControllerUtils.commonResult(productMarketApiService
.isNeedToPopup(UserDetailUtils.getUserDetail().getEnterpriseId(),
UserDetailUtils.getUserDetail().getUserId()));
}
/**
* 是否在黑名单
* @return
*/
@RequestMapping("is-in-black-list")
public RestResponse isInBlackList() {
List<Integer> list = blackListApiService.getBlankListEnterprise().getResult();
return RestResponse.success(list.contains(UserDetailUtils.getUserDetail().getEnterpriseId()));
}
private boolean isNotEmptyList(ServiceResponse<Page<ProductMarketDTO>> response) {
return response.isSuccess() && response.getResult() != null && CollectionUtils.isNotEmpty(response.getResult().getResult());
}
}
package com.gic.enterprise.web.vo;
import java.io.Serializable;
import java.util.Date;
/**
* 日志管理-下载日志
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/5/17 3:48 PM

*/
public class DownloadLogVO implements Serializable{
private static final long serialVersionUID = -4570746329401683370L;
/**
*
*/
private Integer downloadLogId;
/**
*
*/
private Integer enterpriseId;
/**
* 报告id
*/
private String reportId;
/**
* 下载中心id
*/
private Integer downloadReportId;
/**
* 文件名称
*/
private String fileName;
/**
* 数据内容
*/
private String dataContent;
/**
* 报告类型 1:完整数据, 2:脱敏数据, 3:二维码
*/
private Integer dataType;
/**
* 数据总量
*/
private Integer dataCount;
/**
* 下载用户id
*/
private Integer downloadUserId;
/**
* 下载人员名
*/
private String downloadUserName;
/**
* 下载时间
*/
private Date downloadTime;
/**
*
*/
private String projectCode;
/**
*
*/
private Integer status;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
public Integer getDownloadLogId() {
return downloadLogId;
}
public DownloadLogVO setDownloadLogId(Integer downloadLogId) {
this.downloadLogId = downloadLogId;
return this;
}
public Integer getEnterpriseId() {
return enterpriseId;
}
public DownloadLogVO setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
return this;
}
public String getReportId() {
return reportId;
}
public DownloadLogVO setReportId(String reportId) {
this.reportId = reportId;
return this;
}
public Integer getDownloadReportId() {
return downloadReportId;
}
public DownloadLogVO setDownloadReportId(Integer downloadReportId) {
this.downloadReportId = downloadReportId;
return this;
}
public String getFileName() {
return fileName;
}
public DownloadLogVO setFileName(String fileName) {
this.fileName = fileName;
return this;
}
public String getDataContent() {
return dataContent;
}
public DownloadLogVO setDataContent(String dataContent) {
this.dataContent = dataContent;
return this;
}
public Integer getDataType() {
if (dataType != null && dataType == 3) {
//如果是二维码,则变成完整数据类型
return 1;
}
return dataType;
}
public DownloadLogVO setDataType(Integer dataType) {
this.dataType = dataType;
return this;
}
public Integer getDataCount() {
return dataCount;
}
public DownloadLogVO setDataCount(Integer dataCount) {
this.dataCount = dataCount;
return this;
}
public Integer getDownloadUserId() {
return downloadUserId;
}
public DownloadLogVO setDownloadUserId(Integer downloadUserId) {
this.downloadUserId = downloadUserId;
return this;
}
public String getDownloadUserName() {
return downloadUserName;
}
public DownloadLogVO setDownloadUserName(String downloadUserName) {
this.downloadUserName = downloadUserName;
return this;
}
public Date getDownloadTime() {
return downloadTime;
}
public DownloadLogVO setDownloadTime(Date downloadTime) {
this.downloadTime = downloadTime;
return this;
}
public String getProjectCode() {
return projectCode;
}
public DownloadLogVO setProjectCode(String projectCode) {
this.projectCode = projectCode;
return this;
}
public Integer getStatus() {
return status;
}
public DownloadLogVO setStatus(Integer status) {
this.status = status;
return this;
}
public Date getCreateTime() {
return createTime;
}
public DownloadLogVO setCreateTime(Date createTime) {
this.createTime = createTime;
return this;
}
public Date getUpdateTime() {
return updateTime;
}
public DownloadLogVO setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
return this;
}
@Override
public String toString() {
return "DownloadLogVO{" +
"downloadLogId=" + downloadLogId +
", enterpriseId=" + enterpriseId +
", reportId='" + reportId + '\'' +
", downloadReportId=" + downloadReportId +
", fileName='" + fileName + '\'' +
", dataContent='" + dataContent + '\'' +
", dataType=" + dataType +
", dataCount=" + dataCount +
", downloadUserId=" + downloadUserId +
", downloadUserName='" + downloadUserName + '\'' +
", downloadTime=" + downloadTime +
", projectCode='" + projectCode + '\'' +
", status=" + status +
", createTime=" + createTime +
", updateTime=" + updateTime +
'}';
}
}
package com.gic.enterprise.web.vo;
import java.io.Serializable;
import java.util.Date;
/**
* 下载中心列表
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/5/17 3:57 PM

*/
public class DownloadReportVO implements Serializable{
private static final long serialVersionUID = -708734703914189764L;
/**
*
*/
private Integer downloadReportId;
/**
*
*/
private Integer enterpriseId;
/**
* 报告id
*/
private String reportId;
/**
*
*/
private Integer applyUserId;
/**
*
*/
private String applyUserName;
/**
* 开始时间
*/
private Date reportStartTime;
/**
* 结束时间
*/
private Date reportEndTime;
/**
* 文件名称
*/
private String fileName;
/**
* 数据源, 用 "-" 隔开上级和本级
*/
private String dataContent;
/**
* 数据源超链接
*/
private String dataUrl;
/**
* 报告类型 1:完整数据, 2:脱敏数据, 3:二维码
*/
private Integer dataType;
/**
* 数据总量
*/
private Integer dataCount;
private String projectCode;
/**
* 审批结果 0:未审核 1:审核通过 2:审核失败
*/
private Integer auditResult;
/**
* 审批到期时间
*/
private Date auditExpireTime;
/**
* 文件路径
*/
private String downloadUrl;
/**
*
*/
private Integer status;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
private Integer downloadReportStatus;
/**
* 审核人
*/
private Integer auditorId;
/**
* 审核人name
*/
private String auditorName;
/**
* 审核人手机
*/
private String auditorPhone;
/**
* 拒绝理由
*/
private String auditReason;
public Integer getDownloadReportId() {
return downloadReportId;
}
public DownloadReportVO setDownloadReportId(Integer downloadReportId) {
this.downloadReportId = downloadReportId;
return this;
}
public Integer getEnterpriseId() {
return enterpriseId;
}
public DownloadReportVO setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
return this;
}
public String getReportId() {
return reportId;
}
public DownloadReportVO setReportId(String reportId) {
this.reportId = reportId;
return this;
}
public Integer getApplyUserId() {
return applyUserId;
}
public DownloadReportVO setApplyUserId(Integer applyUserId) {
this.applyUserId = applyUserId;
return this;
}
public String getApplyUserName() {
return applyUserName;
}
public DownloadReportVO setApplyUserName(String applyUserName) {
this.applyUserName = applyUserName;
return this;
}
public Date getReportStartTime() {
return reportStartTime;
}
public DownloadReportVO setReportStartTime(Date reportStartTime) {
this.reportStartTime = reportStartTime;
return this;
}
public Date getReportEndTime() {
return reportEndTime;
}
public DownloadReportVO setReportEndTime(Date reportEndTime) {
this.reportEndTime = reportEndTime;
return this;
}
public String getFileName() {
return fileName;
}
public DownloadReportVO setFileName(String fileName) {
this.fileName = fileName;
return this;
}
public String getDataContent() {
return dataContent;
}
public DownloadReportVO setDataContent(String dataContent) {
this.dataContent = dataContent;
return this;
}
public String getDataUrl() {
return dataUrl;
}
public DownloadReportVO setDataUrl(String dataUrl) {
this.dataUrl = dataUrl;
return this;
}
public Integer getDataType() {
if (dataType != null && dataType == 3) {
//如果是二维码,则变成完整数据类型
return 1;
}
return dataType;
}
public DownloadReportVO setDataType(Integer dataType) {
this.dataType = dataType;
return this;
}
public Integer getDataCount() {
return dataCount;
}
public DownloadReportVO setDataCount(Integer dataCount) {
this.dataCount = dataCount;
return this;
}
public String getProjectCode() {
return projectCode;
}
public DownloadReportVO setProjectCode(String projectCode) {
this.projectCode = projectCode;
return this;
}
public Integer getAuditResult() {
return auditResult;
}
public DownloadReportVO setAuditResult(Integer auditResult) {
this.auditResult = auditResult;
return this;
}
public Date getAuditExpireTime() {
return auditExpireTime;
}
public DownloadReportVO setAuditExpireTime(Date auditExpireTime) {
this.auditExpireTime = auditExpireTime;
return this;
}
public String getDownloadUrl() {
return downloadUrl;
}
public DownloadReportVO setDownloadUrl(String downloadUrl) {
this.downloadUrl = downloadUrl;
return this;
}
public Integer getStatus() {
return status;
}
public DownloadReportVO setStatus(Integer status) {
this.status = status;
return this;
}
public Date getCreateTime() {
return createTime;
}
public DownloadReportVO setCreateTime(Date createTime) {
this.createTime = createTime;
return this;
}
public Date getUpdateTime() {
return updateTime;
}
public DownloadReportVO setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
return this;
}
public Integer getDownloadReportStatus() {
return downloadReportStatus;
}
public DownloadReportVO setDownloadReportStatus(Integer downloadReportStatus) {
this.downloadReportStatus = downloadReportStatus;
return this;
}
public Integer getAuditorId() {
return auditorId;
}
public DownloadReportVO setAuditorId(Integer auditorId) {
this.auditorId = auditorId;
return this;
}
public String getAuditorName() {
return auditorName;
}
public DownloadReportVO setAuditorName(String auditorName) {
this.auditorName = auditorName;
return this;
}
public String getAuditorPhone() {
return auditorPhone;
}
public DownloadReportVO setAuditorPhone(String auditorPhone) {
this.auditorPhone = auditorPhone;
return this;
}
public String getAuditReason() {
return auditReason;
}
public DownloadReportVO setAuditReason(String auditReason) {
this.auditReason = auditReason;
return this;
}
@Override
public String toString() {
return "DownloadReportVO{" +
"downloadReportId=" + downloadReportId +
", enterpriseId=" + enterpriseId +
", reportId='" + reportId + '\'' +
", applyUserId=" + applyUserId +
", applyUserName='" + applyUserName + '\'' +
", reportStartTime=" + reportStartTime +
", reportEndTime=" + reportEndTime +
", fileName='" + fileName + '\'' +
", dataContent='" + dataContent + '\'' +
", dataUrl='" + dataUrl + '\'' +
", dataType=" + dataType +
", dataCount=" + dataCount +
", projectCode='" + projectCode + '\'' +
", auditResult=" + auditResult +
", auditExpireTime=" + auditExpireTime +
", downloadUrl='" + downloadUrl + '\'' +
", status=" + status +
", createTime=" + createTime +
", updateTime=" + updateTime +
", downloadReportStatus=" + downloadReportStatus +
", auditorId=" + auditorId +
", auditorName='" + auditorName + '\'' +
", auditorPhone='" + auditorPhone + '\'' +
", auditReason='" + auditReason + '\'' +
'}';
}
}
......@@ -154,4 +154,6 @@
<dubbo:reference interface="com.gic.auth.service.AccountGroupApiService" id="accountGroupApiService" timeout="6000" />
<!--短信签名-->
<dubbo:reference interface="com.gic.marketing.api.service.sms.SmsApiService" id="smsApiService" timeout="6000" />
<dubbo:reference interface="com.gic.enterprise.service.ProductMarketApiService" id="productMarketApiService" timeout="6000" />
<dubbo:reference interface="com.gic.enterprise.service.BlackListApiService" id="blackListApiService" timeout="6000" />
</beans>
package com.gic.operation.web.controller;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.dto.ProductMarketDTO;
import com.gic.enterprise.qo.ProductMarketQO;
import com.gic.enterprise.service.BlackListApiService;
import com.gic.enterprise.service.ProductMarketApiService;
import com.gic.enterprise.utils.ResultControllerUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 达摩情报
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/5/18 3:20 PM

*/
@RestController
@RequestMapping("/product-market")
public class ProductMarketController {
@Autowired
private ProductMarketApiService productMarketApiService;
@Autowired
private BlackListApiService blackListApiService;
/**
* 新增情报
* @param productMarketDTO
* @return
*/
@RequestMapping("save-product-market")
public RestResponse saveProductMarket(ProductMarketDTO productMarketDTO) {
return ResultControllerUtils.commonResult(productMarketApiService.saveProductMarket(productMarketDTO));
}
/**
* 编辑情报
* @param productMarketDTO
* @return
*/
@RequestMapping("update-product-market")
public RestResponse updateProductMarket(ProductMarketDTO productMarketDTO) {
return ResultControllerUtils.commonResult(productMarketApiService.updateProductMarket(productMarketDTO));
}
@RequestMapping("delete-product-market")
public RestResponse deleteProductMarket(Integer productMarketId) {
return ResultControllerUtils.commonResult(productMarketApiService.deleteProductMarket(productMarketId));
}
@RequestMapping("page-product-market")
public RestResponse pageProductMarket(ProductMarketQO params) {
return ResultControllerUtils.commonResult(productMarketApiService.pageProductMarket(params));
}
/**
* 新增黑名单
* @param enterpriseId
* @return
*/
@RequestMapping("save-black-list")
public RestResponse saveBlackList(Integer enterpriseId) {
return ResultControllerUtils.commonResult(blackListApiService.saveBlackList(enterpriseId));
}
@RequestMapping("delete-black-list")
public RestResponse deleteBlackList(Integer blackListId) {
return ResultControllerUtils.commonResult(blackListApiService.deleteBlackList(blackListId));
}
@RequestMapping("page-black-list")
public RestResponse pageBlackList(String search, Integer pageNum, Integer pageSize) {
return ResultControllerUtils.commonResult(blackListApiService.pageBlackList(search, pageNum, pageSize));
}
}
......@@ -93,4 +93,7 @@
<dubbo:reference interface="com.gic.authcenter.api.service.GicDepartmentService" id="gicDepartmentService" timeout="6000" />
<dubbo:reference interface="com.gic.member.config.api.service.MemberCardApiService" id="memberCardApiService" timeout="6000" />
<dubbo:reference interface="com.gic.open.api.service.EnterpriseLicenseApiService" id="enterpriseLicenseApiService" timeout="6000" />
<dubbo:reference interface="com.gic.enterprise.service.ProductMarketApiService" id="productMarketApiService" timeout="6000" />
<dubbo:reference interface="com.gic.enterprise.service.BlackListApiService" id="blackListApiService" timeout="6000" />
</beans>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment