From 42848c538732e7478bee6dbf57d47546bdc37a64 Mon Sep 17 00:00:00 2001
From: jyy <935090232@qq.com>
Date: Tue, 16 Mar 2021 21:25:54 +0800
Subject: [PATCH] 新增配置查询5
---
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesmanAction.java | 42 +++++++++++++++++++++++++++++++++++++++---
1 files changed, 39 insertions(+), 3 deletions(-)
diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesmanAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesmanAction.java
index a47ba98..ed74a5d 100644
--- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesmanAction.java
+++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesmanAction.java
@@ -23,6 +23,7 @@
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;
@@ -54,6 +55,7 @@
@Autowired
ShopSalesmanApplyDao salesmanApplyDao;
+
@Autowired
ShopSalesmanApplyService shopSalesmanApplyService;
@@ -74,6 +76,20 @@
return ajaxResult;
}
+ @ApiOperation(value = "查询分销商城开关", notes = "1开启分销,2关闭分销")
+ @GetMapping(value = "/getSalesMallSetting")
+ public AjaxResult getSalesMallSwith() {
+ BusParameterSettings fxSwith = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_SWITCH, HostInterceptor.getCompanyId());
+ BusParameterSettings fxModel = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_MODEL, HostInterceptor.getCompanyId());
+ AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("查询成功");
+ ajaxResult.putInMap("fxSwith",fxSwith.getParamValue());
+ ajaxResult.putInMap("fxModel",fxModel.getParamValue());
+ return ajaxResult;
+ }
+
+
+
+
@ApiOperation(value = "申请成为推广员", notes = "传入参数invitationId 邀请人openId ,非必填 例: {invitationId:openId}")
@ApiResponses({
@@ -84,10 +100,20 @@
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);
+ if(StringUtils.isNotBlank(invitationId)){
+ BizUser invitationUser = bizUserDao.findByOpenId(invitationId);
+ if(invitationUser!=null && invitationUser.getOpenId().equals(loginUser.getOpenId())) {
+ return AjaxResult.buildFailInstance("不能邀请自己成为推广员");
+ }
+ }
+
+ ShopSalesmanApply shopSalesmanApply= shopSalesmanApplyService.applyToBeAnSalesman(loginUser.getOpenId(),"",invitationId,ShopSalesmanApply.APPLY_WAY_SELF);
loginUser=bizUserDao.selectById(loginUser.getUserId());
redisUserLoginUtils.updateUserInfo(loginUser);
return AjaxResult.buildSuccessInstance(shopSalesmanApply);
+
+
+
}
@@ -100,6 +126,7 @@
BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
QueryWrapper<ShopSalesmanApply> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_id",loginUser.getOpenId());
+ queryWrapper.eq("apply_status",ShopSalesmanApply.APPLY_STATUS_DSH);
ShopSalesmanApply shopSalesmanApply = salesmanApplyDao.selectOne(queryWrapper);
return AjaxResult.buildSuccessInstance(shopSalesmanApply);
}
@@ -157,7 +184,7 @@
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));
@@ -171,7 +198,6 @@
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);
@@ -212,6 +238,16 @@
}
+ @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);
+ }
--
Gitblit v1.9.1