lidongdong
2023-09-05 9e5a4a4b65cf6b8f260e570284e502105062a806
修改兑换记录没有商家名称
4个文件已修改
56 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/VolunteerCreditsExchange.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerMerchantWithdrawServiceImpl.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/VolunteerCreditsExchangeMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/VolunteerMerchantWithdrawMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/VolunteerCreditsExchange.java
@@ -131,6 +131,13 @@
    @ApiModelProperty(value = "商品购买数量")
    private String palyNum;
    /**
     * 商家名称
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "商家名称")
    private String merchantName;
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerMerchantWithdrawServiceImpl.java
@@ -3,18 +3,27 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.VolunteerMerchantVO;
import com.panzhihua.common.model.vos.community.VolunteerMerchantWithdrawVO;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_community.dao.VolunteerMerchantWithdrawDao;
import com.panzhihua.service_community.entity.VolunteerMerchant;
import com.panzhihua.service_community.entity.VolunteerMerchantWithdraw;
import com.panzhihua.service_community.service.VolunteerMerchantService;
import com.panzhihua.service_community.service.VolunteerMerchantWithdrawService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Slf4j
@Service
public class VolunteerMerchantWithdrawServiceImpl extends ServiceImpl<VolunteerMerchantWithdrawDao,
        VolunteerMerchantWithdraw> implements VolunteerMerchantWithdrawService {
    @Resource
    private VolunteerMerchantService  vmService;
    @Override
    public R getList(int pageNum, int pageSize, String disposeType,String merchantName)
@@ -24,7 +33,40 @@
    }
    @Override
    public R insert(VolunteerMerchantWithdrawVO item) {
    public R insert(VolunteerMerchantWithdrawVO item)
    {
        if(item==null)
        {
            return R.fail("参数不能为空");
        }
        if(StringUtils.isEmpty(item.getMerchantId()))
        {
            return R.fail("商家id不能为空");
        }
        if(StringUtils.isEmpty(item.getWithdrawIntegral()))
        {
            return R.fail("提现积分不能为空");
        }
        R<VolunteerMerchant> volunteerMerchantR=vmService.getById(item.getMerchantId());
        int merchant=Integer.valueOf(volunteerMerchantR.getData().getMerchantIntegral());
        int WithdrawIntegral=Integer.valueOf(item.getWithdrawIntegral());
        if(WithdrawIntegral>merchant)
        {
            return R.fail("提现积分不足!");
        }
        merchant=merchant-WithdrawIntegral;
        VolunteerMerchantVO merchantVO=new VolunteerMerchantVO();
        merchantVO.setId(item.getMerchantId());
        merchantVO.setMerchantIntegral(merchant+"");
        vmService.updateVolunteerMerchant(merchantVO);
        int num= baseMapper.insert(item);
        if(num>0)
        {
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/VolunteerCreditsExchangeMapper.xml
@@ -65,6 +65,7 @@
            vce.order_type,
            vce.paly_integral,
            vce.merchant_id,
            (select vm.name from volunteer_merchant as vm where vce.merchant_id=vm.id) as merchantName,
            vce.paly_num,
            vce.update_time
        from volunteer_credits_exchange as vce
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/VolunteerMerchantWithdrawMapper.xml
@@ -37,6 +37,10 @@
            <if test="disposeType !=null ">
                and dispose_type=#{disposeType}
            </if>
            <if test="merchantName !=null ">
                and
                ((select vm.name from volunteer_merchant as vm where volunteer_merchant_withdraw.merchant_id=vm.id) like concat('%',#{merchantName},'%'))
            </if>
        </where>
        order by creation_time desc
    </select>