Commit 941546c7 authored by zhangc's avatar zhangc

Merge branch 'dm_dev' of http://gitlab.ioubuy.cn/yaobenzhang/dm_project into dm_dev

 Conflicts:
	jz-dm-apigateway/src/main/java/com/jz/dm/service/request/ApiQueryService.java
parents ff9c5002 481c4b27
......@@ -5,4 +5,21 @@
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 api_desc varchar(512) DEFAULT NULL COMMENT '接口描述';
alter table t_platform_log add request_type char(2) NOT NULL COMMENT '请求状态:01成功,02失败';
\ No newline at end of file
alter table t_platform_log add request_type char(2) NOT NULL COMMENT '请求状态:01成功,02失败';
alter table t_data_goods add goods_limited datetime DEFAULT NULL COMMENT'商品有限期';
alter table t_data_goods add data_maximum varchar(16) DEFAULT NULL COMMENT'数据最大量';
alter table t_data_goods add max_pages varchar(16) default NULL COMMENT'最大页数';
alter table t_data_goods add data_size varchar(16) default NULL COMMENT'每页数据量';
alter table t_data_goods add scene_id Bigint(20) default NULL COMMENT'场景分类id';
alter table t_role_goods add del_flag char(1) DEFAULT 'N' COMMENT '删除标识:Y是,N否';
alter table t_data_goods add `api_key` varchar(64) DEFAULT NULL COMMENT 'apikey';
alter table t_scene_goods_category add del_flag char(1) DEFAULT 'N' COMMENT '删除标识:Y是,N否';
alter table t_data_goods_category add `category_picture` varchar(128) DEFAULT NULL COMMENT '分类图片';
alter table t_data_goods_category add `category_location` varchar(128) DEFAULT NULL COMMENT '图片位置';
alter table t_data_goods_category add category_desc varchar(40) DEFAULT NULL COMMENT '分类描述';
alter table t_banner add sort Bigint(20) DEFAULT NULL COMMENT '排序';
alter table t_banner add banner_url varchar(128) DEFAULT NULL COMMENT '广告链接';
alter table t_mall_customer add customer_source char(2) DEFAULT NULL COMMENT '账号来源:01DB,02VSS';
alter table t_department add department_source char(2) DEFAULT NULL COMMENT '企业来源:01DB,02VSS';
alter table t_mall_customer add vendor_id varchar(128) DEFAULT NULL COMMENT '供应商编码';
alter table t_order add department_id bigint(20) DEFAULT NULL COMMENT '企业id';
\ 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='菜单配置';
......@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
......@@ -28,6 +29,11 @@ public class MallCustomerApiDto implements Serializable {
*/
@ApiModelProperty(value = "企业id")
private Long departmentId;
@ApiModelProperty(value = "企业名称")
private String departmentName;
@ApiModelProperty(value = "供应商编号")
private String vendorId;
/**
* 密码
*/
......
......@@ -29,6 +29,11 @@ public enum ResultMsg {
TRANS_FAIL("转账失败"),
RECHARGE_SUCCESS("充值成功"),
RECHARGE_FAIL("充值失败"),
AUDIT_SUCCESS("审核成功"),
AUDIT_FAIL("审核失败"),
/**
* 需审核
*/
NEED_AUDIT("已提交审核"),
DATA_NOT_FOUND("查询结果为空"),
REPEATED_REQUEST("重复请求"),
......
package com.jz.common.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
......@@ -30,108 +32,144 @@ public class DataGoods implements Serializable {
/**
* 商品分类id(行业)
*/
@TableField("category_id")
private Long categoryId;
@TableField("scene_id")
private Long sceneId;
/**
* 数据商户id
*/
@TableField("user_id")
private Long userId;
@ApiModelProperty(value = "唯一数据商品标识")
@TableField("api_openid")
private String apiOpenid;
/**
* 数据商品名称
*/
@TableField("data_name")
private String dataName;
/**
* 数据类型:01api,02数据包
*/
@TableField("data_type")
private String dataType;
/**
* 数据商品标签
*/
@TableField("data_label")
private String dataLabel;
/**
* 数据商品图片
*/
@TableField("data_picture")
private String dataPicture;
/**
* 数据商品价格
*/
@TableField("data_price")
private BigDecimal dataPrice;
/**
* 优惠价格
*/
@TableField("discount_price")
private BigDecimal discountPrice;
/**
* 价格类型:01免费,02收费
*/
@TableField("price_type")
private String priceType;
/**
* 商品规格
*/
@TableField("goods")
private String goodsStandards;
/**
* 数据状态:01预售,02在售中,03下架,04上架
*/
@TableField("data_status")
private String dataStatus;
/**
* 审核状态:01待审核,02已审核,03未通过
*/
@TableField("audit_status")
private String auditStatus;
/**
* 清洗规则(脱敏校验)
*/
@TableField("clean_rule")
private String cleanRule;
/**
* 驳回原因
*/
@TableField("reject_reason")
private String rejectReason;
/**
* 审核人
*/
@TableField("audit_person")
private String auditPerson;
/**
* 审核时间
*/
@TableField("audit_time")
private Date auditTime;
/**
* 创建时间
*/
@TableField("cre_time")
private Date creTime;
/**
* 创建人
*/
@TableField("cre_person")
private String crePerson;
/**
* 更新时间
*/
@TableField("upt_time")
private Date uptTime;
/**
* 更新人
*/
@TableField("upt_person")
private String uptPerson;
/**
* 删除标识
*/
@TableField("del_flag")
private String delFlag;
/**
* 年(元)
*/
@TableField("year_type")
private BigDecimal yearType;
/**
* 季(元)
*/
@TableField("season_type")
private BigDecimal seasonType;
/**
* 月(元)
*/
@TableField("month_type")
private BigDecimal monthType;
/**
* 次(元)
*/
@TableField("second_type")
private BigDecimal secondType;
@TableField("data_desc")
private String dataDesc;
@TableField("data_maximum")
private Long dataMaximum;
@TableField("max_pages")
private Long maxPages;
@TableField("data_size")
private Long dataSize;
@TableField("goods_limited")
private Date goodsLimited;
}
\ No newline at end of file
package com.jz.common.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;
......@@ -21,120 +24,152 @@ public class Department implements Serializable {
/**
* 企业id
*/
@TableId(value = "department_id",type = IdType.AUTO)
private Long departmentId;
/**
* 企业名称
*/
@TableField(value = "department_name")
private String departmentName;
/**
* 法人代表
*/
@TableField(value = "legal_representative")
private String legalRepresentative;
/**
* 省份
*/
@TableField(value = "province")
private String province;
/**
* 城市
*/
@TableField(value = "city")
private String city;
@TableField(value = "linkman")
private String linkman;
/**
* 行业
*/
@TableField(value = "industry")
private String industry;
/**
* 联系电话
*/
@TableField(value = "telephone")
private String telephone;
/**
* 注册地址
*/
@TableField(value = "registered_address")
private String registeredAddress;
/**
* 区域编码
*/
@TableField(value = "zone_code")
private Object zoneCode;
/**
* 企业照片
*/
@TableField(value = "depart_picture")
private String departPicture;
/**
* 营业执照
*/
@TableField(value = "business_license")
private String businessLicense;
/**
* 税务登记
*/
@TableField(value = "tax_registration")
private String taxRegistration;
/**
* 企业照片(代码)到期时间
*/
@TableField(value = "depart_picture_time")
private Date departPictureTime;
/**
* 营业执照到期时间
*/
@TableField(value = "business_license_time")
private Date businessLicenseTime;
/**
* 税务登记到期时间
*/
@TableField(value = "tax_registration_time")
private Date taxRegistrationTime;
@TableField(value = "department_source")
private String departmentSource;
/**
* 统一社会信用代码
*/
@TableField(value = "unified_credit_code")
private String unifiedCreditCode;
/**
* 开户行名称
*/
@TableField(value = "bank_name")
private String bankName;
/**
* 银行卡号
*/
@TableField(value = "bank_card_number")
private String bankCardNumber;
/**
* 开户行地址
*/
@TableField(value = "bank_address")
private String bankAddress;
/**
* 开户行号
*/
@TableField(value = "bank_no")
private String bankNo;
/**
* 审核状态:01待审核,02已审核,03未通过
*/
@TableField(value = "audit_status")
private String auditStatus;
/**
* 驳回原因
*/
@TableField(value = "reject_reason")
private String rejectReason;
/**
* 审核人
*/
@TableField(value = "audit_person")
private String auditPerson;
/**
* 审核时间
*/
@TableField(value = "audit_time")
private Date auditTime;
/**
* 创建时间
*/
@TableField(value = "cre_time")
private Date creTime;
/**
* 创建人
*/
@TableField(value = "cre_person")
private String crePerson;
/**
* 更新时间
*/
@TableField(value = "upt_time")
private Date uptTime;
/**
* 更新人
*/
@TableField(value = "upt_person")
private String uptPerson;
/**
* 删除标识
*/
@TableField(value = "del_flag")
private String delFlag;
......
package com.jz.common.enums;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/2
* @Version:
*/
public enum DataGoodsByRoleEnum {
logOutUser("logOutUser", "1"),
unverifiedUser("unverifiedUser", "2"),
authenticatedUser("authenticatedUser", "3"),
;
private String code;
private String value;
DataGoodsByRoleEnum(String code, String value) {
this.code = code;
this.value = value;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static DataGoodsByRoleEnum get(String code) {
if (code == null) {
return null;
}
for (DataGoodsByRoleEnum status : values()) {
if (status.getCode().equalsIgnoreCase(code)) {
return status;
}
}
return null;
}
}
package com.jz.common.enums;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/1
* @Version:
*/
public enum DataStatusEnum {
YS("YS", "01"),
ZS("ZS", "02"),
XJ("XJ", "03"),
SJ("SJ", "04"),
;
private String code;
private String value;
DataStatusEnum(String code, String value) {
this.code = code;
this.value = value;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static DataStatusEnum get(String code) {
if (code == null) {
return null;
}
for (DataStatusEnum status : values()) {
if (status.getCode().equalsIgnoreCase(code)) {
return status;
}
}
return null;
}
}
package com.jz.common.enums;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
public enum OrderStatusEnum {
DZF("DZF", "01"),
YZF("YZF", "02"),
YQS("YQS", "03"),
;
private String code;
private String value;
OrderStatusEnum(String code, String value) {
this.code = code;
this.value = value;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static OrderStatusEnum get(String code) {
if (code == null) {
return null;
}
for (OrderStatusEnum status : values()) {
if (status.getCode().equalsIgnoreCase(code)) {
return status;
}
}
return null;
}
}
package com.jz.common.enums;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
public enum YNEnum {
YES("YES", "Y"),
NO("NO", "N"),
;
private String code;
private String value;
private YNEnum(String code, String value) {
this.code = code;
this.value = value;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static YNEnum get(String code) {
if (code == null) {
return null;
}
for (YNEnum status : values()) {
if (status.getCode().equalsIgnoreCase(code)) {
return status;
}
}
return null;
}
}
package com.jz.common.enums.auth;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
public enum CategoryByIfSceneEnum {
YES("场景分类", "Y"),
NO("商品分类", "N"),
;
private String code;
private String value;
CategoryByIfSceneEnum(String code, String value) {
this.code = code;
this.value = value;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static CategoryByIfSceneEnum get(String code) {
if (code == null) {
return null;
}
for (CategoryByIfSceneEnum status : values()) {
if (status.getCode().equalsIgnoreCase(code)) {
return status;
}
}
return null;
}
}
package com.jz.common.utils;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.CollectionUtils;
public class CommonUtils {
private static final Logger logger = LoggerFactory.getLogger(CommonUtils.class);
/**
* UUID随机数
* @return
*/
public static String generatePrimaryKeyId() {
String id = UUID.randomUUID().toString().toUpperCase().replaceAll("-", "");
return id;
}
/**
* @Title: generateTraceId
* @Description: TODO(生成traceId)
* @param @return 参数
* @return String 返回类型
* @throws
*/
public static String generateTraceId() {
String traceId = UUID.randomUUID().toString().toUpperCase().replaceAll("-", "");
return traceId;
}
/**
* @Title: generateUuid
* @Description: TODO(生成uuid)
* @param @return 参数
* @return String 返回类型
* @throws
*/
public static String generateUuid() {
String uuid = UUID.randomUUID().toString().toUpperCase().replaceAll("-", "");
return uuid;
}
/**
* @param <T>
* @Title: objArrangeTree
* @Description: TODO(将所有的资源整理成树形结构)
* @param @param dmpPermissions
* @param @return
* @param @throws Exception 参数
* @return List<DmpPermission> 返回类型
* @throws
*/
public static <T> List<T> objArrangeTree(Object parentCode, List<T> objs, String parentCodeFiledName, String codeFieldName, String childrenFieldName) throws Exception {
Map<Object, List<T>> dictMap = objs.stream().collect(Collectors.groupingBy(x->{
try {
return ReflectAssistUtils.getFieldValueByFieldName(parentCodeFiledName, x);
} catch (Exception e) {
e.printStackTrace();
logger.error("树形结构封装异常【{}】", e);
}
return "";
}));
List<T> tList = dictMap.get(parentCode);// 获取顶层资源
if (!CollectionUtils.isEmpty(tList)) {
for (T t : tList) {
t = arrangeChildren(t, dictMap, codeFieldName, childrenFieldName);
}
}
return tList;
}
/**
* @Title: arrangeChildren
* @Description: TODO(这里用一句话描述这个方法的作用)
* @param @param permission
* @param @param dictMap
* @param @return
* @param @throws Exception 参数
* @return DmpPermission 返回类型
* @throws
*/
private static <T> T arrangeChildren(T t, Map<Object, List<T>> dictMap, String codeFieldName, String childrenFieldName)throws Exception{
Object code = ReflectAssistUtils.getFieldValueByFieldName(codeFieldName, t);
List<T> children = dictMap.get(code);
if (!CollectionUtils.isEmpty(children)) {
for (T child : children) {
child = arrangeChildren(child, dictMap, codeFieldName, childrenFieldName);
}
ReflectAssistUtils.setFieldValueByFieldName(childrenFieldName, t, children);
}
return t;
}
}
package com.jz.common.utils;
import com.jz.common.bean.SysUserDto;
import com.jz.common.constant.RedisMessageConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/7
* @Version:
*/
@Slf4j
@Component
public class CurrentUserUtil {
//
// @Resource
// private static RedisTemplate redisTemplate;
//
//
//
// public static SysUserDto userDto() {
// SysUserDto userDto = (SysUserDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_SYS);
// return userDto;
// }
}
......@@ -405,7 +405,19 @@ public class DateUtils {
long time = System.currentTimeMillis();
return (int) (time / 1000);
}
// public static void main(String[] args) {
// System.out.println(timestamp());
/**
* 计算有限期
* @param
* @return
*/
public static Date getLimitedTime(int time) {
Calendar cal = Calendar.getInstance();
cal.setTime(DateUtils.getToday());
cal.add(Calendar.YEAR, time);
return cal.getTime();
}
// public static void main(String[] args) throws Exception {
// System.out.println(DateUtils.parseDate2String(getLimitedTime(999)));
// }
}
package com.jz.common.utils;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
/**
* @ClassName: ReflectAssistUtils
* @Description: TODO(反射辅助工具类)
* @author ybz
* @date 2021年1月26日
*
*/
public class ReflectAssistUtils {
/**
* @Title: getFieldValueByFieldName
* @Description: TODO(根据属性名称获取属性值)
* @param @param fieldName
* @param @param cls
* @param @return
* @param @throws Exception 参数
* @return Field 返回类型
* @throws
*/
public static Object getFieldValueByFieldName(String fieldName, Object obj)throws Exception{
Class<?> cls = obj.getClass();
String getMethodName = "get"+fieldName.substring(0, 1).toUpperCase()+fieldName.substring(1);
Method getMethod = cls.getMethod(getMethodName);
return getMethod.invoke(obj);
}
/**
* @param <T>
* @Title: setFieldValueByFieldName
* @Description: TODO(设置属性值)
* @param @param fieldName
* @param @param cls
* @param @param fieldVaule
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
public static <T> void setFieldValueByFieldName(String fieldName, Object obj, T fieldVaule)throws Exception{
Class<?> cls = obj.getClass();
String setMethodName = "set"+fieldName.substring(0, 1).toUpperCase()+fieldName.substring(1);
Class<?> fieldValueClass = fieldVaule.getClass();
if (fieldVaule instanceof ArrayList) {
fieldValueClass = List.class;
}
Method setMethod = cls.getMethod(setMethodName, fieldValueClass);
setMethod.invoke(obj, fieldVaule);
}
}
package com.jz.dm.mall.moduls.controller;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.customer.bean.req.LoginByVSSReq;
import com.jz.dm.mall.moduls.service.MallCustomerService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.jz.dm.mall.moduls.service.TestService;
import org.springframework.web.servlet.ModelAndView;
@RestController
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("/test")
public class TestController {
@Autowired
private TestService testService;
public static void main(String[] args) throws Exception {
@Autowired
private MallCustomerService service;
public static void main(String[] args) {
System.out.println("s");
}
// public static void main(String[] args) throws Exception {
// //
// String filename="C:\\Users\\fengyq\\Desktop\\万家\\表格\\新建 XLSX 工作表.xlsx";
// // 创建工作簿
......@@ -46,12 +63,13 @@ public class TestController {
//
// // 关闭工作簿
// wk.close();
}
@RequestMapping("/hello")
public void test() throws Exception {
// }
@RequestMapping(value = "/hello",method = RequestMethod.POST)
@ApiOperation("hello")
public String test() throws Exception {
//Result result = service.loginByVss(req);
return "redirect:http://www.baidu.com";
}
}
......@@ -2,6 +2,7 @@ package com.jz.dm.mall.moduls.controller.company;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.company.bean.req.CompanyAddReq;
import com.jz.dm.mall.moduls.controller.company.bean.req.CompanyEditReq;
import com.jz.dm.mall.moduls.controller.company.bean.req.CompanyUpdateReq;
import com.jz.dm.mall.moduls.service.CompanyAuthService;
import io.swagger.annotations.Api;
......@@ -12,6 +13,7 @@ import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Mono;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
/**
* @author ZC
......@@ -74,12 +76,29 @@ public class CompanyAuthController {
return Mono.fromSupplier(() ->companyAuthService.checkCompanyInfo(request));
}
@PostMapping("editCompany")
@ApiOperation(value = "重新认证企业")
public Result editCompany(@RequestBody @Valid CompanyEditReq req) {
return companyAuthService.editCompany(req);
}
/**
* 获取省份
* @return
*/
@GetMapping("/getProvince")
@ApiOperation(value = "获取所有省份")
public Result getProvince() {
return companyAuthService.getProvince();
}
/**
* 获取城市
* @param provinceCode
* @param cityCode
* @return
*/
@PostMapping("/getCity")
@ApiOperation(value = "获取当前省份下的城市")
public Result getCity(@RequestParam(name = "provinceCode") String provinceCode,
......
......@@ -64,6 +64,6 @@ public class CompanyAddReq implements Serializable {
@ApiModelProperty(value = "登录用户名称",hidden = true)
private String loginName;
@ApiModelProperty(value = "用户角色 2:卖方,3:买方")
@ApiModelProperty(value = "用户角色 2:卖方,3:买方", hidden = true)
private Long roleId;
}
package com.jz.dm.mall.moduls.controller.company.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/18
* @Version:
*/
@ApiModel("重新认证企业校验请求参数")
@Data
public class CompanyEditReq implements Serializable {
@ApiModelProperty(value = "统一社会编码",required = true)
@NotNull(message = "统一社会编码不能为空")
private String unifiedCreditCode;
}
package com.jz.dm.mall.moduls.controller.customer;
import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultMsg;
import com.jz.common.utils.Result;
import com.jz.common.utils.StatusCode;
import com.jz.dm.mall.moduls.controller.customer.bean.dto.CustomerDto;
import com.jz.dm.mall.moduls.controller.customer.bean.req.LoginByVSSReq;
import com.jz.dm.mall.moduls.controller.customer.bean.req.LoginRequest;
import com.jz.dm.mall.moduls.entity.MallCustomer;
import com.jz.dm.mall.moduls.service.MallCustomerService;
......@@ -11,9 +13,18 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.catalina.servlet4preview.http.HttpServletRequest;
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.Controller;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* @ClassName:
......@@ -21,7 +32,7 @@ import org.springframework.web.bind.annotation.*;
* @Date: 2020/12/2
* @Version:
*/
@RestController
@Controller
@RequestMapping("/customer")
@Api(tags = "商城登陆--controller")
public class LoginController {
......@@ -41,11 +52,31 @@ public class LoginController {
* @return
*/
@PostMapping(value = "/login")
@ResponseBody
@ApiOperation(value = "登陆功能")
public Result result(@RequestBody LoginRequest customer) {
public Result login(@RequestBody LoginRequest customer) {
return mallCustomerService.loginByUser(customer);
}
@PostMapping(value = "/loginByVSS")
@ApiOperation(value = "登陆功能--Vss")
public String loginByVss(@RequestBody LoginByVSSReq req) {
try {
Result result = mallCustomerService.loginByVss(req);
return "redirect:http://www.baidu.com";
}catch (Exception e) {
e.printStackTrace();
}
return null;
}
@GetMapping(value = "/getUserMessage")
@ApiOperation(value = "vss--获取用户信息")
@ResponseBody
public Result getUserMessage() {
return mallCustomerService.getUserMessage();
}
/**
* 手机获取验证码
*
......@@ -53,6 +84,7 @@ public class LoginController {
* @return
*/
@PostMapping(value = "/getCode")
@ResponseBody
@ApiOperation("通过手机号码获取验证码")
public Result loginCheck(@RequestParam(value = "telephone") String telephone,
@RequestParam(value = "validateCode")String validateCode) throws Exception{
......@@ -79,6 +111,7 @@ public class LoginController {
* @return
*/
@GetMapping(value = "/phoneCheck")
@ResponseBody
@ApiOperation(value = "手机号码校验接口", notes = "手机号码是否已注册")
public Result phoneCheck(@RequestParam("telephone") String telephone) throws Exception{
if (telephone == null) {
......@@ -101,6 +134,7 @@ public class LoginController {
* @return
*/
@GetMapping(value = "/phoneUserCheck")
@ResponseBody
@ApiOperation(value = "手机号用户名重复校验接口", notes = "手机号用户名是否重复")
public Result phoneCheck(@RequestParam(value = "username") String username ,
@RequestParam(value = "password") String telephone, HttpServletRequest request) throws Exception{
......
package com.jz.dm.mall.moduls.controller.customer.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/24
* @Version:
*/
@ApiModel(value = "vss登陆账号请求参数")
@Data
public class LoginByVSSReq implements Serializable {
@ApiModelProperty(value = "用户账号")
@NotNull(message = "用户账号不能为空")
private String customerAccount;
@ApiModelProperty(value = "企业名称")
@NotNull(message = "企业名称不能为空")
private String departmentName;
@ApiModelProperty(value = "统一社会信用代码")
@NotNull(message = "统一社会信用代码不能为空")
private String unifiedCreditCode;
@ApiModelProperty(value = "供应商编码")
@NotNull(message = "供应商编码不能为空")
private String vendorId;
}
......@@ -4,15 +4,14 @@ package com.jz.dm.mall.moduls.controller.goods;
import com.jz.common.base.BaseController;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsApiDto;
import com.jz.dm.mall.moduls.controller.goods.bean.request.DataApiDetailsReq;
import com.jz.dm.mall.moduls.service.DataGoodsApiService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/**
......@@ -23,7 +22,7 @@ import java.util.List;
*/
@RestController
@RequestMapping("dataGoodsApi")
@Api(tags = "数据api-controller")
@Api(tags = "商城--数据目录--controller")
public class DataGoodsApiController extends BaseController {
/**
* 服务对象
......@@ -33,15 +32,12 @@ public class DataGoodsApiController extends BaseController {
/**
* 根据主键查询商品详情-api
* @param id
* @param
* @return
*/
@GetMapping("/getGoodsDetails/{id}")
@ApiOperation(value = "点击商品查看商品详情", notes = "api商品")
public Result<List<DataGoodsApiDto>> findById(@PathVariable(value = "id") Long id) {
if (id != null) {
return tDataGoodsApiService.selectById(id);
}
return Result.of_error("查询失败!");
@PostMapping("/findByDetails")
@ApiOperation(value = "数据预览--商品详情", notes = "api商品")
public Result findByDetails(@RequestBody @Valid DataApiDetailsReq req) {
return tDataGoodsApiService.findByDetails(req);
}
}
\ No newline at end of file
......@@ -20,21 +20,31 @@ import org.springframework.web.bind.annotation.RestController;
*/
@RestController
@RequestMapping("dataGoodsCategory")
@Api(tags = "数据商品分类行业")
@Api(tags = "商城--数据银行首页--controller")
public class DataGoodsCategoryController extends BaseController {
/**
* 服务对象
*/
@Autowired
private DataGoodsCategoryService categoryService;
/**
* 查询数据商品分类
* @return
*/
@GetMapping(value = "/findCategory")
@ApiOperation(value = "查询数据商品分类", notes = "查询所有的商品分类")
@ApiOperation(value = "首页--展示一级数据分类")
public Result findCategory() {
Result result = categoryService.findCategory();
if (StringUtils.isEmpty(result)) {
return Result.of_error("查询失败!");
}
return result;
return categoryService.findCategory();
}
/**
* 查询场景分类
* @return
*/
@GetMapping(value = "/findScene")
@ApiOperation(value = "首页--展示场景分类")
public Result findScene() {
return categoryService.findScene();
}
}
\ No newline at end of file
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.bean.BaseBeanResponse;
import com.jz.common.bean.BaseResponse;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants;
import com.jz.common.constant.ResultMsg;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsApiDto;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto;
import com.jz.dm.mall.moduls.controller.goods.bean.request.DataApiUpReq;
......@@ -29,7 +32,7 @@ import javax.servlet.http.HttpServletRequest;
*/
@RestController
@RequestMapping("dataGoods")
@Api(tags = "数据商品管理--controller")
@Api(tags = "商城--数据目录--controller")
public class DataGoodsController extends BaseController {
/**
* 服务对象
......@@ -94,25 +97,28 @@ public class DataGoodsController extends BaseController {
/**
* 列表查询商品数据
* @param dataGoodsListRequest
* @param req
* @param httpRequest
* @return
*/
@PostMapping(value = "/findList")
@ApiOperation(value = "分页展示商品列表", notes = "首页点击分类展示商品列表")
public PageInfoResponse<DataGoodsListDto> findByCategory(@RequestBody DataGoodsListRequest dataGoodsListRequest, HttpServletRequest httpRequest) {
PageInfoResponse<DataGoodsListDto> pageInfo = new PageInfoResponse<DataGoodsListDto>();
@ApiOperation(value = "数据目录--分页展示商品列表", notes = "首页点击分类展示商品列表")
public PageInfoResponse<DataGoodsListDto> findByCategory(@RequestBody DataGoodsListRequest req, HttpServletRequest httpRequest) {
PageInfoResponse<DataGoodsListDto> baseBeanResponse = new PageInfoResponse<DataGoodsListDto>();
try {
pageInfo = dataGoodsService.findList(dataGoodsListRequest, httpRequest);
baseBeanResponse = dataGoodsService.findList(req, httpRequest);
} catch (Exception e) {
pageInfo.setMessage("查询失败");
pageInfo.setCode(Constants.FAILURE_CODE);
baseBeanResponse.setMessage("查询失败");
baseBeanResponse.setCode(Constants.FAILURE_CODE);
e.printStackTrace();
}
return pageInfo;
return baseBeanResponse;
}
/**新增数据商品
* @param
* @return
......
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.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/20
* @Version:
*/
@ApiModel("api详情返回参数")
@Data
public class DataApiDetailsDto implements Serializable {
@ApiModelProperty(value = "apiId")
private Long id;
@ApiModelProperty(value = "apiKey")
private String apiKey;
@ApiModelProperty(value = "api名称")
private String apiName;
@ApiModelProperty(value = "返回类型")
private String outputType;
@ApiModelProperty(value = "目标地址")
private String targetUrl;
@ApiModelProperty(value = "加密方式 0:无 1:MD5,2:RES")
private String signType;
@ApiModelProperty(value = "传输方式 0,http,1.https")
private String apiProtocl;
@ApiModelProperty(value = "超时时间")
private Integer timeout;
@ApiModelProperty(value = "请求方式")
private String reqType;
@ApiModelProperty(value = "最大行数")
private Integer maxRow;
@ApiModelProperty(value = "每页返回数")
private Integer pageRow;
@ApiModelProperty(value = "调用限制")
private Long reqFrequency;
@ApiModelProperty(value = "api描述")
private String apiFunction;
@ApiModelProperty(value = "最大数据量")
private Integer maxData;
@ApiModelProperty(value = "请求参数")
private String requestParam;
@ApiModelProperty(value = "返回参数")
private String responseParam;
@ApiModelProperty(value = "api类型")
private String apiType;
}
package com.jz.dm.mall.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/23
* @Version:
*/
@ApiModel("返回参数")
@Data
public class DataApiDetailsParamsDto implements Serializable {
@ApiModelProperty(value = "参数名称")
private String paramsName;
@ApiModelProperty(value = "参数类型")
private String paramsType;
@ApiModelProperty(value = "参数描述")
private String paramsDesc;
@ApiModelProperty(value = "是否必填")
private String ifRequird;
}
package com.jz.dm.mall.moduls.controller.goods.bean.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jz.common.entity.DataGoodsApiParams;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @ClassName: 商品详情参数封装
......@@ -22,163 +22,91 @@ import java.util.List;
public class DataGoodsApiDto implements Serializable {
/**
* api商品id
* 商品详情
*/
@ApiModelProperty(value = "api商品id")
private Long goodsApi;
/**
* 数据id
*/
@ApiModelProperty(value = "数据id")
private Long dataGoodsId;
@ApiModelProperty(value = "分类名称")
private String categoryName;
/**
* api参数id
*/
@ApiModelProperty(value = "api参数id")
private Long apiParamsId;
/**
* api服务名称
*/
@ApiModelProperty(value = "数据名称")
@ApiModelProperty(value = "商品名称")
private String dataName;
/**
* 请求类型(方式)
*/
@ApiModelProperty(value = "请求类型(方式)")
private String requestType;
/**
* api接口地址
*/
@ApiModelProperty(value = "api接口地址")
private String apiUrl;
/**
* api接口方法
*/
@ApiModelProperty(value = "api接口方法")
private String apiMethod;
@ApiModelProperty(value = "api描述")
private String apiFunction;
/**
* api请求协议
*/
@ApiModelProperty(value = "api请求协议")
private String apiProtocl;
@ApiModelProperty(value = "服务商",hidden = true)
private String userId;
/**
* 返回类型
*/
@ApiModelProperty(value = "返回类型")
private String returnType;
@ApiModelProperty(value = "apiKey")
private String apiKey;
/**
* 更新时间
*/
@ApiModelProperty(value = "更新时间")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date uptTime;
/**
* 价格类型
*/
@ApiModelProperty(value = "价格类型")
private String priceType;
@ApiModelProperty(value = "所属商品分类")
private String categoryName;
@ApiModelProperty(value = "商品价格")
private BigDecimal dataPrice;
@ApiModelProperty(value = "")
private String yearType;
/**
* 供应商名称
*/
@ApiModelProperty(value = "供应商名称")
private String supplierName;
@ApiModelProperty(value = "季")
private String seasonType;
/**
* 参数分类
*/
@ApiModelProperty(value = "参数分类:01公共参数,02请求参数,03响应参数,04请求头参数,05状态码参数")
private String paramsDiff;
@ApiModelProperty(value = "月")
private String monthType;
@ApiModelProperty(value = "年(元)")
private BigDecimal yearType;
@ApiModelProperty(value = "")
private String secondType;
@ApiModelProperty(value = "季(元)")
private BigDecimal seasonType;
@ApiModelProperty(value = "商品有限期")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date goodsLimited;
@ApiModelProperty(value = "月(元)")
private BigDecimal monthType;
@ApiModelProperty(value = "数据大小")
private String dataBag;
@ApiModelProperty(value = "次(元)")
private BigDecimal secondType;
@ApiModelProperty(value = "商品描述")
private String dataDesc;
/**
* 参数名称
*/
@ApiModelProperty(value = "参数名称")
private String paramsName;
@ApiModelProperty(value = "商品图片")
private String dataPicture;
/**
* 参数类型
*/
@ApiModelProperty(value = "参数类型")
private String paramsTYpe;
@ApiModelProperty(value = "价格类型 01免费 02收费")
private String priceType;
/**
* 参数描述
*/
@ApiModelProperty(value = "参数描述")
private String paramsDesc;
@ApiModelProperty(value = "调用次数上限")
private Long reqFrequency;
/**
* 默认值
* api详情
*/
@ApiModelProperty(value = "默认值")
private String defaultValue;
@ApiModelProperty(value = "接口地址")
private String targetUrl;
/**
* 是否必选
*/
@ApiModelProperty(value = "是否必选:Y是,N否")
private String ifRequird;
@ApiModelProperty(value = "加密方式 0:无,1:MD5, 2:RSA")
private String signType;
/**
* 数据类型
*/
@ApiModelProperty(value = "数据类型")
private String dataType;
@ApiModelProperty(value = "传输方式")
private String apiProtocl;
/**
* api返回数据样例
*/
@ApiModelProperty(value = "api返回数据样例")
private String returnDataExample;
@ApiModelProperty(value = "请求方式")
private String reqType;
/**
* api请求样例
*/
@ApiModelProperty(value = "api请求样例")
private String requestExample;
@ApiModelProperty(value = "超时时间")
private Integer timeout;
@ApiModelProperty(value = "参数分类数字")
private String paramsDiffNum;
@ApiModelProperty(value = "返回类型")
private String outputType;
@ApiModelProperty(value = "数据最大量")
private Integer maxData;
@ApiModelProperty(value = "数据商品图片")
private String dataPicture;
@ApiModelProperty(value = "最大页数")
private Integer maxRow;
@ApiModelProperty(value = "数据描述")
private String dataDesc;
@ApiModelProperty(value = "每页数据量")
private String pageRow;
@ApiModelProperty(value = "请求参数")
private List<Map<String, String>> requestParam;
@ApiModelProperty(value = "返回参数")
private List<Map<String, String>> responseParam;
@ApiModelProperty(value = "创建时间")
private Date creTime;
}
......@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
......@@ -23,79 +24,30 @@ public class DataGoodsListDto {
@ApiModelProperty(value = "数据商品id")
private Long dataGoodsId;
/**
* 商品分类id
*/
@ApiModelProperty(value = "商品分类id")
private Long categoryId;
/**
* 数据商品名称
*/
@ApiModelProperty(value = "数据商品名称")
private String dataName;
/**
* 分类名称
*/
@ApiModelProperty(value = "分类名称")
private String categoryName;
/**
* 数据类型
*/
@ApiModelProperty(value = "数据类型:01api,02数据包")
private String dataType;
/**
* 数据商品标签
*/
@ApiModelProperty(value = "数据商品标签")
private String dataLabel;
/**
* 数据商品图片
*/
@ApiModelProperty(value = "数据商品图片")
private String dataPicture;
/**
* 数据商品价格
*/
@ApiModelProperty(value = "数据商品价格")
private BigDecimal dataPrice;
/**
* 价格类型
*/
@ApiModelProperty(value = "价格类型")
private String priceType;
/**
* 年(元)
*/
@ApiModelProperty(value = "年(元)")
private BigDecimal yearType;
@ApiModelProperty(value = "数据描述")
private String dataDesc;
/**
* 季(元)
*/
@ApiModelProperty(value = "季(元)")
private BigDecimal seasonType;
/**
* 月(元)
*/
@ApiModelProperty(value = "月(元)")
private BigDecimal monthType;
@ApiModelProperty("更新时间")
private Date uptTime;
/**
* 次(元)
*/
@ApiModelProperty(value = "次(元)")
private BigDecimal secondType;
@ApiModelProperty("对接客户数")
private String userNumbers;
@ApiModelProperty("apiKey")
private String apiKey;
@ApiModelProperty("授权")
private String goodsToken;
@ApiModelProperty("商品分类id")
private Long categoryId;
@ApiModelProperty("场景分类id")
private Long sceneId;
}
package com.jz.dm.mall.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/22
* @Version:
*/
@ApiModel(value = "数据预览--商品详情请求参数")
@Data
public class DataApiDetailsReq implements Serializable {
@ApiModelProperty(value = "商品id")
@NotNull(message = "商品id不能为空")
private Long dataGoodsId;
@ApiModelProperty(value = "apiKey")
@NotNull(message = "apiKey不能为空")
private String apiKey;
@ApiModelProperty(value = "是否授权")
private String goodsToken;
}
......@@ -3,6 +3,7 @@ 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.util.Date;
......@@ -12,7 +13,8 @@ import java.util.Date;
* @Date: 2020/12/9
* @Version:
*/
@ApiModel(value = "数据集市--数据商品列表参数对象", description = "数据商品列表参数对象")
@ApiModel(value = "数据目录--数据商品列表参数对象", description = "数据商品列表参数对象")
@Data
public class DataGoodsListRequest extends BasePageBean {
/**
......@@ -21,35 +23,8 @@ public class DataGoodsListRequest extends BasePageBean {
@ApiModelProperty(value = "商品分类id")
private Long categoryId;
/**
* 价格类型
*/
@ApiModelProperty(value = "价格类型")
private String priceType;
/**
* 综合排序
*/
@ApiModelProperty(value = "综合排序")
private String synthesizeRank;
/**
* 更新时间
*/
@ApiModelProperty(value = "更新时间")
private Date uptTime;
/**
* 数据商品名称
*/
@ApiModelProperty(value = "数据商品名称")
private String dataName;
/**
* 使用人数
*/
@ApiModelProperty(value = "使用人数")
private Long usePerson;
@ApiModelProperty(value = "场景分类id")
private Long sceneId;
/**
* 数据类型
......@@ -57,59 +32,7 @@ public class DataGoodsListRequest extends BasePageBean {
@ApiModelProperty(value = "数据类型:01api,02数据包")
private String dataType;
public Long getUsePerson() {
return usePerson;
}
public void setUsePerson(Long usePerson) {
this.usePerson = usePerson;
}
public Long getCategoryId() {
return categoryId;
}
public void setCategoryId(Long categoryId) {
this.categoryId = categoryId;
}
public String getPriceType() {
return priceType;
}
public void setPriceType(String priceType) {
this.priceType = priceType;
}
public String getSynthesizeRank() {
return synthesizeRank;
}
public void setSynthesizeRank(String synthesizeRank) {
this.synthesizeRank = synthesizeRank;
}
public Date getUptTime() {
return uptTime;
}
public void setUptTime(Date uptTime) {
this.uptTime = uptTime;
}
public String getDataName() {
return dataName;
}
public void setDataName(String dataName) {
this.dataName = dataName;
}
public String getDataType() {
return dataType;
}
@ApiModelProperty(value = "数据搜索商品名称")
private String dataName;
public void setDataType(String dataType) {
this.dataType = dataType;
}
}
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;
}
......@@ -144,12 +144,6 @@ public class OrderController {
@PostMapping(value = "/resetSalt")
@ApiOperation(value = "订单详情---重置盐值", notes = "重置盐值")
public Result resetSalt(@RequestBody @Valid SaltResetReq req) {
Result result = new Result();
if (StringUtils.isNotEmpty(req.getGoodsToken()) && req.getId() != null) {
result = orderService.updateSalt(req);
}else {
result.setMessage("参数不能为空!");
}
return result;
return orderService.updateSalt(req);
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.controller.order.bean.dto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/24
* @Version:
*/
@ApiModel(value = "api日志返回参数")
@Data
public class ApiReqLogDto implements Serializable {
/**
* 主健ID
*/
@ApiModelProperty("主健ID")
private Long id;
/**
* 请求ip
*/
@ApiModelProperty("请求ip")
private String requestIp;
/**
* apikey
*/
@ApiModelProperty("api_key")
private String apiKey;
/**
* 请求参数
*/
@ApiModelProperty("request_params")
private String requestParams;
/**
* 返回参数
*/
@ApiModelProperty("response_params")
private String responseParams;
/**
* 请求路径
*/
@ApiModelProperty("request_url")
private String requestUrl;
/**
* 请求方法
*/
@ApiModelProperty("request_method")
private String requestMethod;
/**
* 客户请求token
*/
@ApiModelProperty("request_token")
private String requestToken;
/**
* 处理状态 默认为0 未处理
*/
@ApiModelProperty("处理状态 默认为0 未处理")
private String handlerStatus;
/**
* 请求总耗时
*/
@ApiModelProperty("请求总耗时")
private String requestConsuming;
/**
* 请求开始时间
*/
@ApiModelProperty("请求开始时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date requestStartTime;
/**
* 请求结束时间
*/
@ApiModelProperty("请求结束时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date requestEndTime;
/**
* 请求状态: SUCCEED 成功 ,FAIL 失败
*/
@ApiModelProperty("请求状态: SUCCEED 成功 ,FAIL 失败")
private String status;
/**
* 备注
*/
@TableField("remark")
@JsonIgnore
private String remark;
@ApiModelProperty(value = "调用数")
@TableField(exist = false)
private String callNumber;
@ApiModelProperty(value = "错误率")
@TableField(exist = false)
private String errorRate;
@ApiModelProperty(value = "成功数")
@TableField(exist = false)
private String scSuccess;
@ApiModelProperty(value = "错误数")
@TableField(exist = false)
private String wrongNumber;
}
......@@ -16,6 +16,11 @@ import java.io.Serializable;
@Data
public class OrderByPurchaserDto implements Serializable {
@ApiModelProperty(value = "订单id")
private Long orderId;
@ApiModelProperty(value = "商品id")
private Long dataGoodsId;
@ApiModelProperty(value = "商品名称")
private String dataName;
......@@ -29,7 +34,7 @@ public class OrderByPurchaserDto implements Serializable {
@ApiModelProperty(value = "价格")
private String orderMoney;
@ApiModelProperty(value = "价格类型")
@ApiModelProperty(value = "价格类型 01免费,02收费")
private String priceType;
@ApiModelProperty(value = "盐值")
......@@ -40,4 +45,8 @@ public class OrderByPurchaserDto implements Serializable {
@ApiModelProperty(value = "apiKey")
private String apiKey;
@ApiModelProperty(value = "订单状态 01有效,02失效")
private String goodsStatus;
}
......@@ -31,6 +31,9 @@ public class LogInfoListReq implements Serializable {
private String requestToken;
@ApiModelProperty(value = "创建时间")
private String createDate;
@ApiModelProperty(value = "历史查询-数据银行")
@ApiModelProperty(value = "历史查询-数据银行: 输入01")
private String historyQuery;
@ApiModelProperty(value = "订单id")
private Long orderId;
}
......@@ -48,5 +48,6 @@ public class OrderRequest extends BasePageBean {
@ApiModelProperty(value = "搜索")
private String search;
@ApiModelProperty(value = "订单状态 01有效,02失效")
private String goodsStatus;
}
\ No newline at end of file
package com.jz.dm.mall.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;
......@@ -18,11 +21,13 @@ import java.io.Serializable;
public class City implements Serializable {
private static final long serialVersionUID = -3596309983779919750L;
private Long id;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@TableField(value = "name")
private String name;
private String city_code;
private String province_code;
@TableField(value = "city_code")
private String cityCode;
@TableField(value = "province_code")
private String provinceCode;
}
package com.jz.dm.mall.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;
......@@ -22,32 +26,61 @@ public class DataGoodsCategory implements Serializable {
/**
* 商品分类id
*/
@TableId(value = "category_id", type = IdType.AUTO)
@ApiModelProperty(value = "商品分类id")
private Long categoryId;
/**
* 分类名称
*/
@TableField("category_name")
@ApiModelProperty(value = "分类名称")
private String categoryName;
/**
* 父级分类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;
private String delFlag;
@TableField("upt_person")
@ApiModelProperty(value = "更新人")
private String uptPerson;
@ApiModelProperty(value = "分类描述")
@TableField("category_desc")
private String categoryDesc;
private List<DataGoodsCategory> children;
@ApiModelProperty("分类图片")
@TableField("category_picture")
private String categoryPicture;
@ApiModelProperty("分类位置")
@TableField("category_location")
private String categoryLocation;
@TableField("del_flag")
@ApiModelProperty(value = "是否删除")
private String delFlag;
}
\ No newline at end of file
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.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;
import java.util.Date;
......@@ -16,6 +18,7 @@ import java.util.Date;
*/
@TableName("t_mall_customer")
@ApiModel
@Data
public class MallCustomer implements Serializable {
private static final long serialVersionUID = 844124479008859411L;
/**
......@@ -26,191 +29,91 @@ public class MallCustomer implements Serializable {
/**
* 企业id
*/
@TableField(value = "department_id")
private Long departmentId;
/**
* 密码
*/
@TableField(value = "password")
private String password;
/**
* 账户
*/
@TableField(value = "customer_account")
private String customerAccount;
/**
* 用户真实姓名
*/
@TableField(value = "customer_name")
private String customerName;
/**
* 联系电话
*/
@TableField(value = "customer_phone")
private String customerPhone;
/**
* 邮箱
*/
@TableField(value = "customer_email")
private String customerEmail;
/**
* 地址
*/
@TableField(value = "customer_address")
private String customerAddress;
/**
* 供应商编码
*/
@TableField(value = "vendor_id")
private String vendorId;
/**
* 账号来源
*/
@TableField(value = "customer_source")
private String customerSource;
/**
* 用户积分
*/
@TableField(value = "customer_point")
private Long customerPoint;
/**
* 注册时间
*/
@TableField(value = "register_time")
private Date registerTime;
/**
* 会员等级
*/
@TableField(value = "customer_level")
private String customerLevel;
/**
* 证件号
*/
@TableField(value = "identity_card")
private String identityCard;
/**
* 创建时间
*/
@TableField(value = "cre_time")
private Date creTime;
@TableField(value = "cre_person")
private String crePerson;
/**
* 更新时间
*/
@TableField(value = "upt_time")
private Date uptTime;
/**
* 更新人
*/
@TableField(value = "upt_person")
private String uptPerson;
/**
* 删除标识:Y是,N否
*/
@TableField(value = "del_flag")
private String delFlag;
public String getUptPerson() {
return uptPerson;
}
public void setUptPerson(String uptPerson) {
this.uptPerson = uptPerson;
}
public Long getCustomerId() {
return customerId;
}
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
public Long getDepartmentId() {
return departmentId;
}
public void setDepartmentId(Long departmentId) {
this.departmentId = departmentId;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getCustomerAccount() {
return customerAccount;
}
public void setCustomerAccount(String customerAccount) {
this.customerAccount = customerAccount;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getCustomerPhone() {
return customerPhone;
}
public void setCustomerPhone(String customerPhone) {
this.customerPhone = customerPhone;
}
public String getCustomerEmail() {
return customerEmail;
}
public void setCustomerEmail(String customerEmail) {
this.customerEmail = customerEmail;
}
public String getCustomerAddress() {
return customerAddress;
}
public void setCustomerAddress(String customerAddress) {
this.customerAddress = customerAddress;
}
public Long getCustomerPoint() {
return customerPoint;
}
public void setCustomerPoint(Long customerPoint) {
this.customerPoint = customerPoint;
}
public Date getRegisterTime() {
return registerTime;
}
public void setRegisterTime(Date registerTime) {
this.registerTime = registerTime;
}
public String getCustomerLevel() {
return customerLevel;
}
public void setCustomerLevel(String customerLevel) {
this.customerLevel = customerLevel;
}
public String getIdentityCard() {
return identityCard;
}
public void setIdentityCard(String identityCard) {
this.identityCard = identityCard;
}
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 getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
}
\ No newline at end of file
package com.jz.dm.mall.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.dm.mall.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;
}
......@@ -3,11 +3,15 @@ package com.jz.dm.mall.moduls.mapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.base.BaseMapper;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsApiDto;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto;
import com.jz.dm.mall.moduls.entity.DataGoods;
import org.apache.ibatis.annotations.Param;
/**
......@@ -73,4 +77,10 @@ public interface DataGoodsDao extends BaseMapper<DataGoods> {
*/
public void insertBatch(List<DataGoods> dataGoodses)throws Exception;
/**
* 获取商品详情
* @param dataGoodsId
* @return
*/
DataGoodsApiDto selectByDetails(@Param("dataGoodsId") Long dataGoodsId);
}
\ 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
......@@ -3,6 +3,7 @@ package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper;
import com.jz.common.bean.MallCustomerApiDto;
import com.jz.dm.mall.moduls.controller.customer.bean.dto.CustomerDto;
import com.jz.dm.mall.moduls.controller.customer.bean.req.LoginByVSSReq;
import com.jz.dm.mall.moduls.entity.MallCustomer;
import com.jz.dm.mall.moduls.entity.MallMenu;
import com.jz.dm.mall.moduls.entity.MallUserRole;
......@@ -89,4 +90,11 @@ public interface MallCustomerDao extends BaseMapper<MallCustomer> {
* @return
*/
MallCustomerApiDto selectByUser(Map map);
/**
* 查询vss用户
* @param req
* @return
*/
MallCustomerApiDto selectByVSS(LoginByVSSReq req);
}
\ No newline at end of file
......@@ -36,18 +36,14 @@ public interface OrderDao extends BaseMapper<Order> {
*/
void updateTokenAndSalt(Order order);
/**
* 重置盐值
* @param order
*/
void updateSalt(Order order);
IPage<OrderBySellerDto> queryPageListBySeller(IPage<OrderBySellerDto> page, @Param("ew") QueryWrapper<OrderBySellerDto> query);
PurchaserUserCenterDto getMoneyAndOrderTotalDto(Map map);
List<Map<String, String>> getApiKey(@Param(value = "customerId") Long customerId);
List<Map<String, String>> getApiKey(@Param(value = "departmentId") Long departmentId);
List<OrderByPurchaserDto> queryPageListByPurchaser(Map<String, Object> param);
}
\ 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.SceneCategory;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
public interface SceneCategoryDao extends BaseMapper<SceneCategory> {
}
package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper;
import com.jz.dm.mall.moduls.entity.SceneGoodsCategory;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
public interface SceneGoodsCategoryDao extends BaseMapper<SceneGoodsCategory> {
}
......@@ -2,6 +2,7 @@ package com.jz.dm.mall.moduls.service;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.company.bean.req.CompanyAddReq;
import com.jz.dm.mall.moduls.controller.company.bean.req.CompanyEditReq;
import com.jz.dm.mall.moduls.controller.company.bean.req.CompanyUpdateReq;
import javax.servlet.http.HttpServletRequest;
......@@ -52,4 +53,11 @@ public interface CompanyAuthService {
Result getProvince();
Result getCity(String provinceCode,String cityCode);
/**
* 重新认证企业
* @param req
* @return
*/
Result editCompany(CompanyEditReq req);
}
package com.jz.dm.mall.moduls.service;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.goods.bean.request.DataApiDetailsReq;
/**
......@@ -14,8 +14,8 @@ public interface DataGoodsApiService {
/**
* 根据主键查询商品api详情
* @param id
* @param req
* @return
*/
Result selectById(Long id);
Result findByDetails(DataApiDetailsReq req);
}
\ No newline at end of file
......@@ -11,6 +11,16 @@ import com.jz.common.utils.Result;
public interface DataGoodsCategoryService {
/**
* 查询所有的一级分类
* @return
*/
Result findCategory();
/**
* 查询所有的场景
* @return
*/
Result findScene();
}
\ No newline at end of file
package com.jz.dm.mall.moduls.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.bean.BaseBeanResponse;
import com.jz.common.bean.BaseResponse;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto;
......
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;
import com.jz.common.exception.ResponseException;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.customer.bean.dto.CustomerDto;
import com.jz.dm.mall.moduls.controller.customer.bean.req.CustomerRequest;
import com.jz.dm.mall.moduls.controller.customer.bean.req.LoginByVSSReq;
import com.jz.dm.mall.moduls.controller.customer.bean.req.LoginRequest;
import com.jz.dm.mall.moduls.entity.MallCustomer;
......@@ -72,6 +74,20 @@ public interface MallCustomerService {
*/
Result loginByUser(LoginRequest customer);
/**
* vss系统登陆
* @param req
* @return
*/
Result loginByVss(LoginByVSSReq req) throws ResponseException;
/**
* 获取登陆信息
* @return
*/
Result getUserMessage();
// /**
// * 忘记密码
// * @param customer
......
......@@ -46,12 +46,6 @@ public interface OrderService {
*/
Map getApiInterfaceDetail(Map params) throws Exception;
/**
* 重置盐值
* @param req
* @return
*/
Result updateSalt(SaltResetReq req);
/**
* 订单管理列表(分页查询)--卖方
......@@ -83,4 +77,11 @@ public interface OrderService {
* @return
*/
Result getLogDetails(LogInfoListReq req);
/**
* 重置盐值
* @param req
* @return
*/
Result updateSalt(SaltResetReq req);
}
\ No newline at end of file
package com.jz.dm.mall.moduls.service;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
public interface SceneCategoryService {
}
package com.jz.dm.mall.moduls.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jz.common.bean.MallCustomerApiDto;
import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultMsg;
import com.jz.common.entity.Department;
import com.jz.common.enums.AuditStatusEnum;
import com.jz.common.enums.DelFlagEnum;
import com.jz.common.exception.ResponseException;
import com.jz.common.utils.DateUtils;
import com.jz.dm.mall.moduls.controller.company.bean.dto.CityAndAreaDto;
import com.jz.dm.mall.moduls.controller.company.bean.req.CompanyEditReq;
import com.jz.dm.mall.moduls.controller.company.bean.req.CompanyUpdateReq;
import com.jz.dm.mall.moduls.controller.company.bean.dto.CompanyInfoDto;
import com.jz.dm.mall.moduls.entity.*;
......@@ -222,6 +226,29 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
return Result.of_success(listProviceName);
}
/**
* 重新认证企业
*
* @param req
* @return
*/
@Override
public Result editCompany(CompanyEditReq req) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("unified_credit_code",req.getUnifiedCreditCode());
queryWrapper.eq("del_flag", DelFlagEnum.NO.getValue());
queryWrapper.eq("audit_status", AuditStatusEnum.WTG.getValue());
Department department = departmentDao.selectOne(queryWrapper);
if (department != null) {
department.setAuditStatus(AuditStatusEnum.DSH.getValue());
if(departmentDao.updateById(department) != 1) {
return Result.of_error(ResultMsg.UPDATE_FAIL);
}
return Result.of_success(ResultMsg.UPDATE_SUCCESS);
}
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
/**
* 保存企业信息
*
......
package com.jz.dm.mall.moduls.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jz.common.constant.ResultMsg;
import com.jz.common.utils.HttpsUtilsTest;
import com.jz.common.utils.Result;
import com.jz.common.utils.StatusCode;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataDetailsDto;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataApiDetailsDto;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsApiDto;
import com.jz.dm.mall.moduls.controller.goods.bean.request.DataApiDetailsReq;
import com.jz.dm.mall.moduls.mapper.DataGoodsApiDao;
import com.jz.dm.mall.moduls.mapper.DataGoodsDao;
import com.jz.dm.mall.moduls.service.DataGoodsApiService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -31,7 +33,11 @@ public class DataGoodsApiServiceImpl implements DataGoodsApiService {
@Autowired
private DataGoodsApiDao tDataGoodsApiDao;
@Autowired
private DataGoodsDao dataGoodsDao;
@Value("${gateway.getApiDetail}")
private String getApiDetail;
/**
* 根据主键查询商品api详情
......@@ -39,54 +45,120 @@ public class DataGoodsApiServiceImpl implements DataGoodsApiService {
* @param id
* @return
*/
// @Override
// public Result selectById(Long id) {
//
// List<DataGoodsApiDto> dataGoodsApiDto = tDataGoodsApiDao.selectById(id);
// if (dataGoodsApiDto.size() == 0) {
// return Result.error(StatusCode.ERROR, "查询异常!");
// }
// List<DataGoodsApiDto> list1 = new ArrayList<>();
// List<DataGoodsApiDto> list2 = new ArrayList<>();
// List<DataGoodsApiDto> list3 = new ArrayList<>();
// Map<String, Object> map = new HashMap<>();
//
// for (DataGoodsApiDto goodsApiDto : dataGoodsApiDto) {
// if (goodsApiDto.getParamsDiffNum()!= null && goodsApiDto.getParamsDiffNum().equals("01")) {
// list1.add(goodsApiDto);
// }
// if (goodsApiDto.getParamsDiffNum()!= null && goodsApiDto.getParamsDiffNum().equals("02")) {
// list2.add(goodsApiDto);
// }
// if (goodsApiDto.getParamsDiffNum()!= null && goodsApiDto.getParamsDiffNum().equals("03")) {
// list3.add(goodsApiDto);
// }
// if (!StringUtils.isEmpty(goodsApiDto.getRequestExample())) {
// map.put("requestExample", goodsApiDto.getRequestExample()); // 请求示例
// }
// if (!StringUtils.isEmpty(goodsApiDto.getReturnDataExample())) {
// map.put("returnDataExample", goodsApiDto.getReturnDataExample()); // 响应示例
// }
// }
// // 商品详情
// DataGoodsApiDto goods = dataGoodsApiDto.get(0);
// DataDetailsDto data = new DataDetailsDto();
// DecimalFormat df = new DecimalFormat("#0.00");
// String str = df.format(goods.getDataPrice());
// BigDecimal bd = new BigDecimal(str).setScale(2, RoundingMode.HALF_UP);
// data.setDataPrice(bd);
// BeanUtils.copyProperties(goods, data);
// map.put("dataInfo", data);
//
// // 商品参数
// map.put("pubParam", list1); // 公共参数
// map.put("reqParam", list2); // 请求参数
// map.put("resParam", list3); // 响应参数
//
// Result result = new Result();
// result.setData(map);
// return Result.of_success(ResultMsg.SUCCESS, result);
// }
/**
* 根据主键查询商品api详情
*
* @param req
* @return
*/
@Override
public Result selectById(Long id) {
public Result findByDetails(DataApiDetailsReq req) {
List<DataGoodsApiDto> dataGoodsApiDto = tDataGoodsApiDao.selectById(id);
if (dataGoodsApiDto.size() == 0) {
return Result.error(StatusCode.ERROR, "查询异常!");
DataGoodsApiDto dataGoodsApiDto = dataGoodsDao.selectByDetails(req.getDataGoodsId());
if (dataGoodsApiDto == null) {
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
List<DataGoodsApiDto> list1 = new ArrayList<>();
List<DataGoodsApiDto> list2 = new ArrayList<>();
List<DataGoodsApiDto> list3 = new ArrayList<>();
Map<String, Object> map = new HashMap<>();
for (DataGoodsApiDto goodsApiDto : dataGoodsApiDto) {
if (goodsApiDto.getParamsDiffNum()!= null && goodsApiDto.getParamsDiffNum().equals("01")) {
list1.add(goodsApiDto);
}
if (goodsApiDto.getParamsDiffNum()!= null && goodsApiDto.getParamsDiffNum().equals("02")) {
list2.add(goodsApiDto);
}
if (goodsApiDto.getParamsDiffNum()!= null && goodsApiDto.getParamsDiffNum().equals("03")) {
list3.add(goodsApiDto);
}
if (!StringUtils.isEmpty(goodsApiDto.getRequestExample())) {
map.put("requestExample", goodsApiDto.getRequestExample()); // 请求示例
}
if (!StringUtils.isEmpty(goodsApiDto.getReturnDataExample())) {
map.put("returnDataExample", goodsApiDto.getReturnDataExample()); // 响应示例
}
// 获取api详情
String s = HttpsUtilsTest.submitPost(getApiDetail, 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详情失败!");
}
DataApiDetailsDto dataDetailsDto = JSONObject.parseObject(params.getString("data"), DataApiDetailsDto.class);
// 获取请求参数
List<Map<String, String>> requestParam = getRequestParam(dataDetailsDto.getRequestParam());
if (requestParam != null) {
dataGoodsApiDto.setRequestParam(requestParam);
}
List<Map<String, String>> responseParam = getRequestParam(dataDetailsDto.getResponseParam());
if (responseParam != null) {
dataGoodsApiDto.setResponseParam(responseParam);
}
// 商品详情
DataGoodsApiDto goods = dataGoodsApiDto.get(0);
DataDetailsDto data = new DataDetailsDto();
DecimalFormat df = new DecimalFormat("#0.00");
String str = df.format(goods.getDataPrice());
BigDecimal bd = new BigDecimal(str).setScale(2, RoundingMode.HALF_UP);
data.setDataPrice(bd);
BeanUtils.copyProperties(goods, data);
map.put("dataInfo", data);
// 赋值商品详情参数
BeanUtils.copyProperties(dataDetailsDto, dataGoodsApiDto);
return Result.ok(dataGoodsApiDto);
}
// 商品参数
map.put("pubParam", list1); // 公共参数
map.put("reqParam", list2); // 请求参数
map.put("resParam", list3); // 响应参数
Result result = new Result();
result.setData(map);
return Result.of_success(ResultMsg.SUCCESS, result);
}
/**
* 获取请求参数
* @param result
* @return
*/
private List<Map<String, String>> getRequestParam(String result) {
List<Map<String, String>> param = (List<Map<String, String>>) JSONArray.parse(result);
List<Map<String, String>> resultParam = new ArrayList<>();
for (Map<String, String> reqMap : param) {
Map<String, String> map = new HashMap();
for (Map.Entry entry : reqMap.entrySet()) {
if (entry.getKey().equals("name")) {
map.put("paramsName", entry.getKey().toString());
}
if (entry.getKey().equals("type")) {
map.put("paramsType", entry.getKey().toString());
}
if (entry.getKey().equals("requird")) {
map.put("ifRequird",entry.getKey().toString());
}
if (entry.getKey().equals("desc")) {
map.put("paramsDesc", entry.getKey().toString());
}
}
resultParam.add(map);
}
return resultParam;
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jz.common.constant.ResultMsg;
import com.jz.common.enums.DelFlagEnum;
import com.jz.common.enums.YNEnum;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.entity.DataGoodsCategory;
import com.jz.dm.mall.moduls.entity.SceneCategory;
import com.jz.dm.mall.moduls.mapper.DataGoodsCategoryDao;
import com.jz.dm.mall.moduls.mapper.SceneCategoryDao;
import com.jz.dm.mall.moduls.service.DataGoodsCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -23,6 +28,10 @@ public class DataGoodsCategoryServiceImpl implements DataGoodsCategoryService {
@Autowired
private DataGoodsCategoryDao categoryDao;
@Autowired
private SceneCategoryDao sceneCategoryDao;
/**
* 查询所有的商品分类
*
......@@ -30,30 +39,30 @@ public class DataGoodsCategoryServiceImpl implements DataGoodsCategoryService {
*/
@Override
public Result findCategory() {
//1、查出所有分类
List<DataGoodsCategory> entities = categoryDao.selectByList();
// 找到所有的一级分类
List<DataGoodsCategory> level1Menus = entities.stream().filter(categoryEntity -> categoryEntity.getParentId() == 0 && categoryEntity.getIfChild().equals("N")
// 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);
QueryWrapper<DataGoodsCategory> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("parent_id", "0");
queryWrapper.eq("if_child", YNEnum.NO.getValue());
queryWrapper.eq("del_flag", DelFlagEnum.NO.getValue());
List<DataGoodsCategory> dataGoodsCategories = categoryDao.selectList(queryWrapper);
if (dataGoodsCategories != null) {
return Result.ok(dataGoodsCategories);
}
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
private List<DataGoodsCategory> getChildrens(DataGoodsCategory root,List<DataGoodsCategory> all) {
List<DataGoodsCategory> children = all.stream().filter(categoryEntity -> {
return categoryEntity.getParentId() == root.getCategoryId() && categoryEntity.getIfChild().equals("Y");
}).map(categoryEntity -> {
//1、找到子菜单,同时递归调用
categoryEntity.setChildren(getChildrens(categoryEntity, all));
return categoryEntity;
}).collect(Collectors.toList());
return children;
/**
* 查询所有的场景
*
* @return
*/
@Override
public Result findScene() {
QueryWrapper<SceneCategory> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("del_flag", DelFlagEnum.NO.getValue());
List<SceneCategory> sceneCategories = sceneCategoryDao.selectList(queryWrapper);
if (sceneCategories != null) {
return Result.ok(sceneCategories);
}
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
}
\ No newline at end of file
......@@ -2,6 +2,9 @@ package com.jz.dm.mall.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.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jz.common.bean.BaseBeanResponse;
......@@ -11,6 +14,8 @@ import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants;
import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultMsg;
import com.jz.common.enums.DataGoodsByRoleEnum;
import com.jz.common.enums.DelFlagEnum;
import com.jz.common.exception.ResponseException;
import com.jz.common.utils.DateUtils;
import com.jz.common.utils.HttpsUtilsTest;
......@@ -69,61 +74,49 @@ public class DataGoodsServiceImpl implements DataGoodsService {
private DataGoodsApiDao tDataGoodsApiDao;
@Value("${domain.apigateway}")
@Value("${gateway.apigateway}")
private String apiGateway;
@Value("${token.dataBank}")
private String dataBank;
/**条件查询所有数据商品
* @param dataGoodsListRequest
* @param req
* @param httpRequest
* @return
* @throws Exception
*/
@Override
public PageInfoResponse<DataGoodsListDto> findList(DataGoodsListRequest dataGoodsListRequest, HttpServletRequest httpRequest)
public PageInfoResponse findList(DataGoodsListRequest req, HttpServletRequest httpRequest)
throws Exception {
PageInfoResponse<DataGoodsListDto> pageInfoResponse = new PageInfoResponse<>();
Map<String, Object> param = new HashMap<>();
//商品分类id(行业)
if (dataGoodsListRequest.getCategoryId() != null) {
param.put("categoryId", dataGoodsListRequest.getCategoryId());
Map<String, Object> map = new HashMap<>();
if (StringUtils.isNotBlank(req.getDataName())) {
map.put("dataName", req.getDataName());
}
//数据商品名称
if (StringUtils.isNotEmpty(dataGoodsListRequest.getDataName())) {
param.put("dataName", dataGoodsListRequest.getDataName());
if (req.getCategoryId() != null) {
map.put("categoryId", req.getCategoryId());
}
//数据类型:01api,02数据包
if (StringUtils.isNotEmpty(dataGoodsListRequest.getDataType())) {
param.put("dataType", dataGoodsListRequest.getDataType());
if (req.getSceneId() != null) {
map.put("sceneId", req.getSceneId());
}
//价格类型:01免费,02收费
if (StringUtils.isNotEmpty(dataGoodsListRequest.getPriceType())) {
param.put("priceType", dataGoodsListRequest.getPriceType());
}
//更新时间排序
if (dataGoodsListRequest.getUptTime() != null) {
param.put("uptTime", dataGoodsListRequest.getUptTime());
}
// 使用人数
if (dataGoodsListRequest.getUsePerson() != null) {
param.put("usePerson", dataGoodsListRequest.getUsePerson());
// if (getCustomer() != null) {
// map.put("customerId", getCustomer().getCustomerId());
// }
if (getCustomer() != null) {
map.put("departmentId", getCustomer().getDepartmentId());
}
// 综合排序
if (StringUtils.isNotEmpty(dataGoodsListRequest.getSynthesizeRank())) {
param.put("synthesizeRank", dataGoodsListRequest.getSynthesizeRank());
}
PageHelper.startPage(dataGoodsListRequest.getPageNum(), dataGoodsListRequest.getPageSize());
List<DataGoodsListDto> list = dataGoodsDao.findList(param);
for (DataGoodsListDto dataGoodsListDto : list) {
dataGoodsListDto.getDataPrice().setScale(3);
if (getCustomer() == null) {
map.put("roleId", DataGoodsByRoleEnum.logOutUser.getValue());
}else if (getCustomer().getCustomerId() != null) {
map.put("roleId", DataGoodsByRoleEnum.unverifiedUser.getValue());
}else if (getCustomer().getDepartmentId() != null) {
map.put("roleId", DataGoodsByRoleEnum.authenticatedUser.getValue());
}
PageHelper.startPage(req.getPageNum(), req.getPageSize());
List<DataGoodsListDto> list = dataGoodsDao.findList(map);
PageInfo<DataGoodsListDto> pageInfo = new PageInfo<>(list);
pageInfoResponse.setCode(Constants.SUCCESS_CODE);
pageInfoResponse.setMessage("查询成功");
pageInfoResponse.setData(pageInfo);
......@@ -398,4 +391,12 @@ public class DataGoodsServiceImpl implements DataGoodsService {
return encrypt;
}
/**
* 获取用户
* @return
*/
public MallCustomerApiDto getCustomer() {
MallCustomerApiDto customer = (MallCustomerApiDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER);
return customer;
}
}
\ 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
package com.jz.dm.mall.moduls.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -59,14 +60,16 @@ public class OrderServiceImpl implements OrderService {
@Autowired
private RedisTemplate redisTemplate;
@Value("${domain.gatewayUpSalt}")
private String gatewayUpSalt;
@Value("${domain.gatewayOrderLogDetails}")
@Value("${gateway.gatewayOrderLogDetails}")
private String gatewayOrderLogDetails;
@Value("${domain.gatewayOrderLogNumError}")
@Value("${gateway.gatewayOrderLogNumError}")
private String gatewayOrderLogNumError;
@Value("${gateway.gatewayUpSalt}")
private String gatewayUpSalt;
/**
* 订单管理列表(分页查询)
*
......@@ -116,11 +119,9 @@ public class OrderServiceImpl implements OrderService {
@Override
public OrderDto getOrderDetail(String orderId) throws Exception {
OrderDto orderDto = null;
if (StringUtils.isNotEmpty(orderId)) {
orderDto = orderDao.getOrderDetail(orderId);
if (orderDto != null) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date endTime = orderDto.getInvalidTime();
String indate = DateUtils.getTime(endTime, DateUtils.getToday());
orderDto.setIndate(indate);
......@@ -151,41 +152,7 @@ public class OrderServiceImpl implements OrderService {
return returnMap;
}
/**
* 重置盐值
*
* @param req
* @return
*/
@Override
public Result updateSalt(SaltResetReq req) {
// 获取当前用户
MallCustomerApiDto customer = (MallCustomerApiDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER);
//调用gatway
JSONObject object = new JSONObject();
object.put("authCode", req.getGoodsToken());
object.put("createUser", customer.getCustomerName());
String s = HttpsUtilsTest.submitPost(gatewayUpSalt, object.toString());
//处理返回的参数
JSONObject params = JSONObject.parseObject(s);
if (!params.get("code").equals(200) || org.springframework.util.StringUtils.isEmpty(params.get("data"))) {
return Result.error("修改失败!");
}
String data = params.getString("data");
JSONObject dataParam = JSONObject.parseObject(data);
String salt = dataParam.getString("salt");
// 修改参数
Order order = new Order();
order.setSaltValue(salt);
order.setOrderId(req.getId());
order.setUptTime(DateUtils.getToday());
order.setUptPerson(customer.getCustomerId() + "");
orderDao.updateSalt(order);
Map map = new HashMap();
map.put("salt", salt);
return Result.of_success(ResultMsg.SUCCESS, salt);
}
/**
* 订单管理列表(分页查询)--卖方
* @param req
......@@ -265,7 +232,7 @@ public class OrderServiceImpl implements OrderService {
@Override
public Result<PageInfoResponse<OrderByPurchaserDto>> queryPageListByPurchaser(OrderRequest req) {
// 调用gateway,获取调用数/错误率
List<Map<String, String>> reqList = orderDao.getApiKey(getCustomer().getCustomerId());
List<Map<String, String>> reqList = orderDao.getApiKey(getCustomer().getDepartmentId());
JSONObject object = new JSONObject();
object.put("reqList", reqList);
String s = HttpsUtilsTest.submitPost(gatewayOrderLogNumError, object.toString());
......@@ -274,7 +241,6 @@ public class OrderServiceImpl implements OrderService {
if (!params.get("code").equals(200) || org.springframework.util.StringUtils.isEmpty(params.get("data"))) {
return Result.of_error("获取参数失败!");
}
PageInfoResponse<OrderByPurchaserDto> pageInfoResponse = new PageInfoResponse<>();
Map<String, Object> param = new HashMap<>();
if (StringUtils.isNotBlank(req.getDataName())) {
param.put("dataName", req.getDataName());
......@@ -282,10 +248,13 @@ public class OrderServiceImpl implements OrderService {
if (StringUtils.isNotBlank(req.getPriceType())) {
param.put("priceType", req.getPriceType());
}
if (getCustomer().getCustomerId() != null) {
param.put("customerId", getCustomer().getCustomerId());
if (StringUtils.isNotBlank(req.getGoodsStatus())) {
param.put("goodsStatus", req.getGoodsStatus());
}
if (getCustomer().getCustomerId() != null && getCustomer().getDepartmentId() != null) {
param.put("departmentId", getCustomer().getDepartmentId());
}else {
return Result.of_error("用户未登录,请登录!");
return Result.of_error("用户未认证,请认证!");
}
PageHelper.startPage(req.getPageNum(), req.getPageSize());
List<OrderByPurchaserDto> list = orderDao.queryPageListByPurchaser(param);
......@@ -300,7 +269,6 @@ public class OrderServiceImpl implements OrderService {
}
}
PageInfo<OrderByPurchaserDto> pageInfo = new PageInfo<>(list);
return Result.of_success(pageInfo);
......@@ -328,13 +296,50 @@ public class OrderServiceImpl implements OrderService {
if (StringUtils.isEmpty(req.getRequestToken())) {
return Result.of_error("授权码不能为空!");
}
System.out.println(JSON.toJSONString(req));
String post = HttpsUtilsTest.submitPost(gatewayOrderLogDetails, JSON.toJSONString(req));
JSONObject params = JSONObject.parseObject(post);
if (!params.get("code").equals(200) || org.springframework.util.StringUtils.isEmpty(params.get("data"))){
return Result.of_error("获取日志详情失败!");
}
return Result.ok(params.get("data"));
JSONObject object = JSONObject.parseObject(params.getString("data"));
List<ApiReqLogDto> records = JSONObject.parseArray(object.getString("records"), ApiReqLogDto.class);
return Result.ok(records);
}
/**
* 重置盐值
*
* @param req
* @return
*/
@Override
public Result updateSalt(SaltResetReq req) {
//调用gatway
JSONObject object = new JSONObject();
object.put("authCode", req.getGoodsToken());
object.put("createUser", getCustomer().getCustomerId());
String s = HttpsUtilsTest.submitPost(gatewayUpSalt, object.toString());
//处理返回的参数
JSONObject params = JSONObject.parseObject(s);
if (!params.get("code").equals(200) || org.springframework.util.StringUtils.isEmpty(params.get("data"))) {
return Result.error("修改失败!");
}
String data = params.getString("data");
JSONObject dataParam = JSONObject.parseObject(data);
String salt = dataParam.getString("salt");
// 修改参数
Order order = new Order();
order.setSaltValue(salt);
order.setOrderId(req.getId());
order.setUptTime(DateUtils.getToday());
order.setUptPerson(getCustomer().getCustomerId() + "");
if (orderDao.updateById(order) != 1) {
return Result.of_error(ResultMsg.UPDATE_FAIL);
}
Map map = new HashMap();
map.put("salt", salt);
return Result.of_success(ResultMsg.SUCCESS, salt);
}
public MallCustomerApiDto getCustomer() {
......
......@@ -56,7 +56,7 @@ public class PayServiceImpl implements PayService {
//@Autowired
//private HttpsUtils httpsUtils;
@Value("${domain.gatewayGetAuth}")
@Value("${gateway.gatewayGetAuth}")
private String gatewayGetAuth;
/**
......
package com.jz.dm.mall.moduls.service.impl;
import com.jz.dm.mall.moduls.service.SceneCategoryService;
import org.springframework.stereotype.Service;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
@Service("SceneCategoryService")
public class SceneCategoryServiceImpl implements SceneCategoryService {
}
package com.jz.dm.mall.moduls.service.impl;
import com.aliyuncs.CommonRequest;
import com.aliyuncs.CommonResponse;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.http.MethodType;
import com.aliyuncs.profile.DefaultProfile;
import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.utils.Result;
import com.jz.common.utils.SMSUtils;
import com.jz.common.utils.StatusCode;
import com.jz.common.utils.ValidateCodeUtils;
import com.jz.dm.mall.moduls.service.ValidateCodeService;
import org.springframework.beans.factory.annotation.Autowired;
......
......@@ -75,12 +75,13 @@ logging:
level:
com.jz.dm.mall: debug
# 调用gateway接口路径
domain:
gateway:
gatewayGetAuth: http://47.115.53.1:8088/api/auth/mall-user-auth-api
gatewayUpSalt: http://192.168.1.114:8088/api/auth/reset-salt
apigateway: http://127.0.0.1:8088/api/producer/addDataBankApiInfo
gatewayOrderLogDetails: http://127.0.0.1:8088/api/logging/listApiLog
gatewayOrderLogNumError: http://127.0.0.1:8088/api/logging/queryNumberAndError
getApiDetail: http://127.0.0.1:8088/api/interface/getApiDetail
gatewayUpSalt: http://127.0.0.1:8088/api/auth/reset-salt
ftp:
url: 192.168.1.141
port: 21
......
......@@ -92,10 +92,10 @@
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="customerId" useGeneratedKeys="true">
insert into t_mall_customer(department_id, password, customer_account, customer_name, customer_phone, customer_email, customer_address, customer_point, register_time, customer_level, identity_card, cre_time, upt_time, del_flag)
values (#{departmentId}, #{password}, #{customerAccount}, #{customerName}, #{customerPhone}, #{customerEmail}, #{customerAddress}, #{customerPoint}, #{registerTime}, #{customerLevel}, #{identityCard}, #{creTime}, #{uptTime}, #{delFlag})
</insert>
<!--<insert id="insert" keyProperty="customerId" useGeneratedKeys="true">-->
<!--insert into t_mall_customer(department_id, password, customer_account, customer_name, customer_phone, customer_email, customer_address, customer_point, register_time, customer_level, identity_card, cre_time, upt_time, del_flag)-->
<!--values (#{departmentId}, #{password}, #{customerAccount}, #{customerName}, #{customerPhone}, #{customerEmail}, #{customerAddress}, #{customerPoint}, #{registerTime}, #{customerLevel}, #{identityCard}, #{creTime}, #{uptTime}, #{delFlag})-->
<!--</insert>-->
<insert id="insertBatch" keyProperty="customerId" useGeneratedKeys="true">
insert into t_mall_customer(department_id, password, customer_account, customer_name,
......@@ -293,7 +293,8 @@
left JOIN t_department t2 ON t1.department_id = t2.department_id
left JOIN t_finance_customer_assets t3 ON t3.department_id = t2.department_id
WHERE
t1.del_flag = 'N'
t1.del_flag = 'N' and
t1.customer_source = '01'
<if test="customerAccount != null">
and t1.customer_account = #{customerAccount}
</if>
......@@ -302,4 +303,23 @@
</if>
GROUP BY t1.customer_id
</select>
<select id="selectByVSS" resultType="com.jz.common.bean.MallCustomerApiDto">
SELECT
t1.customer_id AS customerId,
t1.department_id AS departmentId,
t1.customer_account AS customerAccount,
t3.assets_id AS assetsId,
t2.department_name as departmentName,
t1.vendor_id as vendorId
FROM
t_mall_customer t1
inner JOIN t_department t2 ON t1.department_id = t2.department_id
inner JOIN t_finance_customer_assets t3 ON t3.department_id = t2.department_id
WHERE
t1.del_flag = 'N' and
t1.customer_source = '02' and
t2.unified_credit_code = #{unifiedCreditCode}
and t1.customer_account = #{customerAccount}
</select>
</mapper>
\ No newline at end of file
......@@ -72,10 +72,10 @@
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="assetsId" useGeneratedKeys="true">
insert into t_finance_customer_assets(department_id, use_money, frozen_money, total_money, cre_time, cre_person, upt_time, upt_person, del_flag)
values (#{departmentId}, #{useMoney}, #{frozenMoney}, #{totalMoney}, #{creTime}, #{crePerson}, #{uptTime}, #{uptPerson}, #{delFlag})
</insert>
<!--<insert id="insert" keyProperty="assetsId" useGeneratedKeys="true">-->
<!--insert into t_finance_customer_assets(department_id, use_money, frozen_money, total_money, cre_time, cre_person, upt_time, upt_person, del_flag)-->
<!--values (#{departmentId}, #{useMoney}, #{frozenMoney}, #{totalMoney}, #{creTime}, #{crePerson}, #{uptTime}, #{uptPerson}, #{delFlag})-->
<!--</insert>-->
<insert id="insertBatch" keyProperty="assetsId" useGeneratedKeys="true">
insert into t_finance_customer_assets(department_id, use_money, frozen_money, total_money,
......
......@@ -179,55 +179,138 @@
</select>
<!--通过实体作为筛选条件查询-->
<select id="findList" resultType="com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto" parameterType="map">
<!--&lt;!&ndash;通过实体作为筛选条件查询&ndash;&gt;-->
<!--<select id="findList" resultType="com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto" parameterType="map">-->
<!--SELECT-->
<!--t1.data_goods_id as dataGoodsId,-->
<!--t1.category_id as categoryId,-->
<!--t2.category_name as categoryName,-->
<!--t1.data_name as dataName,-->
<!--( CASE WHEN t1.data_type = '01' THEN 'api' WHEN t1.data_type = '02' THEN '数据包' END ) dataType,-->
<!--t1.data_label as dataLabel,-->
<!--t1.data_picture as dataPicture,-->
<!--( CASE when t1.price_type = '01' then '免费' when t1.price_type = '02' then '收费' end) priceType,-->
<!--t1.discount_price as discountPrice,-->
<!--t1.data_price as dataPrice,-->
<!--t1.price_type as pariceType,-->
<!--t2.parent_id as parentId,-->
<!--t1.year_type as yearType,-->
<!--t1.season_type as seasonType,-->
<!--t1.month_type as monthType,-->
<!--t1.second_type as secondType-->
<!--FROM-->
<!--t_data_goods t1-->
<!--INNER JOIN t_data_goods_category t2 on t1.category_id = t2.category_id-->
<!--where-->
<!--1= 1 and-->
<!--t1.del_flag = 'N' and-->
<!--t1.data_status = '02'-->
<!--<if test="categoryId != null">-->
<!--and t1.category_id = #{categoryId}-->
<!--</if>-->
<!--<if test="dataName != null and dataName != ''">-->
<!--and data_name like concat('%',#{dataName},'%')-->
<!--</if>-->
<!--<if test="dataType != null and dataType != ''">-->
<!--and data_type = #{dataType}-->
<!--</if>-->
<!--<if test="priceType != null and priceType != ''">-->
<!--and price_type = #{priceType}-->
<!--</if>-->
<!--<if test="uptTime != null ">-->
<!--ORDER BY-->
<!--t1.upt_time desc-->
<!--</if>-->
<!--<if test="usePerson != null ">-->
<!--ORDER BY-->
<!--t1.use_person desc-->
<!--</if>-->
<!--<if test="synthesizeRank != null">-->
<!--ORDER BY-->
<!--t1.upt_time,t1.use_person desc-->
<!--</if>-->
<!--</select>-->
<select id="findList" resultType="com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto" parameterType="map">
select
ttt.data_desc as dataDesc,
ttt.data_name as dataName,
ttt.data_goods_id as dataGoodsId,
ttt.upt_time as uptTime,
ttt.goodsToken as goodsToken,
ttt.category_id as categoryId,
ttt.scene_id as sceneId,
ttt.userNumbers as userNumbers,
ttt.api_key as apiKey
from
(
SELECT
tt.data_goods_id,
tt.data_name,
tt.data_desc,
tt.upt_time,
tt.category_id,
tt.scene_id,
tt.del_flag,
tt.api_key,
case when tt.data_goods_id in (
SELECT
t.data_goods_id
FROM
t_data_goods t
INNER JOIN t_order_goods_info t1 ON t.data_goods_id = t1.data_goods_id
INNER JOIN t_order t2 ON t1.order_id = t2.order_id
WHERE
t.del_flag = 'N'
<if test="departmentId != null">
and t2.department_id = #{departmentId}
</if>
) then '已授权' else '' end goodsToken,
(SELECT
count(t1.data_goods_id)
from
t_data_goods t1
INNER JOIN t_order_goods_info t2 on t1.data_goods_id = t2.data_goods_id
inner join t_order t3 on t2.order_id = t3.order_id
where t1.data_goods_id=tt.data_goods_id) as userNumbers
FROM
t_data_goods tt ) as ttt
INNER JOIN t_role_goods tr ON tr.data_goods_id = ttt.data_goods_id
INNER JOIN t_mall_role tmr ON tmr.role_id = tr.role_id
where
ttt.del_flag = 'N'
AND tr.del_flag = 'N'
AND tmr.role_id = #{roleId}
<if test="dataName != null and dataName != ''">
and ttt.data_name = #{dataName}
</if>
<if test="categoryId != null">
and ttt.category_id = #{categoryId}
</if>
<if test="sceneId != null">
and ttt.scene_id = #{sceneId}
</if>
order by ttt.upt_time desc
</select>
<select id="selectByDetails" resultType="com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsApiDto">
SELECT
t1.data_goods_id as dataGoodsId,
t1.category_id as categoryId,
t2.category_name as categoryName,
t1.data_name as dataName,
( CASE WHEN t1.data_type = '01' THEN 'api' WHEN t1.data_type = '02' THEN '数据包' END ) dataType,
t1.data_label as dataLabel,
t1.data_picture as dataPicture,
( CASE when t1.price_type = '01' then '免费' when t1.price_type = '02' then '收费' end) priceType,
t1.discount_price as discountPrice,
t1.data_price as dataPrice,
t1.price_type as pariceType,
t2.parent_id as parentId,
t1.year_type as yearType,
t1.season_type as seasonType,
t1.month_type as monthType,
t1.second_type as secondType
t1.data_name as dataName,
t1.user_id as userId,
t1.upt_time as uptTime,
t2.category_name as categoryName,
t1.year_type as yearType,
t1.season_type as seasonType,
t1.month_type as monthType,
t1.second_type as secondType,
t1.goods_limited as goodsLimited,
t1.data_desc as dataDesc,
t1.data_picture as dataPicture,
t1.price_type as priceType
FROM
t_data_goods t1
INNER JOIN t_data_goods_category t2 on t1.category_id = t2.category_id
where
1= 1 and
t1.del_flag = 'N' and
t1.data_status = '02'
<if test="categoryId != null">
and t1.category_id = #{categoryId}
</if>
<if test="dataName != null and dataName != ''">
and data_name like concat('%',#{dataName},'%')
</if>
<if test="dataType != null and dataType != ''">
and data_type = #{dataType}
</if>
<if test="priceType != null and priceType != ''">
and price_type = #{priceType}
</if>
<if test="uptTime != null ">
ORDER BY
t1.upt_time desc
</if>
<if test="usePerson != null ">
ORDER BY
t1.use_person desc
</if>
<if test="synthesizeRank != null">
ORDER BY
t1.upt_time,t1.use_person desc
</if>
t_data_goods t1
left join t_data_goods_category t2 on t1.category_id = t2.category_id
where t1.del_flag = 'N'
and t1.data_goods_id = #{dataGoodsId}
</select>
</mapper>
\ No newline at end of file
<?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
......@@ -397,21 +397,7 @@
where order_id = #{orderId}
</update>
<update id="updateSalt" parameterType="com.jz.dm.mall.moduls.entity.Order">
update t_order
<set>
<if test="saltValue != null and saltValue != ''">
salt_value = #{saltValue},
</if>
<if test="uptTime != null">
upt_time = #{uptTime},
</if>
<if test="uptPerson != null and uptPerson != ''">
upt_person = #{uptPerson},
</if>
</set>
where order_id = #{orderId}
</update>
<select id="queryPageListBySeller" resultType="com.jz.dm.mall.moduls.controller.order.bean.dto.OrderBySellerDto">
SELECT
......@@ -500,28 +486,34 @@
<select id="queryPageListByPurchaser" resultType="com.jz.dm.mall.moduls.controller.order.bean.dto.OrderByPurchaserDto">
SELECT
t1.order_id as orderId,
t3.data_goods_id as dataGoodsId,
t1.goods_token as requestToken,
t1.api_key as apiKey,
t1.salt_value as saltValue,
t1.price_type as priceType,
t3.data_name as dataName
t3.data_name as dataName,
(CASE WHEN (t1.invalid_time >= DATE_FORMAT(NOW(), '%Y-%m-%d')) THEN '01' ELSE '02' END ) goodsStatus
FROM
t_order t1
join t_order_goods_info t2 on t1.order_id = t2.order_id
join t_data_goods t3 on t2.data_goods_id = t3.data_goods_id
where
t1.customer_id = #{customerId}
t1.department_id = #{departmentId}
<if test="dataName != null and dataName != ''">
and t3.data_name = #{dataName}
</if>
<if test="priceType != null and priceType != ''">
and t3.price_type = #{priceType}
and t1.price_type = #{priceType}
</if>
<if test="goodsStatus != null">
and (CASE WHEN (t1.invalid_time >= DATE_FORMAT(NOW(), '%Y-%m-%d')) THEN '01' ELSE '02' END ) = #{goodsStatus}
</if>
GROUP BY t1.api_key
order BY t1.order_time
</select>
<select id="getApiKey" resultType="map">
select api_key as apiKey,goods_token as requestToken from t_order where customer_id = #{customerId}
select api_key as apiKey,goods_token as requestToken from t_order where department_id = #{departmentId}
</select>
</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;
}
package com.jz.manage.moduls.controller.customer;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.constant.ResultMsg;
import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.BaseController;
import com.jz.manage.moduls.controller.customer.bean.dto.EnterpriseAuditDto;
import com.jz.manage.moduls.controller.customer.bean.request.CheckDepartmentAuditReq;
import com.jz.manage.moduls.controller.customer.bean.request.DepartmentAuditReq;
import com.jz.manage.moduls.controller.customer.bean.request.EnterpriseAuditRequest;
import com.jz.manage.moduls.controller.customer.bean.request.SaveCustomerRequest;
......@@ -15,6 +17,7 @@ import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
/**
* 企业(Department)表控制层
......@@ -24,7 +27,7 @@ import javax.servlet.http.HttpServletRequest;
*/
@RestController
@RequestMapping("department")
@Api(tags = "企业信息管理--controller")
@Api(tags = "平台--企业管理--controller")
public class DepartmentController extends BaseController {
/**
* 服务对象
......@@ -40,9 +43,14 @@ public class DepartmentController extends BaseController {
* @throws Exception
*/
@PostMapping(value = "/findList")
@ApiOperation(value = "条件分页查询企业审核信息")
@ApiOperation(value = "企业审核--条件分页查询企业审核信息")
public Result<IPage<EnterpriseAuditDto>> findList(@RequestBody EnterpriseAuditRequest auditRequest, HttpServletRequest req) throws Exception {
return departmentService.findList(auditRequest, req);
try {
return departmentService.findList(auditRequest, req);
}catch (Exception e) {
e.printStackTrace();
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
}
/**
......@@ -52,7 +60,7 @@ public class DepartmentController extends BaseController {
* @return
*/
@GetMapping(value = "/getDepartment/{id}")
@ApiOperation(value = "主键查询用户企业详情信息")
@ApiOperation(value = "企业审核--主键查询用户企业详情信息")
public Result selectById(@PathVariable(value = "id") Long id, HttpServletRequest req) throws Exception{
if (id != null) {
return departmentService.selectById(id);
......@@ -66,14 +74,20 @@ public class DepartmentController extends BaseController {
* @return
*/
@PostMapping(value = "/audit")
@ApiOperation(value = "企业审核")
public Result audit(@RequestBody DepartmentAuditReq req) throws Exception{
@ApiOperation(value = "企业审核--审核")
public Result audit(@RequestBody @Valid DepartmentAuditReq req) throws Exception{
if (!StringUtils.isEmpty(req)) {
return departmentService.audit(req);
}
return Result.error("企业审核失败");
}
@PostMapping(value = "/check")
@ApiOperation(value = "企业审核--校验企业是否已认证")
public Result check(@RequestBody @Valid CheckDepartmentAuditReq req) {
return departmentService.check(req);
}
/**
* 添加用户
* @param saveCustomerRequest
......@@ -82,11 +96,22 @@ public class DepartmentController extends BaseController {
* @throws Exception
*/
@PostMapping(value = "/add")
@ApiOperation(value = "添加用户")
public Result add(@RequestBody SaveCustomerRequest saveCustomerRequest, HttpServletRequest req) throws Exception {
@ApiOperation(value = "添加企业")
public Result add(@RequestBody @Valid SaveCustomerRequest saveCustomerRequest, HttpServletRequest req) throws Exception {
if (saveCustomerRequest != null) {
return departmentService.add(saveCustomerRequest, req);
}
return Result.error("添加用户失败!");
}
/**
* 通过授权码查税号--调用接口
* @param goodsToken
* @return
*/
@PostMapping(value = "/findUcCodeByGoodsToken")
@ApiOperation(value = "通过授权码查税号--调用接口")
public Result findUcCodeByGoodsToken(@RequestParam(name = "goodsToken") String goodsToken) {
return departmentService.findUcCodeByGoodsToken(goodsToken);
}
}
\ No newline at end of file
package com.jz.manage.moduls.controller.customer.bean.dto;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -39,5 +40,6 @@ public class EnterpriseAuditDto {
private Date auditTime;
@ApiModelProperty(value = "企业角色")
@JsonIgnore
private Long roleId;
}
package com.jz.manage.moduls.controller.customer.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/18
* @Version:
*/
@ApiModel("校验企业是否通过认证请求参数")
@Data
public class CheckDepartmentAuditReq implements Serializable {
@ApiModelProperty(value = "统一社会信用代码")
@NotNull(message = "统一社会信用代码不能为空")
private String unifiedCreditCode;
}
This diff is collapsed.
This diff is collapsed.
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