Commit e8a13bd5 authored by ysongq's avatar ysongq

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

parent df27bbc5
...@@ -5,4 +5,17 @@ ...@@ -5,4 +5,17 @@
alter table t_data_goods_api add api_type char(2) NOT NULL COMMENT 'api类型:01制作api,02制作数据包'; alter table t_data_goods_api add api_type char(2) NOT NULL COMMENT 'api类型:01制作api,02制作数据包';
alter table t_data_goods_api add target_url varchar(128) DEFAULT NULL COMMENT '目标地址'; 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_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_platform_log add request_type char(2) NOT NULL COMMENT '请求状态:01成功,02失败';
\ No newline at end of file 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; ...@@ -19,7 +19,6 @@ import java.io.Serializable;
**/ **/
@Data @Data
@ApiModel @ApiModel
@Builder
public class SendDataReq extends BasePageBean implements Serializable { public class SendDataReq extends BasePageBean implements Serializable {
@ApiModelProperty(value = "关键词") @ApiModelProperty(value = "关键词")
......
...@@ -103,8 +103,8 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService { ...@@ -103,8 +103,8 @@ public class ApiQueryService extends ApiParamVerify implements OpenApiService {
apiAuth = authService.getAuthInfo(authCode); apiAuth = authService.getAuthInfo(authCode);
verifyAuth(apiAuth); verifyAuth(apiAuth);
//取出缓存数据 //取出缓存数据
//String redisReqParam = redisUtils.get(request.getApiKey()); // String redisReqParam = redisUtils.get(request.getApiKey());
String redisReqParam = null; String redisReqParam = null;
if (StringUtils.isNotBlank(redisReqParam)) {//redis中存在 if (StringUtils.isNotBlank(redisReqParam)) {//redis中存在
//解析出API制作成功时的参数配置 //解析出API制作成功时的参数配置
JSONObject jsonObject = JSONObject.parseObject(redisReqParam); JSONObject jsonObject = JSONObject.parseObject(redisReqParam);
......
...@@ -23,6 +23,8 @@ public enum ResultMsg { ...@@ -23,6 +23,8 @@ public enum ResultMsg {
TRANS_FAIL("转账失败"), TRANS_FAIL("转账失败"),
RECHARGE_SUCCESS("充值成功"), RECHARGE_SUCCESS("充值成功"),
RECHARGE_FAIL("充值失败"), RECHARGE_FAIL("充值失败"),
AUDIT_SUCCESS("审核成功"),
AUDIT_FAIL("审核失败"),
/** /**
* 需审核 * 需审核
*/ */
......
package com.jz.common.entity; package com.jz.common.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
...@@ -30,108 +32,144 @@ public class DataGoods implements Serializable { ...@@ -30,108 +32,144 @@ public class DataGoods implements Serializable {
/** /**
* 商品分类id(行业) * 商品分类id(行业)
*/ */
@TableField("category_id")
private Long categoryId; private Long categoryId;
@TableField("scene_id")
private Long sceneId;
/** /**
* 数据商户id * 数据商户id
*/ */
@TableField("user_id")
private Long userId; private Long userId;
@ApiModelProperty(value = "唯一数据商品标识") @TableField("api_openid")
private String apiOpenid; private String apiOpenid;
/** /**
* 数据商品名称 * 数据商品名称
*/ */
@TableField("data_name")
private String dataName; private String dataName;
/** /**
* 数据类型:01api,02数据包 * 数据类型:01api,02数据包
*/ */
@TableField("data_type")
private String dataType; private String dataType;
/** /**
* 数据商品标签 * 数据商品标签
*/ */
@TableField("data_label")
private String dataLabel; private String dataLabel;
/** /**
* 数据商品图片 * 数据商品图片
*/ */
@TableField("data_picture")
private String dataPicture; private String dataPicture;
/** /**
* 数据商品价格 * 数据商品价格
*/ */
@TableField("data_price")
private BigDecimal dataPrice; private BigDecimal dataPrice;
/** /**
* 优惠价格 * 优惠价格
*/ */
@TableField("discount_price")
private BigDecimal discountPrice; private BigDecimal discountPrice;
/** /**
* 价格类型:01免费,02收费 * 价格类型:01免费,02收费
*/ */
@TableField("price_type")
private String priceType; private String priceType;
/** /**
* 商品规格 * 商品规格
*/ */
@TableField("goods")
private String goodsStandards; private String goodsStandards;
/** /**
* 数据状态:01预售,02在售中,03下架,04上架 * 数据状态:01预售,02在售中,03下架,04上架
*/ */
@TableField("data_status")
private String dataStatus; private String dataStatus;
/** /**
* 审核状态:01待审核,02已审核,03未通过 * 审核状态:01待审核,02已审核,03未通过
*/ */
@TableField("audit_status")
private String auditStatus; private String auditStatus;
/** /**
* 清洗规则(脱敏校验) * 清洗规则(脱敏校验)
*/ */
@TableField("clean_rule")
private String cleanRule; private String cleanRule;
/** /**
* 驳回原因 * 驳回原因
*/ */
@TableField("reject_reason")
private String rejectReason; private String rejectReason;
/** /**
* 审核人 * 审核人
*/ */
@TableField("audit_person")
private String auditPerson; private String auditPerson;
/** /**
* 审核时间 * 审核时间
*/ */
@TableField("audit_time")
private Date auditTime; private Date auditTime;
/** /**
* 创建时间 * 创建时间
*/ */
@TableField("cre_time")
private Date creTime; private Date creTime;
/** /**
* 创建人 * 创建人
*/ */
@TableField("cre_person")
private String crePerson; private String crePerson;
/** /**
* 更新时间 * 更新时间
*/ */
@TableField("upt_time")
private Date uptTime; private Date uptTime;
/** /**
* 更新人 * 更新人
*/ */
@TableField("upt_person")
private String uptPerson; private String uptPerson;
/** /**
* 删除标识 * 删除标识
*/ */
@TableField("del_flag")
private String delFlag; private String delFlag;
/** /**
* 年(元) * 年(元)
*/ */
@TableField("year_type")
private BigDecimal yearType; private BigDecimal yearType;
/** /**
* 季(元) * 季(元)
*/ */
@TableField("season_type")
private BigDecimal seasonType; private BigDecimal seasonType;
/** /**
* 月(元) * 月(元)
*/ */
@TableField("month_type")
private BigDecimal monthType; private BigDecimal monthType;
/** /**
* 次(元) * 次(元)
*/ */
@TableField("second_type")
private BigDecimal secondType; 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 { ...@@ -405,7 +405,19 @@ public class DateUtils {
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
return (int) (time / 1000); 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 { ...@@ -12,7 +12,10 @@ public class TestController {
@Autowired @Autowired
private TestService testService; 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"; // String filename="C:\\Users\\fengyq\\Desktop\\万家\\表格\\新建 XLSX 工作表.xlsx";
// // 创建工作簿 // // 创建工作簿
...@@ -46,7 +49,7 @@ public class TestController { ...@@ -46,7 +49,7 @@ public class TestController {
// //
// // 关闭工作簿 // // 关闭工作簿
// wk.close(); // wk.close();
} // }
@RequestMapping("/hello") @RequestMapping("/hello")
public void test() throws Exception { 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 { ...@@ -120,7 +120,6 @@ public class OrderServiceImpl implements OrderService {
if (StringUtils.isNotEmpty(orderId)) { if (StringUtils.isNotEmpty(orderId)) {
orderDto = orderDao.getOrderDetail(orderId); orderDto = orderDao.getOrderDetail(orderId);
if (orderDto != null) { if (orderDto != null) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date endTime = orderDto.getInvalidTime(); Date endTime = orderDto.getInvalidTime();
String indate = DateUtils.getTime(endTime, DateUtils.getToday()); String indate = DateUtils.getTime(endTime, DateUtils.getToday());
orderDto.setIndate(indate); orderDto.setIndate(indate);
...@@ -328,7 +327,6 @@ public class OrderServiceImpl implements OrderService { ...@@ -328,7 +327,6 @@ public class OrderServiceImpl implements OrderService {
if (StringUtils.isEmpty(req.getRequestToken())) { if (StringUtils.isEmpty(req.getRequestToken())) {
return Result.of_error("授权码不能为空!"); return Result.of_error("授权码不能为空!");
} }
System.out.println(JSON.toJSONString(req));
String post = HttpsUtilsTest.submitPost(gatewayOrderLogDetails, JSON.toJSONString(req)); String post = HttpsUtilsTest.submitPost(gatewayOrderLogDetails, JSON.toJSONString(req));
JSONObject params = JSONObject.parseObject(post); JSONObject params = JSONObject.parseObject(post);
if (!params.get("code").equals(200) || org.springframework.util.StringUtils.isEmpty(params.get("data"))){ 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; ...@@ -3,6 +3,7 @@ package com.jz.manage.moduls.controller.finance.platForm.dto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import java.io.Serializable; import java.io.Serializable;
...@@ -27,5 +28,35 @@ public class DepartmentAssetsDto implements Serializable { ...@@ -27,5 +28,35 @@ public class DepartmentAssetsDto implements Serializable {
private String unifiedCreditCode; private String unifiedCreditCode;
@ApiModelProperty("可用余额") @ApiModelProperty("可用余额")
private String useMoney; 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; 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.Result;
import com.jz.common.utils.StatusCode; import com.jz.common.utils.StatusCode;
import com.jz.manage.moduls.controller.BaseController; 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.DataGoodsApiService;
import com.jz.manage.moduls.service.DataGoodsService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import javax.validation.Valid;
import org.springframework.web.bind.annotation.RestController;
/** /**
...@@ -22,7 +28,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -22,7 +28,7 @@ import org.springframework.web.bind.annotation.RestController;
*/ */
@RestController @RestController
@RequestMapping("dataGoodsApi") @RequestMapping("dataGoodsApi")
@Api(tags = "平台--数据api-controller") @Api(tags = "平台--商品管理--企业商品管理--controller")
public class DataGoodsApiController extends BaseController { public class DataGoodsApiController extends BaseController {
/** /**
* 服务对象 * 服务对象
...@@ -30,6 +36,7 @@ public class DataGoodsApiController extends BaseController { ...@@ -30,6 +36,7 @@ public class DataGoodsApiController extends BaseController {
@Autowired @Autowired
private DataGoodsApiService tDataGoodsApiService; private DataGoodsApiService tDataGoodsApiService;
/** /**
* 根据主键查询商品详情-api * 根据主键查询商品详情-api
* @param id * @param id
...@@ -44,5 +51,21 @@ public class DataGoodsApiController extends BaseController { ...@@ -44,5 +51,21 @@ public class DataGoodsApiController extends BaseController {
return Result.of_error("查询失败!"); 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; 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.Result;
import com.jz.manage.moduls.controller.BaseController; 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 com.jz.manage.moduls.service.DataGoodsCategoryService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import javax.validation.Valid;
import org.springframework.web.bind.annotation.RestController; import java.util.List;
/** /**
* 数据商品分类(行业)(TDataGoodsCategory)表控制层 * 数据商品分类(行业)(TDataGoodsCategory)表控制层
...@@ -19,7 +28,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -19,7 +28,7 @@ import org.springframework.web.bind.annotation.RestController;
*/ */
@RestController @RestController
@RequestMapping("dataGoodsCategory") @RequestMapping("dataGoodsCategory")
@Api(tags = "平台--数据商品分类行业--controller") @Api(tags = "平台--商品管理--分类管理--controller")
public class DataGoodsCategoryController extends BaseController { public class DataGoodsCategoryController extends BaseController {
/** /**
* 服务对象 * 服务对象
...@@ -27,13 +36,79 @@ public class DataGoodsCategoryController extends BaseController { ...@@ -27,13 +36,79 @@ public class DataGoodsCategoryController extends BaseController {
@Autowired @Autowired
private DataGoodsCategoryService categoryService; private DataGoodsCategoryService categoryService;
@GetMapping(value = "/findCategory") @GetMapping(value = "/findByCategory")
@ApiOperation(value = "查询数据商品分类", notes = "查询所有的商品分类") @ApiOperation(value = "查询数据商品分类", notes = "查询所有的商品分类")
public Result findCategory() { public Result<List<DataGoodsCategory>> findByCategory() throws Exception{
Result result = categoryService.findCategory(); return categoryService.findByCategory();
if (StringUtils.isEmpty(result)) { }
return Result.of_error("查询失败!");
/**
* 查询场景分类
* @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);
} }
return result; }
/**
* 获取分类详情
* @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);
}
@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; ...@@ -3,18 +3,16 @@ package com.jz.manage.moduls.controller.goods;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.bean.BaseBeanResponse; import com.jz.common.bean.BaseBeanResponse;
import com.jz.common.bean.BaseResponse; import com.jz.common.bean.BaseResponse;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants; 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.common.utils.Result;
import com.jz.manage.moduls.controller.BaseController; 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.DataGoodsAuditDto;
import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsDto; 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.dto.DataGoodsListDto;
import com.jz.manage.moduls.controller.goods.bean.request.DataGoodsAuditListReq; import com.jz.manage.moduls.controller.goods.bean.request.*;
import com.jz.manage.moduls.controller.goods.bean.request.DataGoodsAuditReq; import com.jz.manage.moduls.entity.DataGoods;
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.service.DataGoodsService; import com.jz.manage.moduls.service.DataGoodsService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -32,7 +30,7 @@ import javax.validation.Valid; ...@@ -32,7 +30,7 @@ import javax.validation.Valid;
*/ */
@RestController @RestController
@RequestMapping("dataGoods") @RequestMapping("dataGoods")
@Api(tags = "平台--数据商品--controller") @Api(tags = "平台--商品管理--商品列表--controller")
public class DataGoodsController extends BaseController { public class DataGoodsController extends BaseController {
/** /**
* 服务对象 * 服务对象
...@@ -40,23 +38,22 @@ public class DataGoodsController extends BaseController { ...@@ -40,23 +38,22 @@ public class DataGoodsController extends BaseController {
@Autowired @Autowired
private DataGoodsService dataGoodsService; private DataGoodsService dataGoodsService;
/**列表查询数据商品 /**列表查询数据商品
* @param dataGoodsListRequest * @param dataGoodsListRequest
* @return * @return
*/ */
@PostMapping(value = "/findList") @PostMapping(value = "/findList")
@ApiOperation(value = "自营数据--列表查询数据") @ApiOperation(value = "商品列表--列表查询数据")
public PageInfoResponse<DataGoodsListDto> findList(@RequestBody DataGoodsListRequest dataGoodsListRequest, HttpServletRequest httpRequest){ public Result<IPage<DataGoodsListDto>> findList(@RequestBody DataGoodsListRequest dataGoodsListRequest, HttpServletRequest httpRequest){
PageInfoResponse<DataGoodsListDto> pageInfo = new PageInfoResponse<>();
try { try {
pageInfo = dataGoodsService.findList(dataGoodsListRequest, httpRequest); return dataGoodsService.findList(dataGoodsListRequest, httpRequest);
} catch (Exception e) { } catch (Exception e) {
pageInfo.setMessage("查询失败");
pageInfo.setCode(Constants.FAILURE_CODE);
e.printStackTrace(); e.printStackTrace();
return Result.of_error("查询失败!");
} }
return pageInfo;
} }
/**列表查询审核数据商品 /**列表查询审核数据商品
* @param req * @param req
...@@ -161,19 +158,121 @@ public class DataGoodsController extends BaseController { ...@@ -161,19 +158,121 @@ public class DataGoodsController extends BaseController {
return baseBeanResponse; return baseBeanResponse;
} }
/**
* 商品上下架
* @param goodsId
* @param statusId
* @return
*/
@PostMapping("/editStatus/{goodsId}/{statusId}") @PostMapping("/editStatus/{goodsId}/{statusId}")
@ApiOperation(value = "商品上下架") @ApiOperation(value = "商品列表--商品上下架")
public Result editStatus(@PathVariable(value = "goodsId") Long goodsId, public Result editStatus(@PathVariable(value = "goodsId") Long goodsId,
@PathVariable(value = "statusId") Long statusId) { @PathVariable(value = "statusId") String statusId) {
Result result = null; try {
return dataGoodsService.editStatus(goodsId, statusId);
}catch (Exception e) {
e.printStackTrace();
return Result.of_error(ResultMsg.UPDATE_FAIL);
}
}
/**
* 商品列表--浏览授权
* @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 { try {
result = dataGoodsService.editStatus(goodsId, statusId); return dataGoodsService.useByAuthorization(req);
}catch (Exception e) { }catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
result = new Result(false, "操作失败!"); 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("制作失败!");
} }
return result;
} }
} }
\ No newline at end of file
package com.jz.manage.moduls.controller.goods; 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.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 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.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
/** /**
* 用户需求定制申请(TDemand)表控制层 * 用户需求定制申请(TDemand)表控制层
...@@ -14,6 +22,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -14,6 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
*/ */
@RestController @RestController
@RequestMapping("demand") @RequestMapping("demand")
@Api(tags = "平台--需求管理--controller")
public class DemandController extends BaseController { public class DemandController extends BaseController {
/** /**
* 服务对象 * 服务对象
...@@ -21,4 +30,31 @@ public class DemandController extends BaseController { ...@@ -21,4 +30,31 @@ public class DemandController extends BaseController {
@Autowired @Autowired
private DemandService tDemandService; 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 { ...@@ -34,7 +34,7 @@ public class DataGoodsListDto {
* 数据类型 * 数据类型
*/ */
@ApiModelProperty(value = "数据类型") @ApiModelProperty(value = "数据类型")
private String apiType; private String dataType;
/** /**
* 数据行业 * 数据行业
...@@ -66,5 +66,7 @@ public class DataGoodsListDto { ...@@ -66,5 +66,7 @@ public class DataGoodsListDto {
@ApiModelProperty(value = "数据状态") @ApiModelProperty(value = "数据状态")
private String dataStatus; 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;
}
package com.jz.manage.moduls.controller.goods.bean.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jz.common.enums.auth.AuthModeEnum;
import com.jz.common.enums.auth.AuthTypeEnum;
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: 2020/12/31
* @Version:
*/
@Data
@ApiModel("商城用户API认证")
public class AuthMallUserApiReq implements Serializable {
private static final long serialVersionUID = -6112096815489941276L;
@ApiModelProperty(value = "apiKey唯一标识",required = true)
@NotNull(message = "apiKey唯一标识不能为空")
private String apiKey;
@ApiModelProperty(value = "组织编码",required = true)
@NotNull(message = "组织编码不能为空")
private String orgCode;
@ApiModelProperty(value = "授权类型:DATA_BANK_AUTH 数据银行 , DMP_AUTH 授权",required = true)
@NotNull(message = "授权类型不能为空")
private String authType;
@ApiModelProperty(value = "授权方式:POWER_CALL_MODE 按次调用 ,RECORD_TIME_MODE 按时间调用,PERMANENT_TIME_MODE 永久有效",required = true)
@NotNull(message = "授权方式不能为空")
private String authMode;
@ApiModelProperty(value = "开始时间",required = false)
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date validStartTime;
@ApiModelProperty(value = "结束时间",required = false)
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date validEndTime;
@ApiModelProperty(value = "备注",required = false)
private String remark;
@ApiModelProperty(value = "创建用户",required = false)
private String createUser;
}
package com.jz.manage.moduls.controller.goods.bean.request;
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/5
* @Version:
*/
@ApiModel
@Data
public class AuthRenewUpdateReq implements Serializable {
@ApiModelProperty(value = "授权码",required = true)
@NotNull(message = "授权码不能为空")
private String authCode;
@ApiModelProperty(value = "有效截止时间",required = true)
@NotNull(message = "有效截止时间不能空")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date validEndTime;
}
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/5
* @Version:
*/
@Data
@ApiModel
public class CategoryAndSceneReq implements Serializable {
@ApiModelProperty(value = "场景分类id")
private Long sceneId;
@ApiModelProperty(value = "商品分类id")
@NotNull(message = "商品分类id不能为空")
private Long categoryId;
}
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/5
* @Version:
*/
@Data
@ApiModel
public class CategoryDetailReq implements Serializable {
@ApiModelProperty(value = "分类id")
@NotNull(message = "分类id不能为空")
private Long categoryId;
}
...@@ -20,112 +20,74 @@ import java.util.List; ...@@ -20,112 +20,74 @@ import java.util.List;
* @Version: * @Version:
*/ */
@Data @Data
@ApiModel(value = "自营数据--api上传参数对象", description = "api上传参数对象") @ApiModel(value = "制作商品--制作商品参数对象", description = "制作商品参数对象")
public class DataApiUpReq implements Serializable { public class DataApiUpReq implements Serializable {
/** /**
* api表 * goods
*/ */
@ApiModelProperty(value = "apiKey")
@ApiModelProperty(value = "请求类型") @NotNull(message = "apiKey不能为空")
private String requestType; private String apiKey;
@ApiModelProperty(value = "数据类型")
@ApiModelProperty(value = "接口地址") @NotNull(message = "数据类型不能为空")
private String apiUrl; private String dataType;
@ApiModelProperty(value = "数据商品名称")
@ApiModelProperty(value = "api请求协议 HTTP/HTTPS") @NotNull(message = "数据商品名称不能为空")
@NotNull()
private String apiProtocl;
@ApiModelProperty(value = "api返回数据样例")
private String returnDataExample;
@ApiModelProperty(value = "返回类型 json/flow")
private String returnType;
@ApiModelProperty(value = "加密方式 MD5/RSA")
private String encryMode;
@ApiModelProperty(value = "功能")
private String apiFunction;
@ApiModelProperty(value = "创建人", hidden = true)
private String crePerson;
@ApiModelProperty(value = "价格类型")
private String priceType;
@ApiModelProperty(value = "api类型 01:api 02: 数据包")
private String apiType;
@ApiModelProperty(value = "接口描述",required = false)
private String apiDesc;
@ApiModelProperty(value = "目标地址",required = false)
private String targetUrl;
/**
* goods表
*/
@ApiModelProperty(value = "数据名称")
private String dataName; private String dataName;
@ApiModelProperty(value = "商品分类") @ApiModelProperty(value = "商品分类")
private Long categoryId; private Long categoryId;
@ApiModelProperty(value = "场景分类")
private Long sceneId;
@ApiModelProperty(value = "目标地址")
@NotNull(message = "目标地址不能为空")
private String targetUrl;
@ApiModelProperty(value = "数据描述") @ApiModelProperty(value = "数据描述")
@NotNull(message = "数据描述不能为空")
private String dataDesc; private String dataDesc;
@ApiModelProperty(value = "商品图片") @ApiModelProperty(value = "商品图片")
@NotNull(message = "商品图片不能为空")
private String dataPicture; private String dataPicture;
@ApiModelProperty(value = "数据最大量")
@NotNull(message = "数据最大量不能为空")
@ApiModelProperty(value = "唯一数据商品标识") private String dataMaximum;
private String apiOpenId; @ApiModelProperty(value = "最大页数")
@NotNull(message = "最大页数不能为空")
@ApiModelProperty(value = "审核人" , hidden = true) private String maxPages;
private String auditPerson; @ApiModelProperty(value = "每页数据量")
@NotNull(message = "每页数据量不能为空")
private String dataSize;
@ApiModelProperty(value = "商品有限期")
@NotNull(message = "商品有限期不能为空")
private Integer goodsLimited;
@ApiModelProperty(value = "价格类型")
@NotNull(message = "价格类型不能为空")
private String priceType;
@ApiModelProperty(value = "年(元)") @ApiModelProperty(value = "年(元)")
private BigDecimal yearType; private BigDecimal yearType;
@ApiModelProperty(value = "季(元)") @ApiModelProperty(value = "季(元)")
private BigDecimal seasonType; private BigDecimal seasonType;
@ApiModelProperty(value = "月(元)") @ApiModelProperty(value = "月(元)")
private BigDecimal monthType; private BigDecimal monthType;
@ApiModelProperty(value = "次(元)") @ApiModelProperty(value = "次(元)")
private BigDecimal secondType; private BigDecimal secondType;
/** /**
* apiParam * gateway制作参数
*/ * api
@ApiModelProperty(value = "请求头")
private List<DataGoodsApiParams> reqHeaders;
@ApiModelProperty(value = "请求参数")
private List<DataGoodsApiParams> requestParam;
@ApiModelProperty(value = "响应参数")
private List<DataGoodsApiParams> responseParam;
@ApiModelProperty(value = "固定参数")
private List<DataGoodsApiParams> inboxParam;
@ApiModelProperty(value = "响应状态码参数")
public List<DataGoodsApiParams> respCode;
/**
* 接口需要的参数
*/ */
@ApiModelProperty(value = "接入类型:对应字典表key",required = true) // @ApiModelProperty(value = "api类型 01:api 02: 数据包")
@NotNull(message = "接入类型不能为空") // private String apiType;
public String joinType; // @ApiModelProperty(value = "api名称")
// private String apiName;
// @ApiModelProperty(value = "返回类型 json/flow")
// private String returnType;
// @ApiModelProperty(value = "加密方式 MD5/RSA")
// private String encryMode;
// @ApiModelProperty(value = "传输方式")
// private String transMode;
// @ApiModelProperty(value = "超时时间")
// private String overTime;
// @ApiModelProperty(value = "api请求协议:http,https")
// private String apiProtocl;
@ApiModelProperty(value = "是否分页")
@NotNull(message = "是否分页不能为空")
public String page;
} }
package com.jz.manage.moduls.controller.goods.bean.request;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
@ApiModel(value = "分类搜索条件请求参数")
@Data
public class DataGoodsByCategoryReq extends BasePageBean {
@ApiModelProperty("分类搜索")
private String search;
}
package com.jz.manage.moduls.controller.goods.bean.request;
import com.sun.org.apache.xpath.internal.operations.Bool;
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/2
* @Version:
*/
@ApiModel
@Data
public class DataGoodsByRoleReq implements Serializable {
@ApiModelProperty(value = "商品id")
@NotNull(message = "商品id不能为空!")
private Long dataGoodsId;
@ApiModelProperty(value = "未登录用户 01开启,02关闭")
private String logOutUser;
@ApiModelProperty(value = "已登陆认证用户 01开启,02关闭")
private String unverifiedUser;
@ApiModelProperty(value = "已认证用户 01开启,02关闭")
private String authenticatedUser;
}
...@@ -47,5 +47,12 @@ public class DataGoodsListRequest extends BasePageBean { ...@@ -47,5 +47,12 @@ public class DataGoodsListRequest extends BasePageBean {
@ApiModelProperty(value = "数据类型") @ApiModelProperty(value = "数据类型")
private String apiType; private String apiType;
@ApiModelProperty(value = "搜索")
private String search;
@ApiModelProperty(value = "上传时间")
private String creTime;
@ApiModelProperty(value = "更新时间")
private String uptTime;
} }
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/7
* @Version:
*/
@ApiModel
@Data
public class DemandAuditReq implements Serializable {
@ApiModelProperty("需求id")
@NotNull(message = "需求id不能为空")
private Long demandId;
@ApiModelProperty("审核状态 01通过 02不通过")
@NotNull(message = "审核状态不能为空")
private String auditStatus;
@ApiModelProperty("审核说明")
private String rejectReason;
}
package com.jz.manage.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;
@ApiModelProperty("审核时间")
private String auditTime;
}
package com.jz.manage.moduls.controller.goods.bean.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/5
* @Version:
*/
@ApiModel("企业商品管理--续费--请求参数")
@Data
public class DepartmentByRenewReq implements Serializable {
@ApiModelProperty(value = "企业id")
@NotNull(message = "企业id不能为空")
private Long departmentId;
@ApiModelProperty(value = "商品id")
@NotNull(message = "商品id不能为空")
private Long dataGoodsId;
@ApiModelProperty(value = "资产id")
@NotNull(message = "资产id不能为空")
private Long assetsId;
@ApiModelProperty("用户id")
@NotNull(message = "用户id不能为空")
private Long customerId;
@ApiModelProperty(value = "商品金额")
private BigDecimal dataPrice;
@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 invalidTime;
@ApiModelProperty(value = "订单id")
@NotNull(message = "订单id不能为空")
private Long orderId;
@ApiModelProperty(value = "购买方式 01年,02季,03月,04次")
@NotNull(message = "购买方式不能为空")
private String purchaseMethod;
}
package com.jz.manage.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/5
* @Version:
*/
@ApiModel("企业商品列表请求参数")
@Data
public class DepartmentDataGoodsReq extends BasePageBean implements Serializable {
@ApiModelProperty("搜索条件")
private String search;
@ApiModelProperty("分类id")
private Long categoryId;
}
package com.jz.manage.moduls.controller.goods.bean.request;
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 DepartmentGoodsReq implements Serializable {
@ApiModelProperty("搜索条件")
private String search;
@ApiModelProperty("企业id")
private Long departmentId;
@ApiModelProperty("商品id")
private Long dataGoodsId;
}
package com.jz.manage.moduls.controller.goods.bean.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/2
* @Version:
*/
@Data
@ApiModel
public class GoodsByAuthorizationReq implements Serializable {
@ApiModelProperty(value = "商品id")
private Long dataGoodsId;
@ApiModelProperty(value = "企业id")
private Long departmentId;
@ApiModelProperty(value = "用户id")
private Long customerId;
@ApiModelProperty(value = "购买方式 01年,02季,03月,04次")
private String purchaseMethod;
@ApiModelProperty(value = "生效期")
private Date takeEffectTime;
@ApiModelProperty(value = "失效期")
private Date invalidTime;
@ApiModelProperty(value = "apiKey")
private String apiKey;
@ApiModelProperty(value = "商品金额")
private BigDecimal dataPrice;
@ApiModelProperty(value = "价格类型")
private String priceType;
@ApiModelProperty(value = "资产账户id")
private Long assetsId;
}
package com.jz.manage.moduls.controller.goods.bean.request;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import java.io.Serializable;
/**
* @author ZC
* @PACKAGE_NAME: com.jz.dm.models.resp
* @PROJECT_NAME: jz-dm-parent
* @NAME: SendDataReq
* @DATE: 2021-1-29/17:35
* @DAY_NAME_SHORT: 周五
* @Description:
**/
@Data
@ApiModel
public class SendDataReq extends BasePageBean implements Serializable {
@ApiModelProperty(value = "关键词")
private String key;
@ApiModelProperty(value = "数据类型")
private String apiType;
@ApiModelProperty(value = "数据格式:Json Flow")
private String outputType;
@ApiModelProperty(value = "创建开始时间")
private String startTime;
@ApiModelProperty(value = "创建结束时间")
private String endTime;
}
package com.jz.manage.moduls.controller.order.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/3
* @Version:
*/
@ApiModel("/商品是否授权企业返回参数")
@Data
public class OrderAndAuthorizedDto implements Serializable {
@ApiModelProperty("是否有效:01有效,02无效")
private String goodsState;
@ApiModelProperty("用户id")
private Long customerId;
}
package com.jz.manage.moduls.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;
import java.util.Date;
/**
* @ClassName: 广告实体对象
* @Author: Carl
* @Date: 2021/2/7
* @Version:
*/
@ApiModel
@Data
@TableName("t_banner")
public class Banner implements Serializable {
private static final long serialVersionUID = 596897642919072871L;
@ApiModelProperty(value = "广告id")
@TableId(value = "banner_id", type = IdType.AUTO)
private Long bannerId;
@ApiModelProperty(value = "广告名称")
@TableField("banner_name")
private String bannerName;
@ApiModelProperty(value = "广告位置")
@TableField("banner_location")
private String bannerLocation;
@ApiModelProperty(value = "广告位描述")
@TableField("banner_desc")
private String bannerDesc;
@ApiModelProperty(value = "广告链接")
@TableField("banner_url")
private String bannerUrl;
@ApiModelProperty(value = "排序")
@TableField("sort")
private Long sort;
@ApiModelProperty(value = "开始时间")
@TableField("banner_start")
private Date bannerStart;
@ApiModelProperty(value = "结束时间")
@TableField("banner_end")
private Date bannerEnd;
@ApiModelProperty(value = "创建时间")
@TableField("cre_time")
private Date creTime;
@ApiModelProperty(value = "创建人")
@TableField("cre_person")
private String crePerson;
@ApiModelProperty(value = "更新时间")
@TableField("upt_time")
private Date uptTime;
@ApiModelProperty(value = "更新人")
@TableField("upt_person")
private String uptPerson;
@ApiModelProperty(value = "删除标识")
@TableField("del_flag")
private String delFlag;
}
package com.jz.manage.moduls.entity; package com.jz.manage.moduls.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 com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -14,325 +18,157 @@ import java.util.Date; ...@@ -14,325 +18,157 @@ import java.util.Date;
* @author Bellamy * @author Bellamy
* @since 2020-12-01 10:41:30 * @since 2020-12-01 10:41:30
*/ */
@TableName("t_data_goods") @TableName(value = "t_data_goods",autoResultMap = true)
@ApiModel @ApiModel
@Data
public class DataGoods implements Serializable { public class DataGoods implements Serializable {
private static final long serialVersionUID = 938517475031285541L; private static final long serialVersionUID = 938517475031285541L;
/** /**
* 数据商品id * 数据商品id
*/ */
@TableId(value = "data_goods_id", type = IdType.AUTO)
private Long dataGoodsId; private Long dataGoodsId;
/** /**
* 商品分类id(行业) * 商品分类id(行业)
*/ */
@TableField("category_id")
private Long categoryId; private Long categoryId;
@TableField("scene_id")
private Long sceneId;
/** /**
* 数据商户id * 数据商户id
*/ */
@TableField("user_id")
private Long userId; private Long userId;
@TableField("api_openid")
private String apiOpenid;
/** /**
* 数据商品名称 * 数据商品名称
*/ */
@TableField("data_name")
private String dataName; private String dataName;
/** /**
* 数据类型:01api,02数据包 * 数据类型:01api,02数据包
*/ */
@TableField("data_type")
private String dataType; private String dataType;
/** /**
* 数据商品标签 * 数据商品标签
*/ */
@TableField("data_label")
private String dataLabel; private String dataLabel;
/** /**
* 数据商品图片 * 数据商品图片
*/ */
@TableField("data_picture")
private String dataPicture; private String dataPicture;
/** /**
* 数据商品价格 * 数据商品价格
*/ */
@TableField("data_price")
private BigDecimal dataPrice; private BigDecimal dataPrice;
/** /**
* 优惠价格 * 优惠价格
*/ */
@TableField("discount_price")
private BigDecimal discountPrice; private BigDecimal discountPrice;
/** /**
* 价格类型:01免费,02收费 * 价格类型:01免费,02收费
*/ */
@TableField("price_type")
private String priceType; private String priceType;
/** /**
* 商品规格 * 商品规格
*/ */
@TableField("goods")
private String goodsStandards; private String goodsStandards;
/** /**
* 数据状态:01预售,02在售中,03下架,04上架 * 数据状态:01预售,02在售中,03下架,04上架
*/ */
@TableField("data_status")
private String dataStatus; private String dataStatus;
/** /**
* 审核状态:01待审核,02已审核,03未通过 * 审核状态:01待审核,02已审核,03未通过
*/ */
@TableField("audit_status")
private String auditStatus; private String auditStatus;
/** /**
* 清洗规则(脱敏校验) * 清洗规则(脱敏校验)
*/ */
@TableField("clean_rule")
private String cleanRule; private String cleanRule;
/** /**
* 驳回原因 * 驳回原因
*/ */
@TableField("reject_reason")
private String rejectReason; private String rejectReason;
@ApiModelProperty(value = "唯一数据商品标识")
private String apiOpenId;
/** /**
* 审核人 * 审核人
*/ */
@TableField("audit_person")
private String auditPerson; private String auditPerson;
/** /**
* 审核时间 * 审核时间
*/ */
@TableField("audit_time")
private Date auditTime; private Date auditTime;
/** /**
* 创建时间 * 创建时间
*/ */
@TableField("cre_time")
private Date creTime; private Date creTime;
/** /**
* 创建人 * 创建人
*/ */
@TableField("cre_person")
private String crePerson; private String crePerson;
/** /**
* 更新时间 * 更新时间
*/ */
@TableField("upt_time")
private Date uptTime; private Date uptTime;
/** /**
* 更新人 * 更新人
*/ */
@TableField("upt_person")
private String uptPerson; private String uptPerson;
/** /**
* 删除标识 * 删除标识
*/ */
@TableField("del_flag")
private String delFlag; private String delFlag;
/** /**
* 年(元) * 年(元)
*/ */
@TableField("year_type")
private BigDecimal yearType; private BigDecimal yearType;
/** /**
* 季(元) * 季(元)
*/ */
@TableField("season_type")
private BigDecimal seasonType; private BigDecimal seasonType;
/** /**
* 月(元) * 月(元)
*/ */
@TableField("month_type")
private BigDecimal monthType; private BigDecimal monthType;
/** /**
* 次(元) * 次(元)
*/ */
@TableField("second_type")
private BigDecimal secondType; private BigDecimal secondType;
@TableField("data_desc")
private String dataDesc;
@TableField("data_maximum")
private String dataMaximum;
public Long getDataGoodsId() { @TableField("max_pages")
return dataGoodsId; private String maxPages;
}
public void setDataGoodsId(Long dataGoodsId) {
this.dataGoodsId = dataGoodsId;
}
public Long getCategoryId() {
return categoryId;
}
public void setCategoryId(Long categoryId) {
this.categoryId = categoryId;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getDataName() {
return dataName;
}
public void setDataName(String dataName) {
this.dataName = dataName;
}
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
public String getDataLabel() {
return dataLabel;
}
public void setDataLabel(String dataLabel) {
this.dataLabel = dataLabel;
}
public String getDataPicture() {
return dataPicture;
}
public void setDataPicture(String dataPicture) {
this.dataPicture = dataPicture;
}
public BigDecimal getDataPrice() {
return dataPrice;
}
public void setDataPrice(BigDecimal dataPrice) {
this.dataPrice = dataPrice;
}
public BigDecimal getDiscountPrice() {
return discountPrice;
}
public void setDiscountPrice(BigDecimal discountPrice) {
this.discountPrice = discountPrice;
}
public String getPriceType() {
return priceType;
}
public void setPriceType(String priceType) {
this.priceType = priceType;
}
public String getGoodsStandards() {
return goodsStandards;
}
public void setGoodsStandards(String goodsStandards) {
this.goodsStandards = goodsStandards;
}
public String getDataStatus() {
return dataStatus;
}
public void setDataStatus(String dataStatus) {
this.dataStatus = dataStatus;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
public String getCleanRule() {
return cleanRule;
}
public void setCleanRule(String cleanRule) {
this.cleanRule = cleanRule;
}
public String getRejectReason() {
return rejectReason;
}
public void setRejectReason(String rejectReason) {
this.rejectReason = rejectReason;
}
public String getAuditPerson() {
return auditPerson;
}
public void setAuditPerson(String auditPerson) {
this.auditPerson = auditPerson;
}
public Date getAuditTime() {
return auditTime;
}
public void setAuditTime(Date auditTime) {
this.auditTime = auditTime;
}
public Date getCreTime() {
return creTime;
}
public void setCreTime(Date creTime) {
this.creTime = creTime;
}
public String getCrePerson() {
return crePerson;
}
public void setCrePerson(String crePerson) {
this.crePerson = crePerson;
}
public Date getUptTime() {
return uptTime;
}
public void setUptTime(Date uptTime) {
this.uptTime = uptTime;
}
public String getUptPerson() {
return uptPerson;
}
public void setUptPerson(String uptPerson) {
this.uptPerson = uptPerson;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public BigDecimal getYearType() {
return yearType;
}
public void setYearType(BigDecimal yearType) {
this.yearType = yearType;
}
public BigDecimal getSeasonType() {
return seasonType;
}
public void setSeasonType(BigDecimal seasonType) {
this.seasonType = seasonType;
}
public BigDecimal getMonthType() {
return monthType;
}
public void setMonthType(BigDecimal monthType) {
this.monthType = monthType;
}
public BigDecimal getSecondType() {
return secondType;
}
public void setSecondType(BigDecimal secondType) {
this.secondType = secondType;
}
@TableField("data_size")
private String dataSize;
@TableField("goods_limited")
private Date goodsLimited;
} }
\ No newline at end of file
package com.jz.manage.moduls.entity; package com.jz.manage.moduls.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 com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
...@@ -23,31 +27,65 @@ public class DataGoodsCategory implements Serializable { ...@@ -23,31 +27,65 @@ public class DataGoodsCategory implements Serializable {
/** /**
* 商品分类id * 商品分类id
*/ */
@TableId(value = "category_id", type = IdType.AUTO)
@ApiModelProperty(value = "商品分类id")
private Long categoryId; private Long categoryId;
/** /**
* 分类名称 * 分类名称
*/ */
@TableField("category_name")
@ApiModelProperty(value = "分类名称")
private String categoryName; private String categoryName;
/** /**
* 父级分类id * 父级分类id
*/ */
@TableField("parent_id")
@ApiModelProperty(value = "父级分类id")
private Long parentId; private Long parentId;
/** /**
* 是否为子节点:Y是,N否 * 是否为子节点:Y是,N否
*/ */
@TableField("if_child")
@ApiModelProperty(value = "是否为子节点")
private String ifChild; private String ifChild;
/** /**
* 创建时间 * 创建时间
*/ */
@TableField("cre_time")
@ApiModelProperty(value = "创建时间")
private Date creTime; private Date creTime;
@TableField("cre_person")
@ApiModelProperty(value = "创建人")
private String crePerson;
/** /**
* 更新时间 * 更新时间
*/ */
@TableField("upt_time")
@ApiModelProperty(value = "更新时间")
private Date uptTime; private Date uptTime;
private String delFlag; @TableField("upt_person")
@ApiModelProperty(value = "更新人")
private String uptPerson;
@ApiModelProperty(value = "分类描述")
@TableField("category_desc")
private String categoryDesc;
@ApiModelProperty("分类图片")
@TableField("category_picture")
private String categoryPicture;
@ApiModelProperty("分类位置")
@TableField("category_location")
private String categoryLocation;
@TableField("del_flag")
@ApiModelProperty(value = "是否删除")
private String delFlag;
@TableField(exist = false)
private List<DataGoodsCategory> children; private List<DataGoodsCategory> children;
......
package com.jz.manage.moduls.entity; package com.jz.manage.moduls.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
...@@ -14,20 +17,19 @@ import java.util.Date; ...@@ -14,20 +17,19 @@ import java.util.Date;
*/ */
@TableName("t_demand") @TableName("t_demand")
@ApiModel @ApiModel
@Data
public class Demand implements Serializable { public class Demand implements Serializable {
private static final long serialVersionUID = 119352065467540895L; private static final long serialVersionUID = 119352065467540895L;
/** /**
* 需求id * 需求id
*/ */
@TableId(value = "demand_id", type = IdType.AUTO)
private Long demandId; private Long demandId;
/** /**
* 用户id * 用户id
*/ */
private Long customerId; private Long customerId;
/**
* 商品分类id(行业)
*/
private Long categoryId;
/** /**
* 需求名称 * 需求名称
*/ */
...@@ -36,14 +38,7 @@ public class Demand implements Serializable { ...@@ -36,14 +38,7 @@ public class Demand implements Serializable {
* 需求描述 * 需求描述
*/ */
private String demandDescribe; private String demandDescribe;
/**
* 数据类型:01api,02数据包
*/
private Long dataType;
/**
* 发布时间
*/
private Date releaseTime;
/** /**
* 审核状态:01待审核,02已审核,03未通过 * 审核状态:01待审核,02已审核,03未通过
*/ */
...@@ -60,10 +55,7 @@ public class Demand implements Serializable { ...@@ -60,10 +55,7 @@ public class Demand implements Serializable {
* 驳回原因 * 驳回原因
*/ */
private String rejectReason; private String rejectReason;
/**
* 购买方式
*/
private String purchaseMethod;
/** /**
* 创建人 * 创建人
*/ */
...@@ -72,142 +64,12 @@ public class Demand implements Serializable { ...@@ -72,142 +64,12 @@ public class Demand implements Serializable {
* 创建时间 * 创建时间
*/ */
private Date creTime; private Date creTime;
/**
* 展示状态:01展示,02不展示
*/
private String ifShow;
/** /**
* 删除标识:Y是,N否 * 删除标识:Y是,N否
*/ */
private String delFlag; private String delFlag;
public Long getDemandId() {
return demandId;
}
public void setDemandId(Long demandId) {
this.demandId = demandId;
}
public Long getCustomerId() {
return customerId;
}
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
public Long getCategoryId() {
return categoryId;
}
public void setCategoryId(Long categoryId) {
this.categoryId = categoryId;
}
public String getDemandName() {
return demandName;
}
public void setDemandName(String demandName) {
this.demandName = demandName;
}
public String getDemandDescribe() {
return demandDescribe;
}
public void setDemandDescribe(String demandDescribe) {
this.demandDescribe = demandDescribe;
}
public Long getDataType() {
return dataType;
}
public void setDataType(Long dataType) {
this.dataType = dataType;
}
public Date getReleaseTime() {
return releaseTime;
}
public void setReleaseTime(Date releaseTime) {
this.releaseTime = releaseTime;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
public String getAuditPerson() {
return auditPerson;
}
public void setAuditPerson(String auditPerson) {
this.auditPerson = auditPerson;
}
public Date getAuditTime() {
return auditTime;
}
public void setAuditTime(Date auditTime) {
this.auditTime = auditTime;
}
public String getRejectReason() {
return rejectReason;
}
public void setRejectReason(String rejectReason) {
this.rejectReason = rejectReason;
}
public String getPurchaseMethod() {
return purchaseMethod;
}
public void setPurchaseMethod(String purchaseMethod) {
this.purchaseMethod = purchaseMethod;
}
public String getCrePerson() {
return crePerson;
}
public void setCrePerson(String crePerson) {
this.crePerson = crePerson;
}
public Date getCreTime() {
return creTime;
}
public void setCreTime(Date creTime) {
this.creTime = creTime;
}
public String getIfShow() {
return ifShow;
}
public void setIfShow(String ifShow) {
this.ifShow = ifShow;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
} }
\ No newline at end of file
...@@ -3,6 +3,7 @@ package com.jz.manage.moduls.entity; ...@@ -3,6 +3,7 @@ package com.jz.manage.moduls.entity;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -16,6 +17,7 @@ import java.util.Date; ...@@ -16,6 +17,7 @@ import java.util.Date;
*/ */
@TableName("t_finance_trade_flow") @TableName("t_finance_trade_flow")
@ApiModel @ApiModel
@Data
public class FinanceTradeFlow implements Serializable { public class FinanceTradeFlow implements Serializable {
private static final long serialVersionUID = -55257582310832314L; private static final long serialVersionUID = -55257582310832314L;
/** /**
...@@ -71,99 +73,4 @@ public class FinanceTradeFlow implements Serializable { ...@@ -71,99 +73,4 @@ public class FinanceTradeFlow implements Serializable {
private BigDecimal balanceMoney; private BigDecimal balanceMoney;
public Long getTradeFlowId() {
return tradeFlowId;
}
public void setTradeFlowId(Long tradeFlowId) {
this.tradeFlowId = tradeFlowId;
}
public Long getOrderId() {
return orderId;
}
public void setOrderId(Long orderId) {
this.orderId = orderId;
}
public Long getCashOutId() {
return cashOutId;
}
public void setCashOutId(Long cashOutId) {
this.cashOutId = cashOutId;
}
public Long getCustomerBalanceId() {
return customerBalanceId;
}
public void setCustomerBalanceId(Long customerBalanceId) {
this.customerBalanceId = customerBalanceId;
}
public String getTradeFlowNumber() {
return tradeFlowNumber;
}
public void setTradeFlowNumber(String tradeFlowNumber) {
this.tradeFlowNumber = tradeFlowNumber;
}
public BigDecimal getTradeMoney() {
return tradeMoney;
}
public void setTradeMoney(BigDecimal tradeMoney) {
this.tradeMoney = tradeMoney;
}
public String getTradeType() {
return tradeType;
}
public void setTradeType(String tradeType) {
this.tradeType = tradeType;
}
public Date getCreTime() {
return creTime;
}
public void setCreTime(Date creTime) {
this.creTime = creTime;
}
public String getCrePerson() {
return crePerson;
}
public void setCrePerson(String crePerson) {
this.crePerson = crePerson;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public Long getAssetsId() {
return assetsId;
}
public void setAssetsId(Long assetsId) {
this.assetsId = assetsId;
}
public BigDecimal getBalanceMoney() {
return balanceMoney;
}
public void setBalanceMoney(BigDecimal balanceMoney) {
this.balanceMoney = balanceMoney;
}
} }
\ No newline at end of file
package com.jz.manage.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 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
@TableName("t_menu_config")
public class MenuConfig implements Serializable {
private static final long serialVersionUID = -5307571642090373317L;
@ApiModelProperty(value = "广告id")
@TableId(value = "config_id", type = IdType.AUTO)
private Long configId;
@ApiModelProperty(value = "菜单名称")
private String configName;
@ApiModelProperty(value = "菜单路径")
private String configUrl;
@ApiModelProperty(value = "创建时间")
private Date creTime;
@ApiModelProperty(value = "创建人")
private String crePerson;
@ApiModelProperty(value = "更新时间")
private Date uptTime;
@ApiModelProperty(value = "更新人")
private String uptPerson;
@ApiModelProperty(value = "删除标识")
private String delFlag;
}
package com.jz.manage.moduls.entity; package com.jz.manage.moduls.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -15,11 +18,13 @@ import java.util.Date; ...@@ -15,11 +18,13 @@ import java.util.Date;
*/ */
@TableName("t_order") @TableName("t_order")
@ApiModel @ApiModel
@Data
public class Order implements Serializable { public class Order implements Serializable {
private static final long serialVersionUID = 651546246975691600L; private static final long serialVersionUID = 651546246975691600L;
/** /**
* 订单id * 订单id
*/ */
@TableId(value = "order_id", type = IdType.AUTO)
private Long orderId; private Long orderId;
/** /**
* 订单编号 * 订单编号
...@@ -110,189 +115,4 @@ public class Order implements Serializable { ...@@ -110,189 +115,4 @@ public class Order implements Serializable {
*/ */
private String delFlag; private String delFlag;
public Long getOrderId() {
return orderId;
}
public void setOrderId(Long orderId) {
this.orderId = orderId;
}
public String getOrderNumber() {
return orderNumber;
}
public void setOrderNumber(String orderNumber) {
this.orderNumber = orderNumber;
}
public Long getCustomerId() {
return customerId;
}
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
public String getOrderStatus() {
return orderStatus;
}
public void setOrderStatus(String orderStatus) {
this.orderStatus = orderStatus;
}
public BigDecimal getOrderMoney() {
return orderMoney;
}
public void setOrderMoney(BigDecimal orderMoney) {
this.orderMoney = orderMoney;
}
public Date getOrderTime() {
return orderTime;
}
public void setOrderTime(Date orderTime) {
this.orderTime = orderTime;
}
public Long getSellerId() {
return sellerId;
}
public void setSellerId(Long sellerId) {
this.sellerId = sellerId;
}
public BigDecimal getPaymentMoney() {
return paymentMoney;
}
public void setPaymentMoney(BigDecimal paymentMoney) {
this.paymentMoney = paymentMoney;
}
public Date getPaymentTime() {
return paymentTime;
}
public void setPaymentTime(Date paymentTime) {
this.paymentTime = paymentTime;
}
public String getPaymentMethod() {
return paymentMethod;
}
public void setPaymentMethod(String paymentMethod) {
this.paymentMethod = paymentMethod;
}
public BigDecimal getDistrictMoney() {
return districtMoney;
}
public void setDistrictMoney(BigDecimal districtMoney) {
this.districtMoney = districtMoney;
}
public String getPurchaseMethod() {
return purchaseMethod;
}
public void setPurchaseMethod(String purchaseMethod) {
this.purchaseMethod = purchaseMethod;
}
public String getGoodsToken() {
return goodsToken;
}
public void setGoodsToken(String goodsToken) {
this.goodsToken = goodsToken;
}
public String getSaltValue() {
return saltValue;
}
public void setSaltValue(String saltValue) {
this.saltValue = saltValue;
}
public String getApiKey() {
return apiKey;
}
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
public Date getTakeEffectTime() {
return takeEffectTime;
}
public void setTakeEffectTime(Date takeEffectTime) {
this.takeEffectTime = takeEffectTime;
}
public Date getInvalidTime() {
return invalidTime;
}
public void setInvalidTime(Date invalidTime) {
this.invalidTime = invalidTime;
}
public String getPriceType() {
return priceType;
}
public void setPriceType(String priceType) {
this.priceType = priceType;
}
public String getCrePerson() {
return crePerson;
}
public void setCrePerson(String crePerson) {
this.crePerson = crePerson;
}
public Date getCreTime() {
return creTime;
}
public void setCreTime(Date creTime) {
this.creTime = creTime;
}
public Date getUptTime() {
return uptTime;
}
public void setUptTime(Date uptTime) {
this.uptTime = uptTime;
}
public String getUptPerson() {
return uptPerson;
}
public void setUptPerson(String uptPerson) {
this.uptPerson = uptPerson;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
} }
\ No newline at end of file
...@@ -2,6 +2,7 @@ package com.jz.manage.moduls.entity; ...@@ -2,6 +2,7 @@ package com.jz.manage.moduls.entity;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -15,6 +16,7 @@ import java.util.Date; ...@@ -15,6 +16,7 @@ import java.util.Date;
*/ */
@TableName("t_order_payment") @TableName("t_order_payment")
@ApiModel @ApiModel
@Data
public class OrderPayment implements Serializable { public class OrderPayment implements Serializable {
private static final long serialVersionUID = -14423507905800987L; private static final long serialVersionUID = -14423507905800987L;
/** /**
...@@ -57,98 +59,12 @@ public class OrderPayment implements Serializable { ...@@ -57,98 +59,12 @@ public class OrderPayment implements Serializable {
* 创建时间 * 创建时间
*/ */
private Date creTime; private Date creTime;
private String crePerson;
/** /**
* 删除标识 * 删除标识
*/ */
private String delFlag; private String delFlag;
public Long getPaymentId() {
return paymentId;
}
public void setPaymentId(Long paymentId) {
this.paymentId = paymentId;
}
public Long getOrderId() {
return orderId;
}
public void setOrderId(Long orderId) {
this.orderId = orderId;
}
public Long getSellerId() {
return sellerId;
}
public void setSellerId(Long sellerId) {
this.sellerId = sellerId;
}
public BigDecimal getPaymentMoney() {
return paymentMoney;
}
public void setPaymentMoney(BigDecimal paymentMoney) {
this.paymentMoney = paymentMoney;
}
public Date getPaymentTime() {
return paymentTime;
}
public void setPaymentTime(Date paymentTime) {
this.paymentTime = paymentTime;
}
public String getPaymentMethod() {
return paymentMethod;
}
public void setPaymentMethod(String paymentMethod) {
this.paymentMethod = paymentMethod;
}
public BigDecimal getDistrictMoney() {
return districtMoney;
}
public void setDistrictMoney(BigDecimal districtMoney) {
this.districtMoney = districtMoney;
}
public String getPaymentStatus() {
return paymentStatus;
}
public void setPaymentStatus(String paymentStatus) {
this.paymentStatus = paymentStatus;
}
public String getPurchaseMethod() {
return purchaseMethod;
}
public void setPurchaseMethod(String purchaseMethod) {
this.purchaseMethod = purchaseMethod;
}
public Date getCreTime() {
return creTime;
}
public void setCreTime(Date creTime) {
this.creTime = creTime;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
} }
\ No newline at end of file
package com.jz.manage.moduls.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 lombok.Data;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/2
* @Version:
*/
@Data
@ApiModel
@TableName(value = "t_role_goods")
public class RoleGoods implements Serializable {
@TableId(value = "role_goods_id", type = IdType.AUTO)
private Long roleGoodsId;
@TableField("role_id")
private Long roleId;
@TableField("data_goods_id")
private Long dataGoodsId;
@TableField("del_flag")
private String delFlag;
@TableField(exist = false)
private String roleName;
}
package com.jz.manage.moduls.entity;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
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;
import java.util.Date;
/**
* @ClassName: 场景分类表
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
@TableName("t_scene_category")
@ApiModel
@Data
public class SceneCategory implements Serializable {
private static final long serialVersionUID = -6098559795341556267L;
/**
* 商品分类id
*/
@TableId(value = "scene_id", type = IdType.AUTO)
@ApiModelProperty(value = "场景分类id")
private Long sceneId;
/**
* 分类名称
*/
@TableField("scene_name")
@ApiModelProperty(value = "分类名称")
private String sceneName;
/**
* 父级分类id
*/
@TableField("parent_id")
@ApiModelProperty(value = "父级分类id")
private Long parentId;
/**
* 是否为子节点:Y是,N否
*/
@TableField("if_child")
@ApiModelProperty(value = "是否为子节点")
private String ifChild;
/**
* 创建时间
*/
@TableField("cre_time")
@ApiModelProperty(value = "创建时间")
private Date creTime;
@TableField("cre_person")
@ApiModelProperty(value = "创建人")
private String crePerson;
/**
* 更新时间
*/
@TableField("upt_time")
@ApiModelProperty(value = "更新时间")
private Date uptTime;
@TableField("del_flag")
@ApiModelProperty(value = "是否删除")
private String delFlag;
}
package com.jz.manage.moduls.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 lombok.Data;
import java.io.Serializable;
/**
* @ClassName: 商品-场景分类关系表
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
@TableName("t_scene_goods_category")
@Data
@ApiModel
public class SceneGoodsCategory implements Serializable {
private static final long serialVersionUID = 7794764423295187797L;
@TableId(value = "scene_category_id", type = IdType.AUTO)
private Long sceneCategoryId;
@TableField("scene_id")
private Long sceneId;
@TableField("category_id")
private Long categoryId;
@TableField("del_flag")
private String delFlag;
}
package com.jz.manage.moduls.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.base.BaseMapper;
import com.jz.manage.moduls.entity.Banner;
import org.apache.ibatis.annotations.Param;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/7
* @Version:
*/
public interface BannerDao extends BaseMapper<Banner> {
/**
* 条件查询全部广告
* @param page
* @param queryWrapper
* @return
*/
IPage<Banner> selectByList(IPage<Banner> page, @Param("ew") QueryWrapper<Banner> queryWrapper);
}
package com.jz.manage.moduls.mapper; package com.jz.manage.moduls.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.base.BaseMapper; import com.jz.common.base.BaseMapper;
import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsApiDto; import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsApiDto;
import com.jz.manage.moduls.controller.goods.bean.dto.DepartmentDataGoodsDto;
import com.jz.manage.moduls.entity.DataGoodsApi; import com.jz.manage.moduls.entity.DataGoodsApi;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -22,4 +25,6 @@ public interface DataGoodsApiDao extends BaseMapper<DataGoodsApi> { ...@@ -22,4 +25,6 @@ public interface DataGoodsApiDao extends BaseMapper<DataGoodsApi> {
* @return * @return
*/ */
List<DataGoodsApiDto> findById(@Param("dataGoodsId") Long id); List<DataGoodsApiDto> findById(@Param("dataGoodsId") Long id);
IPage<DepartmentDataGoodsDto> selectByList(IPage<DepartmentDataGoodsDto> page, @Param("ew") QueryWrapper<DepartmentDataGoodsDto> queryWrapper);
} }
\ No newline at end of file
package com.jz.manage.moduls.mapper; package com.jz.manage.moduls.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jz.common.base.BaseMapper; import com.jz.common.base.BaseMapper;
import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.goods.bean.dto.CategoryAndSceneDto;
import com.jz.manage.moduls.entity.DataGoodsCategory; import com.jz.manage.moduls.entity.DataGoodsCategory;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -15,9 +19,18 @@ import java.util.List; ...@@ -15,9 +19,18 @@ import java.util.List;
public interface DataGoodsCategoryDao extends BaseMapper<DataGoodsCategory> { public interface DataGoodsCategoryDao extends BaseMapper<DataGoodsCategory> {
List<DataGoodsCategory> findByScene();
/** /**
* 查询所有分类 * 条件查询分类
* @param categoryName
* @return * @return
*/ */
List<DataGoodsCategory> selectByList(); List<DataGoodsCategory> selectByList(@Param("categoryName") String categoryName);
CategoryAndSceneDto getCategoryDetail(@Param("categoryId") Long categoryId);
} }
\ No newline at end of file
package com.jz.manage.moduls.mapper; package com.jz.manage.moduls.mapper;
import java.util.List; import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.base.BaseMapper; import com.jz.common.base.BaseMapper;
import com.jz.common.entity.DataGoods;
import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsAuditDto; 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.DataGoodsDto;
import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsListDto; import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsListDto;
import com.jz.manage.moduls.entity.DataGoods;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
/** /**
...@@ -55,12 +55,6 @@ public interface DataGoodsDao extends BaseMapper<DataGoods> { ...@@ -55,12 +55,6 @@ public interface DataGoodsDao extends BaseMapper<DataGoods> {
*/ */
public int deleteByPrimaryKey(Long dataGoodsId)throws Exception; public int deleteByPrimaryKey(Long dataGoodsId)throws Exception;
/**条件查询数据商品
* @param param
* @return
* @throws Exception
*/
public List<DataGoodsListDto> findList(Map<String, Object> param)throws Exception;
/**主键查询数据商品 /**主键查询数据商品
* @param * @param
...@@ -82,4 +76,11 @@ public interface DataGoodsDao extends BaseMapper<DataGoods> { ...@@ -82,4 +76,11 @@ public interface DataGoodsDao extends BaseMapper<DataGoods> {
* @return * @return
*/ */
IPage<DataGoodsAuditDto> findByAudit(IPage<DataGoodsAuditDto> page, @Param("ew") QueryWrapper<DataGoodsAuditDto> queryWrapper); IPage<DataGoodsAuditDto> findByAudit(IPage<DataGoodsAuditDto> page, @Param("ew") QueryWrapper<DataGoodsAuditDto> queryWrapper);
/**条件查询数据商品
* @param pageInfoResponse
* @return
*/
IPage<DataGoodsListDto> findList(IPage<DataGoodsListDto> pageInfoResponse,@Param("ew")QueryWrapper<DataGoodsListDto> queryWrapper);
} }
\ No newline at end of file
package com.jz.manage.moduls.mapper; package com.jz.manage.moduls.mapper;
import com.jz.common.base.BaseMapper; import com.jz.common.base.BaseMapper;
import com.jz.common.entity.Demand; import com.jz.manage.moduls.entity.Demand;
/** /**
* 用户需求定制申请(TDemand)表数据库访问层 * 用户需求定制申请(TDemand)表数据库访问层
......
...@@ -10,6 +10,8 @@ import com.jz.manage.moduls.controller.customer.bean.dto.CompanyDetailsDto; ...@@ -10,6 +10,8 @@ import com.jz.manage.moduls.controller.customer.bean.dto.CompanyDetailsDto;
import com.jz.manage.moduls.controller.customer.bean.dto.EnterpriseAuditDto; import com.jz.manage.moduls.controller.customer.bean.dto.EnterpriseAuditDto;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* 企业(TDepartment)表数据库访问层 * 企业(TDepartment)表数据库访问层
* *
...@@ -37,5 +39,5 @@ public interface DepartmentDao extends BaseMapper<Department> { ...@@ -37,5 +39,5 @@ public interface DepartmentDao extends BaseMapper<Department> {
* @param query * @param query
* @return * @return
*/ */
DepartmentAssetsDto selectByDepartment(@Param("ew")QueryWrapper<DepartmentAssetsDto> query); List<DepartmentAssetsDto> selectByDepartment(@Param("ew")QueryWrapper<DepartmentAssetsDto> query);
} }
\ No newline at end of file
package com.jz.manage.moduls.mapper;
import com.jz.common.base.BaseMapper;
import com.jz.manage.moduls.entity.MenuConfig;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/7
* @Version:
*/
public interface MenuConfigDao extends BaseMapper<MenuConfig> {
}
...@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.base.BaseMapper; import com.jz.common.base.BaseMapper;
import com.jz.manage.moduls.controller.finance.platForm.dto.MoneyAndOrderTotalDto; import com.jz.manage.moduls.controller.finance.platForm.dto.MoneyAndOrderTotalDto;
import com.jz.manage.moduls.controller.goods.bean.dto.DataAndOrderDto;
import com.jz.manage.moduls.controller.order.bean.dto.OrderAndAuthorizedDto;
import com.jz.manage.moduls.controller.order.bean.dto.OrderDetailDto; import com.jz.manage.moduls.controller.order.bean.dto.OrderDetailDto;
import com.jz.manage.moduls.controller.order.bean.dto.OrderDto; import com.jz.manage.moduls.controller.order.bean.dto.OrderDto;
import com.jz.manage.moduls.entity.Order; import com.jz.manage.moduls.entity.Order;
...@@ -41,4 +43,19 @@ public interface OrderDao extends BaseMapper<Order> { ...@@ -41,4 +43,19 @@ public interface OrderDao extends BaseMapper<Order> {
* @return * @return
*/ */
IPage<OrderDto> queryListOrderInfo(IPage<OrderDto> page, @Param("ew") QueryWrapper<OrderDto> query); IPage<OrderDto> queryListOrderInfo(IPage<OrderDto> page, @Param("ew") QueryWrapper<OrderDto> query);
/**
* 查询是否授权给企业使用
* @param goodsId
* @return
*/
DataAndOrderDto selectByGoods(@Param("goodsId") Long goodsId);
/**
*
* @param customerId
* @param dataGoodsId
* @return
*/
OrderAndAuthorizedDto isAuthorization(@Param("customerId") Long customerId,@Param("dataGoodsId") Long dataGoodsId);
} }
\ No newline at end of file
package com.jz.manage.moduls.mapper;
import com.jz.common.base.BaseMapper;
import com.jz.manage.moduls.entity.RoleGoods;
import org.apache.ibatis.annotations.Param;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/2
* @Version:
*/
public interface RoleGoodsDao extends BaseMapper<RoleGoods> {
/**
* 获取商品权限
* @param dataGoodsId
* @return
*/
RoleGoods findByRole(@Param("dataGoodsId") Long dataGoodsId);
}
package com.jz.manage.moduls.mapper;
import com.jz.common.base.BaseMapper;
import com.jz.manage.moduls.entity.SceneCategory;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
public interface SceneCategoryDao extends BaseMapper<SceneCategory> {
}
package com.jz.manage.moduls.mapper;
import com.jz.common.base.BaseMapper;
import com.jz.manage.moduls.entity.SceneGoodsCategory;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
public interface SceneGoodsCategoryDao extends BaseMapper<SceneGoodsCategory> {
}
package com.jz.manage.moduls.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.utils.Result;
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;
/**
* @ClassName: 广告配置表服务接口
* @Author: Carl
* @Date: 2021/2/7
* @Version:
*/
public interface BannerServer {
/**
* 查询全部广告
* @return
*/
Result<IPage<Banner>> findList(BannerConfigListReq req);
/**
* 查询广告
* @param bannerId
* @return
*/
Result findByBanner(Long bannerId);
/**
* 新增广告
* @param req
* @return
*/
Result addBanner(BannerAddAndEditReq req);
/**
* 编辑广告
* @param req
* @return
*/
Result editBanner(BannerAddAndEditReq req);
/**
* 删除广告
* @param bannerId
* @return
*/
Result deleteBanner(Long bannerId);
}
package com.jz.manage.moduls.service; package com.jz.manage.moduls.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.goods.bean.dto.DepartmentDataGoodsDto;
import com.jz.manage.moduls.controller.goods.bean.request.DataApiUpReq; import com.jz.manage.moduls.controller.goods.bean.request.DataApiUpReq;
import com.jz.manage.moduls.controller.goods.bean.request.DepartmentByRenewReq;
import com.jz.manage.moduls.controller.goods.bean.request.DepartmentDataGoodsReq;
/** /**
...@@ -19,5 +23,13 @@ public interface DataGoodsApiService { ...@@ -19,5 +23,13 @@ public interface DataGoodsApiService {
*/ */
Result selectById(Long id) throws Exception; Result selectById(Long id) throws Exception;
/**
* 条件查询企业商品列表
* @param req
* @return
*/
Result<IPage<DepartmentDataGoodsDto>> findByDepartmentGoods(DepartmentDataGoodsReq req);
Result DepartmentByRenew(DepartmentByRenewReq req) throws Exception;
} }
\ No newline at end of file
package com.jz.manage.moduls.service; package com.jz.manage.moduls.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
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.entity.DataGoodsCategory;
import java.util.List; import java.util.List;
...@@ -18,5 +23,46 @@ public interface DataGoodsCategoryService { ...@@ -18,5 +23,46 @@ public interface DataGoodsCategoryService {
* 查询所有的商品分类 * 查询所有的商品分类
* @return * @return
*/ */
Result findCategory(); Result<List<DataGoodsCategory>> findByCategory() throws Exception;
/**
* 查询场景分类
* @return
*/
Result findByScene();
/**
* 添加一级分类
* @param category
* @return
*/
Result addCategory (AddCateGoryReq category)throws Exception;
/**
* 编辑分类
* @param category
* @return
*/
Result editCategory(AddCateGoryReq category) throws Exception;
/**
* 条件查询分类
* @param search
* @return
*/
Result selectByCategory(String search);
/**
* 查询分类详情
* @param req
* @return
*/
Result getCategoryDetail(CategoryDetailReq req);
/**
* 删除分类
* @param req
* @return
*/
Result deleteByCategory(CategoryAndSceneReq req);
} }
\ No newline at end of file
...@@ -5,13 +5,13 @@ import javax.servlet.http.HttpServletRequest; ...@@ -5,13 +5,13 @@ import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.bean.BaseBeanResponse; import com.jz.common.bean.BaseBeanResponse;
import com.jz.common.bean.BaseResponse; import com.jz.common.bean.BaseResponse;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.entity.DataGoods;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsAuditDto; 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.DataGoodsDto;
import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsListDto; import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsListDto;
import com.jz.manage.moduls.controller.goods.bean.request.*; import com.jz.manage.moduls.controller.goods.bean.request.*;
import com.jz.manage.moduls.entity.DataGoods;
/** /**
...@@ -28,7 +28,7 @@ public interface DataGoodsService { ...@@ -28,7 +28,7 @@ public interface DataGoodsService {
* @return * @return
* @throws Exception * @throws Exception
*/ */
public PageInfoResponse<DataGoodsListDto> findList(DataGoodsListRequest dataGoodsListRequest, HttpServletRequest httpRequest)throws Exception; public Result<IPage<DataGoodsListDto>> findList(DataGoodsListRequest dataGoodsListRequest, HttpServletRequest httpRequest)throws Exception;
/**新增数据商品 /**新增数据商品
...@@ -67,7 +67,13 @@ public interface DataGoodsService { ...@@ -67,7 +67,13 @@ public interface DataGoodsService {
*/ */
public BaseResponse deleteById(DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest)throws Exception; public BaseResponse deleteById(DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest)throws Exception;
Result editStatus(Long goodsId, Long statusId); /**
* 商品上下级管理
* @param goodsId
* @param statusId
* @return
*/
Result editStatus(Long goodsId, String statusId) throws Exception;
/** /**
* 列表查询审核数据商品 * 列表查询审核数据商品
...@@ -84,6 +90,61 @@ public interface DataGoodsService { ...@@ -84,6 +90,61 @@ public interface DataGoodsService {
*/ */
Result auditDataGoods(DataGoodsAuditReq req); Result auditDataGoods(DataGoodsAuditReq req);
/**
* 获取api列表
* @return
*/
Result getAPIList(SendDataReq req);
/**
* 获取API详情
* @param req
* @return
*/
Result getApiInterfaceDetail(ApiInterfaceDetailReq req);
/**
* 制作商品
* @param req
* @return
*/
Result makeByGoods(DataApiUpReq req) throws Exception;
/**
* 浏览授权
* @param roleReq
* @return
*/
Result browseByAuthorization(DataGoodsByRoleReq roleReq);
/**
* 查询授权
* @param dataGoodsId
* @return
*/
Result findByAuthorization(Long dataGoodsId);
/**
* 查询商品详情
* @param id
* @return
*/
Result selectById(Long id);
/**
* 使用授权
* @param req
* @return
*/
Result useByAuthorization(GoodsByAuthorizationReq req) throws Exception;
/**
* 查询企业
* @return
*/
Result findByDepartment(DepartmentGoodsReq req);
// Result getJoinType(String parentKey); // Result getJoinType(String parentKey);
} }
\ No newline at end of file
package com.jz.manage.moduls.service; package com.jz.manage.moduls.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.utils.Result;
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;
/** /**
* 用户需求定制申请(TDemand)表服务接口 * 用户需求定制申请(TDemand)表服务接口
* *
...@@ -9,5 +15,24 @@ package com.jz.manage.moduls.service; ...@@ -9,5 +15,24 @@ package com.jz.manage.moduls.service;
public interface DemandService { public interface DemandService {
/**
* 条件查询需求审核列表
* @param req
* @return
*/
Result<IPage<Demand>> findList(DemandListReq req);
/**
* 查看需求审核详情
* @param demandId
* @return
*/
Result findByDemand(Long demandId);
/**
* 审核需求
* @param req
* @return
*/
Result auditDemand(DemandAuditReq req);
} }
\ No newline at end of file
package com.jz.manage.moduls.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.utils.Result;
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;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/7
* @Version:
*/
public interface MenuConfigServer {
/**
* 查询全部菜单
* @return
*/
Result findList();
/**
* 编辑菜单
* @param req
* @return
*/
Result editUrl(MenuConfigReq req);
/**
* 条件分类配置
* @param req
* @return
*/
Result<IPage<DataGoodsCategory>> findCategory(CategoryConfigReq req);
/**
* 编辑分类配置
* @param req
* @return
*/
Result editCategory(CategoryConfigEditReq req);
}
package com.jz.manage.moduls.service;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/2
* @Version:
*/
public interface RoleGoodsService {
}
package com.jz.manage.moduls.service;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
public interface SceneCategoryService {
}
package com.jz.manage.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.SysUserDto;
import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultMsg;
import com.jz.common.enums.DelFlagEnum;
import com.jz.common.utils.DateUtils;
import com.jz.common.utils.Result;
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.mapper.BannerDao;
import com.jz.manage.moduls.service.BannerServer;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/7
* @Version:
*/
@Service("bannerServer")
public class BannerServerImpl implements BannerServer {
@Autowired
private BannerDao bannerDao;
@Autowired
private RedisTemplate redisTemplate;
/**
* 查询全部广告
*
* @return
*/
@Override
public Result<IPage<Banner>> findList(BannerConfigListReq req) {
IPage<Banner> page = new Page<>(req.getPageNum(), req.getPageSize());
QueryWrapper<Banner> queryWrapper = new QueryWrapper<>();
if (StringUtils.isNotEmpty(req.getSearch())) {
queryWrapper.and(s -> s.like("t.bannerName", req.getSearch()));
}
if (StringUtils.isNotEmpty(req.getBannerLocation())) {
queryWrapper.eq("t.bannerLocation", req.getBannerLocation());
}
if (StringUtils.isNotEmpty(req.getBannerStatus())) {
queryWrapper.eq("t.bannerStatus", req.getBannerStatus());
}
if (StringUtils.isNotBlank(req.getBannerStart()) && StringUtils.isNotBlank(req.getBannerEnd())) {
String startTime = req.getBannerStart() + " 00:00:00";
String endTime = req.getBannerEnd() + " 23:59:59";
queryWrapper.ge("t.bannerStart",startTime);
queryWrapper.le("t.bannerEnd",endTime);
}
queryWrapper.eq("t.delFlag", DelFlagEnum.NO.getValue());
queryWrapper.orderByDesc("t.uptTime");
IPage<Banner> list = bannerDao.selectByList(page, queryWrapper);
if (list.getTotal() != 0) {
return Result.of_success(list);
}
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
/**
* 查询广告
*
* @param bannerId
* @return
*/
@Override
public Result findByBanner(Long bannerId) {
if (bannerId != null) {
QueryWrapper<Banner> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("banner_id", bannerId);
queryWrapper.eq("del_flag", DelFlagEnum.NO.getValue());
Banner banner = bannerDao.selectOne(queryWrapper);
if (banner != null) {
return Result.ok(banner);
}
}
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
/**
* 新增广告
*
* @param req
* @return
*/
@Override
public Result addBanner(BannerAddAndEditReq req) {
Banner banner = new Banner();
banner.setCreTime(DateUtils.getToday());
banner.setCrePerson(userDto().getUserId() + "");
banner.setDelFlag(DelFlagEnum.NO.getValue());
BeanUtils.copyProperties(req,banner);
if (bannerDao.insert(banner) != 1) {
return Result.of_error(ResultMsg.INSERT_FAIL);
}
return Result.of_success(ResultMsg.INSERT_SUCCESS);
}
/**
* 编辑广告
*
* @param req
* @return
*/
@Override
public Result editBanner(BannerAddAndEditReq req) {
Banner banner = new Banner();
banner.setUptTime(DateUtils.getToday());
banner.setUptPerson(userDto().getUserId() + "");
BeanUtils.copyProperties(req,banner);
if (bannerDao.updateById(banner) != 1) {
return Result.of_error(ResultMsg.UPDATE_FAIL);
}
return Result.of_success(ResultMsg.UPDATE_SUCCESS);
}
/**
* 删除广告
*
* @param bannerId
* @return
*/
@Override
public Result deleteBanner(Long bannerId) {
QueryWrapper<Banner> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("banner_id", bannerId);
queryWrapper.eq("del_flag", DelFlagEnum.NO.getValue());
Banner banner = bannerDao.selectOne(queryWrapper);
if (banner != null) {
banner.setDelFlag(DelFlagEnum.YES.getValue());
if (bannerDao.updateById(banner) != 1) {
return Result.of_error(ResultMsg.DELETE_FAIL);
}
return Result.of_error(ResultMsg.DELETE_SUCCESS);
}
return Result.of_error(ResultMsg.DELETE_FAIL);
}
public SysUserDto userDto() {
SysUserDto userDto = (SysUserDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_SYS);
return userDto;
}
}
package com.jz.manage.moduls.service.impl; package com.jz.manage.moduls.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jz.common.bean.SysUserDto;
import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultMsg; import com.jz.common.constant.ResultMsg;
import com.jz.common.utils.Result; import com.jz.common.enums.DelFlagEnum;
import com.jz.common.utils.StatusCode; import com.jz.common.enums.PaymentMethodEnum;
import com.jz.common.enums.TradeFlowEnum;
import com.jz.common.exception.ResponseException;
import com.jz.common.utils.*;
import com.jz.manage.moduls.controller.goods.bean.dto.DataBasicDto; import com.jz.manage.moduls.controller.goods.bean.dto.DataBasicDto;
import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsApiDto; import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsApiDto;
import com.jz.manage.moduls.controller.goods.bean.dto.DataInterfaceDto; import com.jz.manage.moduls.controller.goods.bean.dto.DataInterfaceDto;
import com.jz.manage.moduls.mapper.DataGoodsApiDao; import com.jz.manage.moduls.controller.goods.bean.dto.DepartmentDataGoodsDto;
import com.jz.manage.moduls.controller.goods.bean.request.AuthRenewUpdateReq;
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.controller.goods.bean.request.GoodsByAuthorizationReq;
import com.jz.manage.moduls.entity.FinanceCustomerAssets;
import com.jz.manage.moduls.entity.FinanceTradeFlow;
import com.jz.manage.moduls.entity.Order;
import com.jz.manage.moduls.entity.OrderPayment;
import com.jz.manage.moduls.mapper.*;
import com.jz.manage.moduls.service.DataGoodsApiService; import com.jz.manage.moduls.service.DataGoodsApiService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -26,10 +52,27 @@ import java.util.Map; ...@@ -26,10 +52,27 @@ import java.util.Map;
*/ */
@Service("dataGoodsApiService") @Service("dataGoodsApiService")
public class DataGoodsApiServiceImpl implements DataGoodsApiService { public class DataGoodsApiServiceImpl implements DataGoodsApiService {
private static final Logger logger = LoggerFactory.getLogger(DataGoodsApiServiceImpl.class);
@Autowired @Autowired
private DataGoodsApiDao tDataGoodsApiDao; private DataGoodsApiDao tDataGoodsApiDao;
@Autowired
private OrderDao orderDao;
@Autowired
private OrderPaymentDao orderPaymentDao;
@Autowired
private FinanceTradeFlowDao financeTradeFlowDao;
@Autowired
private FinanceCustomerAssetsDao financeCustomerAssetsDao;
@Autowired
private RedisTemplate redisTemplate;
@Value("${domain.updateAuthRenew}")
private String updateAuthRenew;
/** /**
* 主键查询数据详情 * 主键查询数据详情
...@@ -98,5 +141,161 @@ public class DataGoodsApiServiceImpl implements DataGoodsApiService { ...@@ -98,5 +141,161 @@ public class DataGoodsApiServiceImpl implements DataGoodsApiService {
return Result.of_success(ResultMsg.SUCCESS, result); return Result.of_success(ResultMsg.SUCCESS, result);
} }
/**
* 条件查询企业商品列表
*
* @param req
* @return
*/
@Override
public Result<IPage<DepartmentDataGoodsDto>> findByDepartmentGoods(DepartmentDataGoodsReq req) {
IPage<DepartmentDataGoodsDto> page = new Page<>(req.getPageNum(),req.getPageSize());
QueryWrapper<DepartmentDataGoodsDto> queryWrapper = new QueryWrapper<>();
if (StringUtils.isNotEmpty(req.getSearch())) {
queryWrapper.and(s -> s.like("t3.department_name",req.getSearch())
.or().like("t5.data_name", req.getSearch())
);
}
if (req.getCategoryId() != null) {
queryWrapper.eq("t5.category_id",req.getCategoryId());
}
queryWrapper.eq("t1.del_flag", DelFlagEnum.NO.getValue());
queryWrapper.orderByDesc("t1.take_effect_time");
IPage<DepartmentDataGoodsDto> list = tDataGoodsApiDao.selectByList(page, queryWrapper);
if (list.getTotal() == 0) {
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
return Result.of_success(list);
}
@Override
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
public Result DepartmentByRenew(DepartmentByRenewReq req) throws Exception {
QueryWrapper<Order> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("order_id", req.getOrderId());
queryWrapper.eq("del_flag", DelFlagEnum.NO.getValue());
// order更新时间
Order order = orderDao.selectOne(queryWrapper);
if (order == null) {
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
// gateway 更新时间
upGateWayTime(req,order.getGoodsToken());
// order更新时间
addOrderPayment(req,order);
// 修改资产关系表
uptAssets(req,req.getOrderId());
return Result.ok();
}
public Result upGateWayTime(DepartmentByRenewReq req,String authCode) {
AuthRenewUpdateReq renewUpdateReq = new AuthRenewUpdateReq();
renewUpdateReq.setAuthCode(authCode);
renewUpdateReq.setValidEndTime(req.getInvalidTime());
String post = HttpsUtilsTest.submitPost(updateAuthRenew, JSON.toJSONString(renewUpdateReq));
JSONObject params = JSONObject.parseObject(post);
if (!params.get("code").equals(200)){
throw ResponseException.of_error("授权失败!");
}
logger.info("###########################购买商品:授权成功!##############################");
return Result.ok();
}
/**
* 修改order更新时间/新增支付表时间
* @param req
* @return
*/
public Result addOrderPayment(DepartmentByRenewReq req, Order order) {
order.setInvalidTime(req.getInvalidTime());
order.setPurchaseMethod(req.getPurchaseMethod());
order.setOrderMoney(req.getDataPrice());
order.setPaymentMoney(req.getDataPrice());
order.setUptPerson(getUserId() + "");
order.setUptTime(DateUtils.getToday());
if (orderDao.updateById(order) != 1) {
throw ResponseException.of_error("修改订单失败!");
}
logger.info("#############################续费:修改订单失败!##################################");
//新增订单支付
OrderPayment orderPayment = new OrderPayment();
orderPayment.setOrderId(order.getOrderId());
orderPayment.setSellerId(req.getCustomerId());
orderPayment.setPaymentMoney(req.getDataPrice());
orderPayment.setPaymentTime(DateUtils.getToday());
orderPayment.setPaymentMethod(PaymentMethodEnum.YE.getValue());
orderPayment.setPaymentTime(DateUtils.getToday());
orderPayment.setPaymentStatus(order.getOrderStatus());
orderPayment.setPurchaseMethod(req.getPurchaseMethod());
orderPayment.setCrePerson(getUserId() +"");
orderPayment.setCreTime(DateUtils.getToday());
orderPayment.setDelFlag(DelFlagEnum.NO.getValue());
if (orderPaymentDao.insert(orderPayment) != 1) {
throw ResponseException.of_error("新增订单支付表失败!");
}
logger.info("#############################续费:新增订单支付表失败!##################################");
return Result.ok();
}
/**
* 修改资产关系表
* @param req
* @param orderId
* @return
* @throws Exception
*/
public Result uptAssets(DepartmentByRenewReq req, Long orderId) throws Exception{
// 获取企业资产信息
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("assets_id", req.getAssetsId());
queryWrapper.eq("del_flag", DelFlagEnum.NO.getValue());
FinanceCustomerAssets assets = financeCustomerAssetsDao.selectOne(queryWrapper);
// 可用金额减去支付金额
BigDecimal bigDecimal = new BigDecimal(assets.getUseMoney()+ "");
BigDecimal bigDecima2 = new BigDecimal(req.getDataPrice()+ "");
if (bigDecimal.compareTo(bigDecima2) == -1){
return Result.error("金额不足!请充值!");
}
BigDecimal subtract = bigDecimal.subtract(bigDecima2);
// 修改金额
assets.setUseMoney(subtract);
assets.setTotalMoney(subtract);
assets.setUptTime(DateUtils.getToday());
assets.setUptPerson(req.getCustomerId()+ "");
if (financeCustomerAssetsDao.updateById(assets) != 1) {
throw ResponseException.of_error("修改资产金额失败!");
}
logger.info("###########################购买商品:修改资产金额成功!##############################");
// 新增记录表
Long assetsId = assets.getAssetsId();
if (assetsId!= null) {
FinanceTradeFlow flow = new FinanceTradeFlow();
flow.setAssetsId(assetsId);
flow.setOrderId(orderId);
flow.setTradeFlowNumber(NumberUtils.getDealNum());// 交易流水编号
flow.setTradeMoney(req.getDataPrice());
flow.setTradeType(TradeFlowEnum.XF.getValue());
flow.setCreTime(DateUtils.getToday());
flow.setCrePerson(req.getCustomerId() + "");
flow.setTradeFlowNumber(NumberUtils.getDealNum());
flow.setDelFlag(DelFlagEnum.NO.getValue());
if (financeTradeFlowDao.insert(flow) != 1) {
throw ResponseException.of_error("新增记录表失败!");
}
logger.info("###########################购买商品:新增记录表成功!##############################");
}
return Result.ok();
}
/**
* 获取当前用户
* @return
*/
public Long getUserId() {
SysUserDto sysUserDto = (SysUserDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_SYS);
return sysUserDto.getUserId();
}
} }
\ No newline at end of file
package com.jz.manage.moduls.service.impl; package com.jz.manage.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.SysUserDto;
import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultMsg; import com.jz.common.constant.ResultMsg;
import com.jz.common.enums.DataGoodsByRoleEnum;
import com.jz.common.enums.DelFlagEnum;
import com.jz.common.enums.YNEnum;
import com.jz.common.enums.auth.CategoryByIfSceneEnum;
import com.jz.common.exception.ResponseException;
import com.jz.common.utils.CommonUtils;
import com.jz.common.utils.DateUtils;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.goods.bean.dto.CategoryAndSceneDto;
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.entity.DataGoodsCategory;
import com.jz.manage.moduls.entity.SceneCategory;
import com.jz.manage.moduls.entity.SceneGoodsCategory;
import com.jz.manage.moduls.mapper.DataGoodsCategoryDao; import com.jz.manage.moduls.mapper.DataGoodsCategoryDao;
import com.jz.manage.moduls.mapper.SceneCategoryDao;
import com.jz.manage.moduls.mapper.SceneGoodsCategoryDao;
import com.jz.manage.moduls.service.DataGoodsCategoryService; import com.jz.manage.moduls.service.DataGoodsCategoryService;
import com.jz.manage.moduls.service.SceneCategoryService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.List; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -19,19 +47,30 @@ import java.util.stream.Collectors; ...@@ -19,19 +47,30 @@ import java.util.stream.Collectors;
*/ */
@Service("dataGoodsCategoryService") @Service("dataGoodsCategoryService")
public class DataGoodsCategoryServiceImpl implements DataGoodsCategoryService { public class DataGoodsCategoryServiceImpl implements DataGoodsCategoryService {
private static final Logger logger = LoggerFactory.getLogger(DataGoodsServiceImpl.class);
@Autowired @Autowired
private DataGoodsCategoryDao categoryDao; private DataGoodsCategoryDao categoryDao;
@Autowired
private SceneCategoryDao sceneCategoryDao;
@Autowired
private SceneGoodsCategoryDao sceneGoodsCategoryDao;
@Autowired
private RedisTemplate redisTemplate;
/** /**
* 查询所有的商品分类 * 查询所有的商品分类
* *
* @return * @return
*/ */
@Override @Override
public Result findCategory() { public Result<List<DataGoodsCategory>> findByCategory() {
//1、查出所有分类 //1、查出所有分类
List<DataGoodsCategory> entities = categoryDao.selectByList(); QueryWrapper<DataGoodsCategory> query = new QueryWrapper<>();
query.eq("del_flag", DelFlagEnum.NO.getValue());
List<DataGoodsCategory> entities = categoryDao.selectList(query);
// 找到所有的一级分类 // 找到所有的一级分类
List<DataGoodsCategory> level1Menus = entities.stream().filter(categoryEntity -> List<DataGoodsCategory> level1Menus = entities.stream().filter(categoryEntity ->
categoryEntity.getParentId() == 0 && categoryEntity.getIfChild().equals("N") categoryEntity.getParentId() == 0 && categoryEntity.getIfChild().equals("N")
...@@ -54,4 +93,193 @@ public class DataGoodsCategoryServiceImpl implements DataGoodsCategoryService { ...@@ -54,4 +93,193 @@ public class DataGoodsCategoryServiceImpl implements DataGoodsCategoryService {
return children; return children;
} }
/**
* 查询场景分类
*
* @return
*/
@Override
public Result findByScene() {
QueryWrapper<SceneCategory> queryWrapper = new QueryWrapper();
queryWrapper.eq("del_flag", "N");
List<SceneCategory> list = sceneCategoryDao.selectList(queryWrapper);
if (list.size() == 0) {
return Result.of_error(ResultMsg.FAILURE);
}
return Result.ok(list);
}
/**
* 添加一级分类
*
* @param req
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
public Result addCategory(AddCateGoryReq req) throws Exception {
QueryWrapper<DataGoodsCategory> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("category_name", req.getCategoryName());
queryWrapper.eq("del_flag",DelFlagEnum.NO.getValue());
DataGoodsCategory goodsCategory = categoryDao.selectOne(queryWrapper);
if (goodsCategory != null) {
return Result.of_error("同一分类层级已存在相同的分类名称,请填写其他分类名称");
}
DataGoodsCategory category = new DataGoodsCategory();
category.setCategoryName(req.getCategoryName());
// 添加子级分类
if (req.getCategoryId() != null) {
category.setParentId(req.getCategoryId());
category.setIfChild(YNEnum.YES.getValue());
}else {
// 添加一级分类
category.setParentId(0L);
category.setIfChild(YNEnum.NO.getValue());
}
category.setCreTime(DateUtils.getToday());
category.setCrePerson(getUserId()+ "");
category.setDelFlag(DelFlagEnum.NO.getValue());
if (categoryDao.insert(category) != 1) {
throw ResponseException.of_error(ResultMsg.FAILURE);
}
logger.info("########################商品分类管理:添加商品分类成功####################");
// 添加商品-场景关系表
if (category.getCategoryId() != null && req.getSceneId() != null) {
SceneGoodsCategory sceneGoodsCategory = new SceneGoodsCategory();
sceneGoodsCategory.setCategoryId(category.getCategoryId());
sceneGoodsCategory.setSceneId(req.getSceneId());
if (sceneGoodsCategoryDao.insert(sceneGoodsCategory) != 1) {
throw ResponseException.of_error(ResultMsg.FAILURE);
}
logger.info("########################商品分类管理:添加商品场景分类成功####################");
}
return Result.of_success(ResultMsg.SUCCESS);
}
/**
* 编辑分类
*
* @param req
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
public Result editCategory(AddCateGoryReq req) throws Exception {
// 查询是否重名
QueryWrapper<DataGoodsCategory> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("category_name", req.getCategoryName());
queryWrapper.eq("del_flag",DelFlagEnum.NO.getValue());
DataGoodsCategory goodsCategory = categoryDao.selectOne(queryWrapper);
if (goodsCategory != null) {
return Result.of_error("同一分类层级已存在相同的分类名称,请填写其他分类名称");
}
// 修改商品分类
DataGoodsCategory category = new DataGoodsCategory();
category.setCategoryId(req.getCategoryId());
category.setCategoryName(req.getCategoryName());
category.setUptTime(DateUtils.getToday());
category.setUptPerson(getUserId()+ "");
category.setDelFlag(DelFlagEnum.NO.getValue());
if (categoryDao.updateById(category) != 1) {
throw ResponseException.of_error(ResultMsg.FAILURE);
}
logger.info("########################商品分类管理:编辑商品分类成功####################");
// 添加商品-场景关系表
if (category.getCategoryId() != null && req.getSceneId() != null) {
// 查询关系表
QueryWrapper query = new QueryWrapper();
query.eq("scene_id", req.getOldSceneId());
query.eq("category_id",req.getCategoryId());
SceneGoodsCategory sceneGoodsCategory = sceneGoodsCategoryDao.selectOne(query);
sceneGoodsCategory.setCategoryId(category.getCategoryId());
sceneGoodsCategory.setSceneId(req.getSceneId());
if (sceneGoodsCategoryDao.updateById(sceneGoodsCategory) != 1) {
throw ResponseException.of_error(ResultMsg.FAILURE);
}
logger.info("########################商品分类管理:编辑商品场景分类成功####################");
}
return Result.of_success(ResultMsg.SUCCESS);
}
/**
* 条件查询分类
*
* @param search
* @return
*/
@Override
public Result selectByCategory(String search) {
if (StringUtils.isEmpty(search)) {
return findByCategory();
}
List<DataGoodsCategory> entities = categoryDao.selectByList(search);
// 找到所有的一级分类
List<DataGoodsCategory> level1Menus = entities.stream().filter(categoryEntity ->
categoryEntity.getParentId() == 0 && categoryEntity.getIfChild().equals("N")
).map((menu)->{
menu.setChildren(getChildrens(menu,entities));
return menu;
}).collect(Collectors.toList());
return Result.of_success(ResultMsg.SUCCESS, level1Menus);
}
/**
* 查询分类详情
*
* @param req
* @return
*/
@Override
public Result getCategoryDetail(CategoryDetailReq req) {
CategoryAndSceneDto detail = categoryDao.getCategoryDetail(req.getCategoryId());
if (detail != null) {
return Result.of_success(detail);
}
return Result.of_error(ResultMsg.FAILURE);
}
/**
* 删除分类
*
* @param req
* @return
*/
@Override
public Result deleteByCategory(CategoryAndSceneReq req) {
// 删除category
DataGoodsCategory category = new DataGoodsCategory();
category.setCategoryId(req.getCategoryId());
category.setDelFlag(DelFlagEnum.YES.getValue());
if (categoryDao.updateById(category) != 1) {
return Result.of_error(ResultMsg.DELETE_FAIL);
}
// 删除category-scene中间表
if (req.getSceneId() != null) {
QueryWrapper<SceneGoodsCategory> queryWrapper = new QueryWrapper();
queryWrapper.eq("category_id", req.getCategoryId());
queryWrapper.eq("scene_id", req.getSceneId());
queryWrapper.eq("del_flag",DelFlagEnum.NO.getValue());
SceneGoodsCategory sceneGoodsCategory = sceneGoodsCategoryDao.selectOne(queryWrapper);
if (sceneGoodsCategory != null) {
sceneGoodsCategory.setDelFlag(DelFlagEnum.YES.getValue());
if (sceneGoodsCategoryDao.updateById(sceneGoodsCategory) != 1) {
return Result.of_error(ResultMsg.DELETE_FAIL);
}
return Result.of_success(ResultMsg.DELETE_SUCCESS);
}
}
return Result.of_success(ResultMsg.DELETE_SUCCESS);
}
/**
* 获取用户id
* @return
*/
public Long getUserId() {
SysUserDto sysUserDto = (SysUserDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_SYS);
return sysUserDto.getUserId();
}
} }
\ No newline at end of file
package com.jz.manage.moduls.service.impl; package com.jz.manage.moduls.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jz.common.bean.BaseBeanResponse; import com.jz.common.bean.BaseBeanResponse;
import com.jz.common.bean.BaseResponse; import com.jz.common.bean.BaseResponse;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.bean.SysUserDto; import com.jz.common.bean.SysUserDto;
import com.jz.common.constant.Constants; import com.jz.common.constant.Constants;
import com.jz.common.constant.RedisMessageConstant; import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultMsg; import com.jz.common.constant.ResultMsg;
import com.jz.common.entity.DataGoods; import com.jz.common.enums.*;
import com.jz.common.utils.DateUtils; import com.jz.common.enums.auth.AuthModeEnum;
import com.jz.common.utils.Result; import com.jz.common.enums.auth.AuthTypeEnum;
import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsAuditDto; import com.jz.common.exception.ResponseException;
import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsDto; import com.jz.common.utils.*;
import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsListDto; import com.jz.manage.moduls.controller.finance.platForm.dto.DepartmentAssetsDto;
import com.jz.manage.moduls.controller.goods.bean.request.DataGoodsAuditListReq; import com.jz.manage.moduls.controller.goods.bean.dto.*;
import com.jz.manage.moduls.controller.goods.bean.request.DataGoodsAuditReq; import com.jz.manage.moduls.controller.goods.bean.request.*;
import com.jz.manage.moduls.controller.goods.bean.request.DataGoodsListRequest; import com.jz.manage.moduls.controller.order.bean.dto.OrderAndAuthorizedDto;
import com.jz.manage.moduls.controller.goods.bean.request.DataGoodsRequest; import com.jz.manage.moduls.entity.*;
import com.jz.manage.moduls.mapper.DataGoodsApiDao; import com.jz.manage.moduls.mapper.*;
import com.jz.manage.moduls.mapper.DataGoodsApiParamsDao;
import com.jz.manage.moduls.mapper.DataGoodsDao;
import com.jz.manage.moduls.service.DataGoodsService; import com.jz.manage.moduls.service.DataGoodsService;
import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.CrossOrigin;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -50,22 +53,47 @@ import java.util.Map; ...@@ -50,22 +53,47 @@ import java.util.Map;
@Service("dataGoodsService") @Service("dataGoodsService")
@CrossOrigin @CrossOrigin
public class DataGoodsServiceImpl implements DataGoodsService { public class DataGoodsServiceImpl implements DataGoodsService {
private static final Logger logger = LoggerFactory.getLogger(DataGoodsServiceImpl.class);
@Autowired @Autowired
private DataGoodsDao dataGoodsDao; private DataGoodsDao dataGoodsDao;
@Autowired @Autowired
private DataGoodsApiParamsDao apiParamsDao; private RedisTemplate redisTemplate;
@Autowired @Autowired
private RedisTemplate redisTemplate; private OrderDao orderDao;
@Autowired
private RoleGoodsDao roleGoodsDao;
@Autowired
private OrderPaymentDao orderPaymentDao;
@Autowired
private OrderGoodsInfoDao goodsInfoDao;
@Autowired
private FinanceCustomerAssetsDao financeCustomerAssetsDao;
@Autowired @Autowired
private DataGoodsApiDao tDataGoodsApiDao; private FinanceTradeFlowDao financeTradeFlowDao;
@Autowired
private DepartmentDao departmentDao;
//@Autowired
//private HttpsUtils httpsUtils;
@Value("${domain.gatewayGetAuth}")
private String gatewayGetAuth;
@Value("${domain.apigateway}") @Value("${domain.apigateway}")
private String apiGateway; private String apiGateway;
@Value("${domain.updateSendStatus}")
private String updateSendStatus;
/** /**
* 条件分页查询数据列表 * 条件分页查询数据列表
* *
...@@ -75,39 +103,36 @@ public class DataGoodsServiceImpl implements DataGoodsService { ...@@ -75,39 +103,36 @@ public class DataGoodsServiceImpl implements DataGoodsService {
* @throws Exception * @throws Exception
*/ */
@Override @Override
public PageInfoResponse<DataGoodsListDto> findList(DataGoodsListRequest goodsListRequest, HttpServletRequest httpRequest) throws Exception { public Result<IPage<DataGoodsListDto>> findList(DataGoodsListRequest goodsListRequest, HttpServletRequest httpRequest) throws Exception {
PageInfoResponse<DataGoodsListDto> pageInfoResponse = new PageInfoResponse<>(); IPage<DataGoodsListDto> pageInfoResponse = new Page<>(goodsListRequest.getPageNum(), goodsListRequest.getPageSize());
QueryWrapper<DataGoodsListDto> queryWrapper = new QueryWrapper<>();
Map<String, Object> param = new HashMap<>();
//数据商品id //数据商品id
if (goodsListRequest.getDataGoodsId() != null) { if (StringUtils.isNotBlank(goodsListRequest.getSearch())) {
param.put("dataGoodsId", goodsListRequest.getDataGoodsId()); queryWrapper.and(wrapper -> wrapper.like("t1.dataName", goodsListRequest.getSearch()));
} }
//商品分类id(行业)
if (goodsListRequest.getCategoryId() != null) { //数据状态:01预售,02在售中,03下架,04上架
param.put("categoryId", goodsListRequest.getCategoryId()); if (StringUtils.isNotBlank(goodsListRequest.getDataStatus())) {
queryWrapper.eq("t1.data_status", goodsListRequest.getDataStatus());
} }
//数据商品名称 if (StringUtils.isNotBlank(goodsListRequest.getCreTime())) {
if (!StringUtils.isEmpty(goodsListRequest.getDataName())) { String startTime = goodsListRequest.getCreTime().substring(0, 10) + " 00:00:00";
param.put("dataName", goodsListRequest.getDataName()); String endTime = goodsListRequest.getCreTime().substring(11, 21) + " 23:59:59";
queryWrapper.between("t1.cre_time", startTime, endTime);
queryWrapper.orderByDesc("t1.cre_time");
} }
//数据类型:01api,02数据包 if (StringUtils.isNotBlank(goodsListRequest.getUptTime())) {
if (!StringUtils.isEmpty(goodsListRequest.getApiType())) { String startTime = goodsListRequest.getUptTime().substring(0, 10) + " 00:00:00";
param.put("apiType", goodsListRequest.getApiType()); String endTime = goodsListRequest.getUptTime().substring(11, 21) + " 23:59:59";
queryWrapper.between("t1.upt_time", startTime, endTime);
queryWrapper.orderByDesc("t1.upt_time");
} }
//数据状态:01预售,02在售中,03下架,04上架 queryWrapper.eq("t1.del_flag", "N");
if (!StringUtils.isEmpty(goodsListRequest.getDataStatus())) { IPage<DataGoodsListDto> list = dataGoodsDao.findList(pageInfoResponse, queryWrapper);
param.put("dataStatus", goodsListRequest.getDataStatus()); if (list.getTotal() == 0) {
return Result.of_error("请制作商品!");
} }
return Result.of_success(list);
PageHelper.startPage(goodsListRequest.getPageNum(), goodsListRequest.getPageSize());
List<DataGoodsListDto> list = dataGoodsDao.findList(param);
PageInfo<DataGoodsListDto> pageInfo = new PageInfo<>(list);
pageInfoResponse.setCode(Constants.SUCCESS_CODE);
pageInfoResponse.setMessage("查询成功");
pageInfoResponse.setData(pageInfo);
return pageInfoResponse;
} }
...@@ -192,35 +217,60 @@ public class DataGoodsServiceImpl implements DataGoodsService { ...@@ -192,35 +217,60 @@ public class DataGoodsServiceImpl implements DataGoodsService {
/** /**
* 商品上下架 * 商品上下架
*
* @param goodsId * @param goodsId
* @param statusId * @param statusId
*/ */
@Override @Override
public Result editStatus(Long goodsId, Long statusId) { public Result editStatus(Long goodsId, String statusId) throws Exception {
// 获取用户信息 // 获取用户信息
SysUserDto sysUserDto = (SysUserDto) redisTemplate.opsForValue().get("user_" + RedisMessageConstant.SENDTYPE_LOGIN_SYS); SysUserDto sysUserDto = (SysUserDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_SYS);
// 获取商品的信息 // 获取商品的信息
QueryWrapper queryWrapper = new QueryWrapper(); QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("data_goods_id", goodsId); queryWrapper.eq("data_goods_id", goodsId);
queryWrapper.eq("del_flag", "N");
DataGoods dataGoods = dataGoodsDao.selectOne(queryWrapper); DataGoods dataGoods = dataGoodsDao.selectOne(queryWrapper);
if (dataGoods == null) {
return Result.of_error("查询失败!");
}
// 查询当前商品是否在使用
DataAndOrderDto dataAndOrderDto = orderDao.selectByGoods(goodsId);
//商品没有在使用
if (StringUtils.isNotBlank(dataAndOrderDto.getOrderState()) && dataAndOrderDto.getOrderTotal() != 0) {
return Result.of_error("商品在使用,不能修改!");
}
// 商品失效
if (StringUtils.isNotEmpty(dataAndOrderDto.getOrderState()) && dataAndOrderDto.getOrderState().equals("1")) {
return Result.of_error("商品在使用,不能修改!");
}
// 上架 // 上架
if ("01".equals(statusId)) { if ("01".equals(statusId)) {
dataGoods.setDataStatus("04"); if (dataGoods.getDataStatus().equals(DataStatusEnum.SJ.getValue())) {
queryWrapper.eq("data_status", dataGoods.getDataStatus()); return Result.of_error("商品已上架,无需上架!");
queryWrapper.eq("upt_time", DateUtils.getToday()); }
queryWrapper.eq("upt_person", sysUserDto.getUserId()); dataGoods.setDataGoodsId(goodsId);
dataGoodsDao.update(dataGoods, queryWrapper); dataGoods.setDataStatus(DataStatusEnum.SJ.getValue());
dataGoods.setUptPerson(sysUserDto.getUserId() + "");
dataGoods.setUptTime(DateUtils.getToday());
if (dataGoodsDao.updateById(dataGoods) != 1) {
return Result.of_error("上架失败!");
}
return Result.of_success(ResultMsg.UPDATE_SUCCESS); return Result.of_success(ResultMsg.UPDATE_SUCCESS);
} }
// 下架 // 下架
if ("02".equals(statusId)) { if ("02".equals(statusId)) {
dataGoods.setDataStatus("03"); if (dataGoods.getDataStatus().equals(DataStatusEnum.XJ.getValue())) {
queryWrapper.eq("data_status", dataGoods.getDataStatus()); return Result.of_error("商品已下架,无需下架!");
queryWrapper.eq("upt_time", DateUtils.getToday()); }
queryWrapper.eq("upt_person", sysUserDto.getUserId()); dataGoods.setDataGoodsId(goodsId);
dataGoodsDao.update(dataGoods, queryWrapper); dataGoods.setDataStatus(DataStatusEnum.XJ.getValue());
dataGoods.setUptPerson(sysUserDto.getUserId() + "");
dataGoods.setUptTime(DateUtils.getToday());
if (dataGoodsDao.updateById(dataGoods) != 1) {
return Result.of_error("下架失败!");
}
return Result.of_success(ResultMsg.UPDATE_SUCCESS); return Result.of_success(ResultMsg.UPDATE_SUCCESS);
} }
return Result.of_error(ResultMsg.UPDATE_FAIL); return Result.of_error(ResultMsg.UPDATE_FAIL);
...@@ -228,38 +278,39 @@ public class DataGoodsServiceImpl implements DataGoodsService { ...@@ -228,38 +278,39 @@ public class DataGoodsServiceImpl implements DataGoodsService {
/** /**
* 列表查询审核数据商品 * 列表查询审核数据商品
*
* @param req * @param req
* @param httpRequest * @param httpRequest
* @return * @return
*/ */
@Override @Override
public Result<IPage<DataGoodsAuditDto>> findByAudit(DataGoodsAuditListReq req, HttpServletRequest httpRequest) { public Result<IPage<DataGoodsAuditDto>> findByAudit(DataGoodsAuditListReq req, HttpServletRequest httpRequest) {
IPage<DataGoodsAuditDto> page = new Page<>(req.getPageNum(),req.getPageSize()); IPage<DataGoodsAuditDto> page = new Page<>(req.getPageNum(), req.getPageSize());
QueryWrapper<DataGoodsAuditDto> queryWrapper = new QueryWrapper(); QueryWrapper<DataGoodsAuditDto> queryWrapper = new QueryWrapper();
if (StringUtils.isNotBlank(req.getSearch())) { if (StringUtils.isNotBlank(req.getSearch())) {
queryWrapper.and(wrapper -> wrapper.like("t1.data_name", req.getSearch()) queryWrapper.and(wrapper -> wrapper.like("t1.data_name", req.getSearch())
.or().like("t2.category_name",req.getSearch())); .or().like("t2.category_name", req.getSearch()));
} }
if (StringUtils.isNotBlank(req.getDataType())) { if (StringUtils.isNotBlank(req.getDataType())) {
queryWrapper.eq("t1.data_type", req.getDataType()); queryWrapper.eq("t1.data_type", req.getDataType());
} }
if (StringUtils.isNotBlank(req.getAuditStatus())) { if (StringUtils.isNotBlank(req.getAuditStatus())) {
queryWrapper.eq("t1.audit_status",req.getAuditStatus()); queryWrapper.eq("t1.audit_status", req.getAuditStatus());
} }
if (StringUtils.isNotBlank(req.getCreTime())) { if (StringUtils.isNotBlank(req.getCreTime())) {
String startTime = req.getCreTime().substring(0, 10) + " 00:00:00"; String startTime = req.getCreTime().substring(0, 10) + " 00:00:00";
String endTime = req.getCreTime().substring(11, 21)+ " 23:59:59"; String endTime = req.getCreTime().substring(11, 21) + " 23:59:59";
queryWrapper.between( "t1.cre_time",startTime, endTime); queryWrapper.between("t1.cre_time", startTime, endTime);
queryWrapper.orderByDesc("t1.cre_time"); queryWrapper.orderByDesc("t1.cre_time");
} }
if (StringUtils.isNotBlank(req.getUptTime())) { if (StringUtils.isNotBlank(req.getUptTime())) {
String startTime = req.getUptTime().substring(0, 10) + " 00:00:00"; String startTime = req.getUptTime().substring(0, 10) + " 00:00:00";
String endTime = req.getUptTime().substring(11, 21)+ " 23:59:59"; String endTime = req.getUptTime().substring(11, 21) + " 23:59:59";
queryWrapper.between( "t1.upt_time",startTime, endTime); queryWrapper.between("t1.upt_time", startTime, endTime);
queryWrapper.orderByDesc("t1.upt_time"); queryWrapper.orderByDesc("t1.upt_time");
} }
queryWrapper.eq("t1.del_flag", "N"); queryWrapper.eq("t1.del_flag", "N");
IPage<DataGoodsAuditDto> list= dataGoodsDao.findByAudit(page, queryWrapper); IPage<DataGoodsAuditDto> list = dataGoodsDao.findByAudit(page, queryWrapper);
if (list.getTotal() == 0) { if (list.getTotal() == 0) {
return Result.of_error("没有待审核的商品!"); return Result.of_error("没有待审核的商品!");
} }
...@@ -268,6 +319,7 @@ public class DataGoodsServiceImpl implements DataGoodsService { ...@@ -268,6 +319,7 @@ public class DataGoodsServiceImpl implements DataGoodsService {
/** /**
* 商品审核管理--商品审核 * 商品审核管理--商品审核
*
* @param req * @param req
* @return * @return
*/ */
...@@ -292,19 +344,19 @@ public class DataGoodsServiceImpl implements DataGoodsService { ...@@ -292,19 +344,19 @@ public class DataGoodsServiceImpl implements DataGoodsService {
dataGoods.setAuditPerson(sysUser.getUserId() + ""); dataGoods.setAuditPerson(sysUser.getUserId() + "");
dataGoods.setAuditTime(DateUtils.getToday()); dataGoods.setAuditTime(DateUtils.getToday());
dataGoods.setUptTime(DateUtils.getToday()); dataGoods.setUptTime(DateUtils.getToday());
dataGoods.setUptPerson(sysUser.getUserId()+ ""); dataGoods.setUptPerson(sysUser.getUserId() + "");
dataGoods.setDataStatus("04"); dataGoods.setDataStatus(DataStatusEnum.SJ.getValue());
dataGoodsDao.updateById(dataGoods); dataGoodsDao.updateById(dataGoods);
return Result.of_success("商品审核已通过!"); return Result.of_success("商品审核已通过!");
} }
if ("02".equals(req.getAuditStatus())){ if ("02".equals(req.getAuditStatus())) {
// 未通过 // 未通过
dataGoods.setAuditStatus("03"); dataGoods.setAuditStatus("03");
dataGoods.setAuditPerson(sysUser.getUserId() + ""); dataGoods.setAuditPerson(sysUser.getUserId() + "");
dataGoods.setAuditTime(DateUtils.getToday()); dataGoods.setAuditTime(DateUtils.getToday());
dataGoods.setUptTime(DateUtils.getToday()); dataGoods.setUptTime(DateUtils.getToday());
dataGoods.setUptPerson(sysUser.getUserId()+ ""); dataGoods.setUptPerson(sysUser.getUserId() + "");
dataGoods.setDataStatus("03"); dataGoods.setDataStatus(DataStatusEnum.XJ.getValue());
dataGoods.setRejectReason(req.getRejectReason()); dataGoods.setRejectReason(req.getRejectReason());
dataGoodsDao.updateById(dataGoods); dataGoodsDao.updateById(dataGoods);
return Result.of_success("商品审核未通过!"); return Result.of_success("商品审核未通过!");
...@@ -312,6 +364,507 @@ public class DataGoodsServiceImpl implements DataGoodsService { ...@@ -312,6 +364,507 @@ public class DataGoodsServiceImpl implements DataGoodsService {
return Result.of_error("审核失败!"); return Result.of_error("审核失败!");
} }
/**
* 获取api列表
*
* @return
*/
@Override
public Result getAPIList(SendDataReq req) {
String s = HttpsUtilsTest.submitPost("http://127.0.0.1:8088/api/interface/listSendDataBank", JSON.toJSONString(req));
JSONObject params = JSONObject.parseObject(s);
if (!params.get("code").equals(200) || org.springframework.util.StringUtils.isEmpty(params.get("data"))) {
return Result.of_error("获取api列表失败!");
}
return Result.of_success(params.get("data"));
}
/**
* 获取api详情
*
* @param req
* @return
*/
@Override
public Result getApiInterfaceDetail(ApiInterfaceDetailReq req) {
String s = HttpsUtilsTest.submitPost("http://127.0.0.1:8088/api/interface/getApiInterfaceDetail", JSON.toJSONString(req));
JSONObject params = JSONObject.parseObject(s);
if (!params.get("code").equals(200) || org.springframework.util.StringUtils.isEmpty(params.get("data"))) {
return Result.of_error("获取api详情失败!");
}
return Result.of_success(params.get("data"));
}
/**
* 制作商品
*
* @param req
* @return
*/
@Override
public Result makeByGoods(DataApiUpReq req) throws Exception {
// 获取当前用户
SysUserDto user = (SysUserDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_SYS);
if (user == null) {
return Result.of_error("当前用户不存在!请登录!");
}
// 保存商品
DataGoods dataGoods = new DataGoods();
dataGoods.setDataStatus(DataStatusEnum.XJ.getValue());
dataGoods.setAuditStatus(AuditStatusEnum.YSH.getValue());
dataGoods.setAuditPerson(user.getUserId() + "");
dataGoods.setAuditTime(DateUtils.getToday());
dataGoods.setCreTime(DateUtils.getToday());
dataGoods.setCrePerson(user.getUserId() + "");
dataGoods.setUserId(user.getUserId());
dataGoods.setGoodsLimited(DateUtils.getLimitedTime(req.getGoodsLimited()));
dataGoods.setDelFlag("N");
// 校验商品价格
if (req.getSecondType() != null) {
dataGoods.setDataPrice(req.getSecondType());
} else if (req.getMonthType() != null) {
dataGoods.setDataPrice(req.getMonthType());
} else if (req.getSeasonType() != null) {
dataGoods.setDataPrice(req.getSeasonType());
} else {
dataGoods.setDataPrice(req.getYearType());
}
BeanUtils.copyProperties(req, dataGoods);
if (dataGoodsDao.insert(dataGoods) != 1) {
throw ResponseException.of_error("制作商品失败!");
}
return Result.ok();
}
/**
* 浏览授权 TODO 待优化
*
* @param roleReq
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
public Result browseByAuthorization(DataGoodsByRoleReq roleReq) {
RoleGoods role = roleGoodsDao.findByRole(roleReq.getDataGoodsId());
RoleGoods roleGoods = new RoleGoods();
// 第一次授权
if (role == null && roleReq.getLogOutUser().equals("01")) {
roleGoods.setDataGoodsId(roleReq.getDataGoodsId());
roleGoods.setRoleId(Long.valueOf(DataGoodsByRoleEnum.logOutUser.getValue()));
roleGoods.setDelFlag(DelFlagEnum.NO.getValue());
if (roleGoodsDao.insert(roleGoods) != 1) {
throw ResponseException.of_error("未登录用户授权失败!");
}
// 关闭授权
} else if (roleReq.getLogOutUser().equals("02")) {
roleGoods.setDelFlag(DelFlagEnum.YES.getValue());
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("data_goods_id", roleReq.getDataGoodsId());
queryWrapper.eq("role_id", Long.valueOf(DataGoodsByRoleEnum.logOutUser.getValue()));
if (roleGoodsDao.update(roleGoods, queryWrapper) != 1) {
return Result.of_error(ResultMsg.FAILURE);
}
// 开启授权
}else if (roleReq.getLogOutUser().equals("01")) {
roleGoods.setDelFlag(DelFlagEnum.NO.getValue());
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("data_goods_id", roleReq.getDataGoodsId());
queryWrapper.eq("role_id", Long.valueOf(DataGoodsByRoleEnum.logOutUser.getValue()));
if (roleGoodsDao.update(roleGoods, queryWrapper) != 1) {
return Result.of_error(ResultMsg.FAILURE);
}
}
if (role == null && roleReq.getUnverifiedUser().equals("01")) {
roleGoods.setDataGoodsId(roleReq.getDataGoodsId());
roleGoods.setRoleId(Long.valueOf(DataGoodsByRoleEnum.unverifiedUser.getValue()));
roleGoods.setDelFlag(DelFlagEnum.NO.getValue());
if (roleGoodsDao.insert(roleGoods) != 1) {
throw ResponseException.of_error("已登录未认证用户授权失败!");
}
} else if (roleReq.getUnverifiedUser().equals("02")) {
roleGoods.setDelFlag(DelFlagEnum.YES.getValue());
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("data_goods_id", roleReq.getDataGoodsId());
queryWrapper.eq("role_id", Long.valueOf(DataGoodsByRoleEnum.unverifiedUser.getValue()));
if (roleGoodsDao.update(roleGoods, queryWrapper) != 1) {
return Result.of_error(ResultMsg.FAILURE);
}
}else if (roleReq.getUnverifiedUser().equals("01")) {
roleGoods.setDelFlag(DelFlagEnum.NO.getValue());
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("data_goods_id", roleReq.getDataGoodsId());
queryWrapper.eq("role_id", Long.valueOf(DataGoodsByRoleEnum.unverifiedUser.getValue()));
if (roleGoodsDao.update(roleGoods, queryWrapper) != 1) {
return Result.of_error(ResultMsg.FAILURE);
}
}
if (role == null && roleReq.getAuthenticatedUser().equals("01")) {
roleGoods.setDataGoodsId(roleReq.getDataGoodsId());
roleGoods.setRoleId(Long.valueOf(DataGoodsByRoleEnum.authenticatedUser.getValue()));
roleGoods.setDelFlag(DelFlagEnum.NO.getValue());
if (roleGoodsDao.insert(roleGoods) != 1) {
throw ResponseException.of_error("认证用户授权失败!");
}
} else if (roleReq.getAuthenticatedUser().equals("02")) {
roleGoods.setDelFlag(DelFlagEnum.NO.getValue());
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("data_goods_id", roleReq.getDataGoodsId());
queryWrapper.eq("role_id", Long.valueOf(DataGoodsByRoleEnum.authenticatedUser.getValue()));
if (roleGoodsDao.update(roleGoods, queryWrapper) != 1) {
return Result.of_error(ResultMsg.FAILURE);
}
}
return Result.ok("授权成功!");
}
/**
* 查询授权
*
* @param dataGoodsId
* @return
*/
@Override
public Result findByAuthorization(Long dataGoodsId) {
if (dataGoodsId != null) {
QueryWrapper<RoleGoods> queryWrapper = new QueryWrapper();
queryWrapper.eq("data_goods_id", dataGoodsId);
queryWrapper.eq("del_flag", DelFlagEnum.NO.getValue());
List<RoleGoods> roleGoods = roleGoodsDao.selectList(queryWrapper);
if (roleGoods.size() != 0) {
return Result.ok(roleGoods);
}
return Result.ok("用户未授权!");
}
return Result.of_error("查询失败!");
}
/**
* 查询商品详情
*
* @param id
* @return
*/
@Override
public Result selectById(Long id) {
QueryWrapper<DataGoods> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("data_goods_id",id);
queryWrapper.eq("data_status", DataStatusEnum.SJ.getValue());
queryWrapper.last("and (goods_limited >= DATE_FORMAT(NOW(), '%Y-%m-%d'))");
DataGoods dataGoods = dataGoodsDao.selectOne(queryWrapper);
if (dataGoods != null) {
return Result.ok(dataGoods);
}
return Result.of_error("商品未上架,无效!");
}
/**
* 使用授权
*
* @param req
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
public Result useByAuthorization(GoodsByAuthorizationReq req) throws Exception{
if (req.getDepartmentId() == null || req.getAssetsId() == null) {
return Result.of_error("用户没关联企业,支付失败!");
}
// 校验商品是否已授权
OrderAndAuthorizedDto dto = orderDao.isAuthorization(req.getCustomerId(),req.getDataGoodsId());
if (dto != null && dto.getGoodsState().equals("01")) {
return Result.of_error("该企业已经有该商品的使用授权,请选择其他企业进行授权!");
}
if (dto == null) {
// 获取授权
Result authorization = getAuthorization(req);
if (!authorization.isSuccess()) {
return Result.of_success("获取授权失败!");
}
// 新增订单关系表:订单表,订单支付表,订单商品表
Result result = addOrder(req);
if (!result.isSuccess()) {
return Result.of_success("新增订单关系表失败!");
}
Order order = (Order) result.getData();
// 修改企业资产关系表:资产表,新增记录
Result params = uptAssets(req, order);
if (!params.isSuccess()) {
return Result.of_success("修改企业资产关系表失败!");
}
Map<String, String> map = (Map) params.getData();
return Result.of_success(ResultMsg.SUCCESS,map);
}
return Result.of_error(ResultMsg.FAILURE);
}
/**
* 搜索企业
* @param req
* @return
*/
@Override
public Result findByDepartment(DepartmentGoodsReq req) {
QueryWrapper<DepartmentAssetsDto> query = new QueryWrapper();
// 使用授权时搜索企业
if (StringUtils.isNotEmpty(req.getSearch())) {
query.and(wrapper -> wrapper.like("t1.department_name", req.getSearch()));
}
// 续费时搜索企业
if (req.getDepartmentId() != null && req.getDataGoodsId() != null) {
query.eq("t1.department_id", req.getDepartmentId());
query.eq("t6.data_goods_id", req.getDataGoodsId());
}
query.eq("t1.del_flag", DelFlagEnum.NO.getValue());
List<DepartmentAssetsDto> department = departmentDao.selectByDepartment(query);
if (department.size() != 0) {
QueryWrapper<DataGoods> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("data_goods_id", req.getDataGoodsId());
queryWrapper.eq("del_flag", DelFlagEnum.NO.getValue());
DataGoods dataGoods = dataGoodsDao.selectOne(queryWrapper);
for (DepartmentAssetsDto departmentAssetsDto : department) {
departmentAssetsDto.setYearType(dataGoods.getYearType().toString());
departmentAssetsDto.setSeasonType(dataGoods.getSeasonType().toString());
departmentAssetsDto.setMonthType(dataGoods.getMonthType().toString());
departmentAssetsDto.setSecondType(dataGoods.getSecondType().toString());
}
return Result.of_success(ResultMsg.SUCCESS, department);
}
return Result.of_success(ResultMsg.DATA_NOT_FOUND);
}
/**
* 浏览授权优化
*/
public Result addByAuthorization(RoleGoods role,DataGoodsByRoleReq roleReq, String dataGoodsByRoleEnum) {
RoleGoods roleGoods = new RoleGoods();
if (role == null && roleReq.getLogOutUser().equals("01")) {
roleGoods.setDataGoodsId(roleReq.getDataGoodsId());
roleGoods.setRoleId(Long.valueOf(dataGoodsByRoleEnum));
roleGoods.setDelFlag(DelFlagEnum.NO.getValue());
if (roleGoodsDao.insert(roleGoods) != 1) {
throw ResponseException.of_error("未登录用户授权失败!");
}
// 关闭授权
} else if (roleReq.getLogOutUser().equals("02")) {
roleGoods.setDelFlag(DelFlagEnum.YES.getValue());
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("data_goods_id", roleReq.getDataGoodsId());
queryWrapper.eq("role_id", Long.valueOf(dataGoodsByRoleEnum));
if (roleGoodsDao.update(roleGoods, queryWrapper) != 1) {
return Result.of_error(ResultMsg.FAILURE);
}
// 开启授权
}else if (roleReq.getLogOutUser().equals("01")) {
roleGoods.setDelFlag(DelFlagEnum.NO.getValue());
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("data_goods_id", roleReq.getDataGoodsId());
queryWrapper.eq("role_id", Long.valueOf(dataGoodsByRoleEnum));
if (roleGoodsDao.update(roleGoods, queryWrapper) != 1) {
return Result.of_error(ResultMsg.FAILURE);
}
}
return Result.ok();
}
/**
* 制作有效时间
* @param req
* @return
*/
public static Date getTime(GoodsByAuthorizationReq req) {
String purchaseMethod = req.getPurchaseMethod();
Date now = DateUtils.getToday();
if ("01".equals(purchaseMethod)) {
Date nowAddYear = DateUtils.getAfterYear(now);
return nowAddYear;
}else if ("02".equals(purchaseMethod)){
Date nowAddSeason = DateUtils.getAfterSeason(now);
return nowAddSeason;
}else if("03".equals(purchaseMethod)) {
Date nowAddMonth = DateUtils.getAfterMonth(now);
return nowAddMonth;
}else {
return null;
}
}
/**
* 授权: 获取盐值和授权码
*/
public Result getAuthorization(GoodsByAuthorizationReq req) throws Exception{
// 年季月次 商品
AuthMallUserApiReq apiReq = new AuthMallUserApiReq();
if ("04".equals(req.getPurchaseMethod())) {
apiReq.setAuthMode(AuthModeEnum.POWER_CALL_MODE.name());
apiReq.setValidStartTime(req.getTakeEffectTime());
apiReq.setValidEndTime(req.getInvalidTime());
}else {
apiReq.setAuthMode(AuthModeEnum.RECORD_TIME_MODE.name());
apiReq.setValidStartTime(req.getTakeEffectTime());
apiReq.setValidEndTime(req.getInvalidTime());
}
apiReq.setApiKey(req.getApiKey());
apiReq.setAuthType(AuthTypeEnum.DATA_BANK_AUTH.name());
apiReq.setOrgCode("000002"); // TODO
apiReq.setCreateUser(getUserId() +"");
String post = HttpsUtilsTest.submitPost(gatewayGetAuth, JSON.toJSONString(apiReq));
JSONObject params = JSONObject.parseObject(post);
if (!params.get("code").equals(200) || org.springframework.util.StringUtils.isEmpty(params.get("data"))){
throw ResponseException.of_error("授权失败!");
}
logger.info("###########################购买商品:授权成功!##############################");
// 获取到盐值和token
String data = params.getString("data");
JSONObject parse = JSONObject.parseObject(data);
String authCode = parse.getString("authCode");
String salt = parse.getString("salt");
if (StringUtils.isEmpty(authCode) || StringUtils.isEmpty(salt)) {
return Result.of_error("授权失败,未获取到授权码和盐值!");
}
Map<String, String> map = new HashMap();
map.put("authCode",authCode);
map.put("salt",salt);
return Result.ok(map);
}
/**
* 新增订单关系表:订单表,订单支付表,订单商品表
*/
public Result addOrder(GoodsByAuthorizationReq payReq) throws ResponseException{
// 新增订单主表
Order order = new Order();
order.setCustomerId(payReq.getCustomerId());
order.setOrderMoney(payReq.getDataPrice());
order.setOrderStatus(OrderStatusEnum.YZF.getValue());
order.setPaymentMoney(payReq.getDataPrice());
order.setOrderTime(DateUtils.getToday());
order.setPaymentTime(order.getOrderTime());
order.setPaymentMethod(PaymentMethodEnum.YE.getValue());
order.setSellerId(getUserId()); //
// order.setDistrictMoney(); //TODO 优惠金额
order.setTakeEffectTime(order.getOrderTime());
order.setApiKey(payReq.getApiKey());
//处理生效期
Date time = getTime(payReq);
if (time != null) {
order.setInvalidTime(time);
}
order.setPurchaseMethod(payReq.getPurchaseMethod());
order.setPriceType(payReq.getPriceType());
order.setCrePerson(payReq.getCustomerId() + "");
order.setCreTime(DateUtils.getToday());
order.setDelFlag(DelFlagEnum.NO.getValue());
if (orderDao.insert(order) != 1) {
throw ResponseException.of_error("新增订单失败!");
}
logger.info("###########################购买商品:新增订单成功!##############################");
// 新增订单支付表/订单商品表
if (order.getOrderId() != null) {
OrderPayment orderPayment = new OrderPayment();
orderPayment.setSellerId(getUserId()); // TODO
orderPayment.setPaymentMoney(payReq.getDataPrice());
orderPayment.setPaymentTime(DateUtils.getToday());
orderPayment.setPaymentMethod(PaymentMethodEnum.YE.getValue());
// orderPayment.setDistrictMoney(); //TODO
orderPayment.setPaymentStatus(order.getOrderStatus());
orderPayment.setPurchaseMethod(payReq.getPurchaseMethod());
orderPayment.setCreTime(DateUtils.getToday());
orderPayment.setCrePerson(payReq.getCustomerId()+"");
orderPayment.setDelFlag(DelFlagEnum.NO.getValue());
if (orderPaymentDao.insert(orderPayment) != 1) {
throw ResponseException.of_error("新增订单支付表失败!");
}
logger.info("###########################购买商品:新增订单支付表成功!##############################");
// 订单商品表
OrderGoodsInfo goodsInfo = new OrderGoodsInfo();
goodsInfo.setOrderId(order.getOrderId());
goodsInfo.setDataGoodsId(payReq.getDataGoodsId());
goodsInfo.setCreTime(DateUtils.getToday());
goodsInfo.setCrePerson(payReq.getCustomerId()+"");
goodsInfo.setDelFlag(DelFlagEnum.NO.getValue());
// 新增
if (goodsInfoDao.insert(goodsInfo) != 1) {
throw ResponseException.of_error("新增订单商品表失败!");
}
logger.info("###########################购买商品:新增订单商品表成功!##############################");
}
return Result.ok(order);
}
/**
* 修改企业资产关系表:资产表,新增记录
*/
public Result uptAssets(GoodsByAuthorizationReq req, Order order) throws Exception{
// 获取企业资产信息
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("assets_id", req.getAssetsId());
queryWrapper.eq("del_flag", DelFlagEnum.NO.getValue());
FinanceCustomerAssets assets = financeCustomerAssetsDao.selectOne(queryWrapper);
// 可用金额减去支付金额
BigDecimal bigDecimal = new BigDecimal(assets.getUseMoney()+ "");
BigDecimal bigDecima2 = new BigDecimal(req.getDataPrice()+ "");
if (bigDecimal.compareTo(bigDecima2) == -1){
return Result.error("金额不足!请充值!");
}
BigDecimal subtract = bigDecimal.subtract(bigDecima2);
// 修改金额
assets.setUseMoney(subtract);
assets.setTotalMoney(subtract);
assets.setUptTime(DateUtils.getToday());
assets.setUptPerson(req.getCustomerId()+ "");
if (financeCustomerAssetsDao.updateById(assets) != 1) {
throw ResponseException.of_error("修改资产金额失败!");
}
logger.info("###########################购买商品:修改资产金额成功!##############################");
// 授权:获取到盐值和token,更新订单表
Result authorization = getAuthorization(req);
Map<String, String> map= (Map) authorization.getData();
order.setOrderId(order.getOrderId());
order.setGoodsToken(map.get("authCode"));
order.setSaltValue(map.get("salt"));
order.setUptTime(DateUtils.getToday());
order.setOrderNumber(NumberUtils.getOrderNumber(req.getCustomerId()+""));
order.setUptPerson(req.getCustomerId() + "");
if (orderDao.updateById(order) != 1) {
throw ResponseException.of_error("修改订单盐值失败!");
}
logger.info("###########################购买商品:修改订单盐值成功!##############################");
// 新增记录表
Long assetsId = assets.getAssetsId();
if (assetsId!= null) {
FinanceTradeFlow flow = new FinanceTradeFlow();
flow.setAssetsId(assetsId);
flow.setOrderId(order.getOrderId());
flow.setTradeFlowNumber(NumberUtils.getDealNum());// 交易流水编号
flow.setTradeMoney(req.getDataPrice());
flow.setTradeType(TradeFlowEnum.FK.getValue());
flow.setCreTime(DateUtils.getToday());
flow.setCrePerson(req.getCustomerId() + "");
flow.setTradeFlowNumber(NumberUtils.getDealNum());
flow.setDelFlag(DelFlagEnum.NO.getValue());
if (financeTradeFlowDao.insert(flow) != 1) {
throw ResponseException.of_error("新增记录表失败!");
}
logger.info("###########################购买商品:新增记录表成功!##############################");
}
return Result.ok(map);
}
/**
* 获取当前用户
* @return
*/
public Long getUserId() {
SysUserDto sysUserDto = (SysUserDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_SYS);
return sysUserDto.getUserId();
}
/** /**
* 自营数据-上传api * 自营数据-上传api
......
package com.jz.manage.moduls.service.impl; package com.jz.manage.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.SysUserDto;
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.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.mapper.DemandDao; import com.jz.manage.moduls.mapper.DemandDao;
import com.jz.manage.moduls.service.DemandService; import com.jz.manage.moduls.service.DemandService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
...@@ -15,4 +30,95 @@ import org.springframework.stereotype.Service; ...@@ -15,4 +30,95 @@ import org.springframework.stereotype.Service;
public class DemandServiceImpl implements DemandService { public class DemandServiceImpl implements DemandService {
@Autowired @Autowired
private DemandDao tDemandDao; 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());
}
if (StringUtils.isNotBlank(req.getAuditTime())) {
String startTime = req.getAuditTime().substring(0, 10) + " 00:00:00";
String endTime = req.getAuditTime().substring(11, 21) + " 23:59:59";
queryWrapper.between("audit_time", startTime, endTime);
}
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 demandId
* @return
*/
@Override
public Result findByDemand(Long demandId) {
QueryWrapper<Demand> query = new QueryWrapper<>();
query.eq("demand_id", demandId);
query.eq("del_flag", DelFlagEnum.NO.getValue());
Demand demand = tDemandDao.selectOne(query);
if (demand == null) {
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
return Result.of_success(demand);
}
/**
* 审核需求
*
* @param req
* @return
*/
@Override
public Result auditDemand(DemandAuditReq req) {
// 查询审核的需求
QueryWrapper<Demand> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("demand_id",req.getDemandId());
queryWrapper.eq("del_flag",DelFlagEnum.NO.getValue());
Demand demand = tDemandDao.selectOne(queryWrapper);
if (demand == null) {
return Result.of_error(ResultMsg.AUDIT_FAIL);
}
if ("01".equals(demand.getAuditStatus())) {
// 审核通过
if ("01".equals(req.getAuditStatus())) {
demand.setAuditStatus(AuditStatusEnum.YSH.getValue());
}
// 审核未通过
if ("02".equals(req.getAuditStatus())) {
demand.setAuditStatus(AuditStatusEnum.WTG.getValue());
}
demand.setRejectReason(req.getRejectReason());
demand.setAuditPerson(userDto().getUserId() + "");
demand.setAuditTime(DateUtils.getToday());
if (tDemandDao.updateById(demand) != 1) {
return Result.of_error(ResultMsg.AUDIT_FAIL);
}
return Result.of_success(ResultMsg.AUDIT_SUCCESS);
}
return Result.of_error("需求已审核");
}
public SysUserDto userDto() {
SysUserDto userDto = (SysUserDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_SYS);
return userDto;
}
} }
\ No newline at end of file
...@@ -34,6 +34,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -34,6 +34,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 企业客户充值记录(TFinanceCustomerBalance)表服务实现类 * 企业客户充值记录(TFinanceCustomerBalance)表服务实现类
...@@ -353,7 +354,7 @@ public class FinanceCustomerBalanceServiceImpl implements FinanceCustomerBalance ...@@ -353,7 +354,7 @@ public class FinanceCustomerBalanceServiceImpl implements FinanceCustomerBalance
.or().eq("telephone", search) .or().eq("telephone", search)
.or().like("linkman", search)); .or().like("linkman", search));
} }
DepartmentAssetsDto department = departmentDao.selectByDepartment(query); List<DepartmentAssetsDto> department = departmentDao.selectByDepartment(query);
return Result.of_success(ResultMsg.SUCCESS, department); return Result.of_success(ResultMsg.SUCCESS, department);
} }
return Result.of_error("搜索失败!"); return Result.of_error("搜索失败!");
......
package com.jz.manage.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.SysUserDto;
import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultMsg;
import com.jz.common.enums.DelFlagEnum;
import com.jz.common.utils.DateUtils;
import com.jz.common.utils.Result;
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.mapper.DataGoodsCategoryDao;
import com.jz.manage.moduls.mapper.MenuConfigDao;
import com.jz.manage.moduls.service.MenuConfigServer;
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;
import java.util.List;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/7
* @Version:
*/
@Service("menuConfigServer")
public class MenuConfigServerImpl implements MenuConfigServer {
@Autowired
private MenuConfigDao menuConfigDao;
@Autowired
private DataGoodsCategoryDao categoryDao;
@Autowired
private RedisTemplate redisTemplate;
/**
* 查询全部菜单
*
* @return
*/
@Override
public Result findList() {
QueryWrapper<MenuConfig> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("del_flag", DelFlagEnum.NO.getValue());
List<MenuConfig> menuConfigs = menuConfigDao.selectList(queryWrapper);
if (menuConfigs.size() != 0) {
return Result.ok(menuConfigs);
}
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
/**
* 编辑菜单
*
* @param req
* @return
*/
@Override
public Result editUrl(MenuConfigReq req) {
MenuConfig menuConfig = new MenuConfig();
menuConfig.setConfigId(req.getConfigId());
menuConfig.setConfigUrl(req.getConfigUrl());
menuConfig.setUptTime(DateUtils.getToday());
menuConfig.setUptPerson(userDto().getUserId() + "");
if (menuConfigDao.updateById(menuConfig) != 1) {
return Result.of_error(ResultMsg.UPDATE_FAIL);
}
return Result.ok();
}
/**
* 条件查询分类配置
*
* @param req
* @return
*/
@Override
public Result<IPage<DataGoodsCategory>> findCategory(CategoryConfigReq req) {
IPage<DataGoodsCategory> page = new Page<>(req.getPageNum(),req.getPageSize());
QueryWrapper<DataGoodsCategory> queryWrapper = new QueryWrapper<>();
if (StringUtils.isNotEmpty(req.getCategoryName())) {
queryWrapper.like("category_name",req.getCategoryName());
}
queryWrapper.eq("parent_id", "0");
queryWrapper.eq("del_flag",DelFlagEnum.NO.getValue());
queryWrapper.orderByDesc("cre_time");
IPage<DataGoodsCategory> list = categoryDao.selectPage(page, queryWrapper);
if (list.getTotal() != 0) {
return Result.of_success(list);
}
return Result.of_error(ResultMsg.FAILURE);
}
/**
* 编辑分类配置
*
* @param req
* @return
*/
@Override
public Result editCategory(CategoryConfigEditReq req) {
DataGoodsCategory category = new DataGoodsCategory();
category.setCategoryId(req.getCategoryId());
category.setCategoryPicture(req.getCategoryPicture());
category.setCategoryDesc(req.getCategoryDesc());
category.setUptTime(DateUtils.getToday());
category.setUptPerson(userDto().getUserId() + "");
if (categoryDao.updateById(category) != 1) {
return Result.of_error(ResultMsg.UPDATE_FAIL);
}
return Result.ok("分类配置成功!");
}
public SysUserDto userDto() {
SysUserDto userDto = (SysUserDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_SYS);
return userDto;
}
}
...@@ -64,6 +64,8 @@ public class PictureServiceImpl implements PictureService { ...@@ -64,6 +64,8 @@ public class PictureServiceImpl implements PictureService {
filePath = "/picture/logo"; filePath = "/picture/logo";
}else if (params.equals("businessLicense")) { }else if (params.equals("businessLicense")) {
filePath = "/picture/businessLicense"; filePath = "/picture/businessLicense";
}else if (params.equals("category")) {
filePath = "/picture/category";
} }
boolean flag = FtpUtil.uploadFile(ftpUrl, port, username, password, "/", filePath, picture, file.getInputStream()); boolean flag = FtpUtil.uploadFile(ftpUrl, port, username, password, "/", filePath, picture, file.getInputStream());
if (flag) { if (flag) {
......
package com.jz.manage.moduls.service.impl;
import com.jz.manage.moduls.mapper.RoleGoodsDao;
import com.jz.manage.moduls.service.RoleGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/2
* @Version:
*/
@Service("RoleGoodsService")
public class RoleGoodsServiceImpl implements RoleGoodsService {
@Autowired
private RoleGoodsDao roleGoodsDao;
}
package com.jz.manage.moduls.service.impl;
import com.jz.manage.moduls.service.SceneCategoryService;
import org.springframework.stereotype.Service;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
@Service("SceneCategoryService")
public class SceneCategoryServiceImpl implements SceneCategoryService {
}
...@@ -72,8 +72,10 @@ logging: ...@@ -72,8 +72,10 @@ logging:
com.jz.manage: debug com.jz.manage: debug
domain: domain:
apigateway: http://47.115.53.1:8088/api/producer/addDataBankApiInfo gatewayGetAuth: http://127.0.0.1:8088/api/auth/mall-user-auth-api
apigateway: http://127.0.0.1:8088/api/producer/addDataBankApiInfo
updateSendStatus: http://127.0.0.1:8088/api/interface/updateSendStatus
updateAuthRenew: http://192.168.1.114:8088/api/auth/auth-renew
ftp: ftp:
url: 192.168.1.141 url: 192.168.1.141
port: 21 port: 21
......
<?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.manage.moduls.mapper.BannerDao">
<select id="selectByList" resultType="com.jz.manage.moduls.entity.Banner">
SELECT
t.*
from
(
SELECT
banner_id as bannerId,
banner_name as bannerName,
banner_location as bannerLocation,
banner_desc as bannerDesc,
banner_start as bannerStart,
banner_end as bannerEnd,
upt_time as uptTime,
sort as sort,
banner_url as bannerUrl,
(CASE WHEN ( banner_start &lt;= DATE_FORMAT(NOW(),'%Y-%m-%d') &lt;= banner_end) THEN '01' ELSE '02' END ) bannerStatus,
del_flag as delFlag
FROM
t_banner
)t
${ew.customSqlSegment}
</select>
</mapper>
\ No newline at end of file
...@@ -344,16 +344,30 @@ ...@@ -344,16 +344,30 @@
</select> </select>
<select id="selectByDepartment" resultType="com.jz.manage.moduls.controller.finance.platForm.dto.DepartmentAssetsDto"> <select id="selectByDepartment" resultType="com.jz.manage.moduls.controller.finance.platForm.dto.DepartmentAssetsDto">
SELECT SELECT
t1.department_id AS department_id, t1.department_id AS departmentId,
t1.department_name, t1.department_name AS departmentName,
t1.linkman, t1.linkman AS linkman,
t1.telephone, t1.telephone AS telephone,
t1.unified_credit_code, t1.unified_credit_code AS unifiedCreditCode,
t2.use_money t2.use_money AS useMoney,
FROM t2.assets_id AS assetsId,
t_department t1 t3.customer_id AS customerId,
JOIN t_finance_customer_assets t2 ON t1.department_id = t2.department_id t3.customer_name AS customerName,
t4.take_effect_time as takeEffectTime,
t6.data_name as dataName,
t4.take_effect_time as takeEffectTime,
t4.invalid_time as invalidTime,
t4.purchase_method as purchaseMethod,
t4.payment_money as paymentMoney,
t4.order_id as orderId
FROM
t_department t1
INNER JOIN t_finance_customer_assets t2 ON t1.department_id = t2.department_id
INNER JOIN t_mall_customer t3 ON t1.department_id = t3.department_id
left join t_order t4 on t4.customer_id = t3.customer_id
inner join t_order_goods_info t5 on t4.order_id = t5.order_id
INNER JOIN t_data_goods t6 on t6.data_goods_id = t5.data_goods_id
${ew.customSqlSegment} ${ew.customSqlSegment}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -63,4 +63,24 @@ ...@@ -63,4 +63,24 @@
t1.del_flag = 'N' t1.del_flag = 'N'
<if test="dataGoodsId != null"> and t1.data_goods_id = #{dataGoodsId}</if> <if test="dataGoodsId != null"> and t1.data_goods_id = #{dataGoodsId}</if>
</select> </select>
<select id="selectByList" resultType="com.jz.manage.moduls.controller.goods.bean.dto.DepartmentDataGoodsDto">
SELECT
t3.department_id as departmentId,
t3.department_name as departmentName,
t6.category_name as categoryName,
t1.take_effect_time as takeEffectTime,
t1.invalid_time as invalidTime,
t5.data_name as dataName ,
t5.data_goods_id as dataGoodsId,
(CASE WHEN ( t1.invalid_time >= DATE_FORMAT(NOW(), '%Y-%m-%d')) THEN '有效' ELSE '无效' END ) as goodsStatus
FROM
t_order t1
inner join t_mall_customer t2 on t1.customer_id = t2.customer_id
inner join t_department t3 on t3.department_id = t2.department_id
inner join t_order_goods_info t4 on t1.order_id = t4.order_id
inner join t_data_goods t5 on t4.data_goods_id = t5.data_goods_id
left join t_data_goods_category t6 on t5.category_id = t6.category_id
${ew.customSqlSegment}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -58,11 +58,11 @@ ...@@ -58,11 +58,11 @@
</where> </where>
</select> </select>
<!--新增所有列--> <!--&lt;!&ndash;新增所有列&ndash;&gt;-->
<insert id="insert" keyProperty="categoryId" useGeneratedKeys="true"> <!--<insert id="insert" keyProperty="categoryId" useGeneratedKeys="true">-->
insert into t_data_goods_category(category_name, parent_id, if_child, cre_time, upt_time, del_flag) <!--insert into t_data_goods_category(category_name, parent_id, if_child, cre_time, upt_time, del_flag)-->
values (#{categoryName}, #{parentId}, #{ifChild}, #{creTime}, #{uptTime}, #{delFlag}) <!--values (#{categoryName}, #{parentId}, #{ifChild}, #{creTime}, #{uptTime}, #{delFlag})-->
</insert> <!--</insert>-->
<insert id="insertBatch" keyProperty="categoryId" useGeneratedKeys="true"> <insert id="insertBatch" keyProperty="categoryId" useGeneratedKeys="true">
insert into t_data_goods_category(category_name, parent_id, if_child, cre_time, upt_time, insert into t_data_goods_category(category_name, parent_id, if_child, cre_time, upt_time,
...@@ -119,9 +119,72 @@ ...@@ -119,9 +119,72 @@
</delete> </delete>
<select id="selectByList" resultType="com.jz.manage.moduls.entity.DataGoodsCategory" parameterType="map"> <select id="selectByList" resultType="com.jz.manage.moduls.entity.DataGoodsCategory" parameterType="map">
SELECT
*
FROM
(
SELECT
t3.category_id as categoryId,
t3.category_name as categoryName,
t3.parent_id as parentId,
t3.if_child as ifChild,
t3.del_flag as delFlag
FROM
(
SELECT
t1.*,
IF
( FIND_IN_SET( parent_id, @pids ) > 0, @pids := CONCAT( @pids, ',', category_id ), '0' ) AS ischild
FROM
( SELECT * FROM t_data_goods_category AS t WHERE t.del_flag = 'N' ORDER BY t.category_id ASC ) t1,
( SELECT @pids := ( SELECT category_id FROM t_data_goods_category WHERE category_name = #{categoryName} ) ) t2
) t3
WHERE
ischild != '0' UNION ALL
SELECT
T2.category_id,
T2.category_name,
T2.parent_id,
T2.if_child,
T2.del_flag
FROM
(
SELECT
@r AS _id,
( SELECT @r := parent_id FROM t_data_goods_category WHERE category_id = _id ) AS parent_id,
@l := @l + 1 AS lvl
FROM
( SELECT @r := ( SELECT category_id FROM t_data_goods_category WHERE category_name = #{categoryName} ), @l := 0 ) vars,
t_data_goods_category h
WHERE
@r != 0
) T1
JOIN t_data_goods_category T2 ON T1._id = T2.category_id
) t
where t.delFlag = 'N'
</select>
<select id="findByScene" resultType="com.jz.manage.moduls.entity.DataGoodsCategory">
select select
category_id, category_name, parent_id, if_child category_id, category_name
from t_data_goods_category from t_data_goods_category
where del_flag = 'N' where del_flag = 'N'
</select> </select>
<select id="getCategoryDetail" resultType="com.jz.manage.moduls.controller.goods.bean.dto.CategoryAndSceneDto">
SELECT
t1.category_id as categoryId,
t1.category_name as categoryName,
t3.scene_id as sceneId,
t3.scene_name as sceneName
FROM
t_data_goods_category t1
left JOIN t_scene_goods_category t2 on t1.category_id = t2.category_id
left JOIN t_scene_category t3 on t2.scene_id = t3.scene_id
where
t1.del_flag = 'N'
<if test="categoryId != null">
and t1.category_id = #{categoryId}
</if>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
SELECT SELECT
t1.data_goods_id as dataGoodsId, t1.data_goods_id as dataGoodsId,
t1.data_name as dataName, t1.data_name as dataName,
(CASE WHEN t3.api_type = '01' then 'api' WHEN t3.api_type = '02' then '数据包' end) apiType, (CASE WHEN t1.data_type = '01' then 'api' WHEN t1.data_type = '02' then '数据包' end) dataType,
t1.category_id as categoryId, t1.category_id as categoryId,
t2.category_name as categoryName, t2.category_name as categoryName,
t1.upt_time as uptTime, t1.upt_time as uptTime,
...@@ -61,43 +61,19 @@ ...@@ -61,43 +61,19 @@
(CASE WHEN t1.data_status = '01' then '预售' (CASE WHEN t1.data_status = '01' then '预售'
WHEN t1.data_status = '02' then '在售中' WHEN t1.data_status = '02' then '在售中'
WHEN t1.data_status = '03' then '下架' WHEN t1.data_status = '03' then '下架'
WHEN t1.data_status = '04' then '上架' end) dataStatus WHEN t1.data_status = '04' then '上架' end) dataStatus,
(CASE WHEN ( t1.goods_limited >= DATE_FORMAT(NOW(), '%Y-%m-%d')) THEN '有效' ELSE '无效' END ) goodsState
FROM FROM
t_data_goods t1 t_data_goods t1
INNER JOIN t_data_goods_category t2 ON t1.category_id = t2.category_id INNER JOIN t_data_goods_category t2 ON t1.category_id = t2.category_id
INNER JOIN t_data_goods_api t3 ON t1.data_goods_id = t3.data_goods_id ${ew.customSqlSegment}
where t1.del_flag = 'N'
and
t1.audit_status = '02'
<if test="dataGoodsId != null">
and t1.data_goods_id = #{dataGoodsId}
</if>
<if test="categoryId != null">
and t1.category_id = #{categoryId}
</if>
<if test="dataName != null and dataName != ''">
and t1.data_name like concat('%',#{dataName},'%')
</if>
<if test="apiType != null and apiType != ''">
and t3.api_type = #{apiType}
</if>
<if test="dataStatus != null and dataStatus != ''">
and t1.data_status = #{dataStatus}
</if>
<if test="uptTime != null and uptTime != ''">
order by t1.upt_time desc
</if>
<if test="creTime != null and creTime != ''">
order by t1.cre_time desc
</if>
</select> </select>
<!--新增所有列--> <!--新增所有列-->
<insert id="insert" keyProperty="dataGoodsId" useGeneratedKeys="true"> <!--<insert id="insert" keyProperty="dataGoodsId" useGeneratedKeys="true">-->
insert into t_data_goods(category_id, user_id, data_name, data_type, data_label, data_picture, data_price, discount_price, price_type, goods_standards, data_status, audit_status, clean_rule, reject_reason, audit_person, audit_time, cre_time, cre_person, upt_time, upt_person, del_flag, year_type, season_type, month_type, second_type) <!--insert into t_data_goods(category_id, user_id, data_name, data_type, data_label, data_picture, data_price, discount_price, price_type, goods_standards, data_status, audit_status, clean_rule, reject_reason, audit_person, audit_time, cre_time, cre_person, upt_time, upt_person, del_flag, year_type, season_type, month_type, second_type)-->
values (#{categoryId}, #{userId}, #{dataName}, #{dataType}, #{dataLabel}, #{dataPicture}, #{dataPrice}, #{discountPrice}, #{priceType}, #{goodsStandards}, #{dataStatus}, #{auditStatus}, #{cleanRule}, #{rejectReason}, #{auditPerson}, #{auditTime}, #{creTime}, #{crePerson}, #{uptTime}, #{uptPerson}, #{delFlag}, #{yearType}, #{seasonType}, #{monthType}, #{secondType}) <!--values (#{categoryId}, #{userId}, #{dataName}, #{dataType}, #{dataLabel}, #{dataPicture}, #{dataPrice}, #{discountPrice}, #{priceType}, #{goodsStandards}, #{dataStatus}, #{auditStatus}, #{cleanRule}, #{rejectReason}, #{auditPerson}, #{auditTime}, #{creTime}, #{crePerson}, #{uptTime}, #{uptPerson}, #{delFlag}, #{yearType}, #{seasonType}, #{monthType}, #{secondType})-->
</insert> <!--</insert>-->
<insert id="insertBatch" keyProperty="dataGoodsId" useGeneratedKeys="true"> <insert id="insertBatch" keyProperty="dataGoodsId" useGeneratedKeys="true">
insert into t_data_goods(category_id, user_id, data_name, data_type, data_label, data_picture, insert into t_data_goods(category_id, user_id, data_name, data_type, data_label, data_picture,
......
<?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.manage.moduls.mapper.RoleGoodsDao">
<select id="findByRole" resultType="com.jz.manage.moduls.entity.RoleGoods">
SELECT
GROUP_CONCAT(role_id) as roleName,
data_goods_id as dataGoodsId
FROM
`t_role_goods`
where
del_flag = 'N'
<if test="dataGoodsId != null" >
and data_goods_id = #{dataGoodsId}
</if>
GROUP BY data_goods_id
</select>
</mapper>
\ No newline at end of file
...@@ -297,4 +297,38 @@ ...@@ -297,4 +297,38 @@
<if test="endTime != null"> and #{endTime} >= cre_time</if> <if test="endTime != null"> and #{endTime} >= cre_time</if>
)t2 )t2
</select> </select>
<select id="selectByGoods" resultType="com.jz.manage.moduls.controller.goods.bean.dto.DataAndOrderDto">
SELECT
count(t1.order_id) as orderTotal,
( t1.invalid_time >= DATE_FORMAT( NOW( ), '%Y-%m-%d' ) ) orderState,
t1.purchase_method as purchaseMethod,
t1.api_key as apiKey
FROM
t_order t1
left join t_order_goods_info t2 on t1.order_id = t2.order_id
left join t_data_goods t3 on t2.data_goods_id = t3.data_goods_id
where t1.del_flag = 'N'
<if test="goodsId != null">
and t3.data_goods_id = #{goodsId}
</if>
</select>
<select id="isAuthorization" resultType="com.jz.manage.moduls.controller.order.bean.dto.OrderAndAuthorizedDto">
SELECT
t1.customer_id,
(CASE WHEN ( t1.invalid_time >= DATE_FORMAT(NOW(), '%Y-%m-%d')) THEN '01' ELSE '02' END ) goodsState
FROM
t_order t1
left join t_order_goods_info t2 on t1.order_id = t2.order_id
where
1=1 and
t1.del_flag = 'N'
<if test="customerId != null">
and t1.customer_id = #{customerId}
</if>
<if test="customerId != null">
and t2.data_goods_id = #{dataGoodsId}
</if>
</select>
</mapper> </mapper>
\ 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