Commit 29be62f1 by 吕明尚

门店新增保洁时段

parent 9b36552f
...@@ -76,6 +76,9 @@ public class SStore extends BaseEntity ...@@ -76,6 +76,9 @@ public class SStore extends BaseEntity
@Excel(name = "结束营业时间") @Excel(name = "结束营业时间")
private String openEndTime; private String openEndTime;
@Excel(name = "保洁时段")
private String cleaningPeriod;
/** 门店类型 1:标准店 2: 形象店 3:旗舰店 */ /** 门店类型 1:标准店 2: 形象店 3:旗舰店 */
@Excel(name = "门店类型 1:标准店 2: 形象店 3:旗舰店") @Excel(name = "门店类型 1:标准店 2: 形象店 3:旗舰店")
private String storeType; private String storeType;
......
package share.system.service; package share.system.service;
import share.system.domain.Recharge; //import share.system.domain.Recharge;
import share.system.domain.SOrder; import share.system.domain.SOrder;
import share.system.response.OrderPayResultResponse; import share.system.response.OrderPayResultResponse;
import share.system.response.RechargePayResultResponse; //import share.system.response.RechargePayResultResponse;
/** /**
* @Author wwl * @Author wwl
...@@ -30,6 +30,6 @@ public interface OrderPayService { ...@@ -30,6 +30,6 @@ public interface OrderPayService {
* @param recharge 支付参数 * @param recharge 支付参数
* @return OrderPayResultResponse * @return OrderPayResultResponse
*/ */
RechargePayResultResponse saobeiRechargePayment(Recharge recharge); // RechargePayResultResponse saobeiRechargePayment(Recharge recharge);
} }
...@@ -20,12 +20,10 @@ import share.common.exception.base.BaseException; ...@@ -20,12 +20,10 @@ import share.common.exception.base.BaseException;
import share.common.utils.BaseUtil; import share.common.utils.BaseUtil;
import share.common.utils.DateUtil; import share.common.utils.DateUtil;
import share.common.utils.JsonConvertUtil; import share.common.utils.JsonConvertUtil;
import share.system.domain.Recharge;
import share.system.domain.SConsumerToken; import share.system.domain.SConsumerToken;
import share.system.domain.SOrder; import share.system.domain.SOrder;
import share.system.domain.vo.*; import share.system.domain.vo.*;
import share.system.response.OrderPayResultResponse; import share.system.response.OrderPayResultResponse;
import share.system.response.RechargePayResultResponse;
import share.system.service.*; import share.system.service.*;
import share.system.util.WxPayUtil; import share.system.util.WxPayUtil;
...@@ -56,8 +54,8 @@ public class OrderPayServiceImpl implements OrderPayService { ...@@ -56,8 +54,8 @@ public class OrderPayServiceImpl implements OrderPayService {
@Autowired @Autowired
private SaobeiService saobeiService; private SaobeiService saobeiService;
@Autowired // @Autowired
private RechargeService rechargeService; // private RechargeService rechargeService;
/** /**
* 获取域名 * 获取域名
...@@ -113,28 +111,28 @@ public class OrderPayServiceImpl implements OrderPayService { ...@@ -113,28 +111,28 @@ public class OrderPayServiceImpl implements OrderPayService {
* @param recharge 支付参数 * @param recharge 支付参数
* @return * @return
*/ */
@Override // @Override
public RechargePayResultResponse saobeiRechargePayment(Recharge recharge) { // public RechargePayResultResponse saobeiRechargePayment(Recharge recharge) {
RechargePayResultResponse response = new RechargePayResultResponse(); // RechargePayResultResponse response = new RechargePayResultResponse();
response.setRechargeNo(recharge.getRechargeNo()); // response.setRechargeNo(recharge.getRechargeNo());
response.setPayType(PayTypeEnum.getEnumByCode(recharge.getPayType()).getValue()); // response.setPayType(PayTypeEnum.getEnumByCode(recharge.getPayType()).getValue());
response.setStatus(YesNoEnum.no.getFlag()); // response.setStatus(YesNoEnum.no.getFlag());
// 扫呗支付 // // 扫呗支付
ConcurrentHashMap<String, String> unifiedorder = saobeiUnifiedRecharge(recharge); // ConcurrentHashMap<String, String> unifiedorder = saobeiUnifiedRecharge(recharge);
WxPayJsResultVo vo = new WxPayJsResultVo(); // WxPayJsResultVo vo = new WxPayJsResultVo();
vo.setAppId(unifiedorder.get("appId")); // vo.setAppId(unifiedorder.get("appId"));
vo.setNonceStr(unifiedorder.get("nonceStr")); // vo.setNonceStr(unifiedorder.get("nonceStr"));
vo.setPackages(unifiedorder.get("package")); // vo.setPackages(unifiedorder.get("package"));
vo.setSignType(unifiedorder.get("signType")); // vo.setSignType(unifiedorder.get("signType"));
vo.setTimeStamp(unifiedorder.get("timeStamp")); // vo.setTimeStamp(unifiedorder.get("timeStamp"));
vo.setPaySign(unifiedorder.get("paySign")); // vo.setPaySign(unifiedorder.get("paySign"));
// 更新商户订单号 // // 更新商户订单号
recharge.setOutTradeNo(unifiedorder.get("outTradeNo")); // recharge.setOutTradeNo(unifiedorder.get("outTradeNo"));
recharge.setTerminalTrace(unifiedorder.get("terminalTrace")); // recharge.setTerminalTrace(unifiedorder.get("terminalTrace"));
rechargeService.updateById(recharge); // rechargeService.updateById(recharge);
response.setJsConfig(vo); // response.setJsConfig(vo);
return response; // return response;
} // }
/** /**
...@@ -264,59 +262,59 @@ public class OrderPayServiceImpl implements OrderPayService { ...@@ -264,59 +262,59 @@ public class OrderPayServiceImpl implements OrderPayService {
* @param recharge 充值对象 * @param recharge 充值对象
* @return 预下单返回对象 * @return 预下单返回对象
*/ */
private ConcurrentHashMap<String, String> saobeiUnifiedRecharge(Recharge recharge) { // private ConcurrentHashMap<String, String> saobeiUnifiedRecharge(Recharge recharge) {
// 获取用户openId // // 获取用户openId
SConsumerToken userToken = consumerTokenService.getTokenByUserId(recharge.getConsumerId()); // SConsumerToken userToken = consumerTokenService.getTokenByUserId(recharge.getConsumerId());
if (ObjectUtil.isNull(userToken)) { // if (ObjectUtil.isNull(userToken)) {
throw new BaseException("该用户没有openId"); // throw new BaseException("该用户没有openId");
} // }
// 获取appid、mch_id // // 获取appid、mch_id
// 微信签名key // // 微信签名key
String appId = weChatConfig.getAppId(); // String appId = weChatConfig.getAppId();
String mchId = weChatConfig.getMchId(); // String mchId = weChatConfig.getMchId();
String signKey = weChatConfig.getSignKey(); // String signKey = weChatConfig.getSignKey();
// 获取扫呗微信预下单对象 // // 获取扫呗微信预下单对象
SaobeiMiniPayRequestVo unifiedorderVo = getSaobeiUnifiedRechargeVo(recharge, userToken.getToken(), appId, mchId, signKey); // SaobeiMiniPayRequestVo unifiedorderVo = getSaobeiUnifiedRechargeVo(recharge, userToken.getToken(), appId, mchId, signKey);
// 预下单(统一下单) // // 预下单(统一下单)
SaobeiMiniPayResponse response = saobeiService.wechatMinipay(unifiedorderVo); // SaobeiMiniPayResponse response = saobeiService.wechatMinipay(unifiedorderVo);
logger.info("SaobeiMiniPayResponse :", JsonConvertUtil.write2JsonStr(response)); // logger.info("SaobeiMiniPayResponse :", JsonConvertUtil.write2JsonStr(response));
// 组装前端预下单参数 // // 组装前端预下单参数
ConcurrentHashMap<String, String> map = new ConcurrentHashMap<>(); // ConcurrentHashMap<String, String> map = new ConcurrentHashMap<>();
map.put("appId", response.getAppId()); // map.put("appId", response.getAppId());
map.put("nonceStr", response.getNonceStr()); // map.put("nonceStr", response.getNonceStr());
map.put("package", response.getPackage_str()); // map.put("package", response.getPackage_str());
map.put("signType", response.getSignType()); // map.put("signType", response.getSignType());
map.put("timeStamp", response.getTimeStamp()); // map.put("timeStamp", response.getTimeStamp());
map.put("paySign", response.getPaySign()); // map.put("paySign", response.getPaySign());
map.put("prepayTime", DateUtil.nowDateTimeStr()); // map.put("prepayTime", DateUtil.nowDateTimeStr());
map.put("outTradeNo", response.getOut_trade_no()); // map.put("outTradeNo", response.getOut_trade_no());
map.put("terminalTrace", unifiedorderVo.getTerminal_trace()); // map.put("terminalTrace", unifiedorderVo.getTerminal_trace());
return map; // return map;
} // }
/** /**
* 获取预下单对象 (扫呗-微信) * 获取预下单对象 (扫呗-微信)
* 充值 * 充值
* @return 预下单对象 * @return 预下单对象
*/ */
private SaobeiMiniPayRequestVo getSaobeiUnifiedRechargeVo(Recharge recharge, String openid, String appId, String mchId, String signKey) { // private SaobeiMiniPayRequestVo getSaobeiUnifiedRechargeVo(Recharge recharge, String openid, String appId, String mchId, String signKey) {
AttachVo attachVo = new AttachVo(OrderTypeEnum.RECHARGE.getValue(), recharge.getConsumerId()); // AttachVo attachVo = new AttachVo(OrderTypeEnum.RECHARGE.getValue(), recharge.getConsumerId());
//
SaobeiMiniPayRequestVo vo = new SaobeiMiniPayRequestVo(); // SaobeiMiniPayRequestVo vo = new SaobeiMiniPayRequestVo();
vo.setSub_appid(appId); // vo.setSub_appid(appId);
vo.setMerchant_no(saobeiConfig.getMerchantNo()); // vo.setMerchant_no(saobeiConfig.getMerchantNo());
vo.setTerminal_id(saobeiConfig.getTerminalId()); // vo.setTerminal_id(saobeiConfig.getTerminalId());
vo.setAttach(JSONObject.toJSONString(attachVo)); // vo.setAttach(JSONObject.toJSONString(attachVo));
vo.setTerminal_trace(BaseUtil.getOrderNo("WXNO")); // vo.setTerminal_trace(BaseUtil.getOrderNo("WXNO"));
vo.setTerminal_time(DateUtil.nowDate(Constants.DATE_TIME_FORMAT_NUM)); // vo.setTerminal_time(DateUtil.nowDate(Constants.DATE_TIME_FORMAT_NUM));
vo.setOrder_body(StrUtil.concat(true,recharge.getRechargeAmount().toString(),"元充值!")); // vo.setOrder_body(StrUtil.concat(true,recharge.getRechargeAmount().toString(),"元充值!"));
// 订单中使用的是BigDecimal,这里要转为Integer类型 // // 订单中使用的是BigDecimal,这里要转为Integer类型
vo.setTotal_fee(String.valueOf(recharge.getRechargeAmount().multiply(BigDecimal.TEN).multiply(BigDecimal.TEN).intValue())); // vo.setTotal_fee(String.valueOf(recharge.getRechargeAmount().multiply(BigDecimal.TEN).multiply(BigDecimal.TEN).intValue()));
vo.setNotify_url(apiDomain + PayConstants.SAOBEI_PAY_NOTIFY_API_URI); // vo.setNotify_url(apiDomain + PayConstants.SAOBEI_PAY_NOTIFY_API_URI);
vo.setTrade_type(PayConstants.WX_PAY_TRADE_TYPE_JS); // vo.setTrade_type(PayConstants.WX_PAY_TRADE_TYPE_JS);
vo.setOpen_id(openid); // vo.setOpen_id(openid);
vo.setDevice_no("WEB"); // vo.setDevice_no("WEB");
return vo; // return vo;
} // }
} }
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<result property="status" column="status" /> <result property="status" column="status" />
<result property="openStartTime" column="open_start_time" /> <result property="openStartTime" column="open_start_time" />
<result property="openEndTime" column="open_end_time" /> <result property="openEndTime" column="open_end_time" />
<result property="cleaningPeriod" column="cleaning_period"/>
<result property="storeType" column="store_type" /> <result property="storeType" column="store_type" />
</resultMap> </resultMap>
...@@ -49,6 +50,7 @@ ...@@ -49,6 +50,7 @@
status, status,
open_start_time, open_start_time,
open_end_time, open_end_time,
cleaning_period,
store_type store_type
from s_store from s_store
</sql> </sql>
...@@ -71,6 +73,7 @@ ...@@ -71,6 +73,7 @@
<if test="openStartTime != null "> and open_start_time = #{openStartTime}</if> <if test="openStartTime != null "> and open_start_time = #{openStartTime}</if>
<if test="openEndTime != null "> and open_end_time = #{openEndTime}</if> <if test="openEndTime != null "> and open_end_time = #{openEndTime}</if>
<if test="storeType != null "> and store_type = #{storeType}</if> <if test="storeType != null "> and store_type = #{storeType}</if>
<if test="cleaningPeriod != null ">and cleaning_period = #{cleaningPeriod}</if>
</where> </where>
order by create_time desc order by create_time desc
</select> </select>
...@@ -107,6 +110,7 @@ ...@@ -107,6 +110,7 @@
<if test="openStartTime != null">open_start_time,</if> <if test="openStartTime != null">open_start_time,</if>
<if test="openEndTime != null">open_end_time,</if> <if test="openEndTime != null">open_end_time,</if>
<if test="storeType != null">store_type,</if> <if test="storeType != null">store_type,</if>
<if test="cleaningPeriod != null">cleaning_period,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if> <if test="name != null">#{name},</if>
...@@ -129,6 +133,7 @@ ...@@ -129,6 +133,7 @@
<if test="openStartTime != null">#{openStartTime},</if> <if test="openStartTime != null">#{openStartTime},</if>
<if test="openEndTime != null">#{openEndTime},</if> <if test="openEndTime != null">#{openEndTime},</if>
<if test="storeType != null">#{storeType},</if> <if test="storeType != null">#{storeType},</if>
<if test="cleaningPeriod != null">#{cleaningPeriod},</if>
</trim> </trim>
</insert> </insert>
...@@ -152,9 +157,10 @@ ...@@ -152,9 +157,10 @@
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="status != null">status = #{status},</if> <if test="status != null">status = #{status},</if>
<if test="openStartTime != null">open_start_time = #{openStartTime},</if> <if test="openStartTime != ''">open_start_time = #{openStartTime},</if>
<if test="openEndTime != null">open_end_time = #{openEndTime},</if> <if test="openEndTime != ''">open_end_time = #{openEndTime},</if>
<if test="storeType != null">store_type = #{storeType},</if> <if test="storeType != null">store_type = #{storeType},</if>
<if test="cleaningPeriod != ''">cleaning_period = #{cleaningPeriod},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
......
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