lidongdong
2023-08-26 40ae93e712ec9e3d78fec7fd50a2b5cc0b851229
新增订单模块  订单核销
5个文件已修改
6个文件已添加
1078 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/XmostBeautifulApi.java 111 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/VolunteerCreditsExchangeVO.java 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/VolunteerIntegralMerchantApi.java 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/VolunteerIntegralMerchantApi.java 110 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/VolunteerCreditsExchangeDao.java 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/VolunteerCreditsExchange.java 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/VolunteerCreditsExchangeService.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerActivityServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerCreditsExchangeServiceImpl.java 154 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/VolunteerCreditsExchangeMapper.xml 211 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/XmostBeautifulApi.java
@@ -1,14 +1,14 @@
package com.panzhihua.applets.api;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.VolunteerCreditsExchangeVO;
import com.panzhihua.common.service.community.CommunityService;
import com.panzhihua.common.utlis.StringUtils;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -16,7 +16,7 @@
@RestController
@RequestMapping("/XmostBeautiful")
@Api(tags = {"小程序志愿者活动"})
public class XmostBeautifulApi
public class XmostBeautifulApi extends BaseController
{
    @Resource
@@ -69,5 +69,106 @@
        return communityService.volunteerQueryById(Id);
    }
    /***********************************************************************************************************
     *
     *
     *                   订单兑换
     *
     *
     ***********************************************************************************************************/
    /**
     * 分页查询
     * @param
     * @return
     */
    @GetMapping("order/getList")
    public R getList(@RequestParam("pageNum") int pageNum,
                     @RequestParam("pageSize")  int pageSize,
                     @RequestParam(value = "goodsId", required = false) String goodsId,
                     @RequestParam(value = "orderNumber", required = false) String orderNumber,
                     @RequestParam(value = "goodsName", required = false) String goodsName,
                     @RequestParam(value = "condition", required = false) String condition,
                     @RequestParam(value = "userName", required = false) String userName)
    {
        return communityService.getList(pageNum,pageSize,goodsId,orderNumber,goodsName,
                condition,userName,null,getLoginUserInfo().getUserId()+"");
    }
    /**
     * 查询详情
     * @param id
     * @return
     */
    @GetMapping("order/getData")
    public R getData(@RequestParam("id") String id)
    {
        if(StringUtils.isEmpty(id))
        {
            return R.fail("订单id不能为空");
        }
        return communityService.getData(id);
    }
    /**
     * 新增
     * @param
     * @return
     */
    @PostMapping("/order/insertData")
    public R insertData(@RequestBody VolunteerCreditsExchangeVO item)
    {
        LoginUserInfoVO userInfoVO= getLoginUserInfo();
        if(StringUtils.isEmpty(item.getCommunityId()))
        {
            item.setCommunityId(userInfoVO.getCommunityId()+"");
        }
        item.setUserId(userInfoVO.getUserId()+"");
        item.setNeedScore(userInfoVO.getLoveIntegral());
        return communityService.insertData(item);
    }
    /**
     * 更新
     * @param item
     * @return
     */
    @PostMapping("/order/update")
    public R update(@RequestBody VolunteerCreditsExchangeVO item)
    {
        return communityService.update(item);
    }
    /**
     * 删除
     * @param id
     * @return
     */
    @DeleteMapping("/order/delete")
    public R delete(@RequestParam("id") String id)
    {
        if(StringUtils.isEmpty(id))
        {
            return R.fail("订单id不能为空");
        }
        return communityService.delete(id);
    }
    /**
     * 核销
     * @param id
     * @return
     */
    @GetMapping("/order/conditionData")
    public R conditionData(@RequestParam("id") String id)
    {
        if(StringUtils.isEmpty(id))
        {
            return R.fail("订单id不能为空");
        }
        return communityService.conditionData(id);
    }
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/VolunteerCreditsExchangeVO.java
New file
@@ -0,0 +1,79 @@
package com.panzhihua.common.model.vos.community;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@ApiModel("商城积分兑换订单")
public class VolunteerCreditsExchangeVO {
    /**
     * 主键
     */
    @ApiModelProperty(value = "主键")
    private String id;
    /**
     * 活动名称
     */
    @ApiModelProperty(value = "商品名称")
    private String goodsName;
    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    private Date creationTime;
    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;
    /**
     * 社区id
     */
    @ApiModelProperty(value = "社区id")
    private String communityId;
    /**
     * 订单号
     */
    @ApiModelProperty(value = "订单号")
    private String orderNumber;
    /**
     * 商品id
     */
    @ApiModelProperty(value = "商品id")
    private String goodsId;
    /**
     * 商品图片
     */
    @ApiModelProperty(value = "商品图片")
    private String goodsUrl;
    /**
     * 所需积分
     */
    @ApiModelProperty(value = "所需积分")
    private String needScore;
    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户id")
    private String userId;
    /**
     * 核销状态(0未核销  1已核销)
     */
    @ApiModelProperty(value = "核销状态(0未核销  1已核销)")
    private String condition;
    /**
     * 核销时间
     */
    @ApiModelProperty(value = "核销时间")
    private String disposeTime;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -26,6 +26,7 @@
import com.panzhihua.common.model.dtos.property.PagePropertyWorkerDTO;
import com.panzhihua.common.model.dtos.property.PropertyWorkerDTO;
import com.panzhihua.common.model.dtos.shop.*;
import com.panzhihua.common.model.vos.*;
import com.panzhihua.common.model.vos.civil.ComActSocialWorkerVO;
import com.panzhihua.common.model.vos.community.*;
import com.panzhihua.common.model.vos.community.acid.ComActAcidCheckRecordVO;
@@ -37,6 +38,7 @@
import com.panzhihua.common.model.vos.community.raffle.ComActRaffleVO;
import com.panzhihua.common.model.vos.community.reserve.ComActReserveDangerAreaVO;
import com.panzhihua.common.model.vos.shop.AddShopFlowerGoodsVO;
import com.panzhihua.common.utlis.StringUtils;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
@@ -214,12 +216,6 @@
import com.panzhihua.common.model.dtos.vaccines.VaccinesEnrollByAppDTO;
import com.panzhihua.common.model.dtos.vaccines.VaccinesEnrollUserByAppDTO;
import com.panzhihua.common.model.dtos.vaccines.VaccinesInoculationByAdminDTO;
import com.panzhihua.common.model.vos.BcDictionaryItemVO;
import com.panzhihua.common.model.vos.BcDictionaryVO;
import com.panzhihua.common.model.vos.ComActSocialMemberVO;
import com.panzhihua.common.model.vos.DictionaryVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.SystemmanagementConfigVO;
import com.panzhihua.common.model.vos.community.bigscreen.BigScreenStatisticAgeGender;
import com.panzhihua.common.model.vos.community.bigscreen.BigScreenStatisticPartyActivity;
import com.panzhihua.common.model.vos.community.bigscreen.BigScreenStatisticPartyBuild;
@@ -257,6 +253,8 @@
import com.panzhihua.common.model.vos.user.UserElectronicFileVO;
import com.panzhihua.common.model.vos.user.UserPhoneVO;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
@@ -11517,5 +11515,71 @@
    public R  VolunteerIntegralMerchantDeleteById(@RequestParam("id") String id);
    /***********************************************************************************************************
     *
     *
     *                   订单兑换
     *
     *
     ***********************************************************************************************************/
    /**
     * 分页查询
     * @param
     * @return
     */
    @GetMapping("order/getList")
    public R getList(@RequestParam("pageNum") int pageNum,
                     @RequestParam("pageSize")  int pageSize,
                     @RequestParam(value = "goodsId", required = false) String goodsId,
                     @RequestParam(value = "orderNumber", required = false) String orderNumber,
                     @RequestParam(value = "goodsName", required = false) String goodsName,
                     @RequestParam(value = "condition", required = false) String condition,
                     @RequestParam(value = "userName", required = false) String userName,
                     @RequestParam(value = "communityId", required = false) String communityId,
                     @RequestParam(value = "userId", required = false) String userId);
    /**
     * 查询详情
     * @param id
     * @return
     */
    @GetMapping("order/getData")
    public R getData(@RequestParam("id") String id);
    /**
     * 新增
     * @param
     * @return
     */
    @PostMapping("/order/insertData")
    public R insertData(@RequestBody VolunteerCreditsExchangeVO item);
    /**
     * 更新
     * @param item
     * @return
     */
    @PostMapping("/order/update")
    public R update(@RequestBody VolunteerCreditsExchangeVO item);
    /**
     * 删除
     * @param id
     * @return
     */
    @DeleteMapping("/order/delete")
    public R delete(@RequestParam("id") String id);
    /**
     * 核销
     * @param id
     * @return
     */
    @GetMapping("/order/conditionData")
    public R conditionData(@RequestParam("id") String id);
}
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/VolunteerIntegralMerchantApi.java
@@ -1,9 +1,12 @@
package com.panzhihua.community_backstage.api;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.VolunteerCreditsExchangeVO;
import com.panzhihua.common.model.vos.community.VolunteerIntegralMerchantVO;
import com.panzhihua.common.service.community.CommunityService;
import com.panzhihua.common.utlis.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
@@ -77,7 +80,106 @@
    }
    /***********************************************************************************************************
     *
     *
     *                   订单兑换
     *
     *
     ***********************************************************************************************************/
    /**
     * 分页查询
     * @param
     * @return
     */
    @GetMapping("order/getList")
    public R getList(@RequestParam("pageNum") int pageNum,
                     @RequestParam("pageSize")  int pageSize,
                     @RequestParam(value = "goodsId", required = false) String goodsId,
                     @RequestParam(value = "orderNumber", required = false) String orderNumber,
                     @RequestParam(value = "goodsName", required = false) String goodsName,
                     @RequestParam(value = "condition", required = false) String condition,
                     @RequestParam(value = "userName", required = false) String userName)
    {
        return merchantService.getList(pageNum,pageSize,goodsId,orderNumber,goodsName,
                condition,userName,getCommunityId()+"",null);
    }
    /**
     * 查询详情
     * @param id
     * @return
     */
    @GetMapping("order/getData")
    public R getData(@RequestParam("id") String id)
    {
        if(StringUtils.isEmpty(id))
        {
            return R.fail("订单id不能为空");
        }
        return merchantService.getData(id);
    }
    /**
     * 新增
     * @param
     * @return
     */
    @PostMapping("/order/insertData")
    public R insertData(@RequestBody VolunteerCreditsExchangeVO item)
    {
        LoginUserInfoVO userInfoVO= getLoginUserInfo();
        if(StringUtils.isEmpty(item.getCommunityId()))
        {
            item.setCommunityId(userInfoVO.getCommunityId()+"");
        }
        item.setUserId(userInfoVO.getUserId()+"");
        item.setNeedScore(userInfoVO.getLoveIntegral());
        return merchantService.insertData(item);
    }
    /**
     * 更新
     * @param item
     * @return
     */
    @PostMapping("/order/update")
    public R update(@RequestBody VolunteerCreditsExchangeVO item)
    {
        return merchantService.update(item);
    }
    /**
     * 删除
     * @param id
     * @return
     */
    @DeleteMapping("/order/delete")
    public R delete(@RequestParam("id") String id)
    {
        if(StringUtils.isEmpty(id))
        {
            return R.fail("订单id不能为空");
        }
        return merchantService.delete(id);
    }
    /**
     * 核销
     * @param id
     * @return
     */
    @GetMapping("/order/conditionData")
    public R conditionData(@RequestParam("id") String id)
    {
        if(StringUtils.isEmpty(id))
        {
            return R.fail("订单id不能为空");
        }
        return merchantService.conditionData(id);
    }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/VolunteerIntegralMerchantApi.java
@@ -2,10 +2,13 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.VolunteerCreditsExchangeVO;
import com.panzhihua.common.model.vos.community.VolunteerIntegralMerchantVO;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_community.entity.VolunteerIntegralMerchant;
import com.panzhihua.service_community.service.VolunteerCreditsExchangeService;
import com.panzhihua.service_community.service.VolunteerIntegralMerchantService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
@@ -166,10 +169,6 @@
    }
    @DeleteMapping("/deleteById")
    public R  VolunteerIntegralMerchantDeleteById(@RequestParam("id") String id)
    {
@@ -181,7 +180,110 @@
        return R.fail("操作失败");
    }
    /***********************************************************************************************************
     *
     *
     *                   订单兑换
     *
     *
     ***********************************************************************************************************/
    @Resource
    private VolunteerCreditsExchangeService vceService;
    /**
     * 分页查询
     * @param
     * @return
     */
    @GetMapping("order/getList")
    public R getList(@RequestParam("pageNum") int pageNum,
                     @RequestParam("pageSize")  int pageSize,
                     @RequestParam(value = "goodsId", required = false) String goodsId,
                     @RequestParam(value = "orderNumber", required = false) String orderNumber,
                     @RequestParam(value = "goodsName", required = false) String goodsName,
                     @RequestParam(value = "condition", required = false) String condition,
                     @RequestParam(value = "userName", required = false) String userName,
                     @RequestParam(value = "communityId", required = false) String communityId,
                     @RequestParam(value = "userId", required = false) String userId)
    {
        return vceService.getList(pageNum,pageSize,goodsId,orderNumber,goodsName,
                condition,userName,communityId,userId);
    }
    /**
     * 查询详情
     * @param id
     * @return
     */
    @GetMapping("order/getData")
    public R getData(@RequestParam("id") String id)
    {
        if(StringUtils.isEmpty(id))
        {
            return R.fail("订单id不能为空");
        }
        return vceService.getData(id);
    }
    /**
     * 新增
     * @param
     * @return
     */
    @PostMapping("/order/insertData")
    public R insertData(@RequestBody VolunteerCreditsExchangeVO item)
    {
        LoginUserInfoVO userInfoVO= getLoginUserInfo();
        if(StringUtils.isEmpty(item.getCommunityId()))
        {
            item.setCommunityId(userInfoVO.getCommunityId()+"");
        }
        item.setUserId(userInfoVO.getUserId()+"");
        item.setNeedScore(userInfoVO.getLoveIntegral());
        return vceService.insertData(item);
    }
    /**
     * 更新
     * @param item
     * @return
     */
    @PostMapping("/order/update")
    public R update(@RequestBody VolunteerCreditsExchangeVO item)
    {
        return vceService.update(item);
    }
    /**
     * 删除
     * @param id
     * @return
     */
    @DeleteMapping("/order/delete")
    public R delete(@RequestParam("id") String id)
    {
        if(StringUtils.isEmpty(id))
        {
            return R.fail("订单id不能为空");
        }
        return vceService.delete(id);
    }
    /**
     * 核销
     * @param id
     * @return
     */
    @GetMapping("/order/conditionData")
    public R conditionData(@RequestParam("id") String id)
    {
        if(StringUtils.isEmpty(id))
        {
            return R.fail("订单id不能为空");
        }
        return vceService.conditionData(id);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/VolunteerCreditsExchangeDao.java
New file
@@ -0,0 +1,67 @@
package com.panzhihua.service_community.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.common.model.vos.community.VolunteerCreditsExchangeVO;
import com.panzhihua.common.model.vos.community.VolunteerTypeVO;
import com.panzhihua.service_community.entity.VolunteerCreditsExchange;
import com.panzhihua.service_community.entity.VolunteerType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface VolunteerCreditsExchangeDao extends BaseMapper<VolunteerCreditsExchange>
{
    /**
     * 分页查询
     * @param
     * @return
     */
    IPage<VolunteerCreditsExchange> getList(Page page,
                                            @Param("item") String goodsId,
                                            @Param("orderNumber") String orderNumber,
                                            @Param("goodsName") String goodsName,
                                            @Param("condition") String condition,
                                            @Param("userName") String userName,
                                            @Param("communityId") String communityId,
                                            @Param("userId") String userId
                                            );
    /**
     * 查询详情
     * @param id
     * @return
     */
    VolunteerCreditsExchange getData(@Param("id") String id);
    /**
     * 新增
     * @param
     * @return
     */
    int insertData(@Param("item") VolunteerCreditsExchangeVO item);
    /**
     * 更新
     * @param item
     * @return
     */
    int update(@Param("item") VolunteerCreditsExchangeVO item);
    /**
     * 删除
     * @param id
     * @return
     */
    int delete(@Param("id") String id);
    /**
     * 核销
     * @param id
     * @return
     */
    int conditionData(@Param("id") String id);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/VolunteerCreditsExchange.java
New file
@@ -0,0 +1,105 @@
package com.panzhihua.service_community.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("商城积分兑换订单")
public class VolunteerCreditsExchange implements Serializable {
    private static final long serialVersionUID = -70884515430727555L;
    /**
     * 主键
     */
    @ApiModelProperty(value = "主键")
    private String id;
    /**
     * 活动名称
     */
    @ApiModelProperty(value = "商品名称")
    private String goodsName;
    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    private Date creationTime;
    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;
    /**
     * 社区id
     */
    @ApiModelProperty(value = "社区id")
    private String communityId;
    /**
     * 订单号
     */
    @ApiModelProperty(value = "订单号")
    private String orderNumber;
    /**
     * 商品id
     */
    @ApiModelProperty(value = "商品id")
    private String goodsId;
    /**
     * 商品图片
     */
    @ApiModelProperty(value = "商品图片")
    private String goodsUrl;
    /**
     * 所需积分
     */
    @ApiModelProperty(value = "所需积分")
    private String needScore;
    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户id")
    private String userId;
    /**
     * 核销状态(0未核销  1已核销)
     */
    @ApiModelProperty(value = "核销状态(0未核销  1已核销)")
    private String condition;
    /**
     * 核销时间
     */
    @ApiModelProperty(value = "核销时间")
    private String disposeTime;
    /**
     * 核销时间
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "志愿者姓名")
    private String userName;
    /**
     * 核销时间
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "志愿者手机号")
    private String userPhone;
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/VolunteerCreditsExchangeService.java
New file
@@ -0,0 +1,61 @@
package com.panzhihua.service_community.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.VolunteerCreditsExchangeVO;
import com.panzhihua.service_community.entity.VolunteerCreditsExchange;
public interface VolunteerCreditsExchangeService extends IService<VolunteerCreditsExchange>
{
    /**
     * 分页查询
     * @param
     * @return
     */
    R getList(int pageNum, int pageSize,
              String goodsId,
              String orderNumber,
              String goodsName,
              String condition,
              String userName,
              String communityId,
              String userId
    );
    /**
     * 查询详情
     * @param id
     * @return
     */
    R getData(String id);
    /**
     * 新增
     * @param
     * @return
     */
    R insertData(VolunteerCreditsExchangeVO item);
    /**
     * 更新
     * @param item
     * @return
     */
    R update(VolunteerCreditsExchangeVO item);
    /**
     * 删除
     * @param id
     * @return
     */
    R delete(String id);
    /**
     * 核销
     * @param id
     * @return
     */
    R conditionData(String id);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerActivityServiceImpl.java
@@ -3,14 +3,12 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.vos.community.ComActDynVO;
import com.panzhihua.common.model.vos.community.VolunteerActivityVO;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_community.dao.VolunteerActivityDao;
import com.panzhihua.service_community.entity.VolunteerActivity;
import com.panzhihua.service_community.service.VolunteerActivityService;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerCreditsExchangeServiceImpl.java
New file
@@ -0,0 +1,154 @@
package com.panzhihua.service_community.service.impl;
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.VolunteerCreditsExchangeVO;
import com.panzhihua.common.model.vos.community.VolunteerTypeVO;
import com.panzhihua.common.utlis.Snowflake;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_community.dao.VolunteerCreditsExchangeDao;
import com.panzhihua.service_community.dao.VolunteerTypeDao;
import com.panzhihua.service_community.entity.VolunteerActivity;
import com.panzhihua.service_community.entity.VolunteerCreditsExchange;
import com.panzhihua.service_community.entity.VolunteerIntegralMerchant;
import com.panzhihua.service_community.entity.VolunteerType;
import com.panzhihua.service_community.service.VolunteerCreditsExchangeService;
import com.panzhihua.service_community.service.VolunteerIntegralMerchantService;
import com.panzhihua.service_community.service.VolunteerTypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Slf4j
@Service
public class VolunteerCreditsExchangeServiceImpl extends ServiceImpl<VolunteerCreditsExchangeDao,
        VolunteerCreditsExchange> implements VolunteerCreditsExchangeService {
    @Resource
    private VolunteerIntegralMerchantService goodsService;
    @Override
    public R getList(int pageNum, int pageSize, String goodsId, String orderNumber,
                     String goodsName, String condition, String userName,String communityId,String userId) {
        Page page=new Page<VolunteerCreditsExchange>(pageNum,pageSize);
        return R.ok(baseMapper.getList(page,goodsId,orderNumber,goodsName,condition,userName,communityId,userId));
    }
    @Override
    public R getData(String id) {
        return R.ok(baseMapper.getData(id));
    }
    @Override
    public R insertData(VolunteerCreditsExchangeVO item)
    {
        if (item==null)
        {
            return R.fail("参数不能为空");
        }
        if(StringUtils.isEmpty(item.getGoodsId()))
        {
            return R.fail("商品id不能为空");
        }
        VolunteerIntegralMerchant goods=goodsService.queryById(item.getGoodsId());
        if(goods==null)
        {
            return R.fail("商品不存在");
        }
        int integral=0;
        if(!StringUtils.isEmpty(item.getNeedScore()))
        {
            integral=Integer.valueOf(item.getNeedScore());
        }
        if(integral<Integer.valueOf(goods.getIntegral()))
        {
            return R.fail("剩余积分不足!无法下单兑换");
        }
        item.setNeedScore(goods.getIntegral());
        if(StringUtils.isEmpty(item.getUserId()))
        {
            return R.fail("兑换用户id不能为空");
        }
        //设置订单号
        item.setOrderNumber(Snowflake.getId()+"");
        int num= baseMapper.insertData(item);
        if(num>0)
        {
            return R.ok();
        }
        return R.fail("操作失败");
    }
    @Override
    public R update(VolunteerCreditsExchangeVO item)
    {
        if (item==null)
        {
            return R.fail("参数不能为空");
        }
        if(StringUtils.isEmpty(item.getGoodsId()))
        {
            return R.fail("商品id不能为空");
        }
        if(StringUtils.isEmpty(item.getNeedScore()))
        {
            return R.fail("所需积分不能为空");
        }
        if(StringUtils.isEmpty(item.getUserId()))
        {
            return R.fail("兑换用户id不能为空");
        }
        int num= baseMapper.update(item);
        if(num>0)
        {
            return R.ok();
        }
        return R.fail("操作失败");
    }
    @Override
    public R delete(String id) {
        if(StringUtils.isEmpty(id))
        {
            return R.fail("删除订单id不能为空");
        }
        int num= baseMapper.delete(id);
        if(num>0)
        {
            return R.ok();
        }
        return R.fail("操作失败");
    }
    @Override
    public R conditionData(String id)
    {
        if(StringUtils.isEmpty(id))
        {
            return R.fail("核销订单id不能为空");
        }
        int num= baseMapper.conditionData(id);
        if(num>0)
        {
            return R.ok();
        }
        return R.fail("操作失败");
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/VolunteerCreditsExchangeMapper.xml
New file
@@ -0,0 +1,211 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.panzhihua.service_community.dao.VolunteerCreditsExchangeDao">
    <resultMap type="com.panzhihua.service_community.entity.VolunteerCreditsExchange" id="VolunteerCreditsExchangeMap">
        <result property="id" column="id" />
        <result property="goodsName" column="goods_name" />
        <result property="creationTime" column="creation_time" />
        <result property="updateTime" column="update_time" />
        <result property="communityId" column="community_id" />
        <result property="orderNumber" column="order_number" />
        <result property="goodsId" column="goods_id" />
        <result property="goodsUrl" column="goods_url" />
        <result property="needScore" column="need_score" />
        <result property="userId" column="user_id" />
        <result property="condition" column="condition" />
        <result property="disposeTime" column="dispose_time" />
    </resultMap>
    <select id="getData" resultMap="VolunteerCreditsExchangeMap">
        select
            id,
            order_number,
            goods_id,
            (select vim.name from volunteer_integral_merchant as vim where vim.id=volunteer_credits_exchange.good_id) as goods_name,
            (select vim.cover_url from volunteer_integral_merchant as vim where vim.id=volunteer_credits_exchange.good_id) as goods_url,
            need_score,
            user_id,
            (select sy.name from sys_user as sy where sy.user_id=volunteer_credits_exchange.user_id) as userName,
            (select sy.phone from sys_user as sy where sy.user_id=volunteer_credits_exchange.user_id) as userPhone,
            creation_time,
            condition,
            dispose_time,
            community_id,
            update_time
        from volunteer_credits_exchange
        where volunteer_credits_exchange.id=#{id}
    </select>
    <!-- 分页查询 -->
    <select id="getList" resultMap="VolunteerCreditsExchangeMap">
        select
            id,
            order_number,
            goods_id,
            (select vim.name from volunteer_integral_merchant as vim where vim.id=volunteer_credits_exchange.good_id) as goods_name,
            (select vim.cover_url from volunteer_integral_merchant as vim where vim.id=volunteer_credits_exchange.good_id) as goods_url,
            need_score,
            user_id,
            (select sy.name from sys_user as sy where sy.user_id=volunteer_credits_exchange.user_id) as userName,
            (select sy.phone from sys_user as sy where sy.user_id=volunteer_credits_exchange.user_id) as userPhone,
            creation_time,
            condition,
            dispose_time,
            community_id,
            update_time
        from volunteer_credits_exchange
        <where>
            1=1
            <if test="goodsId!=null">
                and goods_id=#{goodsId}
            </if>
            <if test="orderNumber!=null">
                and order_number=#{orderNumber}
            </if>
            <if test="goodsName!=null">
                and goods_name=#{goodsName}
            </if>
            <if test="condition!=null">
                and volunteer_credits_exchange.condition=#{condition}
            </if>
            <if test="userName!=null">
                and ((select su.name from sys_user as su where su.user_id=volunteer_credits_exchange.user_id) like concat('%',#{userName},'%')
            </if>
            <if test="communityId!=null">
                and community_id=#{communityId}
            </if>
            <if test="userId!=null">
                and user_id=#{userId}
            </if>
        </where>
        order by creation_time desc
    </select>
    <insert id="insertData">
        insert into volunteer_credits_exchange
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="item.id != null">
                id,
            </if>
            <if test="item.goodsName != null">
                goods_name,
            </if>
            <if test="item.communityId != null">
                community_id,
            </if>
            <if test="item.orderNumber != null">
                order_number,
            </if>
            <if test="item.goodsId != null">
                goods_id,
            </if>
            <if test="item.goodsUrl != null">
                goods_url,
            </if>
            <if test="item.needScore != null">
                need_score,
            </if>
            <if test="item.userId != null">
                user_id,
            </if>
            <if test="item.condition != null">
                condition,
            </if>
            <if test="item.disposeTime != null">
                dispose_time,
            </if>
            creation_time
        </trim>
        values
        <trim prefix="("  suffix=")" suffixOverrides=",">
            <if test="item.id != null">
                id=#{item.id},
            </if>
            <if test="item.goodsName != null">
                goods_name=#{item.goodsName},
            </if>
            <if test="item.communityId != null">
                community_id=#{item.communityId},
            </if>
            <if test="item.orderNumber != null">
                #{item.orderNumber},
            </if>
            <if test="item.goodsId != null">
                #{item.goodsId},
            </if>
            <if test="item.goodsUrl != null">
                #{item.goodsUrl},
            </if>
            <if test="item.needScore != null">
                #{item.needScore},
            </if>
            <if test="item.userId != null">
                #{item.userId},
            </if>
            <if test="item.condition != null">
                #{item.condition},
            </if>
            <if test="item.disposeTime != null">
                #{item.disposeTime},
            </if>
            sysdate()
        </trim>
    </insert>
    <update id="update">
        update volunteer_credits_exchange
        <set>
            <if test="item.id != null">
                id=#{item.id},
            </if>
            <if test="item.goodsName != null">
                goods_name=#{item.goodsName},
            </if>
            <if test="item.communityId != null">
                community_id=#{item.communityId},
            </if>
            <if test="item.orderNumber != null">
                order_number=#{item.orderNumber},
            </if>
            <if test="item.goodsId != null">
                goods_id=#{item.goodsId},
            </if>
            <if test="item.goodsUrl != null">
                goods_url=#{item.goodsUrl},
            </if>
            <if test="item.needScore != null">
                need_score=#{item.needScore},
            </if>
            <if test="item.userId != null">
                user_id=#{item.userId},
            </if>
            <if test="item.condition != null">
                condition=#{item.condition},
            </if>
            <if test="item.disposeTime != null">
                dispose_time=#{item.disposeTime},
            </if>
            update_time=sysdate()
        </set>
        where id = #{item.id}
    </update>
    <update id="conditionData">
        update volunteer_credits_exchange
        set dispose_time=sysdate(),condition='1',update_time=sysdate()
        where id=#{id}
    </update>
    <delete id="delete" parameterType="String">
        delete from volunteer_credits_exchange where id=#{id}
    </delete>
</mapper>