Commit 2a4f41c1 authored by 赵啸非's avatar 赵啸非

添加首页统计报表

parent ad32b81a
......@@ -96,8 +96,9 @@ DROP TABLE IF EXISTS `mortals_xhx_company_labels`;
CREATE TABLE mortals_xhx_company_labels(
`id` bigint(20) AUTO_INCREMENT COMMENT '主键ID,主键,自增长',
`labelId` bigint(20) NOT NULL COMMENT '标签Id',
`labelName` varchar(64) COMMENT '公司名称',
`companyId` bigint(20) NOT NULL COMMENT '公司Id',
`labelName` varchar(64) COMMENT '标签名称',
`companyName` varchar(64) COMMENT '公司名称',
`remark` varchar(64) COMMENT '备注',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createTime` datetime NOT NULL COMMENT '创建时间',
......@@ -105,6 +106,7 @@ CREATE TABLE mortals_xhx_company_labels(
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='公司标注';
-- ----------------------------
-- 公司专利表
-- ----------------------------
......@@ -119,8 +121,10 @@ CREATE TABLE mortals_xhx_company_patent(
`createTime` datetime NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '更新时间',
`companyName` varchar(64) COMMENT '公司名称',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='公司专利';
-- ----------------------------
-- 分类表
-- ----------------------------
......@@ -356,3 +360,22 @@ CREATE TABLE mortals_xhx_feedback(
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='反馈信息';
-- ----------------------------
-- 公司产品表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_company_product`;
CREATE TABLE mortals_xhx_company_product(
`id` bigint(20) AUTO_INCREMENT COMMENT '主键ID,主键,自增长',
`companyId` bigint(20) NOT NULL COMMENT '公司Id',
`companyName` varchar(64) COMMENT '公司名称',
`productId` bigint(20) NOT NULL COMMENT '产品Id',
`productName` varchar(64) COMMENT '产品名称',
`remark` varchar(64) COMMENT '备注',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createTime` datetime NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='公司产品';
package com.mortals.xhx.module.company.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.company.model.CompanyProductEntity;
import java.util.List;
/**
* 公司产品Dao
* 公司产品 DAO接口
*
* @author zxfei
* @date 2023-09-19
*/
public interface CompanyProductDao extends ICRUDDao<CompanyProductEntity,Long>{
}
package com.mortals.xhx.module.company.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.company.dao.CompanyProductDao;
import com.mortals.xhx.module.company.model.CompanyProductEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 公司产品DaoImpl DAO接口
*
* @author zxfei
* @date 2023-09-19
*/
@Repository("companyProductDao")
public class CompanyProductDaoImpl extends BaseCRUDDaoMybatis<CompanyProductEntity,Long> implements CompanyProductDao {
}
......@@ -10,36 +10,40 @@ import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.company.model.vo.CompanyLabelsVo;
import lombok.Data;
/**
* 公司标注实体对象
*
* @author zxfei
* @date 2023-09-18
*/
* 公司标注实体对象
*
* @author zxfei
* @date 2023-09-19
*/
@Data
public class CompanyLabelsEntity extends CompanyLabelsVo {
private static final long serialVersionUID = 1L;
/**
* 标签Id
*/
* 标签Id
*/
@Excel(name = "标签Id")
private Long labelId;
/**
* 公司Id
*/
* 公司名称
*/
private String labelName;
/**
* 公司Id
*/
@Excel(name = "公司Id")
private Long companyId;
/**
* 标签名称
*/
private String labelName;
* 公司名称
*/
private String companyName;
/**
* 备注
*/
* 备注
*/
private String remark;
@Override
public int hashCode() {
return this.getId().hashCode();
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
......@@ -47,16 +51,17 @@ public class CompanyLabelsEntity extends CompanyLabelsVo {
if (obj instanceof CompanyLabelsEntity) {
CompanyLabelsEntity tmp = (CompanyLabelsEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
return true;
}
}
return false;
}
public void initAttrValue(){
this.labelId = 0L;
this.companyId = 0L;
this.labelName = "";
this.remark = "";
this.labelId = 0L;
this.labelName = "";
this.companyId = 0L;
this.companyName = "";
this.remark = "";
}
}
\ No newline at end of file
......@@ -10,35 +10,39 @@ import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.company.model.vo.CompanyPatentVo;
import lombok.Data;
/**
* 公司专利实体对象
*
* @author zxfei
* @date 2023-09-18
*/
* 公司专利实体对象
*
* @author zxfei
* @date 2023-09-19
*/
@Data
public class CompanyPatentEntity extends CompanyPatentVo {
private static final long serialVersionUID = 1L;
/**
* 公司Id
*/
* 公司Id
*/
@Excel(name = "公司Id")
private Long companyId;
/**
* 知识产权类型
*/
* 知识产权类型
*/
private String intellectPropertyType;
/**
* 知识产权数量
*/
* 知识产权数量
*/
private Integer intellectPropertyNum;
/**
* 备注
*/
* 备注
*/
private String remark;
/**
* 公司名称
*/
private String companyName;
@Override
public int hashCode() {
return this.getId().hashCode();
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
......@@ -46,16 +50,17 @@ public class CompanyPatentEntity extends CompanyPatentVo {
if (obj instanceof CompanyPatentEntity) {
CompanyPatentEntity tmp = (CompanyPatentEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
return true;
}
}
return false;
}
public void initAttrValue(){
this.companyId = 0L;
this.intellectPropertyType = "";
this.intellectPropertyNum = 0;
this.remark = "";
this.companyId = 0L;
this.intellectPropertyType = "";
this.intellectPropertyNum = 0;
this.remark = "";
this.companyName = "";
}
}
\ No newline at end of file
package com.mortals.xhx.module.company.model;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.company.model.vo.CompanyProductVo;
import lombok.Data;
/**
* 公司产品实体对象
*
* @author zxfei
* @date 2023-09-19
*/
@Data
public class CompanyProductEntity extends CompanyProductVo {
private static final long serialVersionUID = 1L;
/**
* 公司Id
*/
@Excel(name = "公司Id")
private Long companyId;
/**
* 公司名称
*/
private String companyName;
/**
* 产品Id
*/
@Excel(name = "产品Id")
private Long productId;
/**
* 产品名称
*/
private String productName;
/**
* 备注
*/
private String remark;
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof CompanyProductEntity) {
CompanyProductEntity tmp = (CompanyProductEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.companyId = 0L;
this.companyName = "";
this.productId = 0L;
this.productName = "";
this.remark = "";
}
}
\ No newline at end of file
package com.mortals.xhx.module.company.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.company.model.CompanyProductEntity;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import com.mortals.framework.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
/**
* 公司产品视图对象
*
* @author zxfei
* @date 2023-09-19
*/
@Data
public class CompanyProductVo extends BaseEntityLong {
/** 主键ID,主键,自增长列表 */
private List <Long> idList;
}
\ No newline at end of file
package com.mortals.xhx.module.company.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.company.model.CompanyEntity;
import java.util.ArrayList;
import java.util.List;
......@@ -8,22 +10,32 @@ import com.mortals.xhx.module.company.model.CompanyLabelsEntity;
import com.mortals.xhx.module.company.model.CompanyPatentEntity;
import lombok.Data;
import com.mortals.framework.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
/**
* 公司视图对象
*
* @author zxfei
* @date 2023-09-18
*/
* 公司视图对象
*
* @author zxfei
* @date 2023-09-18
*/
@Data
public class CompanyVo extends BaseEntityLong {
/** 主键ID,主键,自增长列表 */
private List <Long> idList;
/**
* 主键ID,主键,自增长列表
*/
private List<Long> idList;
//公司专利
private List<CompanyPatentEntity> companyPatentList = new ArrayList<>();
//产品数量
private Integer productNums = 0;
//公司专利
private List<CompanyPatentEntity> companyPatentList=new ArrayList<>();;
//名片数量
private Integer businessCardNums = 0;
}
\ No newline at end of file
package com.mortals.xhx.module.company.model.vo;
import com.mortals.xhx.module.company.model.CompanyEntity;
import com.mortals.xhx.module.news.model.NewsCategoryEntity;
import com.mortals.xhx.module.product.model.ProductEntity;
import com.mortals.xhx.module.staff.model.StaffEntity;
import lombok.Data;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 统计信息
*
* @author: zxfei
* @date: 2023/9/19 14:49
*/
@Data
public class HomeStatInfo {
/**
* 企业总量
*/
private Integer enterpriseNums;
/**
* 产品数量
*/
private Integer productNums;
/**
* 员工数量
*/
private Integer staffNums;
/**
* 新闻数量
*/
private Integer newsNums;
/**
* 反馈数量
*/
private Integer feedbackNums;
/**
* 用户数量
*/
private Integer customerNums;
/**
* 公司产品分布列表
*/
private List<CompanyEntity> productDistributionList;
/**
* 名片分布列表
*/
private List<CompanyEntity> businessCardDistributionList;
/**
* 新闻分布列表
*/
private List<NewsCategoryEntity> newsDistributionList;
/**
* 小程序近30日访问统计报表
*/
private List<Map<String, Integer>> accessStatList;
/**
* 发送卡片总量
*/
private List<StaffEntity> sendCardStaffList;
}
package com.mortals.xhx.module.company.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.company.model.CompanyProductEntity;
import com.mortals.xhx.module.company.dao.CompanyProductDao;
/**
* CompanyProductService
*
* 公司产品 service接口
*
* @author zxfei
* @date 2023-09-19
*/
public interface CompanyProductService extends ICRUDService<CompanyProductEntity,Long>{
CompanyProductDao getDao();
}
\ No newline at end of file
package com.mortals.xhx.module.company.service;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.company.model.CompanyEntity;
import com.mortals.xhx.module.company.dao.CompanyDao;
import com.mortals.xhx.module.company.model.vo.HomeStatInfo;
/**
* CompanyService
*
* 公司 service接口
*
* @author zxfei
* @date 2023-09-18
*/
public interface CompanyService extends ICRUDService<CompanyEntity,Long>{
* CompanyService
* <p>
* 公司 service接口
*
* @author zxfei
* @date 2023-09-18
*/
public interface CompanyService extends ICRUDService<CompanyEntity, Long> {
CompanyDao getDao();
/**
* 首页统计
* @param context
* @return
*/
Rest<HomeStatInfo> indexStat(Context context);
}
\ No newline at end of file
package com.mortals.xhx.module.company.service.impl;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.company.dao.CompanyProductDao;
import com.mortals.xhx.module.company.model.CompanyProductEntity;
import com.mortals.xhx.module.company.service.CompanyProductService;
import lombok.extern.slf4j.Slf4j;
/**
* CompanyProductService
* 公司产品 service实现
*
* @author zxfei
* @date 2023-09-19
*/
@Service("companyProductService")
@Slf4j
public class CompanyProductServiceImpl extends AbstractCRUDServiceImpl<CompanyProductDao, CompanyProductEntity, Long> implements CompanyProductService {
}
\ No newline at end of file
package com.mortals.xhx.module.company.service.impl;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.PageInfo;
import com.mortals.xhx.base.system.user.model.UserQuery;
import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.module.company.model.*;
import com.mortals.xhx.module.company.model.vo.HomeStatInfo;
import com.mortals.xhx.module.company.service.CompanyPatentService;
import com.mortals.xhx.module.company.service.CompanyProductService;
import com.mortals.xhx.module.feedback.model.FeedbackQuery;
import com.mortals.xhx.module.feedback.service.FeedbackService;
import com.mortals.xhx.module.news.model.NewsCategoryEntity;
import com.mortals.xhx.module.news.model.NewsCategoryQuery;
import com.mortals.xhx.module.news.model.NewsQuery;
import com.mortals.xhx.module.news.service.NewsCategoryService;
import com.mortals.xhx.module.news.service.NewsService;
import com.mortals.xhx.module.product.model.ProductQuery;
import com.mortals.xhx.module.product.service.ProductService;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.model.StaffQuery;
import com.mortals.xhx.module.staff.model.StaffRecordEntity;
import com.mortals.xhx.module.staff.model.StaffRecordQuery;
import com.mortals.xhx.module.staff.service.StaffRecordService;
import com.mortals.xhx.module.staff.service.StaffService;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
......@@ -13,9 +36,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import com.mortals.xhx.module.company.service.CompanyLabelsService;
import org.springframework.util.ObjectUtils;
import java.util.Date;
import java.util.Arrays;
import java.util.List;
import java.sql.Array;
import java.util.*;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
......@@ -33,6 +56,25 @@ public class CompanyServiceImpl extends AbstractCRUDServiceImpl<CompanyDao, Comp
private CompanyLabelsService companyLabelsService;
@Autowired
private CompanyPatentService companyPatentService;
@Autowired
private CompanyService companyService;
@Autowired
private ProductService productService;
@Autowired
private StaffService staffService;
@Autowired
private NewsService newsService;
@Autowired
private FeedbackService feedbackService;
@Autowired
private UserService userService;
@Autowired
private CompanyProductService companyProductService;
@Autowired
private NewsCategoryService newsCategoryService;
@Autowired
private StaffRecordService staffRecordService;
@Override
protected void findAfter(CompanyEntity params, PageInfo pageInfo, Context context, List<CompanyEntity> list) throws AppException {
......@@ -107,4 +149,85 @@ public class CompanyServiceImpl extends AbstractCRUDServiceImpl<CompanyDao, Comp
super.removeAfter(ids, context, result);
}
@Override
public Rest<HomeStatInfo> indexStat(Context context) {
HomeStatInfo homeStatInfo = new HomeStatInfo();
//统计公司数量
List<CompanyEntity> companyList = companyService.find(new CompanyQuery(), context);
homeStatInfo.setEnterpriseNums(companyList.size());
//
int productNums = productService.count(new ProductQuery(), context);
homeStatInfo.setProductNums(productNums);
List<StaffEntity> staffList = staffService.find(new StaffQuery(), context);
homeStatInfo.setStaffNums(staffList.size());
int newsNums = newsService.count(new NewsQuery(), context);
homeStatInfo.setNewsNums(newsNums);
int feedbackNums = feedbackService.count(new FeedbackQuery(), context);
homeStatInfo.setFeedbackNums(feedbackNums);
//客户数据待定
int userCount = userService.count(new UserQuery(), context);
homeStatInfo.setCustomerNums(userCount);
//产品分布
companyList.forEach(company -> {
int count = companyProductService.count(new CompanyProductQuery().companyId(company.getId()), context);
company.setProductNums(count);
});
homeStatInfo.setProductDistributionList(companyList);
//发送名片分布
Map<String, Integer> collect = staffList.stream().collect(Collectors.groupingBy(x -> x.getCompanyIds(), Collectors.summingInt(StaffEntity::getSendBusinessCardTimes)));
companyList.forEach(company -> {
//归集公司发送卡片数量
Long companyId = company.getId();
collect.entrySet().stream().forEach(item -> {
String key = item.getKey();
Integer nums = item.getValue();
List<String> split = StrUtil.split(key, ",");
if (split.contains(companyId.toString())) {
company.setBusinessCardNums(company.getBusinessCardNums() + nums);
}
});
});
homeStatInfo.setBusinessCardDistributionList(companyList);
List<NewsCategoryEntity> newsCategoryList = newsCategoryService.find(new NewsCategoryQuery(), context);
newsCategoryList.forEach(category -> {
int count = newsService.count(new NewsQuery().categoryId(category.getId()), context);
category.setNewsNums(count);
});
homeStatInfo.setNewsDistributionList(newsCategoryList);
//近三十天访问记录
List<Map<String, Integer>> dayAccessList = new ArrayList<>();
DateTime beforeDay = DateUtil.offsetDay(new Date(), -30);
for (int i = 0; i < 30; i++) {
DateTime curDate = DateUtil.offsetDay(beforeDay, i);
Map<String, Integer> map = new HashMap<>();
StaffRecordQuery staffRecordQuery = new StaffRecordQuery();
staffRecordQuery.setCreateTimeStart(curDate.toDateStr());
staffRecordQuery.setCreateTimeEnd(curDate.toDateStr());
List<StaffRecordEntity> staffRecordEntities = staffRecordService.find(staffRecordQuery, context);
if (!ObjectUtils.isEmpty(staffRecordEntities)) {
int sum = staffRecordEntities.stream().mapToInt(item -> item.getSumViews()).sum();
map.put(curDate.toDateStr(), sum);
}
dayAccessList.add(map);
}
homeStatInfo.setAccessStatList(dayAccessList);
homeStatInfo.setSendCardStaffList(staffList);
return Rest.ok(homeStatInfo);
}
}
\ No newline at end of file
package com.mortals.xhx.module.company.web;
import com.mortals.framework.common.Rest;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.company.model.vo.HomeStatInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.company.model.CompanyEntity;
import com.mortals.xhx.module.company.service.CompanyService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 公司
*
* @author zxfei
* @date 2023-09-18
*/
* 公司
*
* @author zxfei
* @date 2023-09-18
*/
@RestController
@RequestMapping("company")
public class CompanyController extends BaseCRUDJsonBodyMappingController<CompanyService,CompanyEntity,Long> {
public class CompanyController extends BaseCRUDJsonBodyMappingController<CompanyService, CompanyEntity, Long> {
@Autowired
private ParamService paramService;
public CompanyController(){
super.setModuleDesc( "公司");
public CompanyController() {
super.setModuleDesc("公司");
}
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "totalEmployees", paramService.getParamBySecondOrganize("Company","totalEmployees"));
this.addDict(model, "softNum", paramService.getParamBySecondOrganize("Company","softNum"));
this.addDict(model, "patentNum", paramService.getParamBySecondOrganize("Company","patentNum"));
this.addDict(model, "totalEmployees", paramService.getParamBySecondOrganize("Company", "totalEmployees"));
this.addDict(model, "softNum", paramService.getParamBySecondOrganize("Company", "softNum"));
this.addDict(model, "patentNum", paramService.getParamBySecondOrganize("Company", "patentNum"));
super.init(model, context);
}
/**
* 首页统计
*/
@PostMapping(value = "stat")
public String indexStat() {
JSONObject jsonObject = new JSONObject();
Map<String, Object> model = new HashMap<>();
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_MSG, "");
try {
Rest<HomeStatInfo> rest = this.service.indexStat(getContext());
if (YesNoEnum.YES.getValue() == rest.getCode()) {
model.put("stat", rest.getData());
}
jsonObject.put(KEY_RESULT_DATA, model);
recordSysLog(request, "首页统计 【成功】");
} catch (Exception e) {
log.error("异常", e);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
jsonObject.put(KEY_RESULT_MSG, super.convertException(e));
}
return jsonObject.toJSONString();
}
}
\ No newline at end of file
package com.mortals.xhx.module.company.web;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.company.model.CompanyProductEntity;
import com.mortals.xhx.module.company.service.CompanyProductService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 公司产品
*
* @author zxfei
* @date 2023-09-19
*/
@RestController
@RequestMapping("company/product")
public class CompanyProductController extends BaseCRUDJsonBodyMappingController<CompanyProductService,CompanyProductEntity,Long> {
@Autowired
private ParamService paramService;
public CompanyProductController(){
super.setModuleDesc( "公司产品");
}
@Override
protected void init(Map<String, Object> model, Context context) {
super.init(model, context);
}
}
\ No newline at end of file
package com.mortals.xhx.module.news.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.news.model.NewsCategoryEntity;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import com.mortals.framework.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
/**
* 新闻频道分类视图对象
*
* @author zxfei
* @date 2023-09-18
*/
* 新闻频道分类视图对象
*
* @author zxfei
* @date 2023-09-18
*/
@Data
public class NewsCategoryVo extends BaseEntityLong {
/** 序号,主键,自增长列表 */
private List <Long> idList;
/**
* 序号,主键,自增长列表
*/
private List<Long> idList;
/**
* 新闻数量
*/
private Integer newsNums;
}
\ No newline at end of file
......@@ -19,5 +19,10 @@ public class StaffVo extends BaseEntityLong {
/** 序号,主键,自增长列表 */
private List <Long> idList;
/**
* 累计发卡片数量
*/
private Integer sendCardTotalNums;
}
\ No newline at end of file
###登录
POST {{baseUrl}}/login/login
Content-Type: application/json
{
"loginName":"admin",
"password":"admin",
"securityCode":"8888"
}
> {%
client.global.set("SmsSet_id", JSON.parse(response.body).data.id);
client.global.set("authToken", JSON.parse(response.body).data.token);
%}
###公司产品列表
POST {{baseUrl}}/company/product/list
Content-Type: application/json
{
"page":1,
"size":10
}
###公司产品更新与保存
POST {{baseUrl}}/company/product/save
Authorization: {{authToken}}
Content-Type: application/json
{
"companyId":430,
"companyName":"mv9hur",
"productId":39,
"productName":"3x315j",
"remark":"e2sjue",
}
> {%
client.global.set("CompanyProduct_id", JSON.parse(response.body).data.id);
%}
###公司产品查看
GET {{baseUrl}}/company/product/info?id={{CompanyProduct_id}}
Accept: application/json
###公司产品编辑
GET {{baseUrl}}/company/product/edit?id={{CompanyProduct_id}}
Accept: application/json
###公司产品删除
GET {{baseUrl}}/company/product/delete?id={{CompanyProduct_id}}
Authorization: {{authToken}}
Accept: application/json
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