| | |
| | | @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); |
| | | } |
| | | |
| | | |
| | |
| | | @ApiModelProperty(value = "核销时间") |
| | | private String disposeTime; |
| | | |
| | | |
| | | } |
| | |
| | | private String content; |
| | | |
| | | |
| | | @ApiModelProperty(value = "0 社区商品 1 商家商品") |
| | | private String goodType; |
| | | |
| | | @ApiModelProperty(value = "商家id") |
| | | private String merchantId; |
| | | |
| | | |
| | | /** |
| | | * 商品数量 |
| | | */ |
| | | @ApiModelProperty(value = "商品数量") |
| | | private String goodNum; |
| | | |
| | | } |
| | |
| | | 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); |
| | | |
| | | /** |
| | | * 新增 |
| | |
| | | @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); |
| | | } |
| | | |
| | | /** |
| | |
| | | @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); |
| | | } |
| | | |
| | |
| | | |
| | | 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 |
| | |
| | | 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); |
| | | } |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | |
| | | /** |
| | | * 商品内容逻辑 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/VolunteerIntegralMerchant") |
| | |
| | | { |
| | | @Resource |
| | | private VolunteerIntegralMerchantService merchantService; |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | /** |
| | | * 获取单个详情 |
| | |
| | | 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)); |
| | | } |
| | | |
| | | /** |
| | |
| | | if(StringUtils.isEmpty(vimVO.getCommodityValue())) |
| | | { |
| | | return R.fail("商品价值不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(vimVO.getGoodNum())) |
| | | { |
| | | return R.fail("商品数量不能为空"); |
| | | } |
| | | |
| | | int num= merchantService.insertVolunteer(vimVO); |
| | |
| | | item.setCommunityId(userInfoVO.getCommunityId()+""); |
| | | } |
| | | |
| | | R<LoginUserInfoVO> loginUserInfoVOR=userService.getUserInfoByUserId(userInfoVO.getUserId()+""); |
| | | |
| | | item.setUserId(userInfoVO.getUserId()+""); |
| | | item.setNeedScore(loginUserInfoVOR.getData().getLoveIntegral()); |
| | | return vceService.insertData(item); |
| | | } |
| | | |
| | |
| | | */ |
| | | 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); |
| | | |
| | | |
| | | /** |
| | | * 新增 |
| | |
| | | private String userPhone; |
| | | |
| | | |
| | | /** |
| | | * 商品数量 |
| | | */ |
| | | @ApiModelProperty(value = "商品数量") |
| | | private String good_num; |
| | | |
| | | } |
| | | |
| | |
| | | private String content; |
| | | |
| | | |
| | | @ApiModelProperty(value = "0 社区商品 1 商家商品") |
| | | private String goodType; |
| | | |
| | | @ApiModelProperty(value = "商家id") |
| | | private String merchantId; |
| | | |
| | | |
| | | /** |
| | | * 商品数量 |
| | | */ |
| | | @ApiModelProperty(value = "商品数量") |
| | | private String goodNum; |
| | | |
| | | } |
| | |
| | | * @param |
| | | * @return |
| | | */ |
| | | IPage<VolunteerIntegralMerchant> queryList(Page page, String name, String state); |
| | | IPage<VolunteerIntegralMerchant> queryList(Page page, |
| | | String name, |
| | | String state, |
| | | String goodType, |
| | | String merchantId); |
| | | |
| | | /** |
| | | * 新增 |
| | |
| | | |
| | | 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; |
| | |
| | | @Resource |
| | | private VolunteerIntegralMerchantService goodsService; |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @Override |
| | | public R getList(int pageNum, int pageSize, String goodsId, String orderNumber, |
| | |
| | | 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())) |
| | |
| | | { |
| | | return R.fail("兑换用户id不能为空"); |
| | | } |
| | | |
| | | int num1=integral-Integer.valueOf(goods.getIntegral()); |
| | | loginUserInfoVOR.setLoveIntegral(num1+""); |
| | | userService.putUser(loginUserInfoVOR); |
| | | |
| | | //设置订单号 |
| | | item.setOrderNumber(Snowflake.getId()+""); |
| | |
| | | return R.fail("删除订单id不能为空"); |
| | | } |
| | | |
| | | |
| | | int num= baseMapper.delete(id); |
| | | if(num>0) |
| | | { |
| | |
| | | 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; |
| | | |
| | |
| | | } |
| | | |
| | | @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 |
| | |
| | | <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"> |
| | |
| | | state, |
| | | cover_url, |
| | | content, |
| | | good_type, |
| | | merchant_id, |
| | | good_num, |
| | | community_id |
| | | </sql> |
| | | |
| | |
| | | </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 |
| | |
| | | <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 |
| | |
| | | </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> |
| | |
| | | <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} |