puhanshu
2022-01-14 51ee3c4db2eb49062d3236bf44f95dc22f8f6ac9
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsOrderServiceImpl.java
@@ -11,6 +11,8 @@
import com.panzhihua.common.utlis.SmsUtil;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.common.utlis.WxPayUtils;
import com.panzhihua.service_community.dao.McsMerchantDAO;
import com.panzhihua.service_community.entity.McsMerchant;
import com.panzhihua.service_community.entity.McsOrder;
import com.panzhihua.service_community.dao.McsOrderDao;
import com.panzhihua.service_community.service.McsMerchantService;
@@ -52,6 +54,8 @@
    private RabbitTemplate rabbitTemplate;
    @Resource
    private McsMerchantService mcsMerchantService;
    @Resource
    private McsMerchantDAO mcsMerchantDAO;
    private static String H5_LOGIN_APPID="wx475fcd33c8030df8";
    @Override
@@ -61,8 +65,17 @@
    @Override
    public R insert(McsOrderVO mcsOrderVO) {
        McsMerchant mcsMerchant = mcsMerchantDAO.selectOne(new QueryWrapper<McsMerchant>().lambda()
                .eq(McsMerchant::getUserId, mcsOrderVO.getUserId()));
        McsOrder mcsOrder=new McsOrder();
        BeanUtils.copyProperties(mcsOrderVO,mcsOrder);
        if (nonNull(mcsMerchant)) {
            if (mcsMerchant.getIsDel()) {
                mcsMerchantDAO.deleteById(mcsMerchant.getId());
            } else {
                mcsOrder.setMerchantId(mcsMerchant.getId());
            }
        }
        mcsOrder.setStatus(0);
        mcsOrder.setCreateTime(new Date());
        mcsOrder.setOrderNo(DateUtils.getCurrentDateStrNoSignal());
@@ -131,6 +144,7 @@
        mcsOrderBase.setStatus(1);
        mcsOrderBase.setPayNo(mcsOrderVO.getPayNo());
        mcsOrderBase.setPayTime(mcsOrderVO.getPayTime());
        mcsOrderBase.setPaymentMethod("微信支付");
        int i=this.baseMapper.updateById(mcsOrderBase);
        if(i>0){
            R r = mcsMerchantService.updateOrAddMcsMerchantAfterOrder(mcsOrderBase.getMerchantName(), mcsOrderBase.getConfigId(), mcsOrderBase.getUserId());