| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.binarywang.wxpay.bean.ecommerce.ApplymentsResult; |
| | | import com.github.binarywang.wxpay.bean.ecommerce.ApplymentsStatusResult; |
| | | import com.github.binarywang.wxpay.bean.profitsharingV3.ProfitSharingReceiver; |
| | | import com.github.binarywang.wxpay.exception.WxPayException; |
| | | import com.ruoyi.common.core.constant.CacheConstants; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | |
| | | |
| | | @Resource |
| | | private RemoteUserService remoteUserService; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取商户详情 |
| | |
| | | mgtBasePlatformDto.setUserIdList(userIds); |
| | | shopIds = shopMapper.listShopIdByTotal(mgtBasePlatformDto); |
| | | Shop shop = this.getShopByBelongUserId(userId); |
| | | shopIds.add(shop.getShopId()); |
| | | userIds.add(userId); |
| | | if(shop!=null){ |
| | | shopIds.add(shop.getShopId()); |
| | | userIds.add(userId); |
| | | } |
| | | }else { |
| | | //普通员工查询商户归属的shopId |
| | | Shop shop = this.getShopByBelongUserId(userId); |
| | | |
| | | shopIds.add(shop.getShopId()); |
| | | } |
| | | //分别查询 |
| | | StaffHomeShopTotalVo staffHomeShopTotalVo = shopMapper.getStaffHomeTotal(userIds); |
| | | Integer shopTaskCount = shopTaskService.getShopIngTotal(shopIds); |
| | | StaffHomeShopTotalVo staffHomeShopTotalVo = new StaffHomeShopTotalVo(); |
| | | if(userIds!=null&&!userIds.isEmpty()){ |
| | | staffHomeShopTotalVo = shopMapper.getStaffHomeTotal(userIds); |
| | | }else{ |
| | | staffHomeShopTotalVo.setShopTotal(0); |
| | | staffHomeShopTotalVo.setAgencyTotal(0); |
| | | staffHomeShopTotalVo.setDealerTotal(0); |
| | | } |
| | | Integer shopTaskCount = 0; |
| | | if(shopIds!=null&&!shopIds.isEmpty()){ |
| | | shopTaskService.getShopIngTotal(shopIds); |
| | | } |
| | | staffHomeShopTotalVo.setFollowMember(0); |
| | | staffHomeShopTotalVo.setNewMember(0); |
| | | staffHomeShopTotalVo.setShopTask(shopTaskCount); |
| | |
| | | Shop shop = this.getByShopId(shopAuthentication.getShopId()); |
| | | |
| | | if(mgtShopAuthDto.getBlBusinessFoeverFlag()!=null&&mgtShopAuthDto.getBlBusinessFoeverFlag()==1){ |
| | | mgtShopAuthDto.setBlBusinessDeanline(mgtShopAuthDto.getBlBusinessStartTime()+",长期"); |
| | | mgtShopAuthDto.setBlBusinessDeanline("长期"); |
| | | } |
| | | if(mgtShopAuthDto.getLpIcForeverFlag()!=null&&mgtShopAuthDto.getLpIcForeverFlag()==1){ |
| | | mgtShopAuthDto.setLpIcEndDate("长期"); |
| | |
| | | applymentsResult = wechatPayUtils.ecommerceApply(shopAuthentication,applyNumber,shop); |
| | | } catch (Exception e) { |
| | | log.debug("-----"+shop.getShopId()+":进件异常-----"); |
| | | throw new RuntimeException(e); |
| | | throw new ServiceException(e.getMessage()); |
| | | } |
| | | shopAuthentication.setAuditStatus(3); |
| | | shopAuthenticationService.saveOrUpdate(shopAuthentication); |
| | |
| | | }else { |
| | | userIdList.add(userId); |
| | | } |
| | | return shopMapper.getStaffSimpleTotal(userIdList); |
| | | StaffShopSimpleTotalVo shopTotal = shopMapper.getStaffSimpleTotal(1,userIdList); |
| | | StaffShopSimpleTotalVo agencyTotal = shopMapper.getStaffSimpleTotal(2,userIdList); |
| | | shopTotal.setAgencyTotal(agencyTotal.getShopTotal()); |
| | | shopTotal.setOpenAgencyTotal(agencyTotal.getOpenShopTotal()); |
| | | shopTotal.setCloseAgencyTotal(agencyTotal.getCloseAgencyTotal()); |
| | | return shopTotal; |
| | | } |
| | | |
| | | /** |
| | |
| | | List<ExtendContactsVo> extendContactsVoList = staffShopECEditDto.getExtendContactsVoList(); |
| | | if(extendContactsVoList!=null&&!extendContactsVoList.isEmpty()){ |
| | | extendContacts = JSON.toJSONString(extendContactsVoList); |
| | | }else{ |
| | | extendContacts = ""; |
| | | } |
| | | shop.setExtendContacts(extendContacts); |
| | | shop.setShopId(staffShopECEditDto.getShopId()); |
| | |
| | | public StaffShopDetailVo getShopDetail(Long shopId){ |
| | | ShopDetail shopDetail = shopDetailService.getById(shopId); |
| | | StaffShopDetailVo staffShopDetailVo = new StaffShopDetailVo(); |
| | | BeanUtils.copyProperties(shopDetail, staffShopDetailVo); |
| | | if(shopDetail!=null){ |
| | | BeanUtils.copyProperties(shopDetail, staffShopDetailVo); |
| | | //处理联系人 |
| | | 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); |
| | | } |
| | | //归属客户 |
| | | Shop shop = this.getByShopId(shopId); |
| | | Long belongUserId = shop.getBelongUserId(); |
| | |
| | | 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; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @description |
| | | * @author jqs |
| | | * @date 2023/8/23 9:44 |
| | | * @param |
| | | * @return void |
| | | */ |
| | | @Override |
| | | public void addProfitSharingReceiver(ProfitSharingReceiver profitSharingReceiver){ |
| | | try { |
| | | ProfitSharingReceiver result = wechatPayUtils.addProfitSharingReceiver(profitSharingReceiver); |
| | | } catch (WxPayException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |