| | |
| | | package com.ruoyi.shop.controller.business; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.shop.domain.vo.MgtShopInfoVo; |
| | | import com.ruoyi.shop.service.shop.ShopService; |
| | | import com.ruoyi.system.api.domain.dto.MerBaseDto; |
| | | import com.ruoyi.system.api.domain.dto.MgtBaseGetDto; |
| | | import com.ruoyi.shop.domain.dto.*; |
| | | import com.ruoyi.shop.domain.pojo.shop.ShopRelUser; |
| | | import com.ruoyi.shop.domain.vo.MerAgencyPageVo; |
| | | import com.ruoyi.shop.domain.vo.MerShopCertificateListVo; |
| | | import com.ruoyi.shop.domain.vo.MerShopSuggestVo; |
| | | import com.ruoyi.shop.domain.vo.MerchantBasicdataSettlementVo; |
| | | import com.ruoyi.shop.service.shop.*; |
| | | import com.ruoyi.system.api.domain.dto.*; |
| | | import com.ruoyi.system.api.domain.poji.shop.Shop; |
| | | import com.ruoyi.system.api.domain.vo.MerHomeShopTotalVo; |
| | | import com.ruoyi.system.api.domain.vo.MerStaffInfoVo; |
| | | import com.ruoyi.system.api.domain.vo.MgtSimpleShopVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author jqs34 |
| | |
| | | public class MerShopController { |
| | | |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private ShopService shopService; |
| | | |
| | | @Resource |
| | | private ShopCertificateService shopCertificateService; |
| | | |
| | | @Resource |
| | | private ShopStaffService shopStaffService; |
| | | |
| | | @Resource |
| | | private ShopRelUserService shopRelUserService; |
| | | |
| | | @Resource |
| | | private ShopSuggestService shopSuggestService; |
| | | |
| | | /** |
| | | * 未完成实际统计 |
| | |
| | | @ApiOperation(value = "获取商户端商业统计") |
| | | public R<MerHomeShopTotalVo> getMerHomeTotal(@RequestBody MerBaseDto merBaseDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | MerHomeShopTotalVo merHomeShopTotalVo = shopService.getMerHomeTotal(userId); |
| | | merBaseDto.setUserId(userId); |
| | | MerHomeShopTotalVo merHomeShopTotalVo = shopService.getMerHomeTotal(merBaseDto); |
| | | return R.ok(merHomeShopTotalVo); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pageMerAgency", method = RequestMethod.POST) |
| | | @ApiOperation(value = "分页获取商户加盟商列表") |
| | | public R<Page<MerAgencyPageVo>> pageMerAgency(@RequestBody MerAgencyPageDto merAgencyPageDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | merAgencyPageDto.setUserId(userId); |
| | | Page<MerAgencyPageVo> page = new Page<>(); |
| | | page.setSize(merAgencyPageDto.getPageSize()); |
| | | page.setCurrent(merAgencyPageDto.getPageNum()); |
| | | List<MerAgencyPageVo> merAgencyPageVoList = shopService.pageMerAgencyVo(page,merAgencyPageDto); |
| | | return R.ok(page.setRecords(merAgencyPageVoList)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/listShopCertificate", method = RequestMethod.POST) |
| | | @ApiOperation(value = "获取商户证书列表") |
| | | public R<List<MerShopCertificateListVo>> listShopCertificate(@RequestBody MerShopCertificateListDto merShopCertificateListDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | List<MerShopCertificateListVo> merShopCertificateListVoList = shopCertificateService.listShopCertificateVo(merShopCertificateListDto); |
| | | return R.ok(merShopCertificateListVoList); |
| | | } |
| | | |
| | | @RequestMapping(value = "/editShopCertificate", method = RequestMethod.POST) |
| | | @ApiOperation(value = "编辑商户证书") |
| | | public R editShopCertificate(@RequestBody MerShopCertificateEditDto merShopCertificateEditDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | shopCertificateService.editShopCertificate(merShopCertificateEditDto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/deleteShopCertificate", method = RequestMethod.POST) |
| | | @ApiOperation(value = "删除商户证书") |
| | | public R deleteShopCertificate(@RequestBody MerBaseGetDto merBaseGetDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | shopCertificateService.deleteShopCertificate(Long.valueOf(merBaseGetDto.getId())); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/getShopStaffInfo", method = RequestMethod.POST) |
| | | @ApiOperation(value = "获取员工信息") |
| | | public R<MerStaffInfoVo> getShopStaffInfo() { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | ShopRelUser shopRelUser = shopRelUserService.getByUserId(userId); |
| | | Shop shop = shopService.getByShopId(shopRelUser.getShopId()); |
| | | MerStaffInfoVo merStaffInfoVo = shopStaffService.getShopStaffInfo(userId,shop); |
| | | return R.ok(merStaffInfoVo); |
| | | } |
| | | |
| | | @RequestMapping(value = "/editShopStaffInfo", method = RequestMethod.POST) |
| | | @ApiOperation(value = "修改员工信息") |
| | | public R editShopStaffInfo(@RequestBody MerEditUserDto merEditUserDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | merEditUserDto.setUserId(userId); |
| | | if(merEditUserDto.getEditType()!=5){ |
| | | shopStaffService.editShopStaffInfo(merEditUserDto); |
| | | }else{ |
| | | Shop shop = shopService.getByShopId(merEditUserDto.getShopId()); |
| | | String editValue = merEditUserDto.getEditValue(); |
| | | String[] editArr = editValue.split("-"); |
| | | shop.setBusinessStartTime(editArr[0]); |
| | | shop.setBusinessEndTime(editArr[1]); |
| | | shopService.saveOrUpdate(shop); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "/pageMerShopSuggest", method = RequestMethod.POST) |
| | | @ApiOperation(value = "分页获取商户建议") |
| | | public R<Page<MerShopSuggestVo>> pageMerShopSuggest(@RequestBody MerPageDto merPageDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | merPageDto.setUserId(userId); |
| | | Page<MerShopSuggestVo> page = new Page<>(); |
| | | page.setSize(merPageDto.getPageSize()); |
| | | page.setCurrent(merPageDto.getPageNum()); |
| | | List<MerShopSuggestVo> merShopSuggestVoList = shopSuggestService.pageMerShopSuggest(page,merPageDto); |
| | | return R.ok(page.setRecords(merShopSuggestVoList)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/suggest", method = RequestMethod.POST) |
| | | @ApiOperation(value = "建议") |
| | | public R suggest(@RequestBody MerShopSuggestDto merShopSuggestDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | merShopSuggestDto.setUserId(userId); |
| | | shopSuggestService.suggest(merShopSuggestDto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "/listShopByShop", method = RequestMethod.POST) |
| | | @ApiOperation(value = "获取商户下属代理商") |
| | | public R<List<MgtSimpleShopVo>> listShopByShop(@RequestBody MerBaseDto merBaseDto) |
| | | { |
| | | List<MgtSimpleShopVo> mgtShopListSimpleVos = shopService.listShopByShop(merBaseDto.getShopId()); |
| | | return R.ok(mgtShopListSimpleVos); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "/getShopMerchantBasicDataSettlement", method = RequestMethod.POST) |
| | | @ApiOperation(value = "获取提现记录(汇付天下)") |
| | | public R<List<MerchantBasicdataSettlementVo>> getMerchantBasicDataSettlement(@Validated @RequestBody MerchantBasicdataSettlementDto mgtShopShareRatioSetDto){ |
| | | return shopService.getMerchantBasicDataSettlement(mgtShopShareRatioSetDto); |
| | | } |
| | | } |