Commit e8a13bd5 authored by ysongq's avatar ysongq

新增平台-商品管理,需求管理,配置管理;买方-需求管理

parent df27bbc5
......@@ -6,3 +6,16 @@
alter table t_data_goods_api add target_url varchar(128) DEFAULT NULL COMMENT '目标地址';
alter table t_data_goods_api add api_desc varchar(512) DEFAULT NULL COMMENT '接口描述';
alter table t_platform_log add request_type char(2) NOT NULL COMMENT '请求状态:01成功,02失败';
alter table t_data_goods add goods_limited datetime DEFAULT NULL COMMENT'商品有限期';
alter table t_data_goods add data_maximum varchar(16) DEFAULT NULL COMMENT'数据最大量';
alter table t_data_goods add max_pages varchar(16) default NULL COMMENT'最大页数';
alter table t_data_goods add data_size varchar(16) default NULL COMMENT'每页数据量';
alter table t_data_goods add scene_id Bigint(20) default NULL COMMENT'场景分类id';
alter table t_role_goods add del_flag char(1) DEFAULT 'N' COMMENT '删除标识:Y是,N否';
alter table t_data_goods add `api_key` varchar(64) DEFAULT NULL COMMENT 'apikey';
alter table t_scene_goods_category add del_flag char(1) DEFAULT 'N' COMMENT '删除标识:Y是,N否';
alter table t_data_goods_category add `category_picture` varchar(128) DEFAULT NULL COMMENT '分类图片';
alter table t_data_goods_category add `category_location` varchar(128) DEFAULT NULL COMMENT '图片位置';
alter table t_data_goods_category add category_desc varchar(40) DEFAULT NULL COMMENT '分类描述';
alter table t_banner add sort Bigint(20) DEFAULT NULL COMMENT '排序';
alter table t_banner add banner_url varchar(128) DEFAULT NULL COMMENT '广告链接';
\ No newline at end of file
# 商品角色表
DROP TABLE IF EXISTS `t_role_goods`;
CREATE TABLE `t_role_goods` (
`role_goods_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`role_id` bigint(20) DEFAULT NULL COMMENT '角色id',
`goods_id` bigint(20) DEFAULT NULL COMMENT '商品id',
PRIMARY KEY (`role_goods_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=69 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
# 场景分类表
DROP TABLE IF EXISTS `t_scene_category`;
CREATE TABLE `t_scene_category` (
`scene_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`scene_name` bigint(20) DEFAULT NULL COMMENT '场景分类名称',
`parent_id` bigint(20) DEFAULT NULL COMMENT '父级id',
`if_child` char(1) DEFAULT 'Y' COMMENT '是否为子节点:Y是,N否',
`cre_time` datetime DEFAULT NULL COMMENT '创建时间',
`cre_person` varchar(32) DEFAULT NULL COMMENT '创建人',
`upt_time` datetime DEFAULT NULL COMMENT '更新时间',
`upt_person` varchar(32) DEFAULT NULL COMMENT '更新人',
`del_flag` char(1) DEFAULT 'N',
PRIMARY KEY (`scene_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=69 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
# 场景商品分类表
DROP TABLE IF EXISTS `t_scene_goods_category`;
CREATE TABLE `t_scene_goods_category` (
`scene_category_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`scene_id` bigint(20) DEFAULT NULL COMMENT '场景id',
`category_id` bigint(20) DEFAULT NULL COMMENT '商品分类id',
PRIMARY KEY (`scene_category_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=69 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
# 广告表
CREATE TABLE `t_banner` (
`banner_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '广告id',
`banner_name` varchar(64) DEFAULT NULL COMMENT '广告名称',
`banner_location` varchar(32) DEFAULT NULL COMMENT '广告位置',
`banner_status` char(2) DEFAULT NULL COMMENT '广告状态 01已发布,02未发布',
`banner_desc` varchar(64) DEFAULT NULL COMMENT'广告位描述',
`banner_start` datetime DEFAULT NULL COMMENT '开始时间',
`banner_end` datetime DEFAULT NULL COMMENT '结束时间',
`cre_time` datetime DEFAULT NULL COMMENT '创建时间',
`cre_person` varchar(32) DEFAULT NULL COMMENT '创建人',
`upt_time` datetime DEFAULT NULL COMMENT '更新时间',
`upt_person` varchar(32) DEFAULT NULL COMMENT '更新人',
`del_flag` char(1) DEFAULT 'N' COMMENT '删除标识:Y是,N否',
PRIMARY KEY (`banner_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='广告';
# 菜单配置
CREATE TABLE `t_menu_config` (
`config_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '菜单配置id',
`config_name` varchar(64) DEFAULT NULL COMMENT '菜单名称',
`config_url` varchar(32) DEFAULT NULL COMMENT '菜单路径',
`cre_time` datetime DEFAULT NULL COMMENT '创建时间',
`cre_person` varchar(32) DEFAULT NULL COMMENT '创建人',
`upt_time` datetime DEFAULT NULL COMMENT '更新时间',
`upt_person` varchar(32) DEFAULT NULL COMMENT '更新人',
`del_flag` char(1) DEFAULT 'N' COMMENT '删除标识:Y是,N否',
PRIMARY KEY (`config_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='菜单配置';
......@@ -19,7 +19,6 @@ import java.io.Serializable;
**/
@Data
@ApiModel
@Builder
public class SendDataReq extends BasePageBean implements Serializable {
@ApiModelProperty(value = "关键词")
......
......@@ -103,7 +103,7 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService {
apiAuth = authService.getAuthInfo(authCode);
verifyAuth(apiAuth);
//取出缓存数据
//String redisReqParam = redisUtils.get(request.getApiKey());
// String redisReqParam = redisUtils.get(request.getApiKey());
String redisReqParam = null;
if (StringUtils.isNotBlank(redisReqParam)) {//redis中存在
//解析出API制作成功时的参数配置
......
......@@ -23,6 +23,8 @@ public enum ResultMsg {
TRANS_FAIL("转账失败"),
RECHARGE_SUCCESS("充值成功"),
RECHARGE_FAIL("充值失败"),
AUDIT_SUCCESS("审核成功"),
AUDIT_FAIL("审核失败"),
/**
* 需审核
*/
......
package com.jz.common.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
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 java.io.Serializable;
......@@ -30,108 +32,144 @@ public class DataGoods implements Serializable {
/**
* 商品分类id(行业)
*/
@TableField("category_id")
private Long categoryId;
@TableField("scene_id")
private Long sceneId;
/**
* 数据商户id
*/
@TableField("user_id")
private Long userId;
@ApiModelProperty(value = "唯一数据商品标识")
@TableField("api_openid")
private String apiOpenid;
/**
* 数据商品名称
*/
@TableField("data_name")
private String dataName;
/**
* 数据类型:01api,02数据包
*/
@TableField("data_type")
private String dataType;
/**
* 数据商品标签
*/
@TableField("data_label")
private String dataLabel;
/**
* 数据商品图片
*/
@TableField("data_picture")
private String dataPicture;
/**
* 数据商品价格
*/
@TableField("data_price")
private BigDecimal dataPrice;
/**
* 优惠价格
*/
@TableField("discount_price")
private BigDecimal discountPrice;
/**
* 价格类型:01免费,02收费
*/
@TableField("price_type")
private String priceType;
/**
* 商品规格
*/
@TableField("goods")
private String goodsStandards;
/**
* 数据状态:01预售,02在售中,03下架,04上架
*/
@TableField("data_status")
private String dataStatus;
/**
* 审核状态:01待审核,02已审核,03未通过
*/
@TableField("audit_status")
private String auditStatus;
/**
* 清洗规则(脱敏校验)
*/
@TableField("clean_rule")
private String cleanRule;
/**
* 驳回原因
*/
@TableField("reject_reason")
private String rejectReason;
/**
* 审核人
*/
@TableField("audit_person")
private String auditPerson;
/**
* 审核时间
*/
@TableField("audit_time")
private Date auditTime;
/**
* 创建时间
*/
@TableField("cre_time")
private Date creTime;
/**
* 创建人
*/
@TableField("cre_person")
private String crePerson;
/**
* 更新时间
*/
@TableField("upt_time")
private Date uptTime;
/**
* 更新人
*/
@TableField("upt_person")
private String uptPerson;
/**
* 删除标识
*/
@TableField("del_flag")
private String delFlag;
/**
* 年(元)
*/
@TableField("year_type")
private BigDecimal yearType;
/**
* 季(元)
*/
@TableField("season_type")
private BigDecimal seasonType;
/**
* 月(元)
*/
@TableField("month_type")
private BigDecimal monthType;
/**
* 次(元)
*/
@TableField("second_type")
private BigDecimal secondType;
@TableField("data_desc")
private String dataDesc;
@TableField("data_maximum")
private Long dataMaximum;
@TableField("max_pages")
private Long maxPages;
@TableField("data_size")
private Long dataSize;
@TableField("goods_limited")
private Date goodsLimited;
}
\ No newline at end of file
package com.jz.common.enums;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/2
* @Version:
*/
public enum DataGoodsByRoleEnum {
logOutUser("logOutUser", "1"),
unverifiedUser("unverifiedUser", "2"),
authenticatedUser("authenticatedUser", "3"),
;
private String code;
private String value;
DataGoodsByRoleEnum(String code, String value) {
this.code = code;
this.value = value;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static DataGoodsByRoleEnum get(String code) {
if (code == null) {
return null;
}
for (DataGoodsByRoleEnum status : values()) {
if (status.getCode().equalsIgnoreCase(code)) {
return status;
}
}
return null;
}
}
package com.jz.common.enums;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/1
* @Version:
*/
public enum DataStatusEnum {
YS("YS", "01"),
ZS("ZS", "02"),
XJ("XJ", "03"),
SJ("SJ", "04"),
;
private String code;
private String value;
DataStatusEnum(String code, String value) {
this.code = code;
this.value = value;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static DataStatusEnum get(String code) {
if (code == null) {
return null;
}
for (DataStatusEnum status : values()) {
if (status.getCode().equalsIgnoreCase(code)) {
return status;
}
}
return null;
}
}
package com.jz.common.enums;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
public enum OrderStatusEnum {
DZF("DZF", "01"),
YZF("YZF", "02"),
YQS("YQS", "03"),
;
private String code;
private String value;
OrderStatusEnum(String code, String value) {
this.code = code;
this.value = value;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static OrderStatusEnum get(String code) {
if (code == null) {
return null;
}
for (OrderStatusEnum status : values()) {
if (status.getCode().equalsIgnoreCase(code)) {
return status;
}
}
return null;
}
}
package com.jz.common.enums;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
public enum YNEnum {
YES("YES", "Y"),
NO("NO", "N"),
;
private String code;
private String value;
private YNEnum(String code, String value) {
this.code = code;
this.value = value;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static YNEnum get(String code) {
if (code == null) {
return null;
}
for (YNEnum status : values()) {
if (status.getCode().equalsIgnoreCase(code)) {
return status;
}
}
return null;
}
}
package com.jz.common.enums.auth;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
public enum CategoryByIfSceneEnum {
YES("场景分类", "Y"),
NO("商品分类", "N"),
;
private String code;
private String value;
CategoryByIfSceneEnum(String code, String value) {
this.code = code;
this.value = value;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static CategoryByIfSceneEnum get(String code) {
if (code == null) {
return null;
}
for (CategoryByIfSceneEnum status : values()) {
if (status.getCode().equalsIgnoreCase(code)) {
return status;
}
}
return null;
}
}
package com.jz.common.utils;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.CollectionUtils;
public class CommonUtils {
private static final Logger logger = LoggerFactory.getLogger(CommonUtils.class);
/**
* UUID随机数
* @return
*/
public static String generatePrimaryKeyId() {
String id = UUID.randomUUID().toString().toUpperCase().replaceAll("-", "");
return id;
}
/**
* @Title: generateTraceId
* @Description: TODO(生成traceId)
* @param @return 参数
* @return String 返回类型
* @throws
*/
public static String generateTraceId() {
String traceId = UUID.randomUUID().toString().toUpperCase().replaceAll("-", "");
return traceId;
}
/**
* @Title: generateUuid
* @Description: TODO(生成uuid)
* @param @return 参数
* @return String 返回类型
* @throws
*/
public static String generateUuid() {
String uuid = UUID.randomUUID().toString().toUpperCase().replaceAll("-", "");
return uuid;
}
/**
* @param <T>
* @Title: objArrangeTree
* @Description: TODO(将所有的资源整理成树形结构)
* @param @param dmpPermissions
* @param @return
* @param @throws Exception 参数
* @return List<DmpPermission> 返回类型
* @throws
*/
public static <T> List<T> objArrangeTree(Object parentCode, List<T> objs, String parentCodeFiledName, String codeFieldName, String childrenFieldName) throws Exception {
Map<Object, List<T>> dictMap = objs.stream().collect(Collectors.groupingBy(x->{
try {
return ReflectAssistUtils.getFieldValueByFieldName(parentCodeFiledName, x);
} catch (Exception e) {
e.printStackTrace();
logger.error("树形结构封装异常【{}】", e);
}
return "";
}));
List<T> tList = dictMap.get(parentCode);// 获取顶层资源
if (!CollectionUtils.isEmpty(tList)) {
for (T t : tList) {
t = arrangeChildren(t, dictMap, codeFieldName, childrenFieldName);
}
}
return tList;
}
/**
* @Title: arrangeChildren
* @Description: TODO(这里用一句话描述这个方法的作用)
* @param @param permission
* @param @param dictMap
* @param @return
* @param @throws Exception 参数
* @return DmpPermission 返回类型
* @throws
*/
private static <T> T arrangeChildren(T t, Map<Object, List<T>> dictMap, String codeFieldName, String childrenFieldName)throws Exception{
Object code = ReflectAssistUtils.getFieldValueByFieldName(codeFieldName, t);
List<T> children = dictMap.get(code);
if (!CollectionUtils.isEmpty(children)) {
for (T child : children) {
child = arrangeChildren(child, dictMap, codeFieldName, childrenFieldName);
}
ReflectAssistUtils.setFieldValueByFieldName(childrenFieldName, t, children);
}
return t;
}
}
package com.jz.common.utils;
import com.jz.common.bean.SysUserDto;
import com.jz.common.constant.RedisMessageConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/7
* @Version:
*/
@Slf4j
@Component
public class CurrentUserUtil {
@Resource
private static RedisTemplate redisTemplate;
public static SysUserDto userDto() {
SysUserDto userDto = (SysUserDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_SYS);
return userDto;
}
}
......@@ -405,7 +405,19 @@ public class DateUtils {
long time = System.currentTimeMillis();
return (int) (time / 1000);
}
// public static void main(String[] args) {
// System.out.println(timestamp());
/**
* 计算有限期
* @param
* @return
*/
public static Date getLimitedTime(int time) {
Calendar cal = Calendar.getInstance();
cal.setTime(DateUtils.getToday());
cal.add(Calendar.YEAR, time);
return cal.getTime();
}
// public static void main(String[] args) throws Exception {
// System.out.println(DateUtils.parseDate2String(getLimitedTime(999)));
// }
}
package com.jz.common.utils;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
/**
* @ClassName: ReflectAssistUtils
* @Description: TODO(反射辅助工具类)
* @author ybz
* @date 2021年1月26日
*
*/
public class ReflectAssistUtils {
/**
* @Title: getFieldValueByFieldName
* @Description: TODO(根据属性名称获取属性值)
* @param @param fieldName
* @param @param cls
* @param @return
* @param @throws Exception 参数
* @return Field 返回类型
* @throws
*/
public static Object getFieldValueByFieldName(String fieldName, Object obj)throws Exception{
Class<?> cls = obj.getClass();
String getMethodName = "get"+fieldName.substring(0, 1).toUpperCase()+fieldName.substring(1);
Method getMethod = cls.getMethod(getMethodName);
return getMethod.invoke(obj);
}
/**
* @param <T>
* @Title: setFieldValueByFieldName
* @Description: TODO(设置属性值)
* @param @param fieldName
* @param @param cls
* @param @param fieldVaule
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
public static <T> void setFieldValueByFieldName(String fieldName, Object obj, T fieldVaule)throws Exception{
Class<?> cls = obj.getClass();
String setMethodName = "set"+fieldName.substring(0, 1).toUpperCase()+fieldName.substring(1);
Class<?> fieldValueClass = fieldVaule.getClass();
if (fieldVaule instanceof ArrayList) {
fieldValueClass = List.class;
}
Method setMethod = cls.getMethod(setMethodName, fieldValueClass);
setMethod.invoke(obj, fieldVaule);
}
}
......@@ -12,7 +12,10 @@ public class TestController {
@Autowired
private TestService testService;
public static void main(String[] args) throws Exception {
public static void main(String[] args) {
System.out.println("s");
}
// public static void main(String[] args) throws Exception {
// //
// String filename="C:\\Users\\fengyq\\Desktop\\万家\\表格\\新建 XLSX 工作表.xlsx";
// // 创建工作簿
......@@ -46,7 +49,7 @@ public class TestController {
//
// // 关闭工作簿
// wk.close();
}
// }
@RequestMapping("/hello")
public void test() throws Exception {
......
package com.jz.dm.mall.moduls.controller.goods;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.base.BaseController;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.goods.bean.request.DemandAddReq;
import com.jz.dm.mall.moduls.controller.goods.bean.request.DemandListReq;
import com.jz.dm.mall.moduls.entity.Demand;
import com.jz.dm.mall.moduls.service.DemandService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
* 用户需求定制申请(TDemand)表控制层
*
* @author Bellamy
* @since 2020-12-01 10:41:34
*/
@RestController
@RequestMapping("demand")
@Api(tags = "买方--需求管理--controller")
public class DemandController extends BaseController {
/**
* 服务对象
*/
@Autowired
private DemandService tDemandService;
/**
* 条件查询需求列表
* @param req
* @return
*/
@PostMapping("/findList")
@ApiOperation(value = "我的需求--条件查询需求")
public Result<IPage<Demand>> findList(@RequestBody DemandListReq req) {
return tDemandService.findList(req);
}
/**
* 需求发布
* @param req
* @return
*/
@PostMapping("/addDemand")
@ApiOperation(value = "我的需求--需求发布")
public Result addDemand(@RequestBody @Valid DemandAddReq req) {
return tDemandService.addDemand(req);
}
/**
* 查询需求详情
* @param demandId
* @return
*/
@GetMapping("/findByDemand")
@ApiOperation(value = "我的需求--查询需求详情")
public Result findByDemand(@RequestParam(name = "demandId") Long demandId) {
return tDemandService.findByDemand(demandId);
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.controller.goods.bean.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NonNull;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/7
* @Version:
*/
@ApiModel
@Data
public class DemandAddReq implements Serializable {
@ApiModelProperty(value = "需求名称")
@NotNull(message = "需求名称不能为空")
private String demandName;
@ApiModelProperty(value = "需求描述")
@NotNull(message = "需求描述不能为空")
private String demandDescribe;
}
package com.jz.dm.mall.moduls.controller.goods.bean.request;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/7
* @Version:
*/
@ApiModel
@Data
public class DemandListReq extends BasePageBean implements Serializable {
@ApiModelProperty("搜索条件")
private String search;
@ApiModelProperty("审核状态")
private String auditStatus;
}
package com.jz.dm.mall.moduls.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 lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 用户需求定制申请(Demand)实体类
*
* @author Bellamy
* @since 2020-12-01 10:41:34
*/
@TableName("t_demand")
@ApiModel
@Data
public class Demand implements Serializable {
private static final long serialVersionUID = 119352065467540895L;
/**
* 需求id
*/
@TableId(value = "demand_id", type = IdType.AUTO)
private Long demandId;
/**
* 用户id
*/
private Long customerId;
/**
* 需求名称
*/
private String demandName;
/**
* 需求描述
*/
private String demandDescribe;
/**
* 审核状态:01待审核,02已审核,03未通过
*/
private String auditStatus;
/**
* 审核人
*/
private String auditPerson;
/**
* 审核时间
*/
private Date auditTime;
/**
* 驳回原因
*/
private String rejectReason;
/**
* 创建人
*/
private String crePerson;
/**
* 创建时间
*/
private Date creTime;
/**
* 删除标识:Y是,N否
*/
private String delFlag;
}
\ No newline at end of file
package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper;
import com.jz.dm.mall.moduls.entity.Demand;
/**
* 用户需求定制申请(TDemand)表数据库访问层
*
* @author Bellamy
* @since 2020-12-01 10:41:34
*/
public interface DemandDao extends BaseMapper<Demand> {
}
\ No newline at end of file
package com.jz.dm.mall.moduls.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.goods.bean.request.DemandAddReq;
import com.jz.dm.mall.moduls.controller.goods.bean.request.DemandListReq;
import com.jz.dm.mall.moduls.entity.Demand;
/**
* 用户需求定制申请(TDemand)表服务接口
*
* @author Bellamy
* @since 2020-12-01 10:41:34
*/
public interface DemandService {
/**
* 条件查询需求
* @param req
* @return
*/
Result<IPage<Demand>> findList(DemandListReq req);
/**
* 需求发布
* @param req
* @return
*/
Result addDemand(DemandAddReq req);
/**
* 查询需求详情
* @param demandId
* @return
*/
Result findByDemand(Long demandId);
}
\ No newline at end of file
package com.jz.dm.mall.moduls.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jz.common.bean.MallCustomerApiDto;
import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultMsg;
import com.jz.common.enums.AuditStatusEnum;
import com.jz.common.enums.DelFlagEnum;
import com.jz.common.utils.DateUtils;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.goods.bean.request.DemandAddReq;
import com.jz.dm.mall.moduls.controller.goods.bean.request.DemandListReq;
import com.jz.dm.mall.moduls.entity.Demand;
import com.jz.dm.mall.moduls.mapper.DemandDao;
import com.jz.dm.mall.moduls.service.DemandService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
/**
* 用户需求定制申请(TDemand)表服务实现类
*
* @author Bellamy
* @since 2020-12-01 10:41:34
*/
@Service("demandService")
public class DemandServiceImpl implements DemandService {
@Autowired
private DemandDao tDemandDao;
@Autowired
private RedisTemplate redisTemplate;
/**
* 条件查询需求
*
* @param req
* @return
*/
@Override
public Result<IPage<Demand>> findList(DemandListReq req) {
IPage<Demand> page = new Page<>(req.getPageNum(), req.getPageSize());
QueryWrapper<Demand> queryWrapper = new QueryWrapper<>();
if (StringUtils.isNotEmpty(req.getSearch())) {
queryWrapper.and(s -> s.like("demand_name",req.getSearch())
.or().like("demand_describe", req.getSearch()));
}
if (StringUtils.isNotEmpty(req.getAuditStatus())) {
queryWrapper.eq("audit_status", req.getAuditStatus());
}
queryWrapper.eq("del_flag", DelFlagEnum.NO.getValue());
queryWrapper.orderByDesc("cre_time");
IPage<Demand> list = tDemandDao.selectPage(page, queryWrapper);
if (list.getTotal() != 0) {
return Result.of_success(list);
}
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
/**
* 需求发布
*
* @param req
* @return
*/
@Override
public Result addDemand(DemandAddReq req) {
Demand demand = new Demand();
demand.setCustomerId(getCustomer().getCustomerId());
demand.setDemandName(req.getDemandName());
demand.setDemandDescribe(req.getDemandDescribe());
demand.setCreTime(DateUtils.getToday());
demand.setAuditStatus(AuditStatusEnum.DSH.getValue());
demand.setCrePerson(getCustomer().getCustomerId() + "");
demand.setDelFlag(DelFlagEnum.NO.getValue());
if (tDemandDao.insert(demand) != 1) {
return Result.of_error(ResultMsg.INSERT_SUCCESS);
}
return Result.of_success(ResultMsg.INSERT_SUCCESS);
}
/**
* 查询需求详情
*
* @param demandId
* @return
*/
@Override
public Result findByDemand(Long demandId) {
QueryWrapper<Demand> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("demand_id", demandId);
queryWrapper.eq("del_flag", DelFlagEnum.NO.getValue());
Demand demand = tDemandDao.selectOne(queryWrapper);
if (demand != null) {
return Result.of_success(demand);
}
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
public MallCustomerApiDto getCustomer() {
MallCustomerApiDto customer = (MallCustomerApiDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER);
return customer;
}
}
\ No newline at end of file
......@@ -120,7 +120,6 @@ public class OrderServiceImpl implements OrderService {
if (StringUtils.isNotEmpty(orderId)) {
orderDto = orderDao.getOrderDetail(orderId);
if (orderDto != null) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date endTime = orderDto.getInvalidTime();
String indate = DateUtils.getTime(endTime, DateUtils.getToday());
orderDto.setIndate(indate);
......@@ -328,7 +327,6 @@ public class OrderServiceImpl implements OrderService {
if (StringUtils.isEmpty(req.getRequestToken())) {
return Result.of_error("授权码不能为空!");
}
System.out.println(JSON.toJSONString(req));
String post = HttpsUtilsTest.submitPost(gatewayOrderLogDetails, JSON.toJSONString(req));
JSONObject params = JSONObject.parseObject(post);
if (!params.get("code").equals(200) || org.springframework.util.StringUtils.isEmpty(params.get("data"))){
......
<?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.jz.mall.moduls.mapper.DemandDao">
<resultMap type="com.jz.dm.mall.moduls.entity.Demand" id="TDemandMap">
<result property="demandId" column="demand_id" jdbcType="INTEGER"/>
<result property="customerId" column="customer_id" jdbcType="INTEGER"/>
<result property="categoryId" column="category_id" jdbcType="INTEGER"/>
<result property="demandName" column="demand_name" jdbcType="VARCHAR"/>
<result property="demandDescribe" column="demand_describe" jdbcType="VARCHAR"/>
<result property="dataType" column="data_type" jdbcType="INTEGER"/>
<result property="releaseTime" column="release_time" jdbcType="TIMESTAMP"/>
<result property="auditStatus" column="audit_status" jdbcType="VARCHAR"/>
<result property="auditPerson" column="audit_person" jdbcType="VARCHAR"/>
<result property="auditTime" column="audit_time" jdbcType="TIMESTAMP"/>
<result property="rejectReason" column="reject_reason" jdbcType="VARCHAR"/>
<result property="purchaseMethod" column="purchase_method" jdbcType="VARCHAR"/>
<result property="crePerson" column="cre_person" jdbcType="VARCHAR"/>
<result property="creTime" column="cre_time" jdbcType="TIMESTAMP"/>
<result property="ifShow" column="if_show" jdbcType="VARCHAR"/>
<result property="delFlag" column="del_flag" jdbcType="VARCHAR"/>
</resultMap>
<!--查询单个-->
<select id="queryById" resultMap="TDemandMap">
select
demand_id, customer_id, category_id, demand_name, demand_describe, data_type, release_time, audit_status, audit_person, audit_time, reject_reason, purchase_method, cre_person, cre_time, if_show, del_flag
from t_demand
where demand_id = #{demandId}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="TDemandMap">
select
demand_id, customer_id, category_id, demand_name, demand_describe, data_type, release_time, audit_status, audit_person, audit_time, reject_reason, purchase_method, cre_person, cre_time, if_show, del_flag
from t_demand
limit #{offset}, #{limit}
</select>
<!--通过实体作为筛选条件查询-->
<select id="queryAll" resultMap="TDemandMap">
select
demand_id, customer_id, category_id, demand_name, demand_describe, data_type, release_time, audit_status,
audit_person, audit_time, reject_reason, purchase_method, cre_person, cre_time, if_show, del_flag
from t_demand
<where>
<if test="demandId != null">
and demand_id = #{demandId}
</if>
<if test="customerId != null">
and customer_id = #{customerId}
</if>
<if test="categoryId != null">
and category_id = #{categoryId}
</if>
<if test="demandName != null and demandName != ''">
and demand_name = #{demandName}
</if>
<if test="demandDescribe != null and demandDescribe != ''">
and demand_describe = #{demandDescribe}
</if>
<if test="dataType != null">
and data_type = #{dataType}
</if>
<if test="releaseTime != null">
and release_time = #{releaseTime}
</if>
<if test="auditStatus != null and auditStatus != ''">
and audit_status = #{auditStatus}
</if>
<if test="auditPerson != null and auditPerson != ''">
and audit_person = #{auditPerson}
</if>
<if test="auditTime != null">
and audit_time = #{auditTime}
</if>
<if test="rejectReason != null and rejectReason != ''">
and reject_reason = #{rejectReason}
</if>
<if test="purchaseMethod != null and purchaseMethod != ''">
and purchase_method = #{purchaseMethod}
</if>
<if test="crePerson != null and crePerson != ''">
and cre_person = #{crePerson}
</if>
<if test="creTime != null">
and cre_time = #{creTime}
</if>
<if test="ifShow != null and ifShow != ''">
and if_show = #{ifShow}
</if>
<if test="delFlag != null and delFlag != ''">
and del_flag = #{delFlag}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="demandId" useGeneratedKeys="true">
insert into t_demand(customer_id, category_id, demand_name, demand_describe, data_type, release_time, audit_status, audit_person, audit_time, reject_reason, purchase_method, cre_person, cre_time, if_show, del_flag)
values (#{customerId}, #{categoryId}, #{demandName}, #{demandDescribe}, #{dataType}, #{releaseTime}, #{auditStatus}, #{auditPerson}, #{auditTime}, #{rejectReason}, #{purchaseMethod}, #{crePerson}, #{creTime}, #{ifShow}, #{delFlag})
</insert>
<insert id="insertBatch" keyProperty="demandId" useGeneratedKeys="true">
insert into t_demand(customer_id, category_id, demand_name, demand_describe, data_type,
release_time, audit_status, audit_person, audit_time, reject_reason, purchase_method, cre_person, cre_time,
if_show, del_flag)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.customerId}, #{entity.categoryId}, #{entity.demandName}, #{entity.demandDescribe},
#{entity.dataType}, #{entity.releaseTime}, #{entity.auditStatus}, #{entity.auditPerson},
#{entity.auditTime}, #{entity.rejectReason}, #{entity.purchaseMethod}, #{entity.crePerson},
#{entity.creTime}, #{entity.ifShow}, #{entity.delFlag})
</foreach>
</insert>
<!--通过主键修改数据-->
<update id="update">
update t_demand
<set>
<if test="customerId != null">
customer_id = #{customerId},
</if>
<if test="categoryId != null">
category_id = #{categoryId},
</if>
<if test="demandName != null and demandName != ''">
demand_name = #{demandName},
</if>
<if test="demandDescribe != null and demandDescribe != ''">
demand_describe = #{demandDescribe},
</if>
<if test="dataType != null">
data_type = #{dataType},
</if>
<if test="releaseTime != null">
release_time = #{releaseTime},
</if>
<if test="auditStatus != null and auditStatus != ''">
audit_status = #{auditStatus},
</if>
<if test="auditPerson != null and auditPerson != ''">
audit_person = #{auditPerson},
</if>
<if test="auditTime != null">
audit_time = #{auditTime},
</if>
<if test="rejectReason != null and rejectReason != ''">
reject_reason = #{rejectReason},
</if>
<if test="purchaseMethod != null and purchaseMethod != ''">
purchase_method = #{purchaseMethod},
</if>
<if test="crePerson != null and crePerson != ''">
cre_person = #{crePerson},
</if>
<if test="creTime != null">
cre_time = #{creTime},
</if>
<if test="ifShow != null and ifShow != ''">
if_show = #{ifShow},
</if>
<if test="delFlag != null and delFlag != ''">
del_flag = #{delFlag},
</if>
</set>
where demand_id = #{demandId}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete from t_demand where demand_id = #{demandId}
</delete>
</mapper>
\ No newline at end of file
package com.jz.manage.moduls.controller.config;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.BaseController;
import com.jz.manage.moduls.controller.config.bean.req.BannerAddAndEditReq;
import com.jz.manage.moduls.controller.config.bean.req.BannerConfigListReq;
import com.jz.manage.moduls.entity.Banner;
import com.jz.manage.moduls.service.BannerServer;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/7
* @Version:
*/
@RestController
@RequestMapping("banner")
@Api(tags = "平台--配置管理--controller")
public class BannerController extends BaseController {
@Autowired
private BannerServer bannerServer;
/**
* 查询全部广告
* @return
*/
@PostMapping(value = "/findList")
@ApiOperation(value = "广告配置--查询全部广告")
public Result<IPage<Banner>> findList(@RequestBody BannerConfigListReq req) {
return bannerServer.findList(req);
}
/**
* 查询广告详情
* @param bannerId
* @return
*/
@PostMapping(value = "/findByBanner")
@ApiOperation(value = "广告配置--查询广告详情")
public Result findByBanner(@RequestParam(name = "bannerId") Long bannerId) {
return bannerServer.findByBanner(bannerId);
}
/**
* 新增广告
* @param req
* @return
*/
@PostMapping(value = "/addBanner")
@ApiOperation(value = "广告配置--新增广告")
public Result addBanner(@RequestBody BannerAddAndEditReq req) {
return bannerServer.addBanner(req);
}
/**
* 编辑广告
* @param req
* @return
*/
@PostMapping(value = "/editBanner")
@ApiOperation(value = "广告配置--编辑广告")
public Result editBanner(@RequestBody BannerAddAndEditReq req) {
return bannerServer.editBanner(req);
}
/**
* 删除广告
* @param bannerId
* @return
*/
@PostMapping(value = "/deleteBanner")
@ApiOperation(value = "广告配置--删除广告")
public Result deleteBanner(@RequestParam(name = "bannerId") Long bannerId) {
return bannerServer.deleteBanner(bannerId);
}
}
package com.jz.manage.moduls.controller.config;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.BaseController;
import com.jz.manage.moduls.controller.config.bean.req.CategoryConfigEditReq;
import com.jz.manage.moduls.controller.config.bean.req.CategoryConfigReq;
import com.jz.manage.moduls.controller.config.bean.req.MenuConfigReq;
import com.jz.manage.moduls.entity.DataGoodsCategory;
import com.jz.manage.moduls.entity.MenuConfig;
import com.jz.manage.moduls.service.MenuConfigServer;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/7
* @Version:
*/
@RestController
@RequestMapping("menuConfig")
@Api(tags = "平台--配置管理--controller")
public class MenuConfigController extends BaseController {
@Autowired
private MenuConfigServer menuConfigServer;
/**
* 查询全部菜单
* @return
*/
@GetMapping(value = "/findList")
@ApiOperation(value = "菜单配置--查询全部菜单")
public Result findList() {
return menuConfigServer.findList();
}
/**
* 编辑菜单
* @param req
* @return
*/
@PostMapping(value = "/editUrl")
@ApiOperation(value = "菜单配置--编辑菜单")
public Result editUrl(@RequestBody @Valid MenuConfigReq req) {
return menuConfigServer.editUrl(req);
}
/**
* 条件查询分类配置
* @param req
* @return
*/
@PostMapping(value = "/findCategory")
@ApiOperation(value = "分类配置--条件查询分类")
public Result<IPage<DataGoodsCategory>> findCategory(@RequestBody CategoryConfigReq req) {
return menuConfigServer.findCategory(req);
}
/**
* 编辑分类配置
* @param req
* @return
*/
@PostMapping(value = "/editCategory")
@ApiOperation(value = "分类配置--编辑分类配置")
public Result editCategory(@RequestBody @Valid CategoryConfigEditReq req) {
return menuConfigServer.editCategory(req);
}
}
package com.jz.manage.moduls.controller.config.bean.req;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/7
* @Version:
*/
@ApiModel
@Data
public class BannerAddAndEditReq implements Serializable {
@ApiModelProperty(value = "广告id")
private Long bannerId;
@ApiModelProperty(value = "广告名称")
@NotNull(message = "广告名称不能为空")
private String bannerName;
@ApiModelProperty(value = "广告位置")
@NotNull(message = "广告位置不能为空")
private String bannerLocation;
@ApiModelProperty(value = "广告位描述")
private String bannerDesc;
@ApiModelProperty(value = "广告链接")
@NotNull(message = "广告链接不能为空")
private String bannerUrl;
@ApiModelProperty(value = "排序")
@NotNull(message = "排序不能为空")
private Long sort;
@ApiModelProperty(value = "开始时间")
@NotNull(message = "开始时间不能为空")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date bannerStart;
@ApiModelProperty(value = "结束时间")
@NotNull(message = "结束时间不能为空")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date bannerEnd;
}
package com.jz.manage.moduls.controller.config.bean.req;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/7
* @Version:
*/
@ApiModel
@Data
public class BannerConfigListReq extends BasePageBean implements Serializable {
@ApiModelProperty(value = "搜索")
private String search;
@ApiModelProperty(value = "广告位置")
private String bannerLocation;
@ApiModelProperty(value = "广告状态 01已发布 02未发布")
private String bannerStatus;
@ApiModelProperty(value = "广告位描述")
private String bannerDesc;
@ApiModelProperty(value = "开始时间")
private String bannerStart;
@ApiModelProperty(value = "结束时间")
private String bannerEnd;
}
package com.jz.manage.moduls.controller.config.bean.req;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/7
* @Version:
*/
@ApiModel
@Data
public class CategoryConfigEditReq implements Serializable {
@ApiModelProperty("分类id")
@NotNull(message = "分类id不能为空")
private Long categoryId;
@ApiModelProperty("图片")
@NotNull(message = "图片不能为空")
private String categoryPicture;
@ApiModelProperty("描述")
@NotNull(message = "描述不能为空")
private String categoryDesc;
}
package com.jz.manage.moduls.controller.config.bean.req;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/7
* @Version:
*/
@ApiModel
@Data
public class CategoryConfigReq extends BasePageBean implements Serializable{
@ApiModelProperty("分类名称")
private String categoryName;
}
package com.jz.manage.moduls.controller.config.bean.req;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/7
* @Version:
*/
@ApiModel
@Data
public class MenuConfigReq implements Serializable {
@ApiModelProperty("菜单id")
@NotNull(message = "菜单id不能为空")
private Long configId;
@ApiModelProperty("菜单路径")
@NotNull(message = "菜单路径不能为空")
private String configUrl;
}
......@@ -3,6 +3,7 @@ package com.jz.manage.moduls.controller.finance.platForm.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import java.io.Serializable;
......@@ -27,5 +28,35 @@ public class DepartmentAssetsDto implements Serializable {
private String unifiedCreditCode;
@ApiModelProperty("可用余额")
private String useMoney;
@ApiModelProperty("用户id")
private Long customerId;
@ApiModelProperty("用户名称")
private String customerName;
@ApiModelProperty("资产账户id")
private Long assetsId;
@ApiModelProperty("商品名称")
private String dataName;
@ApiModelProperty("生效日期")
private String takeEffectTime;
@ApiModelProperty("失效日期")
private String invalidTime;
@ApiModelProperty("购买方式")
private String purchaseMethod;
@ApiModelProperty("支付金额")
private String paymentMoney;
@ApiModelProperty("年(元)")
private String yearType;
@ApiModelProperty("季(元)")
private String seasonType;
@ApiModelProperty("月(元)")
private String monthType;
@ApiModelProperty("次(元)")
private String secondType;
@ApiModelProperty("订单id")
private Long orderId;
}
package com.jz.manage.moduls.controller.goods;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.constant.ResultMsg;
import com.jz.common.utils.Result;
import com.jz.common.utils.StatusCode;
import com.jz.manage.moduls.controller.BaseController;
import com.jz.manage.moduls.controller.goods.bean.dto.DepartmentDataGoodsDto;
import com.jz.manage.moduls.controller.goods.bean.request.DepartmentByRenewReq;
import com.jz.manage.moduls.controller.goods.bean.request.DepartmentDataGoodsReq;
import com.jz.manage.moduls.service.DataGoodsApiService;
import com.jz.manage.moduls.service.DataGoodsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
......@@ -22,7 +28,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
@RestController
@RequestMapping("dataGoodsApi")
@Api(tags = "平台--数据api-controller")
@Api(tags = "平台--商品管理--企业商品管理--controller")
public class DataGoodsApiController extends BaseController {
/**
* 服务对象
......@@ -30,6 +36,7 @@ public class DataGoodsApiController extends BaseController {
@Autowired
private DataGoodsApiService tDataGoodsApiService;
/**
* 根据主键查询商品详情-api
* @param id
......@@ -44,5 +51,21 @@ public class DataGoodsApiController extends BaseController {
return Result.of_error("查询失败!");
}
@PostMapping("/findByDepartmentGoods")
@ApiOperation(value = "企业商品管理--列表查询")
public Result<IPage<DepartmentDataGoodsDto>> findByDepartmentGoods(@RequestBody DepartmentDataGoodsReq req) {
return tDataGoodsApiService.findByDepartmentGoods(req);
}
@PostMapping("/DepartmentByRenew")
@ApiOperation(value = "企业商品管理--续费")
public Result DepartmentByRenew(@RequestBody @Valid DepartmentByRenewReq req) {
try {
return tDataGoodsApiService.DepartmentByRenew(req);
} catch (Exception e) {
e.printStackTrace();
return Result.of_error(ResultMsg.FAILURE);
}
}
}
\ No newline at end of file
package com.jz.manage.moduls.controller.goods;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.constant.ResultMsg;
import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.BaseController;
import com.jz.manage.moduls.controller.goods.bean.request.AddCateGoryReq;
import com.jz.manage.moduls.controller.goods.bean.request.CategoryAndSceneReq;
import com.jz.manage.moduls.controller.goods.bean.request.CategoryDetailReq;
import com.jz.manage.moduls.controller.goods.bean.request.DataGoodsByCategoryReq;
import com.jz.manage.moduls.entity.DataGoodsCategory;
import com.jz.manage.moduls.service.DataGoodsCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/**
* 数据商品分类(行业)(TDataGoodsCategory)表控制层
......@@ -19,7 +28,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
@RestController
@RequestMapping("dataGoodsCategory")
@Api(tags = "平台--数据商品分类行业--controller")
@Api(tags = "平台--商品管理--分类管理--controller")
public class DataGoodsCategoryController extends BaseController {
/**
* 服务对象
......@@ -27,13 +36,79 @@ public class DataGoodsCategoryController extends BaseController {
@Autowired
private DataGoodsCategoryService categoryService;
@GetMapping(value = "/findCategory")
@GetMapping(value = "/findByCategory")
@ApiOperation(value = "查询数据商品分类", notes = "查询所有的商品分类")
public Result findCategory() {
Result result = categoryService.findCategory();
if (StringUtils.isEmpty(result)) {
return Result.of_error("查询失败!");
public Result<List<DataGoodsCategory>> findByCategory() throws Exception{
return categoryService.findByCategory();
}
/**
* 查询场景分类
* @return
*/
@GetMapping(value = "/findByScene")
@ApiOperation(value = "查询场景分类", notes = "查询所有的场景分类")
public Result findByScene() {
return categoryService.findByScene();
}
/**
* 添加分类
* @param category
* @return
*/
@PostMapping(value = "/addCategory")
@ApiOperation(value = "商品分类管理--添加分类", notes = "添加一级分类/子级分类")
public Result addCategory(@RequestBody @Valid AddCateGoryReq category) {
try {
return categoryService.addCategory(category);
}catch (Exception e) {
e.printStackTrace();
return Result.of_error(ResultMsg.FAILURE);
}
}
/**
* 编辑分类
* @param category
* @return
*/
@PostMapping(value = "/editCateGoryByParent")
@ApiOperation(value = "商品分类管理--编辑分类", notes = "编辑一级分类/子级分类")
public Result editCategory(@RequestBody @Valid AddCateGoryReq category) {
try {
return categoryService.editCategory(category);
}catch (Exception e) {
e.printStackTrace();
return Result.of_error(ResultMsg.FAILURE);
}
}
/**
* 获取分类详情
* @param req
* @return
*/
@PostMapping("/getCategoryDetail")
@ApiOperation(value = "商品分类管理--获取分类详情")
public Result getCategoryDetail(@RequestBody @Valid CategoryDetailReq req) {
return categoryService.getCategoryDetail(req);
}
/**
* 条件查询商品分类
* @param search
* @return
*/
@PostMapping(value = "/selectByCategory")
@ApiOperation(value = "商品分类管理--条件查询商品分类")
public Result selectByCategory(@RequestParam(required = false) String search) {
return categoryService.selectByCategory(search);
}
return result;
@PostMapping(value = "/deleteByCategory")
@ApiOperation(value = "商品分类管理--删除分类")
public Result deleteByCategory(@RequestBody @Valid CategoryAndSceneReq req) {
return categoryService.deleteByCategory(req);
}
}
\ No newline at end of file
......@@ -3,18 +3,16 @@ package com.jz.manage.moduls.controller.goods;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.bean.BaseBeanResponse;
import com.jz.common.bean.BaseResponse;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants;
import com.jz.common.entity.DataGoods;
import com.jz.common.constant.ResultMsg;
import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.BaseController;
import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsAuditDto;
import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsDto;
import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsListDto;
import com.jz.manage.moduls.controller.goods.bean.request.DataGoodsAuditListReq;
import com.jz.manage.moduls.controller.goods.bean.request.DataGoodsAuditReq;
import com.jz.manage.moduls.controller.goods.bean.request.DataGoodsListRequest;
import com.jz.manage.moduls.controller.goods.bean.request.DataGoodsRequest;
import com.jz.manage.moduls.controller.goods.bean.request.*;
import com.jz.manage.moduls.entity.DataGoods;
import com.jz.manage.moduls.service.DataGoodsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -32,7 +30,7 @@ import javax.validation.Valid;
*/
@RestController
@RequestMapping("dataGoods")
@Api(tags = "平台--数据商品--controller")
@Api(tags = "平台--商品管理--商品列表--controller")
public class DataGoodsController extends BaseController {
/**
* 服务对象
......@@ -40,23 +38,22 @@ public class DataGoodsController extends BaseController {
@Autowired
private DataGoodsService dataGoodsService;
/**列表查询数据商品
* @param dataGoodsListRequest
* @return
*/
@PostMapping(value = "/findList")
@ApiOperation(value = "自营数据--列表查询数据")
public PageInfoResponse<DataGoodsListDto> findList(@RequestBody DataGoodsListRequest dataGoodsListRequest, HttpServletRequest httpRequest){
PageInfoResponse<DataGoodsListDto> pageInfo = new PageInfoResponse<>();
@ApiOperation(value = "商品列表--列表查询数据")
public Result<IPage<DataGoodsListDto>> findList(@RequestBody DataGoodsListRequest dataGoodsListRequest, HttpServletRequest httpRequest){
try {
pageInfo = dataGoodsService.findList(dataGoodsListRequest, httpRequest);
return dataGoodsService.findList(dataGoodsListRequest, httpRequest);
} catch (Exception e) {
pageInfo.setMessage("查询失败");
pageInfo.setCode(Constants.FAILURE_CODE);
e.printStackTrace();
return Result.of_error("查询失败!");
}
return pageInfo;
}
/**列表查询审核数据商品
* @param req
......@@ -161,19 +158,121 @@ public class DataGoodsController extends BaseController {
return baseBeanResponse;
}
/**
* 商品上下架
* @param goodsId
* @param statusId
* @return
*/
@PostMapping("/editStatus/{goodsId}/{statusId}")
@ApiOperation(value = "商品上下架")
@ApiOperation(value = "商品列表--商品上下架")
public Result editStatus(@PathVariable(value = "goodsId") Long goodsId,
@PathVariable(value = "statusId") Long statusId) {
Result result = null;
@PathVariable(value = "statusId") String statusId) {
try {
result = dataGoodsService.editStatus(goodsId, statusId);
return dataGoodsService.editStatus(goodsId, statusId);
}catch (Exception e) {
e.printStackTrace();
result = new Result(false, "操作失败!");
return Result.of_error(ResultMsg.UPDATE_FAIL);
}
}
return result;
/**
* 商品列表--浏览授权
* @param roleReq
* @return
*/
@PostMapping("/browseByAuthorization")
@ApiOperation(value = "商品列表--浏览授权")
public Result browseByAuthorization(@RequestBody @Valid DataGoodsByRoleReq roleReq) {
return dataGoodsService.browseByAuthorization(roleReq);
}
/**
* 商品列表--浏览授权--查询授权
* @param dataGoodsId
* @return
*/
@PostMapping("/findByAuthorization")
@ApiOperation(value = "商品列表--浏览授权--查询授权")
public Result findByAuthorization(@RequestParam(name = "dataGoodsId") Long dataGoodsId) {
return dataGoodsService.findByAuthorization(dataGoodsId);
}
/**
*
* @param
* @return
*/
@PostMapping("/useByAuthorization")
@ApiOperation(value = "商品列表--使用授权")
public Result useByAuthorization(@RequestBody GoodsByAuthorizationReq req) {
try {
return dataGoodsService.useByAuthorization(req);
}catch (Exception e) {
e.printStackTrace();
return Result.of_error(ResultMsg.FAILURE);
}
}
@PostMapping("/findByDepartment")
@ApiOperation(value = "商品列表--使用授权/续费--搜索企业")
public Result findByDepartment(@RequestBody DepartmentGoodsReq req) {
return dataGoodsService.findByDepartment(req);
}
/**
* 根据主键查询商品详情-api
* @param id
* @return
*/
@GetMapping("/getDataDetails/{id}")
@ApiOperation(value = "商品列表--查看商品详情")
public Result findById(@PathVariable(value = "id") Long id) throws Exception{
if (id != null) {
return dataGoodsService.selectById(id);
}
return Result.of_error("查询失败!");
}
/**
* 获取api列表
* @param req
* @return
*/
@PostMapping("/getApiGoods")
@ApiOperation(value = "制作商品-获取api列表",notes = "dmp制作api,发送到数据银行")
public Result getAPIList(@RequestBody @Valid SendDataReq req) {
return dataGoodsService.getAPIList(req);
}
/**
* 获取API详情
* @param req
* @return
*/
@ApiOperation(value = "制作商品-API详情查询",notes = "调用接口")
@PostMapping(value = "/getApiInterfaceDetail")
public Result getApiInterfaceDetail(@RequestBody @Valid ApiInterfaceDetailReq req) {
return dataGoodsService.getApiInterfaceDetail(req);
}
/**
* 制作商品
* @param req
* @return
*/
@PostMapping("/makeByGoods")
@ApiOperation(value = "制作商品--编辑/制作商品",notes = "平台方制作商品")
public Result makeByGoods(@RequestBody @Valid DataApiUpReq req) {
try {
return dataGoodsService.makeByGoods(req);
} catch (Exception e) {
e.printStackTrace();
return Result.of_error("制作失败!");
}
}
}
\ No newline at end of file
package com.jz.manage.moduls.controller.goods;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.BaseController;
import com.jz.manage.moduls.controller.goods.bean.request.DemandAuditReq;
import com.jz.manage.moduls.controller.goods.bean.request.DemandListReq;
import com.jz.manage.moduls.entity.Demand;
import com.jz.manage.moduls.service.DemandService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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 javax.validation.Valid;
/**
* 用户需求定制申请(TDemand)表控制层
......@@ -14,6 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
@RestController
@RequestMapping("demand")
@Api(tags = "平台--需求管理--controller")
public class DemandController extends BaseController {
/**
* 服务对象
......@@ -21,4 +30,31 @@ public class DemandController extends BaseController {
@Autowired
private DemandService tDemandService;
/**
* 条件查询需求审核列表
* @param req
* @return
*/
@PostMapping("/findList")
@ApiOperation(value = "需求审核--条件查询需求")
public Result<IPage<Demand>> findList(@RequestBody DemandListReq req) {
return tDemandService.findList(req);
}
/**
* 查询需求详情
* @param demandId
* @return
*/
@GetMapping("/findByDemand")
@ApiOperation(value = "需求审核--查询需求详情")
public Result findByDemand(@RequestParam(name = "demandId") Long demandId) {
return tDemandService.findByDemand(demandId);
}
@PostMapping("/auditDemand")
@ApiOperation(value = "需求审核--审核需求")
public Result auditDemand(@RequestBody @Valid DemandAuditReq req) {
return tDemandService.auditDemand(req);
}
}
\ No newline at end of file
package com.jz.manage.moduls.controller.goods.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @Description:
* @Author: Mr.zhang
* @Date: 2020-12-23
*/
@Data
@ApiModel("gateWay制作api返回参数")
public class ApiInterfaceDto implements Serializable {
/**
* api唯一标识
*/
@ApiModelProperty(value = "api唯一标识")
private String apiKey;
/**
* api名称
*/
@ApiModelProperty(value = "api名称")
private String apiName;
/**
* api请求协议:http,https
*/
@ApiModelProperty(value = "api请求协议:http,https")
private String apiProtocl;
/**
* 接入类型:对应字典表key
*/
@ApiModelProperty(value = "接入类型:对应字典表key")
private String apiType;
/**
* 目标url
*/
@ApiModelProperty(value = "目标url")
private String targetUrl;
/**
* 请求方式:GET POST
*/
@ApiModelProperty(value = "请求方式:GET POST")
private String reqType;
/**
* '输出类型:flow 流形式输出, json格式输出',
*/
@ApiModelProperty(value = "'输出类型:flow 流形式输出, json格式输出',")
private String outputType;
/**
* 状态(1-草稿 2-发布 3-过时 4-冻结 5-失效)
*/
@ApiModelProperty(value = "状态(1-草稿 2-发布 3-过时 4-冻结 5-失效)")
private String status;
/**
* 接口功能
*/
@ApiModelProperty(value = "接口功能")
private String apiFunction;
/**
* 版本号
*/
@ApiModelProperty(value = "版本号")
private String version;
/**
* 加密方式:0 无 1. MD5 2. RSA
*/
@ApiModelProperty(value = "加密方式:0 无 1. MD5 2. RSA")
private Integer signType;
/**
* 限流类型:DAY 按天,MONTH 按月, YEAR 按年
*/
@ApiModelProperty(value = "限流类型:DAY 按天,MONTH 按月, YEAR 按年")
private String limitType;
/**
* 限制次数
*/
@ApiModelProperty(value = "限制次数")
private Long reqFrequency;
/**
* 超时时间
*/
@ApiModelProperty(value = "超时时间")
private String timeout;
/**
* 文件夹id
*/
@ApiModelProperty(value = "文件夹id")
private Long fileId;
}
package com.jz.manage.moduls.controller.goods.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/5
* @Version:
*/
@ApiModel
@Data
public class CategoryAndSceneDto implements Serializable {
@ApiModelProperty(value = "场景分类id")
private Long sceneId;
@ApiModelProperty(value = "场景名称")
private String sceneName;
@ApiModelProperty(value = "商品分类id")
private Long categoryId;
@ApiModelProperty(value = "商品名称")
private String categoryName;
}
package com.jz.manage.moduls.controller.goods.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/1
* @Version:
*/
@ApiModel
@Data
public class DataAndOrderDto implements Serializable {
@ApiModelProperty(value = "订单数量")
private Long orderTotal;
@ApiModelProperty(value = "订单状态")
private String orderState;
@ApiModelProperty(value = "购买方式")
private String purchaseMethod;
@ApiModelProperty(value = "apiKey")
private String apiKey;
}
......@@ -34,7 +34,7 @@ public class DataGoodsListDto {
* 数据类型
*/
@ApiModelProperty(value = "数据类型")
private String apiType;
private String dataType;
/**
* 数据行业
......@@ -66,5 +66,7 @@ public class DataGoodsListDto {
@ApiModelProperty(value = "数据状态")
private String dataStatus;
@ApiModelProperty(value = "商品状态")
private String goodsState;
}
package com.jz.manage.moduls.controller.goods.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/5
* @Version:
*/
@ApiModel("企业商品列表返回参数")
@Data
public class DepartmentDataGoodsDto implements Serializable {
@ApiModelProperty("企业id")
private Long departmentId;
@ApiModelProperty("企业名称")
private String departmentName;
@ApiModelProperty("商品id")
private Long dataGoodsId;
@ApiModelProperty("商品名称")
private String dataName;
@ApiModelProperty("商品分类")
private String categoryName;
@ApiModelProperty("商品状态")
private String goodsStatus;
@ApiModelProperty("授权时间")
private Date date;
@ApiModelProperty("授权开始时间")
private String takeEffectTime;
@ApiModelProperty("授权结束时间")
private String invalidTime;
}
package com.jz.manage.moduls.controller.goods.bean.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
@ApiModel
@Data
public class AddCateGoryReq implements Serializable {
@ApiModelProperty("上级分类id")
private Long categoryId;
@ApiModelProperty("商品分类名称")
@NotNull(message = "商品分类名称不能为空")
private String categoryName;
@ApiModelProperty("所属场景id/ 编辑-新场景id")
private Long sceneId;
@ApiModelProperty("编辑-旧场景id")
private Long oldSceneId;
}
package com.jz.manage.moduls.controller.goods.bean.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @author ZC
* @PACKAGE_NAME: com.jz.dm.models.req
* @PROJECT_NAME: jz-dm-parent
* @NAME: LogInfoDetailReq
* @DATE: 2020-12-25/15:18
* @DAY_NAME_SHORT: 周五
* @Description:
**/
@Data
@ApiModel("API详情信息")
public class ApiInterfaceDetailReq implements Serializable {
@ApiModelProperty(value = "id",required = true)
@NotNull(message = "id不能为空")
private Long id;
}