|  |  |  | 
|---|
|  |  |  | import com.matrix.component.tools.ImageUtil; | 
|---|
|  |  |  | import com.matrix.component.tools.WxacodeUtil; | 
|---|
|  |  |  | import com.matrix.core.pojo.AjaxResult; | 
|---|
|  |  |  | import com.matrix.core.pojo.BasePageQueryDto; | 
|---|
|  |  |  | import com.matrix.core.tools.LogUtil; | 
|---|
|  |  |  | import com.matrix.core.tools.MD5Util; | 
|---|
|  |  |  | import com.matrix.core.tools.PropertiesUtil; | 
|---|
|  |  |  | import com.matrix.core.tools.StringUtils; | 
|---|
|  |  |  | import com.matrix.system.app.dto.BasePageDto; | 
|---|
|  |  |  | import com.matrix.system.common.bean.BusParameterSettings; | 
|---|
|  |  |  | import com.matrix.system.common.constance.AppConstance; | 
|---|
|  |  |  | import com.matrix.system.common.dao.BusParameterSettingsDao; | 
|---|
|  |  |  | 
|---|
|  |  |  | import com.matrix.system.fenxiao.entity.ShopSalesmanApply; | 
|---|
|  |  |  | import com.matrix.system.fenxiao.service.ShopSalesmanApplyService; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.api.WeChatApiTools; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.vo.SalesmanCenterInfo; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.vo.SalesmanVo; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import io.swagger.annotations.ApiResponse; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | ShopSalesmanApplyDao salesmanApplyDao; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | ShopSalesmanApplyService shopSalesmanApplyService; | 
|---|
|  |  |  | 
|---|
|  |  |  | public AjaxResult applyToBeAnSalesman(@RequestBody Map<String,String> param) { | 
|---|
|  |  |  | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); | 
|---|
|  |  |  | String invitationId = param.get("invitationId"); | 
|---|
|  |  |  | ShopSalesmanApply shopSalesmanApply= shopSalesmanApplyService.applyToBeAnSalesman(loginUser.getOpenId(),invitationId); | 
|---|
|  |  |  | ShopSalesmanApply shopSalesmanApply= shopSalesmanApplyService.applyToBeAnSalesman(loginUser.getOpenId(),"",invitationId,ShopSalesmanApply.APPLY_WAY_SELF); | 
|---|
|  |  |  | loginUser=bizUserDao.selectById(loginUser.getUserId()); | 
|---|
|  |  |  | redisUserLoginUtils.updateUserInfo(loginUser); | 
|---|
|  |  |  | return AjaxResult.buildSuccessInstance(shopSalesmanApply); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "      ", notes = "") | 
|---|
|  |  |  | @ApiOperation(value = "查询审核进度", notes = "") | 
|---|
|  |  |  | @ApiResponses({ | 
|---|
|  |  |  | @ApiResponse(code = 200, message = "ok", response = ShopSalesmanApply.class) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | 
|---|
|  |  |  | BufferedImage qrcordImgBuf = ImageIO.read(new File(qrcodeSavePath)); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //获取海报 | 
|---|
|  |  |  | BusParameterSettings posterSetting = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_TG_POSTER, HostInterceptor.getCompanyId()); | 
|---|
|  |  |  | BusParameterSettings posterSetting = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_TG_POSTER, loginUser.getCompanyId()); | 
|---|
|  |  |  | String posterPath=baseSavePath+"wxacode" + File.separatorChar+MD5Util.strToMD5(loginUser.getOpenId())+"poster.png"; | 
|---|
|  |  |  | ImageUtil.downloadPicture(posterSetting.getParamValue(),posterPath); | 
|---|
|  |  |  | BufferedImage posterImgBuf = ImageIO.read(new File(posterPath)); | 
|---|
|  |  |  | 
|---|
|  |  |  | BufferedImage backgroundImgBuf = new BufferedImage(700, 900, BufferedImage.TYPE_4BYTE_ABGR); | 
|---|
|  |  |  | //绘制背景+产品 | 
|---|
|  |  |  | Graphics2D g = backgroundImgBuf.createGraphics(); | 
|---|
|  |  |  | //g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, 1)); | 
|---|
|  |  |  | g.setColor(Color.WHITE); | 
|---|
|  |  |  | g.fillRect(0,0,700,900); | 
|---|
|  |  |  | g.drawImage(posterImgBuf,0,0,700, 700,null); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "获取下级列表", notes = "") | 
|---|
|  |  |  | @ApiOperation(value = "获取下级列表", notes = "keywords=1 表示下级,keywords=2表示顾客") | 
|---|
|  |  |  | @PostMapping(value = "/getInvitationuserList") | 
|---|
|  |  |  | @ApiResponses({ | 
|---|
|  |  |  | @ApiResponse(code = 200, message = "ok", response = BasePageDto.class) | 
|---|
|  |  |  | @ApiResponse(code = 200, message = "ok", response = SalesmanVo.class) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | AjaxResult getInvitationuserList(@RequestBody BasePageDto pageDto) { | 
|---|
|  |  |  | AjaxResult getInvitationuserList(@RequestBody BasePageQueryDto pageDto) { | 
|---|
|  |  |  | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); | 
|---|
|  |  |  | Page<ShopSalesmanApply> page=new Page<>(pageDto.getPageNum(),pageDto.getPageSize()); | 
|---|
|  |  |  | IPage<ShopSalesmanApply> shopSalesmanApplyIPage = salesmanApplyDao.selectInvitationuserInPage(loginUser.getOpenId(), page); | 
|---|
|  |  |  | Page<SalesmanVo> page=new Page<>(pageDto.getPageNum(),pageDto.getPageSize()); | 
|---|
|  |  |  | IPage<SalesmanVo> shopSalesmanApplyIPage = salesmanApplyDao.selectInvitationuserInPage(page, loginUser.getOpenId(),pageDto.getKeywords()); | 
|---|
|  |  |  | AjaxResult result=AjaxResult.buildSuccessInstance(shopSalesmanApplyIPage.getRecords()); | 
|---|
|  |  |  | return result; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "查询分销员中心信息", notes = "") | 
|---|
|  |  |  | @PostMapping(value = "/getSalesmanCenterInfo") | 
|---|
|  |  |  | @ApiResponses({ | 
|---|
|  |  |  | @ApiResponse(code = 200, message = "ok", response = SalesmanCenterInfo.class) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | AjaxResult getSalesmanCenterInfo() { | 
|---|
|  |  |  | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); | 
|---|
|  |  |  | SalesmanCenterInfo salesmanCenterInfo= salesmanApplyDao.selectSalesmanCenterInfo(loginUser.getOpenId()); | 
|---|
|  |  |  | return AjaxResult.buildSuccessInstance(salesmanCenterInfo); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|