lidongdong
2023-08-29 4ddc5fd15120f714780f63a3e178d2e4cce5b9ac
新增商家商品模块
14个文件已修改
212 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/VolunteerActivitiesPeopleApi.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/VolunteerCreditsExchangeVO.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/VolunteerIntegralMerchantVO.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/VolunteerIntegralMerchantApi.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/VolunteerMerchantApi.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/VolunteerIntegralMerchantApi.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/VolunteerIntegralMerchantDao.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/VolunteerCreditsExchange.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/VolunteerIntegralMerchant.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/VolunteerIntegralMerchantService.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerCreditsExchangeServiceImpl.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerIntegralMerchantServiceImpl.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/VolunteerIntegralMerchantMapper.xml 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/VolunteerActivitiesPeopleApi.java
@@ -265,7 +265,7 @@
                                                @RequestParam(value = "name", required = false) String name,
                                                @RequestParam(value = "state", required = false) String state)
    {
        return volunteerActivitiesPeople.VolunteerIntegralMerchantQueryList(pageNum,pageSize,name,state);
        return volunteerActivitiesPeople.VolunteerIntegralMerchantQueryList(pageNum,pageSize,name,state,"1",null);
    }
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/VolunteerCreditsExchangeVO.java
@@ -76,4 +76,5 @@
    @ApiModelProperty(value = "核销时间")
    private String disposeTime;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/VolunteerIntegralMerchantVO.java
@@ -81,4 +81,17 @@
    private String content;
    @ApiModelProperty(value = "0 社区商品    1 商家商品")
    private String goodType;
    @ApiModelProperty(value = "商家id")
    private String merchantId;
    /**
     * 商品数量
     */
    @ApiModelProperty(value = "商品数量")
    private String goodNum;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -11495,7 +11495,9 @@
    public R VolunteerIntegralMerchantQueryList(@RequestParam("pageNum") int pageNum,
                       @RequestParam("pageSize")  int pageSize,
                       @RequestParam(value = "name", required = false) String name,
                       @RequestParam(value = "state", required = false) String state);
                       @RequestParam(value = "state", required = false) String state,
                        @RequestParam(value = "goodType", required = false) String goodType,
                        @RequestParam(value = "merchantId", required = false) String merchantId);
    /**
     * 新增
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/VolunteerIntegralMerchantApi.java
@@ -42,7 +42,7 @@
                                                @RequestParam(value = "name", required = false) String name,
                                                @RequestParam(value = "state", required = false) String state)
    {
        return merchantService.VolunteerIntegralMerchantQueryList(pageNum,pageSize,name,state);
        return merchantService.VolunteerIntegralMerchantQueryList(pageNum,pageSize,name,state,"1",null);
    }
    /**
@@ -53,12 +53,14 @@
    @PostMapping("/insertVolunteer")
    public R VolunteerIntegralMerchantInsertVolunteer(@RequestBody VolunteerIntegralMerchantVO vimVO)
    {
        vimVO.setGoodType("1");
        return merchantService.VolunteerIntegralMerchantInsertVolunteer(vimVO);
    }
    @PostMapping("/updateById")
    public R  VolunteerIntegralMerchantUpdateById(@RequestBody VolunteerIntegralMerchantVO vimVO)
    {
        vimVO.setGoodType("1");
        return merchantService.VolunteerIntegralMerchantUpdateById(vimVO);
    }
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/VolunteerMerchantApi.java
@@ -2,12 +2,17 @@
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.VolunteerIntegralMerchantVO;
import com.panzhihua.common.model.vos.community.VolunteerMerchantVO;
import com.panzhihua.common.service.community.CommunityService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
 * 路北社区商家管理
 */
@Slf4j
@RestController
@@ -66,5 +71,72 @@
        return R.ok(vtService.volunteerMerchantGetUser(getCommunityId()+"",userName,userPhone));
    }
    /******************************************************************************************************
     *
     *
     *                                     商品管理
     *
     *
     ******************************************************************************************************/
    /**
     * 获取单个详情
     * @param id
     * @return
     */
    @GetMapping("/queryById")
    public R VolunteerIntegralMerchantQueryById(@RequestParam("id") String id)
    {
        return R.ok(vtService.VolunteerIntegralMerchantQueryById(id));
    }
    /**
     * 分页查询
     * @param
     * @return
     */
    @GetMapping("/queryList")
    public R VolunteerIntegralMerchantQueryList(@RequestParam("pageNum") int pageNum,
                                                @RequestParam("pageSize")  int pageSize,
                                                @RequestParam(value = "name", required = false) String name,
                                                @RequestParam(value = "state", required = false) String state,
                                                @RequestParam(value = "merchantId", required = true) String merchantId)
    {
        return R.ok(vtService.VolunteerIntegralMerchantQueryList(pageNum,pageSize,name,state,"2",merchantId));
    }
    /**
     * 新增
     * @param
     * @return
     */
    @PostMapping("/insertVolunteer")
    public R VolunteerIntegralMerchantInsertVolunteer(@RequestBody VolunteerIntegralMerchantVO vimVO)
    {
        vimVO.setGoodType("2");
        return vtService.VolunteerIntegralMerchantInsertVolunteer(vimVO);
    }
    @PostMapping("/updateById")
    public R  VolunteerIntegralMerchantUpdateById(@RequestBody VolunteerIntegralMerchantVO vimVO)
    {
        vimVO.setGoodType("2");
        return vtService.VolunteerIntegralMerchantUpdateById(vimVO);
    }
    @PostMapping("/unmount")
    public R  VolunteerIntegralMerchantUnmount(@RequestBody VolunteerIntegralMerchantVO vimVO)
    {
        vimVO.setGoodType("2");
        return vtService.VolunteerIntegralMerchantUnmount(vimVO);
    }
    @DeleteMapping("/deleteById")
    public R  VolunteerIntegralMerchantDeleteById(@RequestParam("id") String id)
    {
        return vtService.VolunteerIntegralMerchantDeleteById(id);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/VolunteerIntegralMerchantApi.java
@@ -6,7 +6,6 @@
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.user.UserService;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_community.entity.VolunteerIntegralMerchant;
import com.panzhihua.service_community.service.VolunteerCreditsExchangeService;
@@ -16,6 +15,10 @@
import javax.annotation.Resource;
/**
 * 商品内容逻辑
 */
@Slf4j
@RestController
@RequestMapping("/VolunteerIntegralMerchant")
@@ -23,9 +26,6 @@
{
    @Resource
    private VolunteerIntegralMerchantService merchantService;
    @Resource
    private UserService userService;
    /**
     * 获取单个详情
@@ -47,10 +47,12 @@
    public R VolunteerIntegralMerchantQueryList(@RequestParam("pageNum") int pageNum,
                                                @RequestParam("pageSize")  int pageSize,
                                                @RequestParam(value = "name", required = false) String name,
                                                @RequestParam(value = "state", required = false) String state)
                                                @RequestParam(value = "state", required = false) String state,
                                                @RequestParam(value = "goodType", required = false) String goodType,
                                                @RequestParam(value = "merchantId", required = false) String merchantId)
    {
        Page page=new Page<VolunteerIntegralMerchant>(pageNum,pageSize);
        return R.ok(merchantService.queryList(page,name,state));
        return R.ok(merchantService.queryList(page,name,state,goodType,merchantId));
    }
    /**
@@ -85,6 +87,11 @@
        if(StringUtils.isEmpty(vimVO.getCommodityValue()))
        {
            return R.fail("商品价值不能为空");
        }
        if(StringUtils.isEmpty(vimVO.getGoodNum()))
        {
            return R.fail("商品数量不能为空");
        }
        int num= merchantService.insertVolunteer(vimVO);
@@ -243,10 +250,7 @@
            item.setCommunityId(userInfoVO.getCommunityId()+"");
        }
        R<LoginUserInfoVO> loginUserInfoVOR=userService.getUserInfoByUserId(userInfoVO.getUserId()+"");
        item.setUserId(userInfoVO.getUserId()+"");
        item.setNeedScore(loginUserInfoVOR.getData().getLoveIntegral());
        return vceService.insertData(item);
    }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/VolunteerIntegralMerchantDao.java
@@ -26,7 +26,10 @@
     */
    IPage<VolunteerIntegralMerchant> queryList(Page page,
                                       @Param("name") String name,
                                       @Param("state") String state);
                                       @Param("state") String state,
                                       @Param("goodType") String goodType,
                                       @Param("merchantId") String merchantId);
    /**
     * 新增
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/VolunteerCreditsExchange.java
@@ -101,5 +101,11 @@
    private String userPhone;
    /**
     * 商品数量
     */
    @ApiModelProperty(value = "商品数量")
    private String good_num;
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/VolunteerIntegralMerchant.java
@@ -81,4 +81,17 @@
    private String content;
    @ApiModelProperty(value = "0 社区商品    1 商家商品")
    private String goodType;
    @ApiModelProperty(value = "商家id")
    private String merchantId;
    /**
     * 商品数量
     */
    @ApiModelProperty(value = "商品数量")
    private String goodNum;
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/VolunteerIntegralMerchantService.java
@@ -19,7 +19,11 @@
     * @param
     * @return
     */
    IPage<VolunteerIntegralMerchant> queryList(Page page, String name, String state);
    IPage<VolunteerIntegralMerchant> queryList(Page page,
                                               String name,
                                               String state,
                                               String goodType,
                                               String merchantId);
    /**
     * 新增
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerCreditsExchangeServiceImpl.java
@@ -2,9 +2,11 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
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.VolunteerTypeVO;
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.common.utlis.Snowflake;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_community.dao.VolunteerCreditsExchangeDao;
@@ -30,6 +32,8 @@
    @Resource
    private VolunteerIntegralMerchantService goodsService;
    @Resource
    private UserService userService;
    @Override
    public R getList(int pageNum, int pageSize, String goodsId, String orderNumber,
@@ -63,10 +67,12 @@
            return R.fail("商品不存在");
        }
        LoginUserInfoVO loginUserInfoVOR=userService.getUserInfoByUserId(item.getUserId()).getData();
        int integral=0;
        if(!StringUtils.isEmpty(item.getNeedScore()))
        if(!StringUtils.isEmpty(loginUserInfoVOR.getLoveIntegral()))
        {
            integral=Integer.valueOf(item.getNeedScore());
            integral=Integer.valueOf(loginUserInfoVOR.getLoveIntegral());
        }
        if(integral<Integer.valueOf(goods.getIntegral()))
@@ -80,6 +86,10 @@
        {
            return R.fail("兑换用户id不能为空");
        }
        int num1=integral-Integer.valueOf(goods.getIntegral());
        loginUserInfoVOR.setLoveIntegral(num1+"");
        userService.putUser(loginUserInfoVOR);
        //设置订单号
        item.setOrderNumber(Snowflake.getId()+"");
@@ -128,6 +138,7 @@
            return R.fail("删除订单id不能为空");
        }
        int num= baseMapper.delete(id);
        if(num>0)
        {
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerIntegralMerchantServiceImpl.java
@@ -3,15 +3,10 @@
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.R;
import com.panzhihua.common.model.vos.community.VolunteerIntegralMerchantVO;
import com.panzhihua.common.model.vos.community.VolunteerIntegralRecordVO;
import com.panzhihua.service_community.dao.VolunteerIntegralMerchantDao;
import com.panzhihua.service_community.dao.VolunteerIntegralRecordDao;
import com.panzhihua.service_community.entity.VolunteerIntegralMerchant;
import com.panzhihua.service_community.entity.VolunteerIntegralRecord;
import com.panzhihua.service_community.service.VolunteerIntegralMerchantService;
import com.panzhihua.service_community.service.VolunteerIntegralRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@@ -28,8 +23,8 @@
    }
    @Override
    public IPage<VolunteerIntegralMerchant> queryList(Page page, String name, String state) {
        return baseMapper.queryList(page,name,state);
    public IPage<VolunteerIntegralMerchant> queryList(Page page, String name, String state,String goodType,String merchantId) {
        return baseMapper.queryList(page,name,state,goodType,merchantId);
    }
    @Override
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/VolunteerIntegralMerchantMapper.xml
@@ -13,7 +13,9 @@
        <result property="coverUrl" column="cover_url" />
        <result property="content" column="content" />
        <result property="communityId" column="community_id" />
        <result property="goodType" column="good_type" />
        <result property="merchantId" column="merchant_id" />
        <result property="goodNum" column="good_num" />
    </resultMap>
    <sql id="sql_base">
@@ -26,6 +28,9 @@
        state,
        cover_url,
        content,
        good_type,
        merchant_id,
        good_num,
        community_id
    </sql>
@@ -49,6 +54,12 @@
            </if>
            <if  test="state!=null">
                and volunteer_integral_merchant.state =#{state}
            </if>
            <if  test="goodType!=null">
                and volunteer_integral_merchant.goodtType =#{goodType}
            </if>
            <if  test="merchantId!=null">
                and volunteer_integral_merchant.merchant_id =#{merchantId}
            </if>
        </where>
        order by creation_time desc
@@ -81,6 +92,15 @@
            <if test="vimVO.content != null">
                content,
            </if>
            <if test="vimVO.goodType != null">
                 good_type,
            </if>
            <if test="vimVO.merchantId != null">
                 merchant_id,
            </if>
            <if test="vimVO.goodNum != null">
                good_num,
            </if>
            creation_time
        </trim>
        values
@@ -108,6 +128,15 @@
            </if>
            <if test="vimVO.content != null">
                #{vimVO.content},
            </if>
            <if test="vimVO.goodType != null">
                #{vimVO.goodType},
            </if>
            <if test="vimVO.merchantId != null">
                #{merchantId},
            </if>
            <if test="vimVO.goodNum != null">
                #{goodNum},
            </if>
            sysdate()
        </trim>
@@ -140,6 +169,15 @@
            <if test="vimVO.content != null">
                content=#{vimVO.content},
            </if>
            <if test="vimVO.goodType != null">
                good_type=#{vimVO.goodType},
            </if>
            <if test="vimVO.merchantId != null">
                merchant_id=#{merchantId},
            </if>
            <if test="vimVO.goodNum != null">
                good_num=#{goodNum},
            </if>
            update_time=sysdate()
        </set>
        where id = #{vimVO.id}