| | |
| | | import com.ruoyi.shop.domain.dto.*; |
| | | import com.ruoyi.shop.domain.pojo.shop.*; |
| | | import com.ruoyi.shop.domain.pojo.task.ShopFile; |
| | | import com.ruoyi.shop.domain.pojo.task.ShopTask; |
| | | import com.ruoyi.shop.domain.vo.*; |
| | | import com.ruoyi.shop.enums.WxApplyMentStateEnum; |
| | | import com.ruoyi.shop.mapper.shop.ShopMapper; |
| | |
| | | |
| | | @Resource |
| | | private WechatPayUtils wechatPayUtils; |
| | | |
| | | @Resource |
| | | private ShopDetailService shopDetailService; |
| | | |
| | | @Resource |
| | | private RemoteUserService remoteUserService; |
| | | |
| | | /** |
| | | * 获取商户详情 |
| | |
| | | public void mgtShopAuth(MgtShopAuthDto mgtShopAuthDto) throws WxPayException { |
| | | ShopAuthentication shopAuthentication = shopAuthenticationService.getById(mgtShopAuthDto.getAuthId()); |
| | | Shop shop = this.getByShopId(shopAuthentication.getShopId()); |
| | | String applyNumber = IdUtils.simpleUUID(); |
| | | |
| | | if(mgtShopAuthDto.getBlBusinessFoeverFlag()!=null&&mgtShopAuthDto.getBlBusinessFoeverFlag()==1){ |
| | | mgtShopAuthDto.setBlBusinessDeanline(mgtShopAuthDto.getBlBusinessStartTime()+",长期"); |
| | | } |
| | |
| | | mgtShopAuthDto.setLpIcEndDate("长期"); |
| | | } |
| | | BeanUtils.copyProperties(mgtShopAuthDto , shopAuthentication); |
| | | shopAuthentication.setApplyNumber(applyNumber); |
| | | String applyNumber = shopAuthentication.getApplyNumber(); |
| | | if(StringUtils.isBlank(applyNumber)){ |
| | | applyNumber = IdUtils.simpleUUID(); |
| | | shopAuthentication.setApplyNumber(applyNumber); |
| | | } |
| | | ApplymentsResult applymentsResult; |
| | | try { |
| | | applymentsResult = wechatPayUtils.ecommerceApply(shopAuthentication,applyNumber,shop); |
| | |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description 修改店铺详细资料 |
| | | * @author jqs |
| | | * @date 2023/8/22 14:51 |
| | | * @param staffShopDetailDto |
| | | * @return void |
| | | */ |
| | | @Override |
| | | public void editShopDetail(StaffShopDetailDto staffShopDetailDto){ |
| | | ShopDetail shopDetail = shopDetailService.getById(staffShopDetailDto.getShopId()); |
| | | if(shopDetail == null){ |
| | | shopDetail = new ShopDetail(); |
| | | shopDetail.setDelFlag(0); |
| | | } |
| | | BeanUtils.copyProperties(staffShopDetailDto, shopDetail); |
| | | List<StaffCustomerDto> staffCustomerDtoList = staffShopDetailDto.getStaffCustomerDtoList(); |
| | | if(staffCustomerDtoList!=null&&!staffCustomerDtoList.isEmpty()){ |
| | | StringJoiner customerNameSJ = new StringJoiner(","); |
| | | StringJoiner customerMobileSJ = new StringJoiner(","); |
| | | for(StaffCustomerDto staffCustomerDto : staffCustomerDtoList){ |
| | | customerNameSJ.add(staffCustomerDto.getCustomerName()); |
| | | customerMobileSJ.add(staffCustomerDto.getCustomerMobile()); |
| | | } |
| | | shopDetail.setCustomerName(customerNameSJ.toString()); |
| | | shopDetail.setCustomerMobile(customerMobileSJ.toString()); |
| | | } |
| | | shopDetailService.saveOrUpdate(shopDetail); |
| | | } |
| | | |
| | | /** |
| | | * @description 获取店铺详细资料 |
| | | * @author jqs |
| | | * @date 2023/8/22 16:15 |
| | | * @param shopId |
| | | * @return StaffShopDetailVo |
| | | */ |
| | | @Override |
| | | public StaffShopDetailVo getShopDetail(Long shopId){ |
| | | ShopDetail shopDetail = shopDetailService.getById(shopId); |
| | | StaffShopDetailVo staffShopDetailVo = new StaffShopDetailVo(); |
| | | BeanUtils.copyProperties(shopDetail, staffShopDetailVo); |
| | | //归属客户 |
| | | Shop shop = this.getByShopId(shopId); |
| | | Long belongUserId = shop.getBelongUserId(); |
| | | if(belongUserId!=null){ |
| | | SysUser sysUser = remoteUserService.getSysUser(belongUserId).getData(); |
| | | if(sysUser!=null){ |
| | | staffShopDetailVo.setBelongUser(sysUser.getNickName()); |
| | | } |
| | | } |
| | | //最近任务时间 |
| | | ShopTask shopTask = shopTaskService.getLastTask(shopId); |
| | | if(shopTask!=null){ |
| | | staffShopDetailVo.setNextTaskDate(shopTask.getTaskDate()); |
| | | } |
| | | //处理联系人 |
| | | String customerName = shopDetail.getCustomerName(); |
| | | String customerMobile = shopDetail.getCustomerMobile(); |
| | | List<StaffCustomerDto> staffCustomerDtoList = new ArrayList<>(); |
| | | String[] customerNameArr = customerName.split(","); |
| | | String[] customerMobileArr = customerMobile.split(","); |
| | | staffShopDetailVo.setContactName(customerNameArr[0]); |
| | | StaffCustomerDto staffCustomerDto; |
| | | for(int i=0;i<customerNameArr.length;i++){ |
| | | staffCustomerDto = new StaffCustomerDto(); |
| | | staffCustomerDto.setCustomerName(customerNameArr[i]); |
| | | staffCustomerDto.setCustomerMobile(customerMobileArr[i]); |
| | | staffCustomerDtoList.add(staffCustomerDto); |
| | | } |
| | | staffShopDetailVo.setStaffCustomerDtoList(staffCustomerDtoList); |
| | | return staffShopDetailVo; |
| | | } |
| | | } |