Commit 40cb891a by 崔彦峰

svn to git

0 parents
Showing 271 changed files with 4934 additions and 0 deletions
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.com.glsx.framework</groupId>
<artifactId>framework-webapp</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>
<groupId>cn.com.glsx.dj.weapp</groupId>
<artifactId>web-dj-weapp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>web-dj-weapp</name>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.sourceforge.nekohtml</groupId>
<artifactId>nekohtml</artifactId>
</dependency>
<dependency>
<groupId>org.oreframework.common</groupId>
<artifactId>ore-common-security</artifactId>
</dependency>
<dependency>
<groupId>org.oreframework.boot</groupId>
<artifactId>ore-boot-starter-redis</artifactId>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk16</artifactId>
<version>1.46</version>
</dependency>
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-wechat-api</artifactId>
<version>0.0.4-SNAPSHOT</version>
</dependency>
<!--活动、优惠券-->
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-marketing-api</artifactId>
<version>0.0.6-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-system-api</artifactId>
<version>0.0.9-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-payment-api</artifactId>
<version>0.0.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.com.glsx</groupId>
<artifactId>rpc-ddh-weapp-api</artifactId>
<version>0.0.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.com.glsx</groupId>
<artifactId>rpc-dj-insure-api</artifactId>
<version>0.0.8-SNAPSHOT</version>
</dependency>
<!--通知类消息盒子 -->
<dependency>
<groupId> cn.com.glsx </groupId>
<artifactId>rpc-didicb-app-api</artifactId>
<version>0.0.2-SNAPSHOT</version>
</dependency>
<!--爱车追踪 -->
<dependency>
<groupId>com.glsx.biz</groupId>
<artifactId>biz-track-service</artifactId>
<version>1.0.1-SNAPSHOT</version>
</dependency>
<!--用户信息接口 -->
<dependency>
<groupId>com.glsx.biz</groupId>
<artifactId>biz-user-manager</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<!--用户信息接口 -->
<dependency>
<groupId>com.glsx.biz</groupId>
<artifactId>biz-common-user</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.glsx.biz</groupId>
<artifactId>biz-user-service</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<!--云防盗-->
<dependency>
<groupId>cn.com.glsx.ddh</groupId>
<artifactId>rpc-ddh-cloudSecurity-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-customer-api</artifactId>
<version>0.0.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-aibschance-api</artifactId>
<version>0.0.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.oreframework.boot</groupId>
<artifactId>ore-boot-starter-swagger</artifactId>
</dependency>
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-gop-api</artifactId>
<version>0.0.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-weapp-api</artifactId>
<version>0.0.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-car-boutique-api</artifactId>
<version>0.0.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.oreframework</groupId>
<artifactId>ore-util</artifactId>
</dependency>
<dependency>
<groupId>cn.com.glsx.framework</groupId>
<artifactId>framework-rop-extension</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.weapp;
import org.oreframework.boot.main.AbsOreBootStarter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
/**
* @Title: Main.java
* @Description:
* @author zengqi
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2015
*/
@SpringBootApplication
@EnableAsync
@ServletComponentScan
public class Main extends AbsOreBootStarter {
@Override
public void run(String[] args)
{
SpringApplication.run(Main.class, args);
}
public static void main(String[] args)
{
Main main = new Main();
main.run(args);
}
}
package cn.com.glsx.dj.weapp.common;
import cn.com.glsx.framework.core.enums.ErrorEnum;
/**
* @Title: Constants.java
* @Description: 常量
* @author Alvin.zengqi
* @date 2016年6月21日 下午3:32:36
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2015
*/
public class Constants {
public static final String SESSION_REQUEST_PARAMS_KEY = "REQUEST_PARAMS";
public static final String SESSION_REQUEST_URL_KEY = "REQUEST_URL";
public static final String EQUITY_ACTIVE_SUCCESS_SEND_MSG = "恭喜您,权益激活成功!";
public static final String EQUITY_ACTIVE_REPEATE_SEND_MSG = "您的权益已激活。";
/**
* <P>Description: session键定义</P>
*
* @author Alvin
* @version 1.0
*/
public enum SessionKey {
// 账户ID SESSION键
ACCOUNT_ID("SESSION_ACCOUNT_ID"),
// 协议号(原嘀嘀号)SESSION键
PROTOCOL_ID("SESSION_PROTOCOL_ID"),
IMEI("IMEI"),
// 商户号 SESSION键
MERCHANT_ID("SESSION_MERCHANT_ID"),
// 小程序信息 WEAPP_INFO键
WEAPP_INFO_ID("SESSION_WEAPP_INFO"),
// 用户SESSION键
SESSION_USERINFO_KEY("SESSION_USERINFO_KEY"),
// 请求参数 SESSION键
REQUEST_PARAMS_KEY("SESSION_REQUEST_PARAMS_KEY"),
// UNIONID SESSION键
UNIONID("SESSION_UNIONID"),
// OPENID SESSION键
OPENID("SESSION_OPENID"),
// WECHATID SESSION键
WECHATID("SESSION_WECHATID"),
// WEAPP_USERINFO_KEY键
WEAPP_USERINFO_KEY("SESSION_WEAPP_USERINFO_KEY"),
// WEAPP_SESSION_KEY键
WEAPP_SESSION_KEY("SESSION_WEAPP_SESSION_KEY"),
// PLATFORM_SESSIONID_KEY
PLATFORM_SESSIONID_KEY("PLATFORM_SESSIONID_KEY");
private final String value;
SessionKey(String value){
this.value=value;
}
public String getValue() {
return value;
}
}
/**
* 支付错误码枚举
*/
public enum PaymentErrorCode implements ErrorEnum {
/**
* 1000:服务异常
*/
SERVICE_ERROR("1000", "服务异常"),
/**
* 1001:商品ID无效
*/
PRODUCT_ID_INVALID("1001", "商品ID无效"),
/**
* 2001:签名验证失败
*/
SIGN_VERIFY_FAILED("2001", "签名验证失败"),
/**
* 2002:支付失败
*/
PAYMENT_FAILED("2002", "支付失败"),
/**
* 2003:支付回调失败
*/
NOTIFY_FAILED("2003", "支付回调失败"),
/**
* 2004:签名失败
*/
SIGN_FAILED("2004", "签名失败");
private String value;
private String displayName;
private PaymentErrorCode(String value, String displayName){
this.value = value;
this.displayName = displayName;
}
@Override
public String getValue() {
return value;
}
@Override
public String getDisplayName() {
return displayName;
}
}
/**
* 认证状态枚举
* @author yangjia
* @date 2019/06/25
*/
public enum AuthenStatusCode implements ErrorEnum{
/**
* 已认证
* */
AUTHEN_SUCCESS("1","已认证"),
/**
* 认证失败
* */
AUTHEN_FAIL("2","认证失败"),
/**
* 未认证
* */
NOT_AUTHEN("4","未认证");
private String value;
private String displayName;
private AuthenStatusCode(String value, String displayName){
this.value = value;
this.displayName = displayName;
}
@Override
public String getDisplayName() {
return this.displayName;
}
@Override
public String getValue() {
return this.value;
}
}
/**
* 车智能模块错误码枚举
* @author yangjia
* @date 2019/06/25
*/
public enum SmartCarErrorCode implements ErrorEnum{
/**
* 用户未绑定设备
* */
ACCOUNT_UNBIND("2001","用户未绑定设备"),
DEVICE_LIST_UNEXIST("2002", "设备绑定列表获取失败"),
START_CAR_MESSAGES_FAILED("2003","获取爱车启动信息失败"),
ACCOUNT_ID_IS_NULL("2004","accountId为空"),
CHECK_DEVICE_UPDATE("0","更新当前选中设备"),
CHECK_DEVICE_INSERT("1","插入当前选中设备");
private String value;
private String displayName;
private SmartCarErrorCode(String value, String displayName){
this.value = value;
this.displayName = displayName;
}
@Override
public String getDisplayName() {
return this.displayName;
}
@Override
public String getValue() {
return this.value;
}
}
/**
* 套餐类型枚举
*/
public enum WheelPathType {
/**
* 日轨迹
*/
DAY_PATH,
/**
* 月轨迹
*/
MONTH_PATH;
}
}
package cn.com.glsx.dj.weapp.common;
/**
* @author Suro
*/
public class RopConstants {
/**
* 获取商户礼券列表
* */
public static String LIST_MERCHNAT_COUPON = "dj.api.smartCarLife.merchant.coupon.list";
/**
* 生成核销信息
* */
public static String ADD_CUSTOMER_COUPON = "dj.api.smartCarLife.customer.coupon.add";
/**
* 获取核销信息
* */
public static String LIST_CUSTOMER_COUPON = "dj.api.customer.coupon.list";
/**
* 获取礼券详情信息
*/
public static String DETAIL_CUSTOMER_COUPON = "dj.api.smartCarLife.customer.coupon.detail";
/**
* 获取指定商户时间段邀约统计
*/
public static String LIST_INVITE_STAT = "dj.api.smartcarlife.inviteStat.merchant.list";
/**
* (修改)预约
*/
public static String INVITE_DATE_UPDATE_FOR_CUSTOMER_COUPON = "dj.api.smartcarlife.inviteRecord.invite.dateUpdate.byCustomer";
/**
* 预约记录详情
*/
public static String INVITE_RECORD_FOR_CUSTOMER_COUPON_DETAIL = "dj.api.smartcarlife.inviteRecord.detail";
}
package cn.com.glsx.dj.weapp.common;
import org.apache.commons.lang.StringUtils;
/**
* @Title: ServiceMarkEnum
* @Description: 支付订单来源标志
* @author yangjia
* @date 2019/05/06
*/
public enum ServiceMarkEnum {
/**
* 热门活动
*/
POPULAR_ACTIVITY("热门活动");
private final String value;
ServiceMarkEnum(String value){
this.value = value;
}
public String getValue(){
return this.value;
}
/**
* @Title: getValue
* @Description: 通过枚举名获取枚举值
* @param name
* @return String
* @author yangjia
* @Date: 2019/05/06
*/
public static String getValue(String name){
if(StringUtils.isNotEmpty(name)){
ServiceMarkEnum serviceMarkEnum = ServiceMarkEnum.valueOf(name);
if(serviceMarkEnum == null){
return null;
}
return serviceMarkEnum.getValue();
}
return null;
}
}
package cn.com.glsx.dj.weapp.common;
/**
* @author yangjia
* @version V1.0
* @Title: SmartCarConstant
* @Description: 车智能相关参数定义
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2018
*/
public class SmartCarConstant {
/**
* 设备状态定义:1:添加设备 2:设备被踢,添加设备 3:直接请求相关数据
*/
public enum DeviceStatusCode {
/**
* 没有绑定设备
*/
NOT_BINDING(1),
/**
* 选中设备被解绑且无其他设备
*/
UNBIND_AND_NOCHOICE(3),
/**
* 绑定设备且选中
*/
BINDING_AND_SELECTED(5);
private Integer deviceStatusCode;
DeviceStatusCode(Integer deviceStatusCode) {
this.deviceStatusCode = deviceStatusCode;
}
public Integer getDeviceStatusCode() {
return this.deviceStatusCode;
}
}
/**
* 跳转链接类型定义
*/
public enum JumpUrlTypeKey {
/**
* 小程序内部跳转
*/
WEAPP,
/**
* 外部链接
*/
H5
}
/**
* 默认保养里程:5000公里
*/
public static Integer SERVICECYCLE = 5000;
/**
* 默认显示几个月的轨迹
*/
public static int DEFAULT_NUM = 3;
}
package cn.com.glsx.dj.weapp.common;
import java.io.File;
import java.io.FileOutputStream;
import java.text.MessageFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;
import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import cn.com.glsx.dj.weapp.config.FileConfig;
import cn.com.glsx.dj.weapp.config.UploadProperty;
import cn.com.glsx.framework.core.beans.ResultEntity;
/**
* <P>
* Description:文件上传
* </P>
*
* @author Alvin
* @version 1.0
*/
@RestController
@RequestMapping("common")
public class UploadController {
private Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private UploadProperty uploadProperty;
/**
* 文件上传
* @param file
* @param fileType 文件类型(file:所有文件类型;video:视频;image:图片)
* @return
* @author Alvin
* @date 2019年5月1日 下午7:46:21
*/
@RequestMapping("upload")
public ResultEntity<String> upload(@RequestParam(value = "file")MultipartFile file, String fileType){
try {
FileConfig config = uploadProperty.getUpload().get(fileType);
String extension = getExtension(file.getOriginalFilename());
boolean isAllowFormat = false;
for(String f:config.getFormat().split(",")){
if(f.equalsIgnoreCase("*") || f.equalsIgnoreCase(extension)){
isAllowFormat = true;
break;
}
}
if(!isAllowFormat){
return ResultEntity.error("1001", MessageFormat.format("请上传{0}格式的文件", config.getFormat()));
}
Long maxUploadSize = Long.valueOf(config.getSize());
Long fileSize = (long) Math.ceil(file.getSize() / FileUtils.ONE_MB);
if (maxUploadSize != null && fileSize.longValue() > maxUploadSize.longValue()) {
return ResultEntity.error("1002", MessageFormat.format("文件超出大小限制({0})KB", maxUploadSize));
}
String name = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()).concat(UUID.randomUUID().toString().replace("-", ""));
String savePath = config.getDir() + File.separator;
String url = config.getUrl() + name + "." + extension ;
uploadFile(file.getBytes(), savePath, name + "." + extension);
return ResultEntity.success(url);
} catch (Exception e) {
logger.error("服务器繁忙,上传文件失败", e);
return ResultEntity.error("1003", "文件上传失败");
}
}
/**
* 上传文件
* @param file
* @return
* @author Alvin
* @date 2019年5月1日 下午7:46:00
*/
@RequestMapping(value = "/uploadFile")
public ResultEntity<String> uploadFile(@RequestParam("file") MultipartFile file) {
return upload(file, "file");
}
/**
* 上传视频
* @param file
* @return
* @author Alvin
* @date 2019年5月1日 下午7:46:05
*/
@RequestMapping(value = "/uploadVideo")
public ResultEntity<String> uploadVideo(@RequestParam("file") MultipartFile file) {
return upload(file, "video");
}
/**
* 上传图片
* @param file
* @return
* @author Alvin
* @date 2019年5月1日 下午7:46:10
*/
@RequestMapping(value = "uploadImage")
public ResultEntity<String> uploadImage(@RequestParam("file")MultipartFile file){
return upload(file, "image");
}
public void uploadFile(byte[] file, String filePath, String fileName) throws Exception {
File targetFile = new File(filePath);
if (!targetFile.exists()) {
targetFile.mkdirs();
}
FileOutputStream out = new FileOutputStream(filePath + File.separator + fileName);
out.write(file);
out.flush();
out.close();
}
private String getExtension(String originalFilename) {
int i = originalFilename.lastIndexOf(".");
return originalFilename.substring(i + 1).toLowerCase();
}
}
package cn.com.glsx.dj.weapp.config;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import cn.com.glsx.dj.aibschance.remote.CollisionNoticeConfigRemote;
/**
* @Title: AibschanceDubboConfig.java
* @Description:
* @author Alvin
* @date 2020年11月9日 下午7:03:08
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
@Configuration
public class AibschanceDubboConfig {
@Autowired
private ReferenceBuilderFactory factory;
@Bean
public CollisionNoticeConfigRemote collisionNoticeConfigRemote() {
return factory.builder(CollisionNoticeConfigRemote.class).check(false).timeout(3000).build();
}
}
package cn.com.glsx.dj.weapp.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import cn.com.glsx.dj.weapp.web.interceptor.AuthInterceptor;
import cn.com.glsx.dj.weapp.web.interceptor.SessionInterceptor;
/**
* @Title: BeanConfig.java
* @Description:
* @author Alvin
* @date 2019年3月9日 下午4:22:04
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2018
*/
@Configuration
public class BeanConfig {
@Autowired
private AuthInterceptor authInterceptor;
@Autowired
private SessionInterceptor sessionInterceptor;
@Bean(name = "threadPoolTaskExecutor")
public ThreadPoolTaskExecutor threadPoolTaskExecutor(){
ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
taskExecutor.setCorePoolSize(100);
taskExecutor.setMaxPoolSize(200);
taskExecutor.setQueueCapacity(10002);
taskExecutor.setKeepAliveSeconds(300);
return taskExecutor;
}
/**
* 注册自定义拦截器
* @return
* @author Alvin
* @date 2020年10月28日 下午5:51:59
*/
@Bean
public WebMvcConfigurer registInterceptor(){
return new WebMvcConfigurer() {
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(sessionInterceptor).addPathPatterns("/**");
registry.addInterceptor(authInterceptor).addPathPatterns("/**").excludePathPatterns("/swagger-ui.html", "/webjars/**", "/swagger-resources/**");
}
};
}
}
package cn.com.glsx.dj.weapp.config;
import cn.com.glsx.dj.car.boutique.remote.*;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class CarBoutiqueDubboConfig {
@Autowired
private ReferenceBuilderFactory factory;
@Bean
public BdGoodsRelationRemote bdGoodsRelationRemote(){
return factory.builder(BdGoodsRelationRemote.class).check(false).timeout(30000).build();
}
@Bean
public BdOrderRemote bdOrderRemote(){
return factory.builder(BdOrderRemote.class).check(false).timeout(30000).build();
}
@Bean
public BdSubOrderRemote bdSubOrderRemote(){
return factory.builder(BdSubOrderRemote.class).check(false).timeout(30000).build();
}
@Bean
public BdGoodsRemote bdGoodsRemote(){
return factory.builder(BdGoodsRemote.class).check(false).timeout(30000).build();
}
@Bean
public BdUnboundOrderRemote bdUnboundOrderRemote(){
return factory.builder(BdUnboundOrderRemote.class).check(false).timeout(30000).build();
}
}
package cn.com.glsx.dj.weapp.config;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import cn.com.glsx.dj.customer.remote.MerchantCustomerRemote;
/**
* @Title: CustomerDubboConfig.java
* @Description:
* @author Alvin
* @date 2020年11月9日 下午7:02:25
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
@Configuration
public class CustomerDubboConfig {
@Autowired
private ReferenceBuilderFactory factory;
/**
* 商户客户关系
* @return
* @author zhangyan
* @date 2019/10/15
*/
@Bean
public MerchantCustomerRemote merchantCustomerRemote(){
return factory.builder(MerchantCustomerRemote.class).check(false).timeout(30000).build();
}
}
package cn.com.glsx.dj.weapp.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
/**
* @Title: DjWeappProperty.java
* @Description:
* @author zengqi
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
@Configuration
@ConfigurationProperties("dj.weapp")
public class DjWeappProperty {
/**
* 会话ID键值
*/
private String sessionIdKey;
/**
* 缓存键值前缀
*/
private String cachePrefix;
/**
* 缓存失效时间(单位:秒)
*/
private Long cacheExpire;
/**
* 挪车服务访问地址
* */
private String movecarUrl;
/**
* OBD信息访问地址
* */
private String jiabaoUrl;
/**
* 嘀加小程序渠道ID
*/
private Integer channelId;
/**
* 私钥
*/
private String privateKey;
/**
* 嘀加公版小程序应用Id
*/
private String generalEditionAppid;
/**
* 嘀加公版小程序昵称
*/
private String generalEditionAppName;
/**
* 嘀加公版小程序商户Id
*/
private Integer generalEditionMerchantId;
/**
* 保单路径域名
*/
private String insureDdfUrl;
/**
* 订单超时时间
*/
private Integer expireTime;
public String getSessionIdKey() {
return sessionIdKey;
}
public void setSessionIdKey(String sessionIdKey) {
this.sessionIdKey = sessionIdKey;
}
public String getCachePrefix() {
return cachePrefix;
}
public void setCachePrefix(String cachePrefix) {
this.cachePrefix = cachePrefix;
}
public Long getCacheExpire() {
return cacheExpire;
}
public void setCacheExpire(Long cacheExpire) {
this.cacheExpire = cacheExpire;
}
public String getMovecarUrl() {
return movecarUrl;
}
public void setMovecarUrl(String movecarUrl) {
this.movecarUrl = movecarUrl;
}
public String getJiabaoUrl() {
return jiabaoUrl;
}
public void setJiabaoUrl(String jiabaoUrl) {
this.jiabaoUrl = jiabaoUrl;
}
public Integer getChannelId() {
return channelId;
}
public void setChannelId(Integer channelId) {
this.channelId = channelId;
}
public String getPrivateKey() {
return privateKey;
}
public void setPrivateKey(String privateKey) {
this.privateKey = privateKey;
}
public String getGeneralEditionAppid() {
return generalEditionAppid;
}
public void setGeneralEditionAppid(String generalEditionAppid) {
this.generalEditionAppid = generalEditionAppid;
}
public Integer getGeneralEditionMerchantId() {
return generalEditionMerchantId;
}
public void setGeneralEditionMerchantId(Integer generalEditionMerchantId) {
this.generalEditionMerchantId = generalEditionMerchantId;
}
public String getGeneralEditionAppName() {
return generalEditionAppName;
}
public void setGeneralEditionAppName(String generalEditionAppName) {
this.generalEditionAppName = generalEditionAppName;
}
public String getInsureDdfUrl() {
return insureDdfUrl;
}
public void setInsureDdfUrl(String insureDdfUrl) {
this.insureDdfUrl = insureDdfUrl;
}
public Integer getExpireTime() {
return expireTime;
}
public void setExpireTime(Integer expireTime) {
this.expireTime = expireTime;
}
}
package cn.com.glsx.dj.weapp.config;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import cn.com.glsx.dj.weapp.remote.IntelligentRminderRemote;
import cn.com.glsx.dj.weapp.remote.MerchantModuleRemote;
import cn.com.glsx.dj.weapp.remote.MerchantWeappNoticeRemote;
import cn.com.glsx.dj.weapp.remote.UserAddressRemote;
import cn.com.glsx.dj.weapp.remote.WeappModuleRemote;
import com.glsx.biz.user.service.SessionService;
/**
* @Title: DubboConfig.java
* @Description: Dubbo服务注册配置
* @author zengqi
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2018
*/
@Configuration
public class DubboConfig {
@Autowired
private ReferenceBuilderFactory factory;
/**
* 首页模块远程服务
* @author yangjia
* @date 2019/05/01
*/
@Bean
public WeappModuleRemote weappModuleRemote(){
return factory.builder(WeappModuleRemote.class).check(false).timeout(3000).build();
}
/**
* 首页商户模块远程服务
* @author yangjia
* @date 2019/05/01
*/
@Bean
public MerchantModuleRemote merchantModuleRemote(){
return factory.builder(MerchantModuleRemote.class).check(false).timeout(3000).build();
}
/**
* 智能提醒远程服务
* @author yangjia
* @date 2019/05/01
*/
@Bean
public IntelligentRminderRemote intelligentRminderRemote(){
return factory.builder(IntelligentRminderRemote.class).check(false).timeout(30000).build();
}
/**
* 获取门店公告远程服务
* @return
* @author zhangyan
* @date 2019/05/11
*/
@Bean
public MerchantWeappNoticeRemote merchantWeappNoticeRemote(){
return factory.builder(MerchantWeappNoticeRemote.class).check(false).timeout(30000).build();
}
@Bean
public UserAddressRemote userAddressRemote(){
return factory.builder(UserAddressRemote.class).timeout(30000).check(false).build();
}
}
package cn.com.glsx.dj.weapp.config;
/**
* @Title: FileConfig.java
* @Description:
* @author Alvin
* @date 2019年5月2日 上午11:32:18
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2018
*/
public class FileConfig{
/**
* 文件大小:单位KB
*/
private Integer size;
/**
* 文件存储路径
*/
private String dir;
/**
* 文件访问路径
*/
private String url;
/**
* 文件格式
*/
private String format;
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public String getDir() {
return dir;
}
public void setDir(String dir) {
this.dir = dir;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getFormat() {
return format;
}
public void setFormat(String format) {
this.format = format;
}
}
package cn.com.glsx.dj.weapp.config;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import cn.com.glsx.dj.gop.remote.GopBoutiqueDeliveryRemote;
import cn.com.glsx.dj.gop.remote.GopCarInfoRemote;
import cn.com.glsx.dj.gop.remote.GopCreateQrCodeRemote;
import cn.com.glsx.dj.gop.remote.GopMileageRemote;
import cn.com.glsx.dj.gop.remote.GopSendTemplateMessageRemote;
@Configuration
public class GopDubboConfig {
@Autowired
private ReferenceBuilderFactory factory;
@Bean
public GopBoutiqueDeliveryRemote gopBoutiqueDeliveryRemote() {
return factory.builder(GopBoutiqueDeliveryRemote.class).check(false).timeout(30000).build();
}
/**
* 发送模板消息
* @return
* @author zhangyan
* @date 2020年4月7日09:42:29
*/
@Bean
public GopSendTemplateMessageRemote gopSendTemplateMessageRemote(){
return factory.builder(GopSendTemplateMessageRemote.class).check(false).timeout(30000).build();
}
/**
* 设备里程接口
* @return
*/
@Bean
public GopMileageRemote gopMileageRemote(){
return factory.builder(GopMileageRemote.class).check(false).timeout(30000).build();
}
/**
* 车型
*/
@Bean
public GopCarInfoRemote gopCarInfoRemote(){
return factory.builder(GopCarInfoRemote.class).timeout(30000).check(false).build();
}
@Bean
public GopCreateQrCodeRemote gopCreateQrCodeRemote(){
return factory.builder(GopCreateQrCodeRemote.class).timeout(30000).check(false).build();
}
}
package cn.com.glsx.dj.weapp.config;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import cn.com.glsx.dj.insure.remote.EquityActiveInfoRemote;
import cn.com.glsx.dj.insure.remote.InsureDeviceRemote;
import cn.com.glsx.dj.insure.remote.InsureEquityRemote;
/**
* @Title: InsureDubboConfig.java
* @Description:
* @author Alvin
* @date 2020年11月9日 下午6:58:36
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
@Configuration
public class InsureDubboConfig {
@Autowired
private ReferenceBuilderFactory factory;
/**
* 保单设备远程服务
* @author yangjia
* @date 2019/10/10
*/
@Bean
public InsureDeviceRemote insureDeviceRemote(){
return factory.builder(InsureDeviceRemote.class).check(false).timeout(30000).build();
}
/**
* 权益信息
* @return
* @author zhangyan
* @date 2020年3月18日13:22:03
*/
@Bean
public EquityActiveInfoRemote equityActiveInfoRemote(){
return factory.builder(EquityActiveInfoRemote.class).check(false).timeout(30000).build();
}
/**
* 保单权益
* @return
* @author zhangyan
* @date 2020年3月25日10:22:46
*/
@Bean
public InsureEquityRemote insureEquityRemote(){
return factory.builder(InsureEquityRemote.class).check(false).timeout(30000).build();
}
}
package cn.com.glsx.dj.weapp.config;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import cn.com.glsx.dj.marketing.remote.CouponInfoRemote;
import cn.com.glsx.dj.marketing.remote.KdniaoLogisticRemote;
import cn.com.glsx.dj.marketing.remote.ShopActivityOrderDeliverRemote;
import cn.com.glsx.dj.marketing.remote.ShopActivityOrderRefundRemote;
import cn.com.glsx.dj.marketing.remote.ShopActivityQuoteRemote;
import cn.com.glsx.dj.marketing.remote.ShopActivityRemote;
import cn.com.glsx.dj.marketing.remote.ShopActivitySpecialSubjectRemote;
import cn.com.glsx.dj.marketing.remote.WeappActivityRemote;
import cn.com.glsx.dj.marketing.remote.WeappLiveManageRemote;
import cn.com.glsx.dj.marketing.remote.WeappReportRemote;
import cn.com.glsx.dj.marketing.remote.WxCouponUserRemote;
import cn.com.glsx.dj.marketing.remote.WxShopActivityRemote;
import cn.com.glsx.dj.marketing.remote.WxShopRechargeRecordRemote;
/**
* @Title: MarketingDubboConfig.java
* @Description:
* @author Alvin
* @date 2020年11月9日 下午6:53:06
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
@Configuration
public class MarketingDubboConfig {
@Autowired
private ReferenceBuilderFactory factory;
/**
* 优惠券远程服务
* @author yangjia
* @date 2019/05/01
*/
@Bean
public CouponInfoRemote couponInfoRemote(){
return factory.builder(CouponInfoRemote.class).check(false).version("0.0.1").timeout(3000).build();
}
/**
* 活动优惠券远程服务
* @author yangjia
* @date 2019/05/01
*/
@Bean
public WxCouponUserRemote activityCouponUserRemote(){
return factory.builder(WxCouponUserRemote.class).check(false).version("0.0.1").timeout(3000).build();
}
/**
* 用户优惠券远程服务
* @author yangjia
* @date 2019/05/04
*/
@Bean
public WxCouponUserRemote wxCouponUserRemote(){
return factory.builder(WxCouponUserRemote.class).check(false).version("0.0.1").timeout(3000).build();
}
/**
* 热门活动远程服务
* @author yangjia
* @date 2019/05/06
*/
@Bean
public WxShopActivityRemote wxShopActivityRemote(){
return factory.builder(WxShopActivityRemote.class).check(false).version("0.0.1").timeout(3000).build();
}
/**
* 活动订单远程服务
* @author yangjia
* @date 2019/05/08
*/
@Bean
public WxShopRechargeRecordRemote wxShopRechargeRecordRemote(){
return factory.builder(WxShopRechargeRecordRemote.class).check(false).version("0.0.1").timeout(3000).build();
}
/**
* 做活动小程序接口
* @author yangjia
* @date 2020/02/16
* */
@Bean
public WeappActivityRemote weappActivityRemote(){
return factory.builder(WeappActivityRemote.class).check(false).timeout(3000).build();
}
/**
* 做活动小程序报表接口
* @author yangjia
* @date 2020/02/16
* */
@Bean
public WeappReportRemote weappReportRemote(){
return factory.builder(WeappReportRemote.class).check(false).timeout(3000).build();
}
/**
* 活动信息
* @author yangjia
* @date 2020/02/16
* */
@Bean
public ShopActivityRemote shopActivityRemote(){
return factory.builder(ShopActivityRemote.class).check(false).version("0.0.1").timeout(3000).build();
}
/**
* 订单发货信息接口
* @return
*/
@Bean
public ShopActivityOrderDeliverRemote shopActivityOrderDeliverRemote(){
return factory.builder(ShopActivityOrderDeliverRemote.class).timeout(30000).check(false).build();
}
/**
* 退款接口
* @return
*/
@Bean
public ShopActivityOrderRefundRemote shopActivityOrderRefundRemote(){
return factory.builder(ShopActivityOrderRefundRemote.class).timeout(30000).check(false).build();
}
/**
* 快递接口
* @return
*/
@Bean
public KdniaoLogisticRemote kdniaoLogisticRemote(){
return factory.builder(KdniaoLogisticRemote.class).timeout(30000).check(false).build();
}
/**
* 直播
* @return
*/
@Bean
public WeappLiveManageRemote weappLiveManageRemote(){
return factory.builder(WeappLiveManageRemote.class).timeout(30000).check(false).build();
}
/**
* 报价
*/
@Bean
public ShopActivityQuoteRemote shopActivityQuoteRemote(){
return factory.builder(ShopActivityQuoteRemote.class).timeout(30000).check(false).build();
}
/**
* 专题
*/
@Bean
public ShopActivitySpecialSubjectRemote shioActivitySpecialSubjectRemote(){
return factory.builder(ShopActivitySpecialSubjectRemote.class).timeout(30000).check(false).build();
}
}
package cn.com.glsx.dj.weapp.config;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import cn.com.glsx.dj.payment.remote.WechatPaymentRemote;
import cn.com.glsx.dj.payment.remote.WechatSpecialMerchantRemote;
/**
* @Title: PaymentDubboConfig.java
* @Description:
* @author Alvin
* @date 2020年11月9日 下午6:59:30
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
@Configuration
public class PaymentDubboConfig {
@Autowired
private ReferenceBuilderFactory factory;
/**
* 微信特约商户远程服务
* @author yangjia
* @date 2019/05/08
*/
@Bean
public WechatSpecialMerchantRemote wechatSpecialMerchantRemote(){
return factory.builder(WechatSpecialMerchantRemote.class).check(false).timeout(3000).build();
}
/**
* 微信支付远程服务
* @author yangjia
* @date 2019/05/08
*/
@Bean
public WechatPaymentRemote wechatPaymentRemote(){
return factory.builder(WechatPaymentRemote.class).check(false).timeout(3000).build();
}
}
package cn.com.glsx.dj.weapp.config;
import cn.com.glsx.dj.weapp.remote.*;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class SmartMicroStoreDubboConfig {
@Autowired
private ReferenceBuilderFactory factory;
@Bean
public IntelligentRemindRuleRemote intelligentRemindRuleRemote(){
return factory.builder(IntelligentRemindRuleRemote.class).check(false).timeout(30000).build();
}
@Bean
public QrCodeManageRemote qrCodeManageRemote(){
return factory.builder(QrCodeManageRemote.class).check(false).timeout(30000).build();
}
@Bean
public CustomerServiceMessageRemote customerServiceMessageRemote(){
return factory.builder(CustomerServiceMessageRemote.class).check(false).timeout(30000).build();
}
@Bean
public CustomerServiceMessageCatalogRemote customerServiceMessageCatalogRemote(){
return factory.builder(CustomerServiceMessageCatalogRemote.class).check(false).timeout(30000).build();
}
@Bean
public IntelligentRemindServiceRemote intelligentRemindServiceRemote(){
return factory.builder(IntelligentRemindServiceRemote.class).check(false).timeout(30000).build();
}
@Bean
public IntelligentRemindServiceClassifyTagRemote intelligentRemindServiceClassifyTagRemote(){
return factory.builder(IntelligentRemindServiceClassifyTagRemote.class).check(false).timeout(30000).build();
}
}
package cn.com.glsx.dj.weapp.config;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import cn.com.glsx.dj.system.remote.ConfigRemote;
import cn.com.glsx.dj.system.remote.EmployeeRemote;
import cn.com.glsx.dj.system.remote.MerchantCarBrandRemote;
import cn.com.glsx.dj.system.remote.MerchantRemote;
import cn.com.glsx.dj.system.remote.UserCustomerBehaviorRemote;
import cn.com.glsx.dj.system.remote.UserCustomerRefRemote;
import cn.com.glsx.dj.system.remote.UserRemote;
/**
* @Title: SystemDubboConfig.java
* @Description:
* @author Alvin
* @date 2020年11月9日 下午6:55:25
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
@Configuration
public class SystemDubboConfig {
@Autowired
private ReferenceBuilderFactory factory;
/**
* 商户远程服务
* @author yangjia
* @date 2019/05/03
*/
@Bean
public MerchantRemote merchantRemote(){
return factory.builder(MerchantRemote.class).check(false).timeout(3000).build();
}
/**
* 嘀加商户用户信息服务
* @author yangjia
* @date 2020/02/18
* */
@Bean
public UserRemote userRemote(){
return factory.builder(UserRemote.class).check(false).timeout(30000).build();
}
/**
* 顾问远程服务
* @return
* @author zhangyan
* @date 2019/05/11
*/
@Bean
public EmployeeRemote employeeRemote(){
return factory.builder(EmployeeRemote.class).check(false).timeout(3000).build();
}
/**
* 点赞评价远程服务
* @return
* @author zhangyan
* @date 2019/05/11
*/
@Bean
public UserCustomerBehaviorRemote userCustomerBehaviorRemote(){
return factory.builder(UserCustomerBehaviorRemote.class).check(false).timeout(3000).build();
}
/**
* 设置顾问远程服务
* @return
* @author zhangyan
* @date 2019/05/11
*/
@Bean
public UserCustomerRefRemote userCustomerRefRemote(){
return factory.builder(UserCustomerRefRemote.class).check(false).timeout(3000).build();
}
/**
* 大类车标接口
* @return
*/
@Bean
public MerchantCarBrandRemote merchantCarBrandRemote(){
return factory.builder(MerchantCarBrandRemote.class).check(false).timeout(3000).build();
}
@Bean
public ConfigRemote configRemote(){
return factory.builder(ConfigRemote.class).timeout(30000).check(false).build();
}
}
package cn.com.glsx.dj.weapp.config;
import java.util.Map;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
/**
* @Title: UploadProperty.java
* @Description:
* @author Alvin.zengqi
* @date 2018年5月11日 上午11:02:04
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2015
*/
@Configuration
@ConfigurationProperties("dj.webapp")
public class UploadProperty {
/**
* 文件访问路径
*/
private Map<String, FileConfig> upload;
public Map<String, FileConfig> getUpload() {
return upload;
}
public void setUpload(Map<String, FileConfig> upload) {
this.upload = upload;
}
}
package cn.com.glsx.dj.weapp.config;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import cn.com.glsx.dj.weapp.remote.PageVisitCollectRemote;
/**
* @Title: WeappDubboConfig.java
* @Description:
* @author zengqi
* @date 2021年6月4日 下午5:15:02
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
@Configuration
public class WeappDubboConfig {
@Autowired
private ReferenceBuilderFactory factory;
@Bean
public PageVisitCollectRemote pageVisitCollectRemote(){
return factory.builder(PageVisitCollectRemote.class).check(false).timeout(30000).build();
}
}
package cn.com.glsx.dj.weapp.config;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import cn.com.glsx.dj.wechat.remote.MerchantWechatAuthRemote;
import cn.com.glsx.dj.wechat.remote.WeappBaseInfoRemote;
import cn.com.glsx.dj.wechat.remote.WeappLivePlayerRemote;
import cn.com.glsx.dj.wechat.remote.WeappVersionInfoRemote;
import cn.com.glsx.dj.wechat.remote.WechatAppAuthorizerInfoRemote;
import cn.com.glsx.dj.wechat.remote.WechatMiniprogramRemote;
import cn.com.glsx.dj.wechat.remote.WechatQrcodeSceneRemote;
import cn.com.glsx.dj.wechat.remote.WechatUserInfoRemote;
@Configuration
public class WechatDubboConfig extends DubboConfig {
@Autowired
private ReferenceBuilderFactory factory;
@Bean
public WechatQrcodeSceneRemote wechatQrcodeSceneRemote() {
return factory.builder(WechatQrcodeSceneRemote.class).check(false).timeout(3000).build();
}
/**
* 小程序远程服务
* @return
* @author Alvin
* @date 2019年4月18日 下午8:48:51
*/
@Bean
public WechatMiniprogramRemote wechatMiniprogramRemote(){
return factory.builder(WechatMiniprogramRemote.class).timeout(3000).check(false).build();
}
/**
* 微信用户信息远程服务
* @return
* @author Alvin
* @date 2019年4月22日 下午8:19:10
*/
@Bean
public WechatUserInfoRemote wechatUserInfoRemote(){
return factory.builder(WechatUserInfoRemote.class).check(false).timeout(3000).build();
}
/**
* 获取小程序appId服务
* @return
* @author zhangyan
* @date 2019/05/11
*/
@Bean
public MerchantWechatAuthRemote merchantWechatAuthRemote(){
return factory.builder(MerchantWechatAuthRemote.class).check(false).timeout(30000).build();
}
/**
* 获取小程序公众号信息服务
* @return
* @author zhangyan
* @date 2019/05/11
*/
@Bean
public WechatAppAuthorizerInfoRemote wechatAppAuthorizerInfoRemote(){
return factory.builder(WechatAppAuthorizerInfoRemote.class).check(false).timeout(30000).build();
}
/**
* 小程序基本信息服务
* @return
* @author Alvin
* @date 2019年6月10日 下午7:08:19
*/
@Bean
public WeappBaseInfoRemote weappBaseInfoRemote(){
return factory.builder(WeappBaseInfoRemote.class).check(false).timeout(30000).build();
}
/**
* 小程序版本信息服务
* @return
* @author zhangyan
* @date 2019/06/15
*/
@Bean
public WeappVersionInfoRemote weappVersionInfoRemote(){
return factory.builder(WeappVersionInfoRemote.class).check(false).timeout(3000).build();
}
@Bean
public WeappLivePlayerRemote weappLivePlayerRemote(){
return factory.builder(WeappLivePlayerRemote.class).timeout(30000).check(false).build();
}
}
package cn.com.glsx.dj.weapp.controller;
import cn.com.glsx.dj.weapp.common.Constants;
import cn.com.glsx.dj.weapp.config.DjWeappProperty;
import cn.com.glsx.dj.weapp.util.ThreadLocalCache;
import cn.com.glsx.dj.weapp.web.session.Session;
import cn.com.glsx.dj.wechat.model.WechatUserInfo;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
/**
* 控制器基类
* <P>Description: </P>
*
* @author Alvin
* @version 1.0
*/
@Controller
public class BaseController {
@Autowired
private HttpServletRequest request;
@Autowired
private DjWeappProperty property;
private static final String UN_KNOWN = "unknown";
private Logger logger = LoggerFactory.getLogger(getClass());
/**
* @Title: getWechatUser
* @Description: 获取登录用户信息
* @return
* @Date:2016-12-16
*/
protected WechatUserInfo getWechatUserInfo() {
WechatUserInfo wechatUserInfo = ThreadLocalCache.getWechatUserInfo();
if (wechatUserInfo != null) {
return wechatUserInfo;
}
Session session = ThreadLocalCache.getSession();
wechatUserInfo = session.get(
Constants.SessionKey.SESSION_USERINFO_KEY.getValue(),
WechatUserInfo.class);
return wechatUserInfo;
}
/**
* @Title: getAccountId
* @Description:
* @return
* @Date:2016-12-16
*/
protected Integer getAccountId() {
return ThreadLocalCache.getAccountId();
}
protected Integer getMerchantId() {
Session session = ThreadLocalCache.getSession();
String merchantIdParam = request.getParameter("merchantId");
logger.info("getMerchantId:{}", merchantIdParam);
if(StringUtils.isNotEmpty(merchantIdParam)){
return Integer.valueOf(merchantIdParam);
}
if (ThreadLocalCache.getMerchantId() != null) {
return ThreadLocalCache.getMerchantId();
}
Integer merchantId = session.get(Constants.SessionKey.MERCHANT_ID.getValue(), Integer.class);
if (merchantId != null) {
return merchantId;
}
return getGeneralEditionMerchantId();
}
protected Integer getGeneralEditionMerchantId(){
return property.getGeneralEditionMerchantId();
}
protected String getPhone() {
return ThreadLocalCache.getMobile();
}
protected String getOpenId() {
WechatUserInfo wechatUserInfo = getWechatUserInfo();
if (wechatUserInfo != null) {
return wechatUserInfo.getOpenId();
}
return null;
}
protected String getIpAddr() {
String ip = request.getHeader("x-forwarded-for");
if (ip == null || ip.length() == 0 || UN_KNOWN.equalsIgnoreCase(ip)) {
ip = request.getHeader("X-Forwarded-For");
}
if (ip == null || ip.length() == 0 || UN_KNOWN.equalsIgnoreCase(ip)) {
ip = request.getHeader("Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || UN_KNOWN.equalsIgnoreCase(ip)) {
ip = request.getHeader("WL-Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || UN_KNOWN.equalsIgnoreCase(ip)) {
ip = request.getHeader("HTTP_CLIENT_IP");
}
if (ip == null || ip.length() == 0 || UN_KNOWN.equalsIgnoreCase(ip)) {
ip = request.getHeader("HTTP_X_FORWARDED_FOR");
}
if (ip == null || ip.length() == 0 || UN_KNOWN.equalsIgnoreCase(ip)) {
ip = request.getHeader("X-Real-IP");
}
if (ip == null || ip.length() == 0 || UN_KNOWN.equalsIgnoreCase(ip)) {
ip = request.getRemoteAddr();
}
if (ip != null) {
String[] ss = ip.split(",");
if (ss.length > 0) {
return ss[0];
}
}
return ip;
}
/**
* 获取请求体内容
* @return
* @author Alvin
* @date 2019年5月4日 下午3:31:07
*/
protected String getRequestBody(){
try {
return IOUtils.toString(request.getInputStream());
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
}
package cn.com.glsx.dj.weapp.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import cn.com.glsx.dj.insure.model.EquityActiveInfo;
import cn.com.glsx.dj.weapp.service.EquityService;
import cn.com.glsx.dj.weapp.vo.EquityActiveInfoVO;
import cn.com.glsx.dj.weapp.web.annotation.NeedLogin;
import cn.com.glsx.framework.core.beans.ResultEntity;
/**
* 权益信息相关控制层
* @title EquityController
* @author zhangyan
* @date 2020年3月18日13:42:10
*
*/
@Controller
@RequestMapping("/equity/")
public class EquityController extends BaseController{
@Autowired
private EquityService equityService;
/**
* 获取已激活权益列表
* @param info:unionId或者mobile必填
* @return
* @author zhangyan
* @date 2020年3月18日13:40:53
*/
@RequestMapping("list")
@ResponseBody
public ResultEntity<EquityActiveInfoVO> listEquities(EquityActiveInfo info){
return equityService.listEquities(info);
}
/**
* 根据权益订单号或者身份证号激活权益保单信息
* @param searchCondition:cardNo或者fullInsuranceNo或者equityNo
* @return
* @author zhangyan
* @date 2020年3月24日15:04:47
*/
@RequestMapping("query")
@ResponseBody
@NeedLogin
public ResultEntity<Integer> queryAndActiveBySearchCondition(String searchCondition){
return equityService.queryAndActiveBySearchCondition(searchCondition, getAccountId());
}
/**
* 查找权益项是否存在
* @param searchCondition
* @return
*/
@RequestMapping("exist")
@ResponseBody
public ResultEntity<Boolean> existEquity(String searchCondition){
return equityService.existEquity(searchCondition);
}
/**
* 完善车牌号
* @param standNo
* @param plateNum
* @return
* @author zhangyan
* @date 2020年3月26日16:58:41
*/
@RequestMapping("edit")
@ResponseBody
public ResultEntity<EquityActiveInfo> editCarBrand(EquityActiveInfo info){
return equityService.editCarBrand(info);
}
}
package cn.com.glsx.dj.weapp.controller;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import cn.com.glsx.dj.marketing.dto.ShopActivityOperationLogDTO;
import cn.com.glsx.dj.marketing.model.ShopActivityInfo;
import cn.com.glsx.dj.marketing.model.ShopActivityOperationLog;
import cn.com.glsx.dj.system.dto.MerchantDTO;
import cn.com.glsx.dj.system.dto.UserDTO;
import cn.com.glsx.dj.weapp.service.ActivityService;
import cn.com.glsx.dj.weapp.service.home.IndexModuleService;
import cn.com.glsx.dj.weapp.service.home.PopularActivityService;
import cn.com.glsx.dj.weapp.vo.ActivityVO;
import cn.com.glsx.dj.weapp.vo.LogRecordVO;
import cn.com.glsx.dj.weapp.vo.MyActivityDetailVO;
import cn.com.glsx.dj.weapp.vo.ShopActivityInfoVO;
import cn.com.glsx.framework.core.beans.ResultEntity;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
/**
* @Title: MyActivityController.java
* @Description: 我的活动接口
* @author yangjia
* @date 2020/02/03
*/
@RestController
@RequestMapping("/myactivity")
public class MyActivityController extends BaseController {
Logger logger = LoggerFactory.getLogger(MyActivityController.class);
@Autowired
private ActivityService activityService;
@Autowired
private IndexModuleService indexModuleService;
@Autowired
private PopularActivityService popularActivityService;
@GetMapping("/getAccountListByPhone")
public ResultEntity<List<UserDTO>> getAccountListByPhone(@RequestParam(name = "phone") String phone) {
return ResultEntity.success(indexModuleService.getByPhone(phone == null ? getPhone() : phone));
}
@PostMapping("/list")
public ResultEntity<RpcPagination<ShopActivityInfo>> listActivityByStatus(@RequestBody ActivityVO vo){
return activityService.listActivityByStatus(vo);
}
@PostMapping("/detail")
public ResultEntity<ShopActivityInfoVO> detail(@RequestBody MyActivityDetailVO vo){
return activityService.detail(vo);
}
@PostMapping("/createLogRecord")
public ResultEntity<Integer> createLogRecord(@RequestBody ShopActivityOperationLogDTO dto){
return activityService.createLogRecord(dto);
}
@PostMapping("/listLogRecord")
public ResultEntity<RpcPagination<ShopActivityOperationLog>> listLogRecord(@RequestBody LogRecordVO vo){
return activityService.listLogRecord(vo);
}
@GetMapping(value = "merchant")
@ResponseBody
public ResultEntity<MerchantDTO> getMerchantById(@RequestParam(value = "mid") Integer mid) {
return popularActivityService.getMerchantById(mid);
}
@GetMapping("/getDoActivityLink")
public ResultEntity<String> getDoActivityLink() {
return activityService.getDoActivityLink();
}
}
package cn.com.glsx.dj.weapp.controller;
import cn.com.glsx.dj.marketing.dto.WeappReportDTO;
import cn.com.glsx.dj.weapp.service.ReportService;
import cn.com.glsx.dj.weapp.vo.ReportVO;
import cn.com.glsx.framework.core.beans.ResultEntity;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @Title: ReportController.java
* @Description: 报表接口
* @author yangjia
* @date 2020/02/04
*/
@RestController
@RequestMapping("/report")
public class ReportController extends BaseController {
Logger logger = LoggerFactory.getLogger(ReportController.class);
@Autowired
private ReportService reportService;
@GetMapping("/trendAndRank")
public ResultEntity<List<WeappReportDTO>> trendAndRank(@RequestBody ReportVO vo){
return reportService.trendAndRank(vo);
}
@GetMapping("/data")
public ResultEntity<RpcPagination<WeappReportDTO>> data(@RequestBody ReportVO vo){
return reportService.data(vo);
}
}
package cn.com.glsx.dj.weapp.controller;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import cn.com.glsx.dj.marketing.dto.ShopActivityInfoDTO;
import cn.com.glsx.dj.marketing.remote.WxShopActivityRemote;
import cn.com.glsx.dj.system.dto.EmployeeDTO;
import cn.com.glsx.dj.system.remote.EmployeeRemote;
import cn.com.glsx.dj.weapp.common.Constants;
import cn.com.glsx.dj.weapp.enums.SceneUrlEnum;
import cn.com.glsx.dj.weapp.service.WeappUserService;
import cn.com.glsx.dj.weapp.util.ThreadLocalCache;
import cn.com.glsx.dj.weapp.vo.WeappUserInfoVO;
import cn.com.glsx.dj.weapp.vo.WechatAuthSettingVO;
import cn.com.glsx.dj.weapp.web.annotation.NeedLogin;
import cn.com.glsx.dj.weapp.web.session.Session;
import cn.com.glsx.dj.wechat.dto.JsCodeSessionDTO;
import cn.com.glsx.dj.wechat.enums.WechatErrorEnum;
import cn.com.glsx.dj.wechat.model.WechatUserInfo;
import cn.com.glsx.dj.wechat.remote.WechatMiniprogramRemote;
import cn.com.glsx.framework.core.beans.ResultEntity;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.enums.StatusEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
/**
* @Title: WeAppController.java
* @Description: 微信小程序接口
* @author Alvin.zengqi
* @date 2018年3月5日 下午2:54:48
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2015
*/
@RestController
public class WeAppController extends BaseController{
@Autowired
private WeappUserService weappUserService;
@Autowired
private WechatMiniprogramRemote wechatMiniprogramRemote;
@Autowired
private WxShopActivityRemote wxShopActivityRemote;
@Autowired
private EmployeeRemote employeeRemote;
Logger logger = LoggerFactory.getLogger(WeAppController.class);
/**
* 利用jscode登录
* @param code
* @return
* @author Alvin.zengqi
* @date 2018年3月5日 下午2:54:31
*/
@RequestMapping("jscode/login")
public ResultEntity<WeappUserInfoVO> loginByJsCode(
@RequestParam(name = "code", required = true) String code,
@RequestParam(name = "appId", required = true) String appId){
RpcResponse<JsCodeSessionDTO> response = wechatMiniprogramRemote.jsCode2Session(appId, code);
if(response == null || response.getResult() == null || StringUtils.isEmpty(response.getResult().getSessionKey())){
return ResultEntity.error(WechatErrorEnum.JS_CODE_2_SESSION_FAILED.getValue(), WechatErrorEnum.JS_CODE_2_SESSION_FAILED.getDisplayName());
}
Session session = ThreadLocalCache.getSession();
logger.debug("get sessoin by code:{} return:{}", code, response.getResult());
session.put(Constants.SessionKey.WEAPP_SESSION_KEY.getValue(), response.getResult());
session.put(Constants.SessionKey.WECHATID.getValue(), appId);
return weappUserService.loginByOpenId(response.getResult().getOpenId());
}
@RequestMapping("jscode/getOpenId")
public ResultEntity<WeappUserInfoVO> getOpenId(
@RequestParam(name = "code", required = true) String code,
@RequestParam(name = "appId", required = true) String appId){
RpcResponse<JsCodeSessionDTO> response = wechatMiniprogramRemote.jsCode2Session(appId, code);
if(response == null || response.getResult() == null || StringUtils.isEmpty(response.getResult().getSessionKey())){
return ResultEntity.error(WechatErrorEnum.JS_CODE_2_SESSION_FAILED.getValue(), WechatErrorEnum.JS_CODE_2_SESSION_FAILED.getDisplayName());
}
WeappUserInfoVO vo = new WeappUserInfoVO();
vo.setOpenId(response.getResult().getOpenId());
return ResultEntity.success(vo);
}
/**
* 授权登录
* @param authSetting
* @return 会话ID
* @author Alvin.zengqi
* @date 2018年3月20日 下午6:57:31
*/
@RequestMapping("auth/login")
public ResultEntity<WeappUserInfoVO> authLogin(@RequestBody WechatAuthSettingVO authSetting){
logger.info("auth/login WechatAuthSettingVO:{}", authSetting);
Session session = ThreadLocalCache.getSession();
// 得到session的key
JsCodeSessionDTO jsCodeSession = session.get(Constants.SessionKey.WEAPP_SESSION_KEY.getValue(), JsCodeSessionDTO.class);
if(StringUtils.isNotEmpty(authSetting.getCode()) && StringUtils.isNotEmpty(authSetting.getAppId())){
WechatUserInfo wechatUserInfo = session.get(Constants.SessionKey.SESSION_USERINFO_KEY.getValue(), WechatUserInfo.class);
// jsCodeSession为空或者用户已退出登录,则重新获取jsCodeSession
if(jsCodeSession == null || (wechatUserInfo != null && StatusEnum.NO.getValue().equals(wechatUserInfo.getIsLogin()))){
// 用appId 和code 拿到 sessionKey 和unionId 和 openId 这个参数是真对原来的平台的如果是本小程序就是本小程序的
RpcResponse<JsCodeSessionDTO> response = wechatMiniprogramRemote.jsCode2Session(authSetting.getAppId(), authSetting.getCode());
if(response.isSuccess()){
logger.debug("get sessoin by code:{} return:{}", authSetting.getCode(), response.getResult());
// 把sessionkey放到缓存中
session.put(Constants.SessionKey.WECHATID.getValue(), authSetting.getAppId());
session.put(Constants.SessionKey.WEAPP_SESSION_KEY.getValue(), response.getResult());
}
}
}
return weappUserService.authLogin(authSetting);
}
/**
* 授权手机号
* @param mobile 手机号
* @return
* @author Alvin.zengqi
* @date 2018年3月24日 下午2:37:33
*/
@RequestMapping("auth/phone")
public ResultEntity<WeappUserInfoVO> authPhone(@RequestBody WechatAuthSettingVO authSetting){
logger.info("auth/phone WechatAuthSettingVO:{}", authSetting);
boolean flag = true;
try{
// 得到来源
if(null != authSetting.getSceneParam() &&
SceneUrlEnum.ACTIVITY_SHARING.getValue().equals(authSetting.getSceneUrl())){
// 活动分享页进入 活动分享页面获取到来源信息
RpcResponse<ShopActivityInfoDTO> activity = wxShopActivityRemote.getActivityById(Integer.valueOf(authSetting.getSceneParam()));
logger.info("获取活动信息:{}", activity);
if(activity.isSuccess() && activity.hasResult()){
authSetting.setSceneParam(activity.getResult().getShopName());
flag = false;
}
}else if(null != authSetting.getSceneParam() &&
SceneUrlEnum.SERVICE_SHARING.getValue().equals(authSetting.getSceneUrl())){
// 顾问分享页进入
RpcResponse<EmployeeDTO> employee = employeeRemote.getByEmployeeId(Integer.valueOf(authSetting.getSceneParam()));
logger.info("获取顾问信息:{}", employee);
if(employee.isSuccess() && employee.hasResult()){
authSetting.setSceneParam(employee.getResult().getName());
flag = false;
}
}
}catch(RpcServiceException e){
logger.error("获取活动或顾问相关信息失败:{}", e.getMessage(), e);
}
if(flag){
authSetting.setSceneParam("小程序");
}
return weappUserService.authPhone(authSetting);
}
/**
* 退出登录
* @return
* @author Alvin
* @date 2020年12月15日 上午11:20:16
*/
@RequestMapping("logout")
@NeedLogin
public ResultEntity<WeappUserInfoVO> logout(){
return weappUserService.logout();
}
}
package cn.com.glsx.dj.weapp.controller;
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.RestController;
import cn.com.glsx.dj.weapp.service.WeappBaseInfoService;
import cn.com.glsx.dj.weapp.vo.AppInfoVO;
import cn.com.glsx.framework.core.beans.ResultEntity;
/**
* @Title: WeappBaseInfoController.java
* @Description:
* @author Alvin
* @date 2019年6月10日 下午7:11:00
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2018
*/
@RestController
public class WeappBaseInfoController {
@Autowired
private WeappBaseInfoService weappBaseInfoService;
/**
* 获取小程序头像
* @param appId 小程序应用ID
* @return
* @author Alvin
* @date 2019年6月10日 下午7:15:03
*/
@GetMapping("{appid}/headimage/get")
public ResultEntity<String> getHeadImage(@PathVariable("appid") String appId){
return weappBaseInfoService.getHeadImage(appId);
}
/**
* 获取小程序应用信息
* @param merchantId
* @return
* @author Alvin
* @date 2019年12月24日 下午3:09:17
*/
@GetMapping("appinfo/get")
public ResultEntity<AppInfoVO> getAppInfo(Integer merchantId){
return weappBaseInfoService.getAppInfo(merchantId);
}
}
package cn.com.glsx.dj.weapp.controller.boutiquedelivery;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import cn.com.glsx.dj.car.boutique.dto.BdGoodsDTO;
import cn.com.glsx.dj.weapp.controller.BaseController;
import cn.com.glsx.dj.weapp.service.boutiquedelivery.BdGoodsService;
import cn.com.glsx.dj.weapp.web.annotation.NeedLogin;
import cn.com.glsx.framework.core.beans.ResultEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
@RestController
@RequestMapping("/boutiquedelivery/goods")
@Api(value = "/boutiquedelivery/goods", tags = "精品交付-商品")
public class BdGoodsController extends BaseController{
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private BdGoodsService bdGoodsService;
//@NeedLogin
@GetMapping(value = "/getDetailByGoodsCode")
@ApiOperation(value = "根据商品编号获取商品详情",notes = "根据商品编号获取商品详情")
@ApiImplicitParam(name = "goodsCode",value = "商品编号",dataType = "String",required = true)
public ResultEntity<BdGoodsDTO> getDetailByGoodsCode(@RequestParam String goodsCode) {
logger.info("goodsCode:{}",goodsCode);
return bdGoodsService.getDetailByGoodsCode(goodsCode);
}
}
package cn.com.glsx.dj.weapp.controller.boutiquedelivery;
import cn.com.glsx.dj.car.boutique.dto.BdOrderDTO;
import cn.com.glsx.dj.system.model.Config;
import cn.com.glsx.dj.weapp.service.boutiquedelivery.BdOrderService;
import cn.com.glsx.dj.weapp.util.ThreadLocalCache;
import cn.com.glsx.dj.weapp.vo.BdGoodsTypeVo;
import cn.com.glsx.dj.weapp.vo.BdOrderVo;
import cn.com.glsx.dj.weapp.web.annotation.NeedLogin;
import cn.com.glsx.framework.core.beans.ResultEntity;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/boutiquedelivery/order")
@Api(value = "/boutiquedelivery/order", tags = "精品交付-订单")
public class BdOrderController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private BdOrderService bdOrderService;
@NeedLogin
@GetMapping(value = "/firstScan")
@ApiOperation(value = "客户扫码绑定订单(首次扫码)",notes = "客户扫码绑定订单(首次扫码)")
@ApiImplicitParam(name = "orderCode",value = "主订单编号",dataType = "String",required = true)
public ResultEntity<BdOrderVo> firstScan(@RequestParam String orderCode){
logger.info("orderCode:{}",orderCode);
return bdOrderService.bindCustomer(orderCode);
}
@GetMapping(value = "/getDetail")
@ApiOperation(value = "获取订单详情",notes = "获取订单详情")
@ApiImplicitParam(name = "orderCode",value = "主订单编号",dataType = "String",required = true)
public ResultEntity<BdOrderVo> getDetail(@RequestParam String orderCode){
logger.info("orderCode:{}",orderCode);
return bdOrderService.getOrderInfo(orderCode);
}
@NeedLogin
@PostMapping(value = "/listMyOrder")
@ApiOperation(value = "分页获取我的精品交付单列表",notes = "分页获取我的精品交付单列表")
@ApiImplicitParam(name = "pagination",value = "分页对象",dataType = "BdOrderDTO",required = true)
public ResultEntity<RpcPagination<BdOrderDTO>> listMyOrder(@RequestBody RpcPagination<BdOrderDTO> pagination) {
pagination.setPageSize(20);
if(null == pagination.getCondition()){
pagination.setCondition(new BdOrderDTO());
}
pagination.getCondition().setAccountId(ThreadLocalCache.getAccountId());
return ResultEntity.success(bdOrderService.listPage(pagination));
}
@NeedLogin
@GetMapping(value = "/listUpgradeList")
@ApiOperation(value = "获取该订单下精品升级商品列表",notes = "获取该订单下精品升级商品列表")
@ApiImplicitParam(name = "orderCode",value = "主订单编号",dataType = "String",required = true)
public ResultEntity<List<BdGoodsTypeVo>> listUpgradeList(@RequestParam String orderCode) {
logger.info("orderCode:{}",orderCode);
return bdOrderService.listUpgradeList(orderCode);
}
@NeedLogin
@GetMapping(value = "/secondScan")
@ApiOperation(value = "客户二次扫码获取订单详情",notes = "客户二次扫码获取订单详情")
@ApiImplicitParams({@ApiImplicitParam(name = "orderCode",value = "主订单编号",dataType = "String",required = true),
@ApiImplicitParam(name = "batchCode",value = "子订单批次号",dataType = "String",required = true)
})
public ResultEntity<BdOrderDTO> secondScan(@RequestParam String orderCode,@RequestParam String batchCode){
logger.info("secondScan.orderCode:{},batchCode:{}",orderCode,batchCode);
return bdOrderService.secondScan(orderCode, batchCode);
}
@NeedLogin
@PostMapping(value = "/confirmUpgrade")
@ApiOperation(value = "确认升级提交评分",notes = "确认升级提交评分")
@ApiImplicitParam(name = "order",value = "订单对象",dataType = "BdOrderDTO",required = true)
public ResultEntity<BdOrderDTO> confirmUpgrade(@RequestBody BdOrderDTO order) {
logger.info("confirmUpgrade:{}",order);
return bdOrderService.confirmUpgrade(order);
}
@GetMapping(value = "/getCommentLabelList")
@ApiOperation(value = "获取评论标签列表",notes = "获取评论标签列表")
public ResultEntity<List<Config>> getCommentLabelList(){
return bdOrderService.getCommentLabel();
}
}
package cn.com.glsx.dj.weapp.controller.common;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import cn.com.glsx.dj.weapp.converter.PageVisitConverter;
import cn.com.glsx.dj.weapp.service.PageVisitCollectService;
import cn.com.glsx.dj.weapp.vo.common.PageVisitVO;
/**
* @Title: PageVisitCollectController.java
* @Description:
* @author zengqi
* @date 2021年6月4日 下午1:42:40
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
@RestController
@RequestMapping("page/visit")
public class PageVisitCollectController {
@Autowired
private PageVisitCollectService pageVisitCollectService;
@PostMapping("collect")
public void collect(@RequestBody PageVisitVO pageVisit){
pageVisitCollectService.collect(PageVisitConverter.INSTANCE.convertToDTO(pageVisit));
}
}
package cn.com.glsx.dj.weapp.controller.common;
import com.google.zxing.WriterException;
import org.oreframework.util.qrcode.QrcodeUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* @author Suro
*/
@RequestMapping("/createCustomerCouponQrCode")
@RestController
public class QrCodeController {
@RequestMapping("/createQrCode")
public void createQrCode (HttpServletResponse response, String url) throws IOException, WriterException {
QrcodeUtil.createQrcode(response, url);
}
}
package cn.com.glsx.dj.weapp.controller.common;
import java.io.UnsupportedEncodingException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
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 cn.com.glsx.dj.weapp.service.WechatQrcodeService;
import cn.com.glsx.dj.weapp.vo.common.WeappQrcodeVO;
import cn.com.glsx.dj.weapp.web.annotation.NeedLogin;
import cn.com.glsx.framework.core.beans.ResultEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
/**
* @Title: WechatQrcodeController.java
* @Description: 微信二维码接口
* @author Alvin
* @date 2020年4月27日 上午10:18:17
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
@RestController
@Api(tags = "微信二维码")
public class WechatQrcodeController {
@Autowired
private WechatQrcodeService wechatQrcodeService;
/**
* @title createQrcode
* @description 生成小程序码
* @param merchantId
* @param path
* @return
* @author zhangyan
* @throws UnsupportedEncodingException
* @date 2019/05/11
*/
@RequestMapping(value = "/createQrcode", method = {RequestMethod.POST, RequestMethod.GET})
@ApiOperation(value = "生成小程序二维码",notes = "生成小程序二维码")
public ResultEntity<String> createQrcode(@ApiParam(name = "weappQrcode",value = "小程序二维码对象", required = true)
WeappQrcodeVO weappQrcode){
if(null == weappQrcode){
return null;
}
return wechatQrcodeService.createQrcode(weappQrcode);
}
}
package cn.com.glsx.dj.weapp.controller.home;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import cn.com.glsx.dj.marketing.dto.LiveRoomInfoDTO;
import cn.com.glsx.dj.weapp.controller.BaseController;
import cn.com.glsx.dj.weapp.dto.IntelligentReminderDTO;
import cn.com.glsx.dj.weapp.service.WechatQrcodeSceneService;
import cn.com.glsx.dj.weapp.service.home.LivePlayerService;
import cn.com.glsx.dj.weapp.service.home.IndexModuleService;
import cn.com.glsx.dj.weapp.service.personal.VehicleService;
import cn.com.glsx.dj.weapp.vo.CarBrandInfoVO;
import cn.com.glsx.dj.weapp.vo.IndexModuleVO;
import cn.com.glsx.dj.weapp.vo.LiveRoomInfoVO;
import cn.com.glsx.dj.weapp.vo.PageRequestVO;
import cn.com.glsx.dj.weapp.vo.VehicleDTO;
import cn.com.glsx.dj.weapp.vo.VehicleVO;
import cn.com.glsx.dj.weapp.web.annotation.NeedLogin;
import cn.com.glsx.dj.wechat.dto.request.WeappLiveInfoRequestDTO;
import cn.com.glsx.dj.wechat.dto.request.WeappLiveReplayRequestDTO;
import cn.com.glsx.dj.wechat.dto.response.WeappLiveReplayResponseDTO;
import cn.com.glsx.dj.wechat.model.WechatQrcodeScene;
import cn.com.glsx.framework.core.beans.ResultEntity;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
/**
* @author zhangyan
* @title HomeController
* @description 首页控制层
* @date 2019/04/24
*/
@Controller
@RequestMapping("/home")
public class HomeController extends BaseController {
@Autowired
private VehicleService vehicleService;
@Autowired
private IndexModuleService indexModuleService;
@Autowired
private LivePlayerService groupBuyService;
@Autowired
private WechatQrcodeSceneService wechatQrcodeSceneService;
/**
* @param request
* @return
* @title getVehicles
* @description 获取账户下的所有车辆
* @author zhangyan
* @date 2019/04/24
*/
@RequestMapping("/getVehicles")
@ResponseBody
@NeedLogin
public ResultEntity<List<VehicleVO>> getVehicles() {
return vehicleService.getVehicleList(getAccountId(), getPhone());
}
/**
* @param request
* @return
* @title getVehicles
* @description 获取账户下的所有车辆
* @author zhangyan
* @date 2019/04/24
*/
@RequestMapping("/getVehiclesForVerify")
@ResponseBody
@NeedLogin
public ResultEntity<List<VehicleVO>> getVehiclesForVerify() {
return vehicleService.getVehiclesForVerify(getAccountId(), getPhone());
}
/**
* @title getIllegalFlag
* @description 获取违章开关
* @param appId
* @return
* @author zhangyan
* @date 2019/06/19
*/
@RequestMapping("/getIllegalFlag")
@ResponseBody
@NeedLogin
public ResultEntity<Boolean> getIllegalFlag(String appId){
return vehicleService.getIllegalFlag(appId);
}
/**
* @param vehicle
* @param phone
* @return
* @title addOrUpdateVehicle
* @description 新增或修改车辆
* @author zhangyan
* @date 2019/04/25
*/
@RequestMapping("/addOrUpdateVehicle")
@ResponseBody
@NeedLogin
public ResultEntity<String> addOrUpdateVehicle(VehicleDTO vehicle) {
return vehicleService.addOrUpdateVehicle(vehicle, getAccountId());
}
/**
* @Title deleteVehicle
* @description 删除车辆
* @param id
* @param accountId
* @param phone
* @return
* @author zhangyan
* @date 2019/05/23
*/
@RequestMapping("/deleteVehicle")
@ResponseBody
@NeedLogin
public ResultEntity<String> deleteVehicle(Integer id){
return vehicleService.deleteVehicle(id, getAccountId(), getPhone());
}
/**
* @return
* @title getParentBrands
* @description 获得父级品牌
* @author zhangyan
* @date 2019/04/24
*/
@RequestMapping("/getParentBrands")
@ResponseBody
@NeedLogin
public ResultEntity<Map<String, Object>> getParentBrands() {
return vehicleService.getParentBrands();
}
/**
* @param brandId
* @return
* @title getSecondBrands
* @description 根据父品牌id获得二级品牌
* @author zhangyan
* @date 2019/04/24
*/
@RequestMapping("/getSecondBrands")
@ResponseBody
@NeedLogin
public ResultEntity<List<CarBrandInfoVO>> getSecondBrands(Integer parentId) {
return vehicleService.getSecondBrands(parentId);
}
/**
* @param merchantId 商户id
* @return ResultEntity<IndexModuleVO>
* @Title: getIndexModules
* @Description: 获取首页显示信息
* @author yangjia
* @Date: 2019/04/29
*/
@GetMapping(value = "getIndexModules")
@ResponseBody
public ResultEntity<IndexModuleVO> getIndexModules(@RequestParam(value = "merchantId",required = false) Integer merchantId) {
if(null == merchantId){
merchantId = getMerchantId();
}
return indexModuleService.getIndexModuleInfo(merchantId);
}
/**
* @param vo
* appId
* accountId 账户id
* @return ResultEntity<RpcPagination < IntelligentReminderDTO>>
* @Title: getIndexModules
* @Description: 智能提醒分页查看
* @author yangjia
* @Date: 2019/05/15
*/
@PostMapping(value = "pageIntelligentRminders")
@ResponseBody
@NeedLogin
public ResultEntity<RpcPagination<IntelligentReminderDTO>> pageIntelligentRminders(PageRequestVO vo) {
vo.setMerchantId(getMerchantId());
return indexModuleService.pageIntelligentRminders(vo);
}
/**
* @Description: 获取绑定信息
* @return ResultEntity
* @author yangjia
* @Date: 2019/05/21
*/
@GetMapping(value = "getBindInfoByCondition")
@ResponseBody
@NeedLogin
public ResultEntity<Integer> getBindInfoByCondition() {
return indexModuleService.getBindInfoByCondition(getPhone());
}
/**
* @return
* @Title getNotice
* @description 获取门店的公告内容
* @author zhangyan
* @date 2019/05/10
*/
@RequestMapping("/getNotice")
@ResponseBody
public ResultEntity<String> getNotice() {
return indexModuleService.getNotice();
}
/**
* 获取直播间
* @param start
* @param limit
* @return
*/
@RequestMapping(value = "liveplayer/info")
@ResponseBody
public ResultEntity<LiveRoomInfoVO> getLiveInfo(WeappLiveInfoRequestDTO requestDTO){
return groupBuyService.getLiveInfo(requestDTO);
}
/**
* 获取直播间详情
* @param start
* @param limit
* @return
*/
@RequestMapping(value = "liveplayer/detail")
@ResponseBody
public ResultEntity<LiveRoomInfoDTO> getLiveDetail(Long roomId){
return groupBuyService.getLiveDetail(roomId, getMerchantId());
}
/**
* 获取直播回放信息
* @param requestDTO
* @return
*/
@RequestMapping(value = "liveplayer/replay")
@ResponseBody
public ResultEntity<WeappLiveReplayResponseDTO> getLiveReplay(WeappLiveReplayRequestDTO requestDTO){
if(null == requestDTO.getMerchantId() || 0 == requestDTO.getMerchantId()){
requestDTO.setMerchantId(getMerchantId());
}
return groupBuyService.getLiveReplay(requestDTO);
}
/**
* 根据id获取场景值
* @param requestDTO
* @return
*/
@RequestMapping(value = "qrCodeScene/getSceneById")
@ResponseBody
public ResultEntity<String> getSceneById(WechatQrcodeScene qrcodeScene){
if(null == qrcodeScene || null == qrcodeScene.getId()){
return null;
}
return wechatQrcodeSceneService.getById(qrcodeScene);
}
}
package cn.com.glsx.dj.weapp.controller.home;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import org.oreframework.util.lang.EmojiUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import cn.com.glsx.dj.weapp.controller.BaseController;
import cn.com.glsx.dj.weapp.dto.CustomerServiceMessageDTO;
import cn.com.glsx.dj.weapp.dto.IntelligentRemindServiceDTO;
import cn.com.glsx.dj.weapp.dto.IntelligentRemindServiceListConditionDTO;
import cn.com.glsx.dj.weapp.model.CustomerServiceMessage;
import cn.com.glsx.dj.weapp.model.IntelligentRemindServiceClassifyTag;
import cn.com.glsx.dj.weapp.model.QrCodeManage;
import cn.com.glsx.dj.weapp.service.home.IntelligentRemindServeService;
import cn.com.glsx.dj.weapp.util.ThreadLocalCache;
import cn.com.glsx.dj.weapp.vo.IntelligentRemindServiceVO;
import cn.com.glsx.dj.weapp.web.annotation.NeedLogin;
import cn.com.glsx.dj.wechat.enums.WechatUserTypeEnum;
import cn.com.glsx.framework.core.beans.ResultEntity;
@RestController
@RequestMapping("/remindServiceInfo/")
@Api(value = "/remindServiceInfo/", tags = "智能提醒服务")
public class IntelligentRemindServiceController extends BaseController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private IntelligentRemindServeService remindServeService;
@GetMapping(value = "/getRemindServiceList")
@ApiOperation(value = "获取智能提醒服务列表(首页)",notes = "获取智能提醒服务列表")
@ApiImplicitParam(name = "classifyTagId",value = "分类标签ID",dataType = "long",required = true)
public ResultEntity<List<IntelligentRemindServiceVO>> getRemindServiceList(@RequestParam Long classifyTagId) {
IntelligentRemindServiceListConditionDTO conditionDTO = new IntelligentRemindServiceListConditionDTO();
conditionDTO.setClassifyTagId(classifyTagId);
conditionDTO.setMerchantId(ThreadLocalCache.getMerchantId());
return remindServeService.getRemindServiceList(conditionDTO);
}
@GetMapping(value = "/getRemindServiceDetail")
@ApiOperation(value = "获取提醒服务详情(活动、车系、素材、规则)",notes = "获取提醒服务详情")
@ApiImplicitParams({
@ApiImplicitParam(name = "id",value = "服务id",dataType = "int",required = true),
@ApiImplicitParam(name = "userId",value = "用户id",dataType = "int",required = true)
})
public ResultEntity<IntelligentRemindServiceDTO> getRemindServiceDetail(Integer id,Integer userId){
logger.info("getRemindServiceDetail:{}",id);
logger.info("getRemindServiceDetail:{}",userId);
return remindServeService.getById(id,userId);
}
@GetMapping(value = "/getQrCodeInfo")
@ApiOperation(value = "根据商户号获取加群码",notes = "根据商户号获取加群码")
public ResultEntity<QrCodeManage> getQrCodeInfo(){
return remindServeService.getQrCodeInfo(ThreadLocalCache.getMerchantId());
}
@NeedLogin
@GetMapping(value = "/getCustomerMessageList")
@ApiOperation(value = "获取客服消息",notes = "获取客服消息")
public ResultEntity<List<CustomerServiceMessageDTO>> getByAccountId() {
return remindServeService.getByAccountId(ThreadLocalCache.getAccountId(),ThreadLocalCache.getMerchantId());
}
@NeedLogin
@PostMapping(value = "/getCustomerMessageNew")
@ApiOperation(value = "获取最新未读客服信息内容",notes = "获取最新未读客服信息内容")
@ApiImplicitParam(name = "customerServiceMessage",value = "客服信息",dataType = "CustomerServiceMessage",required = true)
public ResultEntity<List<CustomerServiceMessageDTO>> getCustomerMessageNew(@RequestBody CustomerServiceMessage customerServiceMessage){
logger.info("getCustomerMessageNew:{}",customerServiceMessage);
logger.info("accountId:{}",customerServiceMessage.getAccountId());
logger.info("merchantId:{}",ThreadLocalCache.getMerchantId());
logger.info("sendType:{}",customerServiceMessage.getSendType());
customerServiceMessage.setMerchantId(ThreadLocalCache.getMerchantId());
return remindServeService.getUnreadByAccountId(customerServiceMessage);
}
@NeedLogin
@PostMapping(value = "/addCustomerMessage")
@ApiOperation(value = "添加客服消息",notes = "添加客服消息")
@ApiImplicitParam(name = "customerServiceMessage",value = "客服消息",dataType = "CustomerServiceMessageDTO",required = true)
public ResultEntity<CustomerServiceMessageDTO> addCustomerMessage(@RequestBody CustomerServiceMessageDTO customerServiceMessage) {
logger.info("addCustomerMessage:{}",customerServiceMessage);
customerServiceMessage.setAccountId(ThreadLocalCache.getAccountId());
customerServiceMessage.setMerchantId(ThreadLocalCache.getMerchantId());
customerServiceMessage.setSendType(WechatUserTypeEnum.CUSTOMER.getValue());
customerServiceMessage.setCreatedBy(ThreadLocalCache.getWechatUserInfo().getOpenId());
customerServiceMessage.setAvatarUrl(ThreadLocalCache.getWechatUserInfo().getLogo());
customerServiceMessage.setAvatarUrlLog(ThreadLocalCache.getWechatUserInfo().getLogo());
customerServiceMessage.setNickName(EmojiUtil.filterEmoji(ThreadLocalCache.getWechatUserInfo().getNickName()));
customerServiceMessage.setPhone(ThreadLocalCache.getWechatUserInfo().getPhone());
return remindServeService.addCustomerMessage(customerServiceMessage);
}
@NeedLogin
@PostMapping(value = "/updateMessage")
@ApiOperation(value = "更新客服消息",notes = "更新客服消息")
@ApiImplicitParam(name = "customerServiceMessage",value = "客服消息",dataType = "CustomerServiceMessage",required = true)
public ResultEntity<Integer> updateByAccountId(@RequestBody CustomerServiceMessage customerServiceMessage){
logger.info("customerServiceMessage:{}",customerServiceMessage);
customerServiceMessage.setAccountId(ThreadLocalCache.getAccountId());
customerServiceMessage.setMerchantId(ThreadLocalCache.getMerchantId());
customerServiceMessage.setSendType(WechatUserTypeEnum.MERCHANT.getValue());
return remindServeService.updateByAccountId(customerServiceMessage);
}
@GetMapping(value = "/classifytag/list")
@ApiOperation(value = "获取服务分类标签", notes = "获取服务分类标签列表")
public ResultEntity<List<IntelligentRemindServiceClassifyTag>> getServiceClassifyTag(){
Integer merchantId = ThreadLocalCache.getMerchantId();
return remindServeService.getServiceClassifyTag(merchantId);
}
}
package cn.com.glsx.dj.weapp.controller.home;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import cn.com.glsx.dj.gop.response.common.CarInfoResponse;
import cn.com.glsx.dj.marketing.dto.ShopActivityQuoteRecordDTO;
import cn.com.glsx.dj.marketing.model.ShopActivityQuoteRecord;
import cn.com.glsx.dj.weapp.controller.BaseController;
import cn.com.glsx.dj.weapp.service.home.QuoteService;
import cn.com.glsx.dj.weapp.vo.CarInfoVo;
import cn.com.glsx.dj.weapp.vo.QuotePriceVO;
import cn.com.glsx.dj.weapp.vo.ShopActivityQuoteVO;
import cn.com.glsx.dj.weapp.web.annotation.NeedLogin;
import cn.com.glsx.framework.core.beans.ResultEntity;
/**
* 报价
* @author zhangyan
* @date 2020年7月19日12:10:41
*
*/
@RestController
@NeedLogin
@RequestMapping("/quote")
public class QuoteController extends BaseController{
@Autowired
private QuoteService quoteService;
/**
* 查找活动的报价福利
* @param activityId
* @return
*/
@GetMapping("/getQuoteCoupon")
@ApiOperation(value = "查找活动的报价福利",notes = "查找活动的报价福利")
@ApiImplicitParam(name = "activityId",value = "活动id",dataType = "long",required = true)
public ResultEntity<String> getQuoteCoupon(Long activityId){
return quoteService.getQuoteCoupon(activityId);
}
/**
* 查找客户是否有报价记录
* @param activityId
* @return
*/
@GetMapping("/getQuoteRecord")
@ApiOperation(value = "查找客户是否有报价记录",notes = "查找客户是否有报价记录")
@ApiImplicitParam(name = "activityId",value = "活动id",dataType = "long",required = true)
public ResultEntity<ShopActivityQuoteRecord> getQuoteRecord(Long activityId){
return quoteService.getQuoteRecord(activityId, getAccountId());
}
/**
* 根据车型年款和购车时间匹配报价价格
* @param quote
* @return
*/
@PostMapping("/getQuoteInfo")
@ApiOperation(value = "根据车型年款和购车时间匹配报价价格",notes = "根据车型年款和购车时间匹配报价价格")
@ApiImplicitParam(name = "quote",value = "型年款和购车时间匹配条件对象",dataType = "ShopActivityQuoteVO",required = true)
public ResultEntity<QuotePriceVO> getQuoteInfo(@RequestBody ShopActivityQuoteVO quote){
quote.setMerchantId(getMerchantId());
return quoteService.getQuoteInfo(quote);
}
/**
* 立即报价
* @param record
* @return
* @author zhangyan
* @date 2020年7月17日16:42:08
*/
@PostMapping("/generateQuoteRecord")
@ApiOperation(value = "立即报价",notes = "立即报价")
@ApiImplicitParam(name = "record",value = "报价对象",dataType = "ShopActivityQuoteRecordDTO",required = true)
public ResultEntity<ShopActivityQuoteRecord> generateQuoteRecord(@RequestBody ShopActivityQuoteRecordDTO record){
record.setAccountId(getAccountId());
record.setPhone(getPhone());
record.setMerchantId(getMerchantId());
record.setCreatedBy(getAccountId().toString());
record.setUpdatedBy(getAccountId().toString());
record.setNickName(getWechatUserInfo().getNickName());
return quoteService.generateQuoteRecord(record);
}
/**
* 获取商户主营品牌下车系列表
* @Description:
* @return
* @author zhoulm
* @date 2020年3月13日 上午10:04:29
*/
@GetMapping("getMerchantCarSeriesList")
@ApiOperation(value = "获取商户主营品牌下车系列表",notes = "获取商户主营品牌下车系列表")
@ApiImplicitParam(name = "merchantId",value = "商户ID",dataType = "int",required = true)
public ResultEntity<List<CarInfoVo>> getMerchantCarSeriesList(){
return ResultEntity.success(quoteService.getMerchantCarSeriesList(getMerchantId()));
}
/**
* 根据车系ID和年款查询车型
* @Description:
* @param carSeriesId
* @return
* @author zhoulm
* @date 2020年3月12日 下午1:13:14
*/
@GetMapping("getCarTypeList")
@ApiOperation(value = "根据车系ID和年款查询车型列表",notes = "根据车系ID和年款查询车型列表")
@ApiImplicitParam(name = "carSeriesId",value = "查询对象",dataType = "int",required = true)
public ResultEntity<List<CarInfoResponse>> getCarTypeList(@RequestParam int carSeriesId) {
return ResultEntity.success(quoteService.getCarTypeList(carSeriesId));
}
}
package cn.com.glsx.dj.weapp.controller.home;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import cn.com.glsx.dj.system.dto.EmployeeDTO;
import cn.com.glsx.dj.system.dto.MerchantDTO;
import cn.com.glsx.dj.system.dto.UserCustomerBehaviorDTO;
import cn.com.glsx.dj.system.model.UserCustomerBehavior;
import cn.com.glsx.dj.system.model.UserCustomerRef;
import cn.com.glsx.dj.weapp.controller.BaseController;
import cn.com.glsx.dj.weapp.service.home.ServicerService;
import cn.com.glsx.dj.weapp.vo.WeappQrcodeReqeustVO;
import cn.com.glsx.dj.weapp.web.annotation.NeedLogin;
import cn.com.glsx.framework.core.beans.ResultEntity;
/**
* @title ConsultantController
* @description 顾问控制层
* @author zhangyan
* @date 2019/05/04
*
*/
@Controller
@RequestMapping("/servicer")
public class ServicerController extends BaseController {
@Autowired
private ServicerService servicerService;
/**
* @Title getEmployeeOfAccount
* @description 获取用户的服务顾问
* @param merchantId
* @return
*/
@RequestMapping("/getEmployeeOfAccount")
@NeedLogin
@ResponseBody
public ResultEntity<EmployeeDTO> getEmployeeOfAccount(){
return servicerService.getEmployeeOfAccount(getAccountId(), getMerchantId());
}
/**
* @Title getMerchantBussiness
* @description 获取门店的主营业务
* @param merchantId
* @return
* @author zhangyan
* @date 2019/05/05
*/
@RequestMapping("/getMerchantBussiness")
@ResponseBody
public ResultEntity<MerchantDTO> getMerchantBussiness(@RequestParam(name = "merchantId", required=false)Integer merchantId){
if(null == merchantId){
merchantId = getMerchantId();
}
return servicerService.getMerchantBussiness(merchantId);
}
/**
* @Title getEmployeesList
* @description 获取门店的所有顾问列表
* @param merchantId
* @return
* @author zhangyan
* @date 2019/05/04
*/
@RequestMapping("/getEmployeesList")
@ResponseBody
public ResultEntity<List<EmployeeDTO>> getEmployeesList(@RequestParam(name = "merchantId")Integer merchantId,
@RequestParam(name = "accountGroupList", required = false)List<String> accountGroupList){
return servicerService.getEmployeesList( getMerchantId(),accountGroupList);
}
/**
* @Title getEmployee
* @description 获取员工信息
* @param employeeId
* @return
* @author zhangyan
* @date 2019/05/06
*
*/
@RequestMapping("/getEmployee")
@ResponseBody
public ResultEntity<EmployeeDTO> getEmployee(Integer employeeId){
return servicerService.getEmployeeInfo(employeeId);
}
/**
* 获取门店下的员工账户分组列表
* @Description:
* @param employeeId
* @return
* @author zhoulm
* @date 2020年2月12日 下午1:46:22
*/
@RequestMapping("/getAccountGroupList")
@ResponseBody
public ResultEntity<List<String>> getAccountGroupList(){
return servicerService.getAccountGroupList( getMerchantId());
}
/**
* @title makeAppraise
* @description 对顾问进行浏览或标签点赞
* @param record
* @return
* @author zhangyan
* @date 2019/05/04
*/
@RequestMapping("/makeAppraise")
@ResponseBody
public ResultEntity<UserCustomerBehavior> makeAppraise(UserCustomerBehavior record){
return servicerService.makeAppraise(record);
}
/**
* @title setConsultant
* @description 设置顾问
* @param record
* @return
* @author zhangyan
* @date 2019/05/04
*/
@RequestMapping("/setConsultant")
@ResponseBody
public ResultEntity<UserCustomerRef> setConsultant(UserCustomerRef ref){
ref.setMerchantId( getMerchantId());
return servicerService.setConsultant(ref);
}
/**
* @Title getUserOfConsultant
* @decription 查询顾问下的服务人数
* @param record
* @return
* @author zhangyan
* @date 2019/05/06
*/
@RequestMapping("/getUserOfConsultant")
@ResponseBody
public ResultEntity<List<UserCustomerBehaviorDTO>> getUserOfConsultant(UserCustomerBehaviorDTO record){
record.setMerchantId( getMerchantId());
return servicerService.getUserOfConsultant(record);
}
/**
* @title createQrcode
* @description 生成小程序码
* @param merchantId
* @param path
* @return
* @author zhangyan
* @date 2019/05/11
*/
@RequestMapping("/createQrcode")
@ResponseBody
public ResultEntity<String> createQrcode(WeappQrcodeReqeustVO vo){
if(null == vo){
return null;
}
return servicerService.createQrcode(vo, getMerchantId());
}
}
package cn.com.glsx.dj.weapp.controller.personal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import cn.com.glsx.dj.marketing.dto.WxActivityCouponUserDTO;
import cn.com.glsx.dj.weapp.service.personal.CouponService;
import cn.com.glsx.dj.weapp.vo.CouponInfoVO;
import cn.com.glsx.dj.weapp.web.annotation.NeedLogin;
import cn.com.glsx.framework.core.beans.ResultEntity;
/**
* @Title: CouponController.java
* @Description: 优惠券接口
* @date 2019/05/01
* @author yangjia
*/
@Controller
@RequestMapping("/coupon")
@NeedLogin
public class CouponController {
@Autowired
private CouponService couponService;
/**
* @Description: 活动优惠券详情
* @param activityCouponId 活动优惠券ID
* @return ResultEntity<CouponInfoVO>
* @author yangjia
* @date 2019/05/01
*/
@RequestMapping(value = "detail",method= RequestMethod.GET)
@ResponseBody
public ResultEntity<CouponInfoVO> detail(@RequestParam(value = "activityCouponId", required = true) Integer activityCouponId){
return couponService.getCouponInfoById(activityCouponId);
}
/**
* @param activityId 活动ID
* @param activityCouponId 活动优惠券ID
* @return ResultEntity<CouponInfoVO>
* @Description: 领取优惠券
* @author yangjia
* @date 2019/05/01
*/
@PostMapping(value = "receive")
@ResponseBody
public ResultEntity<WxActivityCouponUserDTO> receive(@RequestParam(value = "activityCouponId", required = true) Integer activityCouponId,
@RequestParam(value = "activityId", required = true) Integer activityId) {
return couponService.receiveActivityCouponById(activityCouponId,activityId);
}
/**
* 小程序端暂时无核销操作
* @Description: 核销优惠券
* @param verificationCode 核销码
* @return ResultEntity<CouponInfoVO>
* @author yangjia
* @date 2019/05/01
*/
/*@PostMapping(value = "verify")
@ResponseBody
public ResultEntity<Integer> verify(@RequestParam(value = "merchantId",required = false) Integer merchantId,
@RequestParam(value = "accountId", required = false) Integer accountId,
@RequestParam(value = "verificationCode", required = true) String verificationCode) {
return couponService.verifyCouponByVerificationCode(merchantId,accountId,verificationCode);
}*/
}
package cn.com.glsx.dj.weapp.controller.personal;
import cn.com.glsx.dj.weapp.model.UserAddress;
import cn.com.glsx.dj.weapp.service.personal.MyAddressService;
import cn.com.glsx.dj.weapp.web.annotation.NeedLogin;
import cn.com.glsx.framework.core.beans.ResultEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @Title MyAddressController
* @Description
* @Author zhaojp
* @Date 2020年06月09日 11:11:18
* @Version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2018
**/
@RestController
@RequestMapping("myAddress")
@NeedLogin
@Api(value = "myAddress", tags = "我的地址")
public class MyAddressController {
@Autowired
private MyAddressService myAddressService;
@PostMapping("list")
@ApiOperation(value = "查询地址列表",notes = "查询地址列表")
@ApiImplicitParam(name = "userAddress",value = "地址对象",dataType = "UserAddress",required = true)
public ResultEntity<List<UserAddress>> list(@RequestBody UserAddress userAddress){
return ResultEntity.result(myAddressService.list(userAddress));
}
@PostMapping("insert")
@ApiOperation(value = "新增地址",notes = "新增地址")
@ApiImplicitParam(name = "userAddress",value = "地址对象",dataType = "UserAddress",required = true)
public ResultEntity<UserAddress> insert(@RequestBody UserAddress userAddress){
return ResultEntity.result(myAddressService.insert(userAddress));
}
@PostMapping("update")
@ApiOperation(value = "修改地址",notes = "修改地址")
@ApiImplicitParam(name = "userAddress",value = "地址对象",dataType = "UserAddress",required = true)
public ResultEntity<UserAddress> update(@RequestBody UserAddress userAddress){
return ResultEntity.result(myAddressService.update(userAddress));
}
@GetMapping("getById")
@ApiOperation(value = "获取地址",notes = "获取地址")
@ApiImplicitParam(name = "id",value = "地址ID",dataType = "int",required = true)
public ResultEntity<UserAddress> getById(@RequestParam Integer id){
return ResultEntity.result(myAddressService.getById(id));
}
@GetMapping("deleteById")
@ApiOperation(value = "删除地址",notes = "删除地址")
@ApiImplicitParam(name = "id",value = "地址ID",dataType = "int",required = true)
public ResultEntity<Integer> deleteById(@RequestParam Integer id){
return ResultEntity.result(myAddressService.deleteById(id));
}
}
package cn.com.glsx.dj.weapp.controller.personal;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import cn.com.glsx.dj.marketing.dto.ShopActivityRechargeRecordDTO;
import cn.com.glsx.dj.marketing.dto.WxActivityCouponUserDTO;
import cn.com.glsx.dj.system.dto.MerchantDTO;
import cn.com.glsx.dj.weapp.controller.BaseController;
import cn.com.glsx.dj.weapp.dto.MerchantModuleDTO;
import cn.com.glsx.dj.weapp.service.home.IndexModuleService;
import cn.com.glsx.dj.weapp.service.home.PopularActivityService;
import cn.com.glsx.dj.weapp.service.personal.CouponService;
import cn.com.glsx.dj.weapp.service.personal.PersonalService;
import cn.com.glsx.dj.weapp.vo.PageRequestVO;
import cn.com.glsx.dj.weapp.web.annotation.NeedLogin;
import cn.com.glsx.dj.wechat.model.WechatAppAuthorizerInfo;
import cn.com.glsx.framework.core.beans.ResultEntity;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
/**
* @author yangjia
* @title PersonalController
* @description 个人中心控制层
* @date 2019/05/02
*/
@Controller
@RequestMapping("/personal")
public class PersonalController extends BaseController {
@Autowired
private CouponService couponService;
@Autowired
private PopularActivityService popularActivityService;
@Autowired
private IndexModuleService indexModuleService;
@Autowired
private PersonalService personalService;
/**
* @param merchantId 商户id
* @return ResultEntity<IndexModuleVO>
* @Title: getIndexModules
* @Description: 获取个人中心“我的”显示信息
* @author yangjia
* @Date: 2019/04/29
*/
@GetMapping(value = "getPersonalModules")
@ResponseBody
@NeedLogin
public ResultEntity<List<MerchantModuleDTO>> getMyModules(@RequestParam(value = "merchantId") Integer merchantId) {
if(null == merchantId){
merchantId = getMerchantId();
}
return indexModuleService.getPersonalModules(merchantId);
}
/**
* @Title: getPersonalCoupons
* @Description: 获取个人中心优惠券信息
* @param vo
* merchantId 商户id
* appId
* accountId 账户id
* flag 优惠券状态标识,1:待使用,2:已使用,3:已失效
* @return List<ActivityCouponUserDTO>
* @author yangjia
* @Date: 2019/05/02
*/
@GetMapping(value = "coupons")
@ResponseBody
@NeedLogin
public ResultEntity<RpcPagination<WxActivityCouponUserDTO>> getPersonalCoupons(PageRequestVO vo) {
vo.setAccountId(getAccountId());
vo.setPhone(getPhone());
// vo.setMerchantId(getMerchantId());
return couponService.getPersonalCoupons(vo);
}
/**
* @Title: getPersonalOrders
* @Description: 获取个人中心订单
* @param vo
* merchantId 商户id
* appId
* accountId 账户id
* flag 订单状态标识,0:全部,1:待付款,2:待使用
* @return RpcPagination<ShopActivityRechargeRecordDTO>
* @author yangjia
* @Date: 2019/05/09
*/
@RequestMapping(value = "orders")
@ResponseBody
@NeedLogin
public ResultEntity<RpcPagination<ShopActivityRechargeRecordDTO>> getPersonalOrders(PageRequestVO vo) {
vo.setAccountId(getAccountId());
// vo.setMerchantId(getMerchantId());
return popularActivityService.getPersonalOrders(vo);
}
/**
* @Title: getMerchantById
* @Description: 根据商户id获取商户信息
* @param merchantId 商户id
* @return ResultEntity<Merchant>
* @author yangjia
* @Date: 2019/05/08
*/
@GetMapping(value = "merchant")
@ResponseBody
public ResultEntity<MerchantDTO> getMerchantById(@RequestParam(value = "merchantId") Integer merchantId) {
if(null == merchantId){
merchantId =getMerchantId();
}
return popularActivityService.getMerchantById(merchantId);
}
/**
* @Title getWxAccountInfo
* @description 根据商户id获取小程序绑定的微信公众号
* @param merchantId
* @return
* @author zhangyan
* @date 2019/05/11
*/
@RequestMapping("/getWxAccountInfo")
@ResponseBody
@NeedLogin
public ResultEntity<WechatAppAuthorizerInfo> getWxAccountInfo(Integer merchantId){
if(null == merchantId){
merchantId =getMerchantId();
}
return personalService.getWxAccountInfo(merchantId);
}
/**
* @Title subscribWechat
* @description 判断用户是否关注公众号
* @return
* @author zhangyan
* @date 2019/05/13
*/
@RequestMapping("/subscribWechat")
@ResponseBody()
@NeedLogin
public ResultEntity<Boolean> subscribWechat(){
return personalService.subscribWechat();
}
}
package cn.com.glsx.dj.weapp.controller.smartcarlife;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import cn.com.glsx.dj.weapp.service.smartcarlife.CustomerWarrantyCardService;
import cn.com.glsx.dj.weapp.vo.smartcarlife.CustomerWarrantyCardVO;
import cn.com.glsx.framework.core.beans.ResultEntity;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
@RestController
@RequestMapping("/smartcarlife/customerWarrantyCard")
@Api(value = "/smartcarlife/customerWarrantyCard", tags = "智享车生活-质保卡信息")
public class CustomerWarrantyCardController {
@Autowired
private CustomerWarrantyCardService customerWarrantyCardService;
@PostMapping(value = "/search")
@ApiOperation(value = "搜索质保卡",notes = "搜索质保卡")
@ApiImplicitParam(name = "pagination",value = "查询信息",required = true)
public ResultEntity<RpcPagination<CustomerWarrantyCardVO>> listMyOrder(@RequestBody RpcPagination<CustomerWarrantyCardVO> pagination) {
return customerWarrantyCardService.search(pagination);
}
@PostMapping(value = "/get")
@ApiOperation(value = "获取质保卡明细",notes = "获取质保卡明细")
@ApiImplicitParam(name = "cardCode",value = "质保卡编号",required = true)
public ResultEntity<CustomerWarrantyCardVO> listMyOrder(@RequestParam String cardCode) {
CustomerWarrantyCardVO record = new CustomerWarrantyCardVO();
record.setCardCode(cardCode);
return customerWarrantyCardService.get(record);
}
}
package cn.com.glsx.dj.weapp.controller.smartcarlife;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import cn.com.glsx.dj.weapp.service.smartcarlife.GoodsOrderCommentService;
import cn.com.glsx.dj.weapp.vo.smartcarlife.GoodsOrderCommentVO;
import cn.com.glsx.dj.weapp.web.annotation.NeedLogin;
import cn.com.glsx.framework.core.beans.ResultEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
@RestController
@RequestMapping("/smartcarlife/goodsOrderComment")
@Api(value = "/smartcarlife/goodsOrderComment", tags = "智享车生活-商品订单评价")
public class GoodsOrderCommentController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private GoodsOrderCommentService goodsOrderCommentService;
@NeedLogin
@PostMapping(value = "/addComment")
@ApiOperation(value = "新增订单评论",notes = "新增订单评论")
@ApiImplicitParam(name = "comment",value = "评论信息",dataType = "GoodsOrderCommentVO",required = true)
public ResultEntity<GoodsOrderCommentVO> addComment(@RequestBody GoodsOrderCommentVO comment) {
logger.info("addComment:{}",comment);
return goodsOrderCommentService.addComment(comment);
}
}
package cn.com.glsx.dj.weapp.controller.smartcarlife;
import cn.com.glsx.dj.payment.dto.CreateOrderResponseDTO;
import cn.com.glsx.dj.weapp.controller.BaseController;
import cn.com.glsx.dj.weapp.service.smartcarlife.GoodsOrderService;
import cn.com.glsx.dj.weapp.vo.smartcarlife.CreateOrderPayH5VO;
import cn.com.glsx.dj.weapp.vo.smartcarlife.GoodsOrderVO;
import cn.com.glsx.dj.weapp.vo.smartcarlife.PaymentOrderRequestVO;
import cn.com.glsx.dj.weapp.vo.smartcarlife.QueryWxPayStatusVO;
import cn.com.glsx.dj.weapp.vo.smartcarlife.WxPaymentOrderH5RequestVO;
import cn.com.glsx.dj.weapp.vo.smartcarlife.WxQueryOrderStatusRequestVO;
import cn.com.glsx.dj.weapp.web.annotation.NeedLogin;
import cn.com.glsx.framework.core.beans.ResultEntity;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/smartcarlife/goodsOrder")
@Api(value = "/smartcarlife/goodsOrder", tags = "智享车生活-商品订单")
public class GoodsOrderController extends BaseController{
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private GoodsOrderService goodsOrderService;
@NeedLogin
@PostMapping(value = "/listMyOrder")
@ApiOperation(value = "分页获取我的精品交付单列表",notes = "分页获取我的精品交付单列表")
@ApiImplicitParam(name = "pagination",value = "分页对象",dataType = "BdOrderDTO",required = true)
public ResultEntity<RpcPagination<GoodsOrderVO>> listMyOrder(@RequestBody RpcPagination<GoodsOrderVO> pagination) {
pagination.setPageSize(20);
return goodsOrderService.list(pagination);
}
@GetMapping(value = "/getDetailByOrderCode")
@ApiOperation(value = "根据订单编号获取订单详情",notes = "根据订单编号获取订单详情")
@ApiImplicitParam(name = "orderCode",value = "商品编号",dataType = "String",required = true)
public ResultEntity<GoodsOrderVO> getDetailByGoodsCode(@RequestParam String orderCode) {
logger.info("orderCode:{}",orderCode);
return goodsOrderService.getDetailByOrderCode(orderCode);
}
@NeedLogin
@GetMapping(value = "/scanGetDetailByOrderCode")
@ApiOperation(value = "扫码后根据订单编号获取订单详情",notes = "扫码后根据订单编号获取订单详情")
@ApiImplicitParam(name = "orderCode",value = "商品编号",dataType = "String",required = true)
public ResultEntity<GoodsOrderVO> scanGetDetailByOrderCode(@RequestParam String orderCode) {
logger.info("orderCode:{}",orderCode);
goodsOrderService.scanUpdateOrder(orderCode);
return goodsOrderService.getDetailByOrderCode(orderCode);
}
@NeedLogin
@GetMapping(value = "/createWxPayOrder")
@ApiOperation(value = "发起微信支付(银盛)",notes = "根据订单编号发起微信支付")
@ApiImplicitParam(name = "orderCode",value = "订单编号",dataType = "String",required = true)
public ResultEntity<String> createWxPayOrder(@RequestParam String orderCode, @RequestParam String workWxSessionId) {
logger.info("orderCode:{},workWxSessionId:{}", orderCode, workWxSessionId);
return goodsOrderService.createWxPayOrder(orderCode, workWxSessionId,null, null,null,null);
}
@GetMapping(value = "/createWxPayOrderWithNotLogin")
@ApiOperation(value = "发起微信支付(银盛)",notes = "根据订单编号发起微信支付")
@ApiImplicitParam(name = "orderCode",value = "订单编号",dataType = "String",required = true)
public ResultEntity<String> createWxPayOrderWithNotLogin(@RequestParam String orderCode, @RequestParam String openId,
@RequestParam String workWxSessionId, @RequestParam(required = false) Byte zyVoucherStatus,
@RequestParam(required = false) String paymentChannelId,
@RequestParam(required = false) String appId) {
logger.info("orderCode:{},workWxSessionId:{},openId:{},paymentChannelId:{},appId:{}",
orderCode, workWxSessionId,openId,paymentChannelId,appId);
logger.info("zyVoucherStatus:{}", zyVoucherStatus);
return goodsOrderService.createWxPayOrder(orderCode, workWxSessionId, openId, zyVoucherStatus,paymentChannelId,appId);
}
//@NeedLogin
@PostMapping(value = "/createWxPayOrderH5")
@ApiOperation(value = "发起微信支付(银盛)收银台",notes = "根据订单编号发起微信支付收银台页面")
@ApiImplicitParam(name = "WxPaymentOrderH5RequestVO",value = "微信支付信息",dataType = "WxPaymentOrderH5RequestVO",required = true)
public ResultEntity<CreateOrderPayH5VO> createWxPayOrderH5(@RequestBody WxPaymentOrderH5RequestVO requestVO) {
logger.info("WxPaymentOrderH5RequestVO:{}", requestVO);
return goodsOrderService.createWxPayOrderH5(requestVO);
}
//@NeedLogin
@PostMapping(value = "/queryPayOrderStatus")
@ApiOperation(value = "查询微信支付结果",notes = "查询微信支付结果")
@ApiImplicitParam(name = "WxQueryOrderStatusRequestVO",value = "交易参考号",dataType = "WxQueryOrderStatusRequestVO",required = true)
public ResultEntity<QueryWxPayStatusVO> queryPayOrderStatus(@RequestBody WxQueryOrderStatusRequestVO request) {
logger.info("查询微信支付结果,参数为:{}", request);
return goodsOrderService.getByQueryWxPayStatusByOutTradeNo(request.getOutTradeNo());
}
@NeedLogin
@PostMapping(value = "invokeWxUnifiedorder")
@ApiOperation(value = "调用微信统一下单接口,点击立即支付发起调用",notes = "调用微信统一下单接口,点击立即支付发起调用")
@ApiImplicitParam(name = "PaymentOrderRequestVO",value = "支付信息",dataType = "PaymentOrderRequestVO",required = true)
public ResultEntity<CreateOrderResponseDTO> invokeWxUnifiedorder(@RequestBody PaymentOrderRequestVO activityPaymentVO) {
activityPaymentVO.setSpbillCreateIp(getIpAddr());
return goodsOrderService.invokeWxUnifiedorder(activityPaymentVO);
}
/**
* 支付成功异步回调
*/
@RequestMapping(value = "notify")
@ApiOperation(value = "支付成功回调",notes = "支付成功回调")
public String notifyAfterPaid() {
return goodsOrderService.notifyAfterPaid(getRequestBody());
}
}
package cn.com.glsx.dj.weapp.controller.smartcarlife;
import cn.com.glsx.dj.gop.remote.GopCreateQrCodeRemote;
import cn.com.glsx.dj.gop.request.weapp.CreateQrCodeRequest;
import cn.com.glsx.dj.gop.response.weapp.CreateQrCodeResponse;
import cn.com.glsx.dj.weapp.controller.BaseController;
import cn.com.glsx.dj.weapp.service.smartcarlife.InviteRecordService;
import cn.com.glsx.dj.weapp.service.smartcarlife.ServiceMerchantRefService;
import cn.com.glsx.dj.weapp.vo.smartcarlife.InviteRecordVO;
import cn.com.glsx.dj.weapp.vo.smartcarlife.ServiceMerchantVO;
import cn.com.glsx.dj.weapp.web.annotation.NeedLogin;
import cn.com.glsx.framework.core.beans.ResultEntity;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.util.DateUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import java.text.MessageFormat;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.*;
import com.glsx.cloudframework.core.util.DateUtil;
/**
* @author admin
*/
@RestController
@RequestMapping("/smartCarLife/inviteRecord")
@Api(value = "/smartCarLife/inviteRecord", tags = "邀约记录")
public class InviteRecordController extends BaseController{
@Autowired
private InviteRecordService inviteRecordService;
@Autowired
private ServiceMerchantRefService serviceMerchantRefService;
@Autowired
private GopCreateQrCodeRemote gopCreateQrCodeRemote;
@Autowired
private Environment env;
@NeedLogin
@PostMapping("/invite")
@ApiOperation(value = "(修改)预约",notes = "(修改)预约")
@ApiImplicitParam(name = "InviteRecordVO",value = "预约信息",dataType = "InviteRecordVO", required = true)
public ResultEntity<InviteRecordVO> invite(@RequestBody InviteRecordVO record) {
return inviteRecordService.updateInviteDate(record);
}
@NeedLogin
@GetMapping("/detail")
@ApiOperation(value = "预约详情",notes = "预约详情")
@ApiImplicitParam(name = "id",value = "预约记录id",dataType = "int", required = true)
public ResultEntity<InviteRecordVO> detail(@RequestParam Integer id) {
ResultEntity<InviteRecordVO> detailVORes = inviteRecordService.detail(id);
if (!"0".equals(detailVORes.getReturnCode())) {
return detailVORes;
}
if (detailVORes.getData() == null) {
return ResultEntity.error(DefaultErrorEnum.DATA_NOT_EXIST.getValue(),"不存在的预约");
}
ResultEntity<ServiceMerchantVO> yqInfoRes = serviceMerchantRefService.getYqInfo(detailVORes.getData().getMerchantCoupon().getMerchantId(), detailVORes.getData().getUserId());
if (!"0".equals(yqInfoRes.getReturnCode())) {
return ResultEntity.error(yqInfoRes.getErrId(), yqInfoRes.getMessage());
}
detailVORes.getData().setMerchant(yqInfoRes.getData());
CreateQrCodeRequest request = new CreateQrCodeRequest();
request.setScene("autoReply_");
request.setWxId(env.getProperty("ddh.wechat.biz.app.id"));
request.setSeqNo("CUSTOMER_INVITE_CHANNEL_".concat(env.getProperty("current.attribution.channel")));
request.setCreatedBy(this.getAccountId().toString());
request.setSceneParams(MessageFormat.format("yqMerchantName={0}&inviteDate={1}&customerCouponId={2}",
detailVORes.getData().getMerchantCoupon().getYqMerchantName(),
detailVORes.getData().getInviteDate() == null ? "":DateUtils.formatDate(detailVORes.getData().getInviteDate(),"yyyy年MM月dd日 HH:mm:ss"),
String.valueOf(detailVORes.getData().getCustomerCoupon().getId())));
RpcResponse<CreateQrCodeResponse> res = gopCreateQrCodeRemote.createQrCode(request);
if(res.hasResult()){
detailVORes.getData().setQrCodeUrl(res.getResult().getQrCode());
}
return detailVORes;
}
}
package cn.com.glsx.dj.weapp.controller.smartcarlife;
import cn.com.glsx.dj.weapp.service.smartcarlife.InviteStatService;
import cn.com.glsx.dj.weapp.vo.smartcarlife.InviteDayStatVO;
import cn.com.glsx.framework.core.beans.ResultEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author admin
*/
@RestController
@RequestMapping("/smartCarLife/inviteStat")
@Api(value = "/smartCarLife/inviteStat", tags = "邀约统计")
public class InviteStatController {
@Autowired
private InviteStatService inviteStatService;
@PostMapping("/merchant/list")
@ApiOperation(value = "获取指定商户指定日期范围的邀约统计",notes = "获取指定商户指定日期范围的邀约统计")
@ApiImplicitParam(name = "InviteDayStatVO",value = "查询条件",dataType = "InviteDayStatVO",required = true)
public ResultEntity<List<InviteDayStatVO>> listByMerchant(@RequestBody InviteDayStatVO request) {
return inviteStatService.list(request);
}
}
package cn.com.glsx.dj.weapp.controller.smartcarlife;
import cn.com.glsx.dj.weapp.controller.BaseController;
import cn.com.glsx.dj.weapp.service.smartcarlife.LifeCustomerCouponService;
import cn.com.glsx.dj.weapp.util.ResultEntity;
import cn.com.glsx.dj.weapp.vo.smartcarlife.LifeCustomerCouponVO;
import cn.com.glsx.dj.weapp.web.annotation.NeedLogin;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @author admin
*/
@RestController
@RequestMapping("/smartCarLife/lifeCustomerCoupon")
@Api(value = "/smartCarLife/lifeCustomerCoupon", tags = "核销券")
public class LifeCustomerCouponController extends BaseController {
@Autowired
private LifeCustomerCouponService lifeCustomerCouponService;
@RequestMapping("/add")
public ResultEntity<String> add (@RequestBody LifeCustomerCouponVO record) {
return lifeCustomerCouponService.add(record);
}
@NeedLogin
@PostMapping(value = "/listMyCoupon")
@ApiOperation(value = "分页获取我的精品礼券列表",notes = "分页获取我的精品礼券列表")
@ApiImplicitParam(name = "pagination",value = "分页对象",dataType = "LifeCustomerCouponVO",required = true)
public ResultEntity<RpcPagination<LifeCustomerCouponVO>> listMyCoupon(@RequestBody RpcPagination<LifeCustomerCouponVO> pagination) {
pagination.setPageSize(20);
return lifeCustomerCouponService.list(pagination);
}
@GetMapping(value = "/getCustomerCouponVo")
@ApiOperation(value = "获取我的精品礼券详情",notes = "获取我的精品礼券详情")
public ResultEntity<LifeCustomerCouponVO> getCustomerCouponVo(@RequestParam Integer id) {
return lifeCustomerCouponService.getCustomerCouponVo(id);
}
}
package cn.com.glsx.dj.weapp.controller.smartcarlife;
import cn.com.glsx.dj.weapp.service.smartcarlife.LifeMerchantCouponService;
import cn.com.glsx.dj.weapp.vo.smartcarlife.LifeMerchantCouponVO;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.beans.ResultEntity;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author admin
*/
@RestController
@RequestMapping("/smartCarLife/LifeMerchantCoupon")
@Api(value = "/smartCarLife/LifeMerchantCoupon", tags = "商户券")
public class LifeMerchantCouponController {
@Autowired
private LifeMerchantCouponService lifeMerchantCouponService;
@RequestMapping("/getById")
@ApiMethod("根据id查询商户券消息")
public ResultEntity<LifeMerchantCouponVO> getById (Integer id ) {
return lifeMerchantCouponService.getById(id);
}
}
package cn.com.glsx.dj.weapp.controller.smartcarlife;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import cn.com.glsx.dj.weapp.service.smartcarlife.ServiceMerchantRefService;
import cn.com.glsx.dj.weapp.vo.smartcarlife.ServiceMerchantVO;
import cn.com.glsx.framework.core.beans.ResultEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
@RestController
@RequestMapping("/smartcarlife/serviceMerchantRef")
@Api(value = "/smartcarlife/serviceMerchantRef", tags = "智享车生活-服务4S店信息")
public class ServiceMerchantRefController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private ServiceMerchantRefService serviceMerchantRefService;
@GetMapping(value = "/getYqInfo")
@ApiOperation(value = "获取4S店所属园区店信息",notes = "获取4S店所属园区店信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "merchantId",value = "4S店商户号",dataType = "int",required = true),
@ApiImplicitParam(name = "userId",value = "园区店员工用户ID",dataType = "int",required = false)
})
public ResultEntity<ServiceMerchantVO> getYqInfo(@RequestParam Integer merchantId, String userId) {
return serviceMerchantRefService.getYqInfo(merchantId,userId);
}
}
package cn.com.glsx.dj.weapp.controller.smartcarlife;
import cn.com.glsx.dj.weapp.service.smartcarlife.ServiceMerchantRefService;
import cn.com.glsx.dj.weapp.vo.smartcarlife.YqMerchantConfigVO;
import cn.com.glsx.framework.core.beans.ResultEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/smartcarlife/yqMerchant")
@Api(value = "/smartcarlife/yqMerchant", tags = "智享车生活-园区店信息")
public class YqMerchantController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private ServiceMerchantRefService serviceMerchantRefService;
@GetMapping(value = "/getYqMerchantConfig")
@ApiOperation(value = "获取园区店配置",notes = "获取园区店配置")
@ApiImplicitParams({
@ApiImplicitParam(name = "yqMerchantId",value = "园区店商户号",dataType = "int",required = true),
})
public ResultEntity<YqMerchantConfigVO> getYqMerchantConfig(@RequestParam Integer yqMerchantId) {
return serviceMerchantRefService.getYqMerchantConfig(yqMerchantId);
}
}
package cn.com.glsx.dj.weapp.controller.smartplus;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import cn.com.glsx.ddh.cloudSecurity.dto.CloudSecurityConfigDTO;
import cn.com.glsx.dj.weapp.service.smartplus.CloudSecurityService;
import cn.com.glsx.dj.weapp.web.annotation.NeedLogin;
import cn.com.glsx.framework.core.beans.ResultEntity;
/**
* @Title: CloudSecurityController
* @Description: 云防盗控制层
* @author yangjia
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2019
*/
@RestController
@RequestMapping("cloudSecurity")
@NeedLogin
public class CloudSecurityController {
@Autowired
private CloudSecurityService cloudSecurityService;
/**
* @Title: getCloudSecurityList
* @Description: 获取云防盗设置列表
* @param protocolId 嘀嘀号
* @return ResultEntity<List<CloudSecurityConfigDTO>>
* @author yangjia
* @date 2019/10/11
*/
@PostMapping("getCloudSecurityList")
public ResultEntity<List<CloudSecurityConfigDTO>> getCloudSecurityList(String protocolId){
return cloudSecurityService.getCloudSecurityList(protocolId);
}
/**
* @Title: updateCloudSecurity
* @Description: 保存或者更新云防盗信息
* @param obj
* @return ResultEntity<String>
* @author yangjia
* @date 2019/10/11
*/
@PostMapping("updateCloudSecurity")
public ResultEntity<String> updateCloudSecurity(CloudSecurityConfigDTO obj){
return cloudSecurityService.updateCloudSecurity(obj);
}
/**
* @Title: deleteCloudSecurity
* @Description: 删除云防盗信息
* @param userId 嘀嘀号
* @param group 所属组编号
* @return ResultEntity<Boolean>
* @author yangjia
* @date 2019/10/11
*/
@PostMapping("deleteCloudSecurity")
public ResultEntity<Boolean> deleteCloudSecurity(String userId,String group){
return cloudSecurityService.deleteCloudSecurity(userId,group);
}
/**
* @Title: updateCloudSecurity
* @Description: 者更新云防盗开关信息
* @param obj
* @return ResultEntity<String>
* @author yangjia
* @date 2019/10/11
*/
@PostMapping("updateCloudSecurityEnable")
public ResultEntity<String> updateCloudSecurityEnable(CloudSecurityConfigDTO obj){
return cloudSecurityService.updateCloudSecurityEnable(obj);
}
}
package cn.com.glsx.dj.weapp.controller.smartplus;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import cn.com.glsx.dj.weapp.controller.BaseController;
import cn.com.glsx.dj.weapp.exception.PhysicalException;
import cn.com.glsx.dj.weapp.service.smartplus.DeviceService;
import cn.com.glsx.dj.weapp.vo.BindInfo;
import cn.com.glsx.dj.weapp.vo.DeviceBindVO;
import cn.com.glsx.dj.wechat.model.WechatUserInfo;
import cn.com.glsx.framework.core.beans.ResultEntity;
/**
* @author yangjia
* @Title: DeviceController
* @Description: 设备服务
* @date 2019/10/10
*/
@RestController
@RequestMapping("/device")
public class DeviceController extends BaseController {
private Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private DeviceService deviceService;
/**
* @Title: getBindInfo
* @Description: 获取绑定信息
* @return
* @date 2019-10-17
*/
@GetMapping("/getBindInfo")
public Object getBindInfo(@RequestParam(value = "sourcefrom", required = false)String sourcefrom) {
Map<String, Object> result = new HashMap<String, Object>(8);
try {
WechatUserInfo wechatUserInfo = getWechatUserInfo();
List<BindInfo> bindInfoList = deviceService.getBindInfoList(wechatUserInfo, sourcefrom);
result.put("returnCode", PhysicalException.OK);
result.put("bindInfoList", bindInfoList);
Integer deviceType = null;
if(!bindInfoList.isEmpty()){
deviceType = bindInfoList.get(0).getDeviceType();
}
result.put("nowBindDeviceType", deviceType);
} catch (Exception e) {
logger.error("GET BINDINFO ERROR:" + e.getMessage(), e);
result = PhysicalException.getCommonError(e.getMessage());
if (e instanceof PhysicalException) {
PhysicalException pe = (PhysicalException) e;
result = pe.getResultMap();
// 如果是获取不到还是给0
result.put("returnCode", 0);
}
}
//bindImg为0,表示未关闭开启“开启智能车生活”提示图片,1表示展示过且已关闭了
result.put("bindImg",deviceService.getBindImgByAccountId(getAccountId()));
logger.info("getBindInfo resultMap:{}", result);
return result;
}
@PostMapping("/closeBindImg")
public Object closeBindImg() {
return deviceService.closeBindImgByAccountId(getAccountId());
}
/**
* @Title: bindobd
* @Description: 绑定OBD
* @param vo
* imei
* validateCode
* enter 入口参数【针对广汇汇养车APP提供,汇养车参数为“hyc”,其他为空字符串】
* merchantId 商户id
* @return
*/
@PostMapping("/bindobd")
public Object bindobd(@RequestBody DeviceBindVO vo) {
return deviceService.bindobd(vo.getImei(), vo.getValidateCode(), vo.getTypeId(), vo.getEnter(), getAccountId());
}
/**
* @Title: newCarBindOBD
* @Description: 新车未上牌绑定驾宝盒子
* @return ResultEntity<Integer>
* @author yangjia
* @date 2019-10-10
*/
@PostMapping("/newCarBindOBD")
public ResultEntity<Integer> newCarBindOBD(@RequestParam(value = "sn", required = true)String sn,
@RequestParam(value = "checkCode", required = true) String checkCode,
@RequestParam(value = "typeId", required = true) Integer typeId){
return deviceService.newCarBindOBD(sn,checkCode,typeId,getAccountId());
}
/**
* @Title: isNoVehicle
* @Description: 账户下是否包含车辆
* @return ResultEntity<Integer>
* @author yangjia
* @date 2019-10-10
*/
@GetMapping("/isNoVehicle")
public ResultEntity<Integer> isNoVehicle(@RequestParam(value = "typeId", required = true) Integer typeId){
return deviceService.isNoVehicle(typeId,getAccountId());
}
}
package cn.com.glsx.dj.weapp.controller.smartplus;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import cn.com.glsx.dj.weapp.common.Constants;
import cn.com.glsx.dj.weapp.controller.BaseController;
import cn.com.glsx.dj.weapp.service.smartplus.WheelPathService;
import cn.com.glsx.dj.weapp.vo.MyMileageVO;
import cn.com.glsx.dj.weapp.vo.WheelPathRequestVO;
import cn.com.glsx.dj.weapp.vo.WheelPathVO;
import cn.com.glsx.dj.weapp.web.annotation.NeedLogin;
import cn.com.glsx.framework.core.beans.ResultEntity;
/**
* @author yangjia
* @Title: JourneyController
* @Description: 行程轨迹相关接口
* @date 2019/07/03
*/
@RestController
@RequestMapping("journey")
@NeedLogin
@Api(value = "/journey", tags = "行程轨迹")
public class JourneyController extends BaseController {
/**
* 行车轨迹接口
*/
@Autowired
private WheelPathService wheelPathService;
/**
* @param wheelPathRequestVO
* @return ResultEntity<List < WheelPathVO>>
* @Title: getDailyWheelPathList
* @Description: 获取日轨迹列表
* @author yangjia
* @Date: 2019/07/03
*/
@RequestMapping(value = "getDailyWheelPathList", method = {RequestMethod.GET, RequestMethod.POST})
@ApiOperation(value = "获取日行程轨迹列表",notes = "获取日行程轨迹列表")
@ApiImplicitParam(name = "wheelPathRequestVO", value = "请求参数", dataType = "WheelPathRequestVO", required = true)
public ResultEntity<List<WheelPathVO>> getDailyWheelPathList(WheelPathRequestVO wheelPathRequestVO) {
return ResultEntity.success(wheelPathService.getWheelPathList(wheelPathRequestVO, Constants.WheelPathType.DAY_PATH));
}
/**
* @param wheelPathRequestVO
* @return ResultEntity<List < WheelPathVO>>
* @Title: getMonthWheelPathList
* @Description: 获取月轨迹列表
* @author yangjia
* @Date: 2019/07/03
*/
@RequestMapping(value = "getMonthWheelPathList", method = {RequestMethod.GET, RequestMethod.POST})
@ApiOperation(value = "获取月行程轨迹列表",notes = "获取月行程轨迹列表")
@ApiImplicitParam(name = "wheelPathRequestVO", value = "请求参数", dataType = "WheelPathRequestVO", required = true)
public ResultEntity<List<WheelPathVO>> getMonthWheelPathList(WheelPathRequestVO wheelPathRequestVO) {
return ResultEntity.success(wheelPathService.getWheelPathList(wheelPathRequestVO, Constants.WheelPathType.MONTH_PATH));
}
/**
* @param userId
* @param time
* @return ResultEntity<MyMileageVO>
* @Title: getDailyJourneyCardInfo
* @Description: 获取某日行程的轨迹信息
* @author yangjia
* @Date: 2019/07/03
*/
@RequestMapping(value = "getDailyJourneyCardInfo", method = {RequestMethod.GET, RequestMethod.POST})
@ApiOperation(value = "获取日行程总计",notes = "获取日行程总计")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "嘀嘀号",dataType = "int",required = true),
@ApiImplicitParam(name = "time", value = "获取某个时间行车轨迹,2019-01或者2019-01-05",dataType = "string",required = true)
})
public ResultEntity<MyMileageVO> getDailyJourneyCardInfo(Integer userId, String time) {
return ResultEntity.success(wheelPathService.getJourneyCardInfo(userId, time, Constants.WheelPathType.DAY_PATH));
}
/**
* @param userId
* @param time
* @return ResultEntity<MyMileageVO>
* @Title: getMonthJourneyCardInfo
* @Description: 获取某月行程的轨迹信息(只支持最近三个月的)
* @author yangjia
* @Date: 2019/07/03
*/
@RequestMapping(value = "getMonthJourneyCardInfo", method = {RequestMethod.GET, RequestMethod.POST})
@ApiOperation(value = "获取月行程总计",notes = "获取月行程总计")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "嘀嘀号", dataType = "int", required = true),
@ApiImplicitParam(name = "time", value = "获取某个时间行车轨迹,2019-01或者2019-01-05", dataType = "string", required = true)
})
public ResultEntity<MyMileageVO> getMonthJourneyCardInfo(Integer userId, String time) {
return ResultEntity.success(wheelPathService.getJourneyCardInfo(userId, time, Constants.WheelPathType.MONTH_PATH));
}
/**
* @param userId 嘀嘀号
* @return ResultEntity<List < String>>
* @Title: getJouneyDays
* @Description: 获取近三个月有轨迹的日期
* @author yangjia
* @Date: 2019/07/03
*/
@RequestMapping(value = "getJouneyDays", method = {RequestMethod.GET, RequestMethod.POST})
@ApiOperation(value = "获取近三个月有轨迹的日期",notes = "获取近三个月有轨迹的日期")
@ApiImplicitParam(name = "userId",value = "嘀嘀号",dataType = "int",required = true)
public ResultEntity<List<String>> getJouneyDays(Integer userId) {
return ResultEntity.success(wheelPathService.getJourneyAllDay(userId));
}
}
package cn.com.glsx.dj.weapp.controller.smartplus;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import cn.com.glsx.dj.weapp.controller.BaseController;
import cn.com.glsx.dj.weapp.manager.LookBackMediaManager;
import cn.com.glsx.dj.weapp.util.PageInfo;
import cn.com.glsx.dj.weapp.util.ResultEntity;
import cn.com.glsx.dj.weapp.vo.LookBackMediaVo;
import cn.com.glsx.dj.weapp.vo.RemoteVideoVo;
import cn.com.glsx.dj.weapp.web.annotation.NeedLogin;
import com.glsx.cloudframework.core.util.StringUtils;
@RestController
@RequestMapping("lookBackMedia")
@NeedLogin
@Api(value = "/lookBackMedia", tags = "回放接口")
public class LookBackMediaController extends BaseController {
private static final Logger LOGGER = LoggerFactory.getLogger(LookBackMediaController.class);
private LookBackMediaManager lookBackMediaManager;
/**
* @Title: listLookBackMedia
* @Description: 开启回看列表指令
* @Date:2020-04-26
*/
@GetMapping(value = "/listLookBackMedia")
@ApiOperation(value = "开启回看列表指令",notes = "开启回看列表指令")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId",value = "嘀嘀号",dataType = "String",required = true),
@ApiImplicitParam(name = "beginTime",value = "开始时间",dataType = "String",required = true),
@ApiImplicitParam(name = "endTime",value = "结束时间",dataType = "String",required = true)
})
public ResultEntity<String> listLookBackMedia(@RequestParam String userId,@RequestParam String beginTime,@RequestParam String endTime) {
try {
Boolean paramsIsEmpty= StringUtils.isEmpty(beginTime) && StringUtils.isEmpty(endTime) &&
StringUtils.isEmpty(userId);
if (paramsIsEmpty) {
return ResultEntity.error("-1", "params must not null");
}
String result = lookBackMediaManager.listLookBackMedia(userId, beginTime, endTime);
if (StringUtils.isEmpty(result)) {
return ResultEntity.error("-1", "直播列表发送失败");
}
return ResultEntity.success(result);
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
return ResultEntity.error("-1", e.getMessage());
}
}
/**
* @Title: pollListLookBackMedia
* @Description: 获取回看列表
* @Date:2020-04-26
*/
@GetMapping(value = "/pollListLookBackMedia")
@ApiOperation(value = "获取回看列表",notes = "获取回看列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "mediaId",value = "嘀嘀号",dataType = "String",required = true),
@ApiImplicitParam(name = "pageNumber",value = "当前页码",dataType = "String",required = true),
@ApiImplicitParam(name = "pageSize",value = "每页大小",dataType = "String",required = true)
})
public ResultEntity<PageInfo<LookBackMediaVo>> pollListLookBackMedia(@RequestParam String mediaId,@RequestParam String pageNumber,@RequestParam String pageSize) {
try {
Boolean paramsIsEmpty= StringUtils.isEmpty(mediaId) && StringUtils.isEmpty(pageNumber) &&
StringUtils.isEmpty(pageSize);
if (paramsIsEmpty) {
return ResultEntity.error("-1", "params must not null");
}
PageInfo<LookBackMediaVo> result = lookBackMediaManager.pollListLookBackMedia(mediaId, pageNumber, pageSize);
if (null == result) {
return ResultEntity.error("-1", "开启直播失败");
}
return ResultEntity.success(result);
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
return ResultEntity.error("-1", e.getMessage());
}
}
/**
* @Title: startLookBackMedia
* @Description: 开启回看视频
* @Date:2020-04-26
*/
@GetMapping(value = "/startLookBackMedia")
@ApiOperation(value = "开启回看视频",notes = "开启回看视频")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId",value = "嘀嘀号",dataType = "String",required = true),
@ApiImplicitParam(name = "pageNumber",value = "第几页",dataType = "String",required = true),
@ApiImplicitParam(name = "pageSize",value = "页面条数",dataType = "String",required = true)
})
public ResultEntity<String> startLookBackMedia(@RequestParam String userId, @RequestParam String pageNumber, @RequestParam String pageSize) {
try {
Boolean paramsIsEmpty= StringUtils.isEmpty(userId) && StringUtils.isEmpty(pageNumber) &&
StringUtils.isEmpty(pageSize);
if (paramsIsEmpty) {
return ResultEntity.error("-1", "userId must not null");
}
String
result = lookBackMediaManager.startLookBackMedia(userId, pageNumber, pageSize);
if (StringUtils.isEmpty(result)) {
return ResultEntity.error("-1", "开启回看视频失败");
}
return ResultEntity.success(result);
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
return ResultEntity.error("-1", e.getMessage());
}
}
/**
* @Title: endLookBackMedia
* @Description: 结束回看视频
* @Date:2020-04-26
*/
@GetMapping(value = "/endLookBackMedia")
@ApiOperation(value = "结束回看视频",notes = "结束回看视频")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId",value = "嘀嘀号",dataType = "String",required = true),
@ApiImplicitParam(name = "beginTime",value = "开始时间",dataType = "String",required = true),
@ApiImplicitParam(name = "endTime",value = "结束时间",dataType = "String",required = true)
})
public ResultEntity<Boolean> endLookBackMedia(@RequestParam String userId, @RequestParam String beginTime, @RequestParam String endTime) {
try {
Boolean paramsIsEmpty= StringUtils.isEmpty(userId) && StringUtils.isEmpty(beginTime) &&
StringUtils.isEmpty(endTime);
if (paramsIsEmpty) {
return ResultEntity.error("-1", "params must not null");
}
Boolean result = lookBackMediaManager.endLookBackMedia(userId, beginTime, endTime);
if (null == result) {
return ResultEntity.error("-1", "结束回看视频失败");
}
return ResultEntity.success(result);
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
return ResultEntity.error("-1", e.getMessage());
}
}
/**
* @Title: endLookBackMedia
* @Description: 结束回看视频
* @Date:2020-04-26
*/
@GetMapping(value = "/mediaId")
@ApiOperation(value = "获取回看视频url",notes = "获取回看视频url")
@ApiImplicitParam(name = "mediaId",value = "流水号",dataType = "String",required = true)
public ResultEntity<RemoteVideoVo> pollLookBackMedia(@RequestParam String mediaId) {
try {
Boolean paramsIsEmpty= StringUtils.isEmpty(mediaId);
if (paramsIsEmpty) {
return ResultEntity.error("-1", "params must not null");
}
RemoteVideoVo result = lookBackMediaManager.pollLookBackMedia(mediaId);
if (null == result) {
return ResultEntity.error("-1", "获取回看视频url失败");
}
return ResultEntity.success(result);
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
return ResultEntity.error("-1", e.getMessage());
}
}
}
package cn.com.glsx.dj.weapp.controller.smartplus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import cn.com.glsx.didicb.app.dto.MessageBoxInfoDTO;
import cn.com.glsx.didicb.app.enums.MessageBoxTypeEnum;
import cn.com.glsx.dj.weapp.controller.BaseController;
import cn.com.glsx.dj.weapp.manager.MessageBoxManager;
import cn.com.glsx.dj.weapp.util.ResultEntity;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
/**
* @author yangjia
* @Title: MessageBoxController
* @Description: 消息盒子
* @date 2019/10/10
*/
@RestController
@RequestMapping("/device")
@ApiIgnore
public class MessageBoxController extends BaseController {
private static final Logger LOGGER = LoggerFactory.getLogger(MessageBoxController.class);
@Autowired
private MessageBoxManager messageBoxManager;
/**
* @Title: RescueEventCustomerSubmit
* @Description: 提交自提碰撞
* @Date:2020-04-26
*/
@GetMapping("getMessageBoxInfoListWithPage")
public ResultEntity<RpcPagination<MessageBoxInfoDTO>> getMessageBoxInfoListWithPage(String pageSize, String pageNumber) {
try {
String accountId = String.valueOf(getAccountId());
String typeListStr = String.valueOf(MessageBoxTypeEnum.CLOUD_SECURITY.getValue()) + "," +
String.valueOf(MessageBoxTypeEnum.CRASH.getValue());
RpcPagination<MessageBoxInfoDTO> result = messageBoxManager.getMessageBoxInfoListWithPage(pageSize, pageNumber, accountId, typeListStr);
return ResultEntity.success(result);
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
return ResultEntity.error("-1", e.getMessage());
}
}
}
package cn.com.glsx.dj.weapp.controller.smartplus;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import cn.com.glsx.dj.weapp.controller.BaseController;
import cn.com.glsx.dj.weapp.manager.RemoteVideoManager;
import cn.com.glsx.dj.weapp.util.ResultEntity;
import cn.com.glsx.dj.weapp.vo.CarPositionVO;
import cn.com.glsx.dj.weapp.vo.RemoteVideoVo;
import com.glsx.cloudframework.core.util.StringUtils;
@RestController
@RequestMapping("remoteVideo")
//@NeedLogin
@Api(value = "/remoteVideo", tags = "直播接口")
public class RemoteVideoController extends BaseController {
private static final Logger LOGGER = LoggerFactory.getLogger(RemoteVideoController.class);
@Autowired
private RemoteVideoManager remoteVideoManager;
/**
* @Title: startRemoteVideo
* @Description: 开启直播
* @Date:2020-04-26
*/
@GetMapping(value = "/startRemoteVideo")
@ApiOperation(value = "开启直播",notes = "开启直播")
@ApiImplicitParam(name = "userId",value = "嘀嘀号",dataType = "String",required = true)
public ResultEntity<String> startRemoteVideo(String userId) {
try {
if (StringUtils.isEmpty(userId)) {
return ResultEntity.error("-1", "userId must not null");
}
String result = remoteVideoManager.startRemoteVideo(userId);
if (StringUtils.isEmpty(result)) {
return ResultEntity.error("-1", "开启直播失败");
}
return ResultEntity.success(result);
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
return ResultEntity.error("-1", e.getMessage());
}
}
/**
* @Title: endRemoteVideo
* @Description: 结束直播
* @Date:2020-04-26
*/
@GetMapping(value = "/endRemoteVideo")
@ApiOperation(value = "结束直播",notes = "结束直播")
@ApiImplicitParam(name = "userId",value = "嘀嘀号",dataType = "String",required = true)
public ResultEntity<Boolean> endRemoteVideo(String userId) {
try {
Boolean result = false;
if (StringUtils.isEmpty(userId)) {
return ResultEntity.error("-1", "userId must not null");
}
result = remoteVideoManager.endRemoteVideo(userId);
if (!result) {
return ResultEntity.error("-1", "结束直播失败");
}
return ResultEntity.success(result);
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
return ResultEntity.error("-1", e.getMessage());
}
}
/**
* @Title: pollRemoteVideo
* @Description: 获取直播url
* @Date:2020-04-26
*/
@GetMapping(value = "/pollRemoteVideo")
@ApiOperation(value = "获取直播url",notes = "获取直播url")
@ApiImplicitParam(name = "mediaId",value = "流水号",dataType = "String",required = true)
public ResultEntity<RemoteVideoVo> pollRemoteVideo(String mediaId) {
try {
RemoteVideoVo result = null;
if (StringUtils.isEmpty(mediaId)) {
return ResultEntity.error("-1", "mediaId must not null");
}
result = remoteVideoManager.pollRemoteVideo(mediaId);
if (result == null) {
return ResultEntity.error("-1", "结束直播失败");
}
return ResultEntity.success(result);
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
return ResultEntity.error("-1", e.getMessage());
}
}
/**
* @Title: pollRemoteVideo
* @Description: 获取直播url
* @Date:2020-04-26
*/
@GetMapping(value = "/getCarPosition")
@ApiOperation(value = "获取设备地址",notes = "获取设备地址")
@ApiImplicitParam(name = "userId",value = "嘀嘀号",dataType = "String",required = true)
public ResultEntity<CarPositionVO> getCarPosition(String userId) {
try {
if (StringUtils.isEmpty(userId)) {
return ResultEntity.error("-1", "userId must not null");
}
CarPositionVO result = remoteVideoManager.getCarPosition(userId);
if (result == null) {
return ResultEntity.error("-1", "获取设备为空");
}
return ResultEntity.success(result);
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
return ResultEntity.error("-1", e.getMessage());
}
}
}
package cn.com.glsx.dj.weapp.controller.smartplus;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import cn.com.glsx.dj.aibschance.dto.CollisionNoticeConfigDTO;
import cn.com.glsx.dj.aibschance.remote.CollisionNoticeConfigRemote;
import cn.com.glsx.dj.weapp.controller.BaseController;
import cn.com.glsx.dj.weapp.manager.RescueEventManager;
import cn.com.glsx.dj.weapp.util.PageInfo;
import cn.com.glsx.dj.weapp.util.ResultEntity;
import cn.com.glsx.dj.weapp.vo.RescueEventConfigVo;
import cn.com.glsx.dj.weapp.vo.RescueEventMedia;
import cn.com.glsx.dj.weapp.vo.RescueEventVo;
import cn.com.glsx.dj.weapp.web.annotation.NeedLogin;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import com.glsx.cloudframework.core.util.StringUtils;
@RestController
@RequestMapping("rescueEvent")
@NeedLogin
//@Api(value = "/rescueEvent", tags = "碰撞")
@ApiIgnore
public class RescueEventController extends BaseController {
private static final Logger LOGGER = LoggerFactory.getLogger(RescueEventController.class);
@Autowired
private CollisionNoticeConfigRemote collisionNoticeConfigRemote;
@Autowired
private RescueEventManager rescueEventManager;
/**
* @Title: getCarCollisionConfig
* @Description: 获取碰撞配置
* @Date:2020-04-26
*/
@GetMapping("getCarCollisionConfig")
@ApiOperation(value = "获取碰撞配置",notes = "获取碰撞配置")
public ResultEntity<CollisionNoticeConfigDTO> getCarCollisionConfig() {
try {
CollisionNoticeConfigDTO result = null;
// 用户id
Integer accountId = getAccountId();
LOGGER.info("accountId {}", accountId);
RpcResponse<CollisionNoticeConfigDTO> rpc = collisionNoticeConfigRemote.queryByUserId(accountId);
if (rpc.hasResult()) {
result = rpc.getResult();
}
return ResultEntity.success(result);
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
return ResultEntity.error("-1", e.getMessage());
}
}
/**
* @Title: RescueEventCustomerSubmit
* @Description: 提交自提碰撞
* @Date:2020-04-26
*/
@PostMapping("rescueEventCustomerSubmit")
@ApiOperation(value = "提交自提碰撞",notes = "提交自提碰撞")
@ApiImplicitParams({
@ApiImplicitParam(name = "sn",value = "设备号",dataType = "String",required = true),
@ApiImplicitParam(name = "lng",value = "精度",dataType = "String",required = true),
@ApiImplicitParam(name = "lat",value = "纬度",dataType = "String",required = true),
@ApiImplicitParam(name = "mediaList",value = "图片信息",dataType = "list",required = true)
})
public ResultEntity<Long> RescueEventCustomerSubmit(String sn, String lng, String lat, List<RescueEventMedia> mediaList) {
try {
Boolean paramsIsEmpty= StringUtils.isEmpty(sn) && StringUtils.isEmpty(lng) &&
StringUtils.isEmpty(lat);
if (paramsIsEmpty) {
return ResultEntity.error("-1", "params must not null");
}
Long result = rescueEventManager.RescueEventCustomerSubmit(sn, lng, lat, mediaList);
if (result == null) {
return ResultEntity.error("-1", "提交自提碰撞发送失败");
}
return ResultEntity.success(result);
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
return ResultEntity.error("-1", e.getMessage());
}
}
/**
* @Title: RescueEventCustomerListWithPage
* @Description: 提交自提碰撞
* @Date:2020-04-26
*/
@GetMapping(value = "RescueEventCustomerListWithPage")
@ApiOperation(value = "获取碰撞列表",notes = "获取碰撞列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "sn",value = "设备号",dataType = "String",required = true),
@ApiImplicitParam(name = "pageSize",value = "分页大小",dataType = "String",required = true),
@ApiImplicitParam(name = "pageNumber",value = "当前页码",dataType = "String",required = true)
})
public ResultEntity<PageInfo<RescueEventConfigVo>> RescueEventCustomerListWithPage(String sn, String pageSize, String pageNumber) {
try {
Boolean paramsIsEmpty= StringUtils.isEmpty(sn) && StringUtils.isEmpty(pageSize) &&
StringUtils.isEmpty(pageNumber);
if (paramsIsEmpty) {
return ResultEntity.error("-1", "params must not null");
}
PageInfo<RescueEventConfigVo> result = rescueEventManager.RescueEventCustomerListWithPage(sn, pageSize, pageNumber);
if (result == null) {
return ResultEntity.error("-1", "提交自提碰撞发送失败");
}
return ResultEntity.success(result);
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
return ResultEntity.error("-1", e.getMessage());
}
}
/**
* @Title: getRescueEventById
* @Description: 提交自提碰撞
* @Date:2020-04-26
*/
@GetMapping(value = "getRescueEventById")
@ApiOperation(value = "获取碰撞详情",notes = "获取碰撞详情")
@ApiImplicitParam(name = "rescueEventId",value = "碰撞id",dataType = "String",required = true)
public ResultEntity<RescueEventVo> getRescueEventById(String rescueEventId) {
try {
Boolean paramsIsEmpty= StringUtils.isEmpty(rescueEventId);
if (paramsIsEmpty) {
return ResultEntity.error("-1", "params must not null");
}
RescueEventVo result = rescueEventManager.RescueEventById(rescueEventId);
if (result == null) {
return ResultEntity.error("-1", "提交自提碰撞发送失败");
}
return ResultEntity.success(result);
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
return ResultEntity.error("-1", e.getMessage());
}
}
}
No preview for this file type
No preview for this file type
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!