Commit 6c3a78ce authored by 周健威's avatar 周健威

Merge remote-tracking branch 'origin/base-modify' into base-modify

parents c68a000e 73275032
package com.xxfc.platform.app.biz; package com.xxfc.platform.app.biz;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.github.wxiaoqi.security.common.msg.TableResultResponse;
import com.github.wxiaoqi.security.common.util.EntityUtils; import com.github.wxiaoqi.security.common.util.EntityUtils;
import com.github.wxiaoqi.security.common.util.Query;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.app.entity.vo.WithDrawRuleVo; import com.xxfc.platform.app.entity.vo.WithDrawRuleVo;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -12,6 +15,7 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz; ...@@ -12,6 +15,7 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
import tk.mybatis.mapper.entity.Example; import tk.mybatis.mapper.entity.Example;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 系统配置表 * 系统配置表
...@@ -35,7 +39,7 @@ public class CofigBiz extends BaseBiz<CofigMapper,Cofig> { ...@@ -35,7 +39,7 @@ public class CofigBiz extends BaseBiz<CofigMapper,Cofig> {
*/ */
public int updateConfig(Cofig cofig) { public int updateConfig(Cofig cofig) {
EntityUtils.setUpdatedInfo(cofig); EntityUtils.setUpdatedInfo(cofig);
return mapper.updateConfig(cofig); return mapper.updateByPrimaryKeySelective(cofig);
} }
public WithDrawRuleVo getWithDrawRule(){ public WithDrawRuleVo getWithDrawRule(){
...@@ -52,4 +56,22 @@ public class CofigBiz extends BaseBiz<CofigMapper,Cofig> { ...@@ -52,4 +56,22 @@ public class CofigBiz extends BaseBiz<CofigMapper,Cofig> {
withDrawRuleVo.setDescription(cofig.getValue()); withDrawRuleVo.setDescription(cofig.getValue());
return withDrawRuleVo; return withDrawRuleVo;
} }
public void updateConfigStatus(int id) {
Cofig cofig = new Cofig();
cofig.setId(id);
cofig.setIsDel(1);
mapper.updateByPrimaryKeySelective(cofig);
}
public TableResultResponse<Cofig> listWithPage(Map<String, Object> params) {
Query query = new Query(params);
Example example = new Example(Cofig.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("isDel",0);
PageDataVO<Cofig> cofigPage = PageDataVO.pageInfo(query.getPage(), query.getLimit(), () -> mapper.selectByExample(example));
return new TableResultResponse<>(cofigPage.getTotalCount(),cofigPage.getData()) ;
}
} }
\ No newline at end of file
package com.xxfc.platform.app.rest.admin; package com.xxfc.platform.app.rest.admin;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.msg.TableResultResponse;
import com.github.wxiaoqi.security.common.rest.BaseController; import com.github.wxiaoqi.security.common.rest.BaseController;
import com.xxfc.platform.app.biz.CofigBiz; import com.xxfc.platform.app.biz.CofigBiz;
import com.xxfc.platform.app.entity.Cofig; import com.xxfc.platform.app.entity.Cofig;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import java.util.List;
import java.util.Map;
/** /**
* @author libin * @author libin
* @version 1.0 * @version 1.0
...@@ -20,6 +23,11 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -20,6 +23,11 @@ import org.springframework.web.bind.annotation.RestController;
public class CofigAdminController extends BaseController<CofigBiz,Cofig> { public class CofigAdminController extends BaseController<CofigBiz,Cofig> {
@Override
public TableResultResponse<Cofig> list(@RequestParam Map<String, Object> params) {
return getBaseBiz().listWithPage(params);
}
/** /**
* 修改通用配置 * 修改通用配置
* @param cofig * @param cofig
...@@ -33,4 +41,11 @@ public class CofigAdminController extends BaseController<CofigBiz,Cofig> { ...@@ -33,4 +41,11 @@ public class CofigAdminController extends BaseController<CofigBiz,Cofig> {
} }
return ObjectRestResponse.createDefaultFail(); return ObjectRestResponse.createDefaultFail();
} }
@Override
public ObjectRestResponse<Cofig> remove(@PathVariable int id) {
getBaseBiz().updateConfigStatus(id);
return ObjectRestResponse.succ();
}
} }
\ No newline at end of file
...@@ -137,9 +137,29 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> { ...@@ -137,9 +137,29 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> {
orderPay.setStatus(1); orderPay.setStatus(1);
orderPay.setSerialNumber(serialNumber); orderPay.setSerialNumber(serialNumber);
int num=mapper.updateByExampleSelective(orderPay,example); int num=mapper.updateByExampleSelective(orderPay,example);
log.error("---支付回调处理---num====="+num+"----orderNo======="+orderNo); log.error("---支付回调处理---num====="+num+"----orderNo======="+orderNo);
if(num>0){ if(num>0){
//支付成功,添加积分
OrderPay pay= list.get(0); OrderPay pay= list.get(0);
OrderPay newValue = mapper.selectOne(orderPay);
log.info("支付回调信息:newValue = {}", newValue);
if(newValue.getStatus() == 1) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("userId", newValue.getUserId());
jsonObject.put("amount", newValue.getAmount());
jsonObject.put("channelId", newValue.getOrderNo());
if(newValue.getChannel() == 1) {//租车
jsonObject.put("integralRuleCode", "RENTRV");
} else if(newValue.getChannel() == 2) { //旅游
jsonObject.put("integralRuleCode", "BUYROUT");
} else if(newValue.getChannel() == 3) { //会员
jsonObject.put("integralRuleCode", "BUYMEMBER");
}
log.info("支付订单号:orderNo = {}, orderType = {}", newValue.getOrderNo(), newValue.getChannel());
log.info("支付成功获取积分:发送消息 exchange = {}, routingKey = {}, json = {}", MQconstant.INTEGRAL_EXCHANGE, MQconstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
mqServiceBiZ.sendMessage(MQconstant.INTEGRAL_EXCHANGE, MQconstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
}
if(StringUtils.isNotBlank(pay.getNotifyUrl())){ if(StringUtils.isNotBlank(pay.getNotifyUrl())){
String url=pay.getNotifyUrl(); String url=pay.getNotifyUrl();
Integer type=pay.getType()==null?1:pay.getType(); Integer type=pay.getType()==null?1:pay.getType();
...@@ -152,23 +172,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> { ...@@ -152,23 +172,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> {
result= HTTPUtils.doGet(url); result= HTTPUtils.doGet(url);
} }
log.error("---支付回调处理---orderNo======="+orderNo+"---result==="+result); log.error("---支付回调处理---orderNo======="+orderNo+"---result==="+result);
//支付成功,添加积分
if(pay.getStatus() == 1) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("userId", pay.getUserId());
jsonObject.put("amount", pay.getAmount());
jsonObject.put("channelId", pay.getOrderNo());
if(pay.getChannel() == 1) {//租车
jsonObject.put("integralRuleCode", "RENTRV");
} else if(pay.getChannel() == 2) { //旅游
jsonObject.put("integralRuleCode", "BUYROUT");
} else if(pay.getChannel() == 3) { //会员
jsonObject.put("integralRuleCode", "BUYMEMBER");
}
log.info("支付订单号:orderNo = {}, orderType = {}", pay.getOrderNo(), pay.getChannel());
log.info("支付成功获取积分:发送消息 exchange = {}, routingKey = {}, json = {}", MQconstant.INTEGRAL_EXCHANGE, MQconstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
mqServiceBiZ.sendMessage(MQconstant.INTEGRAL_EXCHANGE, MQconstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
}
} }
} }
} }
......
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