Commit 2e4edbe1 by gaowenzheng

Merge remote-tracking branch 'origin/master'

parents a0eb79d7 8efa4d1c
......@@ -111,6 +111,11 @@ public class RedisKeyConstant {
public final static String SAAS_ACCESSTOKEN_APPID = "saas:accesstoken:appid:";
/**
* wxapp_config配置表
*/
public final static String KGD_ORDER_OPEN_STORE_IAPP_WXAPP_CONFIG_WXAPPID_ = "kgd:order:open_store_iapp_wxapp_config:wxappid_";
/**
* cocoNotMadeGoods:商户号:门店号:yyyy-MM-dd
*
* @param partnerId
......
......@@ -157,4 +157,12 @@ public class ExposureOrderController {
return ResponseUtil.success(refundService.refundOrderAmt(request.getPartnerId(), request.getOrderCode(), request.getReason()));
}
/**
* 结算页获取是否展示订单那备注配置
*/
@PostMapping(value = "/getOpenStoreIappWxappConfig")
@ApiAnnotation(logMessage = "/getOpenStoreIappWxappConfig")
public BaseResponse getOpenStoreIappWxappConfig(@LogParams @RequestBody OpenStoreIappWxappConfigRequestVo request) {
return exposureOrderService.getOpenStoreIappWxappConfig(request);
}
}
package cn.freemud.entities.db;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.util.Date;
public class OpenStoreIappWxappConfig {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* 自定义小程序appid
*/
private String appid;
/**
* 微信小程序appid
*/
@Column(name = "wx_appid")
private String wxAppid;
/**
* 是否允许填写备注文案,0=否,1=是
*/
@Column(name = "take_inside")
private Integer takeInside;
/**
* 到店订单默认文案
*/
@Column(name = "inside_remark")
private String insideRemark;
/**
* 外卖订单默认文案
*/
@Column(name = "take_out_remark")
private String takeOutRemark;
/**
* 创建时间
*/
@Column(name = "gmt_created")
private Date gmtCreated;
/**
* 修改时间
*/
@Column(name = "gmt_modified")
private Date gmtModified;
/**
* @return id
*/
public Long getId() {
return id;
}
/**
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* 获取自定义小程序appid
*
* @return appid - 自定义小程序appid
*/
public String getAppid() {
return appid;
}
/**
* 设置自定义小程序appid
*
* @param appid 自定义小程序appid
*/
public void setAppid(String appid) {
this.appid = appid;
}
/**
* 获取微信小程序appid
*
* @return wx_appid - 微信小程序appid
*/
public String getWxAppid() {
return wxAppid;
}
/**
* 设置微信小程序appid
*
* @param wxAppid 微信小程序appid
*/
public void setWxAppid(String wxAppid) {
this.wxAppid = wxAppid;
}
/**
* 获取是否允许填写备注文案,0=否,1=是
*
* @return take_inside - 是否允许填写备注文案,0=否,1=是
*/
public Integer getTakeInside() {
return takeInside;
}
/**
* 设置是否允许填写备注文案,0=否,1=是
*
* @param takeInside 是否允许填写备注文案,0=否,1=是
*/
public void setTakeInside(Integer takeInside) {
this.takeInside = takeInside;
}
/**
* 获取到店订单默认文案
*
* @return inside_remark - 到店订单默认文案
*/
public String getInsideRemark() {
return insideRemark;
}
/**
* 设置到店订单默认文案
*
* @param insideRemark 到店订单默认文案
*/
public void setInsideRemark(String insideRemark) {
this.insideRemark = insideRemark;
}
/**
* 获取外卖订单默认文案
*
* @return take_out_remark - 外卖订单默认文案
*/
public String getTakeOutRemark() {
return takeOutRemark;
}
/**
* 设置外卖订单默认文案
*
* @param takeOutRemark 外卖订单默认文案
*/
public void setTakeOutRemark(String takeOutRemark) {
this.takeOutRemark = takeOutRemark;
}
/**
* 获取创建时间
*
* @return gmt_created - 创建时间
*/
public Date getGmtCreated() {
return gmtCreated;
}
/**
* 设置创建时间
*
* @param gmtCreated 创建时间
*/
public void setGmtCreated(Date gmtCreated) {
this.gmtCreated = gmtCreated;
}
/**
* 获取修改时间
*
* @return gmt_modified - 修改时间
*/
public Date getGmtModified() {
return gmtModified;
}
/**
* 设置修改时间
*
* @param gmtModified 修改时间
*/
public void setGmtModified(Date gmtModified) {
this.gmtModified = gmtModified;
}
}
package cn.freemud.entities.vo;
import lombok.Data;
import org.hibernate.validator.constraints.NotEmpty;
@Data
public class OpenStoreIappWxappConfigRequestVo {
@NotEmpty(message = "sessionId不能为空")
private String sessionId;
}
package cn.freemud.service;
import cn.freemud.entities.vo.GetMallPayConfigVo;
import cn.freemud.entities.vo.GetPayCodeVo;
import cn.freemud.entities.vo.GetPayConfigVo;
import cn.freemud.entities.vo.GetPaySuccessDataV2Request;
import cn.freemud.base.entity.BaseResponse;
import cn.freemud.constant.RedisKeyConstant;
import cn.freemud.entities.db.OpenStoreIappWxappConfig;
import cn.freemud.entities.vo.*;
import cn.freemud.entities.vo.order.PayConfigVo;
import cn.freemud.entities.vo.order.PaySuccessDataVo;
import cn.freemud.entities.vo.order.VirtualStoreVo;
......@@ -11,10 +11,16 @@ import cn.freemud.enums.AggregationTypeEnum;
import cn.freemud.enums.OrderTackCodeFactory;
import cn.freemud.enums.TakeCodeOrderType;
import cn.freemud.manager.OrderTackCodeManager;
import cn.freemud.redis.RedisCache;
import cn.freemud.service.business.impl.OrderBusinessServiceImpl;
import cn.freemud.service.impl.PayServiceImpl;
import cn.freemud.utils.ResponseUtil;
import com.freemud.api.assortment.datamanager.entity.db.AssortmentOpenPlatformIappWxappStore;
import com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo;
import com.freemud.api.assortment.datamanager.manager.customer.AssortmentCustomerInfoManager;
import com.freemud.application.sdk.api.log.ErrorLog;
import lombok.RequiredArgsConstructor;
import org.apache.commons.beanutils.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
......@@ -30,6 +36,8 @@ public class ExposureOrderService {
private final PayServiceImpl payService;
private final OrderTackCodeManager orderTackCodeManager;
private final OrderBusinessServiceImpl orderBusinessService;
private final RedisCache redisCache;
private final AssortmentCustomerInfoManager assortmentCustomerInfoManager;
public PayConfigVo getPayConfig(GetPayConfigVo req) {
PayConfigVo vo = new PayConfigVo();
......@@ -121,4 +129,29 @@ public class ExposureOrderService {
public String getPayCode(GetPayCodeVo req) {
return payService.getPayCode(req.getAppId(), req.getStoreId(), req.getChannel());
}
public BaseResponse getOpenStoreIappWxappConfig(OpenStoreIappWxappConfigRequestVo openStoreIappWxappConfigRequestVo){
// 获取用户信息
AssortmentCustomerInfoVo assortmentCustomerInfoVo = assortmentCustomerInfoManager.getCustomerInfoByObject(openStoreIappWxappConfigRequestVo.getSessionId());
//缓存为空则初始化为展示备注,默认备注为空,
OpenStoreIappWxappConfig defauleConfig = new OpenStoreIappWxappConfig();
defauleConfig.setTakeInside(1);
defauleConfig.setInsideRemark("");
defauleConfig.setTakeOutRemark("");
OpenStoreIappWxappConfig config;
try {
config = redisCache.hashGet(RedisKeyConstant.KGD_ORDER_OPEN_STORE_IAPP_WXAPP_CONFIG_WXAPPID_, assortmentCustomerInfoVo.getWxAppId());
if (null == config) {
config = new OpenStoreIappWxappConfig();
BeanUtils.copyProperties(config,defauleConfig);
return ResponseUtil.success(config);
}else{
return ResponseUtil.success(config);
}
}catch (Exception e){
//异常打印日常日志,返回默认config
ErrorLog.errorConvertJson(this.getClass(),"getOpenStoreIappWxappConfig",e);
return ResponseUtil.success(defauleConfig);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment