From 789c5301ba9c69f779cb0b29f22857299760a960 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Mon, 15 Mar 2021 15:51:23 +0800
Subject: [PATCH] Merge branch 'score_shop' of http://120.27.238.55:7000/r/beauty-erp into score_shop
---
zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/weixinUtil/WeixinServiceUtil.java | 18 +
zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SaleProductDto.java | 18 +
zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml | 6
zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java | 84 +++++++
zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoSettingAction.java | 3
zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanOrderDao.java | 4
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UpdateTgtpDto.java | 17 +
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesOrderAction.java | 7
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderTask.java | 1
zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/payComProtocol/JsApiPayComReqData.java | 82 +++---
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UpdateTgjhDto.java | 17 +
zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html | 191 +++++++++++-----
zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java | 34 +++
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesProductAction.java | 65 +++++
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopProduct.java | 12
zq-erp/src/test/java/com/matrix/SourceFlowTests.java | 13 +
zq-erp/src/main/java/com/matrix/system/common/actions/TestActionBB.java | 33 +++
zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesOrderVo.java | 2
18 files changed, 484 insertions(+), 123 deletions(-)
diff --git a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/payComProtocol/JsApiPayComReqData.java b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/payComProtocol/JsApiPayComReqData.java
index d38b928..45b726d 100644
--- a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/payComProtocol/JsApiPayComReqData.java
+++ b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/payComProtocol/JsApiPayComReqData.java
@@ -3,7 +3,6 @@
import com.matrix.component.wechat.externalInterface.common.RandomStringGenerator;
import com.matrix.component.wechat.externalInterface.common.Signature;
-import com.matrix.component.wechat.externalInterface.common.WechatConfigure;
import java.lang.reflect.Field;
import java.util.HashMap;
@@ -21,31 +20,29 @@
/**
* 商户号
*/
- private String mch_id = "";
+ private String mchid = "";
+
+ private String mch_appid = "";
+
/**
* 商户企业付款单号
*/
private String partner_trade_no = "";
+
/**
* 随机字符串
*/
private String nonce_str = "";
+
+
+ private String check_name = "";
+
+
/**
* 签名
*/
private String sign = "";
- /**
- * 收款方银行卡号
- */
- private String enc_bank_no = "";
- /**
- * 收款方用户名
- */
- private String enc_true_name = "";
- /**
- * 收款方开户行
- */
- private String bank_code = "";
+
/**
* 付款金额 RMB(分)
*/
@@ -54,6 +51,8 @@
* 备注
*/
private String desc = "";
+
+ private String openid = "";
public JsApiPayComReqData() {
@@ -66,58 +65,49 @@
* @param desc 描述
* @param outTradeNo 商户企业付款单号
* @param totalFee 付款金额
- * @param bankNo 银行卡号
- * @param bankTrueName 收款号姓名
* @param bankCode 收款号开户行
*/
- public JsApiPayComReqData(String mchID,String paySecret ,String desc, String outTradeNo, int totalFee, String bankNo, String bankTrueName, String bankCode) {
+ public JsApiPayComReqData(String mchID,String mch_appid,String paySecret ,String desc, String outTradeNo, int totalFee,
+ String openid, String check_name, String bankCode) {
+ setMch_appid(mch_appid);
//默认必须设置
- setMch_id(mchID);
+ setMchid(mchID);
setDesc(desc);
setPartner_trade_no(outTradeNo);
setAmount(totalFee);
+ setOpenid(openid);
+ setCheck_name(check_name);
//随机字符串,不长于32 位
setNonce_str(RandomStringGenerator.getRandomStringByLength(32));
//根据API给的签名规则进行签名 【 必须要放在本方法的最后】
String sign = Signature.getSign(toMap(),paySecret);
setSign(sign);//把签名数据设置到Sign这个属性中
-// setEnc_bank_no();
-// setEnc_true_name();
-// setBank_code();
+
}
-
- public String getMch_id() {
- return mch_id;
+ public String getMch_appid() {
+ return mch_appid;
}
- public void setMch_id(String mch_id) {
- this.mch_id = mch_id;
+ public void setMch_appid(String mch_appid) {
+ this.mch_appid = mch_appid;
}
- public String getEnc_bank_no() {
- return enc_bank_no;
+ public String getCheck_name() {
+ return check_name;
}
- public void setEnc_bank_no(String enc_bank_no) {
- this.enc_bank_no = enc_bank_no;
+ public void setCheck_name(String check_name) {
+ this.check_name = check_name;
}
- public String getEnc_true_name() {
- return enc_true_name;
+ public String getMchid() {
+ return mchid;
}
- public void setEnc_true_name(String enc_true_name) {
- this.enc_true_name = enc_true_name;
- }
-
- public String getBank_code() {
- return bank_code;
- }
-
- public void setBank_code(String bank_code) {
- this.bank_code = bank_code;
+ public void setMchid(String mchid) {
+ this.mchid = mchid;
}
public String getNonce_str() {
@@ -144,6 +134,14 @@
this.partner_trade_no = partner_trade_no;
}
+ public String getOpenid() {
+ return openid;
+ }
+
+ public void setOpenid(String openid) {
+ this.openid = openid;
+ }
+
public int getAmount() {
return amount;
}
diff --git a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/weixinUtil/WeixinServiceUtil.java b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/weixinUtil/WeixinServiceUtil.java
index 30c7d4d..5af497a 100644
--- a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/weixinUtil/WeixinServiceUtil.java
+++ b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/weixinUtil/WeixinServiceUtil.java
@@ -142,20 +142,32 @@
* @param openid
* @return
*/
- public JsApiPayComResData comPay(String desc, String outTradeNo,int totalFee, String openid){
+ public JsApiPayComResData comPay(String desc, String outTradeNo,int totalFee, String openid,Long companyId){
JsApiPayComResData result=null;
//boolean flag=false;
try {
JsApiPayBusiness jsApiPayBusiness = new JsApiPayBusiness();
// TODO 企业付款
- Long companyId=HostInterceptor.getCompanyId();
+
BusParameterSettings mchID = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_MCHID, companyId);
+ BusParameterSettings appId = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.MINIPROGRAM_APPID, companyId);
BusParameterSettings paySecret = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_SECRET, companyId);
+ BusParameterSettings certLocalPath = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_CERTLOCAL_PATH, companyId);
- JsApiPayComReqData jsApiPayComReqData=new JsApiPayComReqData(mchID.getParamValue(),paySecret.getParamValue(),"","",0,"","","");
+ JsApiPayComReqData jsApiPayComReqData=new JsApiPayComReqData(mchID.getParamValue(),
+ appId.getParamValue(),
+ paySecret.getParamValue(),
+ desc,outTradeNo,totalFee,openid,"NO_CHECK","");
JsApiPayComService jsApiPayComService=new JsApiPayComService();
+
+ HttpsRequest2 request2= (HttpsRequest2) jsApiPayComService.getServiceRequest();
+ request2.setCertLocalPath(certLocalPath.getParamValue());
+ request2.setMchId(mchID.getParamValue());
+
+
result = jsApiPayBusiness.payComOrder(jsApiPayComService, jsApiPayComReqData);
+
LogUtil.info("#提现,企业付款到个人---result:{}",result);
if (result.getResult_code().equals("SUCCESS")) {
return result;
diff --git a/zq-erp/src/main/java/com/matrix/system/common/actions/TestActionBB.java b/zq-erp/src/main/java/com/matrix/system/common/actions/TestActionBB.java
new file mode 100644
index 0000000..b4b02ed
--- /dev/null
+++ b/zq-erp/src/main/java/com/matrix/system/common/actions/TestActionBB.java
@@ -0,0 +1,33 @@
+package com.matrix.system.common.actions;
+
+import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil;
+import com.matrix.core.pojo.AjaxResult;
+import com.matrix.core.web.BaseAction;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+/**
+ * 测试一下
+ */
+@RequestMapping(value = "/testb")
+@Controller
+public class TestActionBB extends BaseAction {
+
+ @Autowired
+ WeixinServiceUtil weixinServiceUtil;
+
+
+ @GetMapping(value = "/testPay/{no}")
+ @ResponseBody
+ public AjaxResult hiveMobileLoginOut(@PathVariable String no) {
+ weixinServiceUtil.comPay("提现", no,1,"oJkRK4yelehsY4S7I6Ee1ydWtQMI",36L);
+ return AjaxResult.buildSuccessInstance("");
+ }
+
+
+
+}
\ No newline at end of file
diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoSettingAction.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoSettingAction.java
index cf487c7..3ab2680 100644
--- a/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoSettingAction.java
+++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoSettingAction.java
@@ -100,9 +100,6 @@
}
}
}
-
-
-
return result;
}
diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java
index 169a429..f0fe454 100644
--- a/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java
+++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java
@@ -10,7 +10,10 @@
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.tools.StringUtils;
import com.matrix.core.tools.WebUtil;
+import com.matrix.system.common.bean.BusParameterSettings;
import com.matrix.system.common.bean.SysUsers;
+import com.matrix.system.common.dao.BusParameterSettingsDao;
+import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant;
import com.matrix.system.fenxiao.dao.ShopSalesmanApplyDao;
import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao;
import com.matrix.system.fenxiao.dto.*;
@@ -22,9 +25,12 @@
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
+import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
+import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
@RestController
@@ -39,6 +45,8 @@
private BizUserDao bizUserDao;
@Autowired
private ShopSalesmanGradeDao shopSalesmanGradeDao;
+ @Autowired
+ private BusParameterSettingsDao busParameterSettingsDao;
/**
* 分销员详情页面信息
@@ -102,6 +110,82 @@
}
/**
+ *推广图片
+ */
+ @ApiOperation(value = "推广图片")
+ @PostMapping(value = "/updateTgtp")
+ public @ResponseBody
+ AjaxResult updateTgtp(@RequestBody UpdateTgtpDto updateTgtpDto) {
+ return shopSalesmanApplyService.updateTgtp(updateTgtpDto);
+ }
+
+ /**
+ *推广图片
+ */
+ @RequestMapping(value = "/loadTgtpSetting")
+ public AjaxResult loadTgtpSetting() {
+
+ AjaxResult result= AjaxResult.buildSuccessInstance("查询成功");
+ SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
+ Long companyId = user.getCompanyId();
+
+ //推广文案
+ String[] FXKGCode={FenxiaoSettingConstant.FX_TG_POSTER};
+ String[] FXKGName={"推广图片"};
+ List<FenXiaoSettingVo> fxkgRuleSettingsVo = getRuleSettingsVo(FXKGCode,FXKGName,companyId);
+ result.putInMap("tgtp", fxkgRuleSettingsVo.get(0));
+ return result;
+ }
+
+ /**
+ *推广计划更新
+ */
+ @ApiOperation(value = "推广计划更新")
+ @PostMapping(value = "/updateTgjh")
+ public @ResponseBody
+ AjaxResult updateTgjh(@RequestBody UpdateTgjhDto updateTgjhDto) {
+ return shopSalesmanApplyService.updateTgjh(updateTgjhDto);
+ }
+ /**
+ *查询推广计划
+ */
+ @RequestMapping(value = "/loadTgwaSetting")
+ public AjaxResult loadTgwaSetting() {
+
+ AjaxResult result= AjaxResult.buildSuccessInstance("查询成功");
+ SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
+ Long companyId = user.getCompanyId();
+
+ //推广文案
+ String[] FXKGCode={FenxiaoSettingConstant.FX_TG_PLAN};
+ String[] FXKGName={"推广文案"};
+ List<FenXiaoSettingVo> fxkgRuleSettingsVo = getRuleSettingsVo(FXKGCode,FXKGName,companyId);
+ result.putInMap("tgwa", fxkgRuleSettingsVo.get(0));
+ return result;
+ }
+
+ /**
+ *获取对应的规则设置数据
+ * @param ArrayCode
+ * @param ArrayName
+ * @param companyId
+ * @return
+ */
+ private List<FenXiaoSettingVo> getRuleSettingsVo(String[] ArrayCode,String[] ArrayName,Long companyId){
+ List<BusParameterSettings> dataList = busParameterSettingsDao.selectByCodesAndCompanyId(Arrays.asList(ArrayCode), companyId);
+ List<FenXiaoSettingVo> scoreRuleSettingsVos=new ArrayList<FenXiaoSettingVo>();
+ int index=0;
+ for (BusParameterSettings item:dataList){
+ FenXiaoSettingVo paramVo=new FenXiaoSettingVo();
+ BeanUtils.copyProperties(item,paramVo);
+ paramVo.setParamName(ArrayName[index]);
+ scoreRuleSettingsVos.add(paramVo);
+ index++;
+ }
+ return scoreRuleSettingsVos;
+ }
+
+ /**
* 分佣方案
*/
@ApiOperation(value = "查询分佣方案")
diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanOrderDao.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanOrderDao.java
index 964e9ec..ac3d1f6 100644
--- a/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanOrderDao.java
+++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanOrderDao.java
@@ -6,7 +6,7 @@
import com.matrix.system.fenxiao.entity.ShopSalesmanOrder;
import com.matrix.system.shopXcx.api.dto.SaleOrderDto;
import com.matrix.system.shopXcx.vo.SalesOrderVo;
-import io.lettuce.core.dynamic.annotation.Param;
+import org.apache.ibatis.annotations.Param;
/**
* @description 分销订单
@@ -21,6 +21,6 @@
* @param saleOrderDto
* @return
*/
- IPage<SalesOrderVo> selectSalesManOrder(Page<SalesOrderVo> page, @Param("record") SaleOrderDto saleOrderDto);
+ IPage<SalesOrderVo> selectSalesManOrder(Page<SalesOrderVo> page, @Param("record")SaleOrderDto saleOrderDto);
}
\ No newline at end of file
diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UpdateTgjhDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UpdateTgjhDto.java
new file mode 100644
index 0000000..bfb530c
--- /dev/null
+++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UpdateTgjhDto.java
@@ -0,0 +1,17 @@
+package com.matrix.system.fenxiao.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel(value = "UpdateTgjhDto", description = "参数")
+public class UpdateTgjhDto {
+
+ @ApiModelProperty(value = "方案名称")
+ private String tgfa;
+
+ @ApiModelProperty(hidden = true)
+ private Long companyId;
+
+}
diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UpdateTgtpDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UpdateTgtpDto.java
new file mode 100644
index 0000000..45c168d
--- /dev/null
+++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UpdateTgtpDto.java
@@ -0,0 +1,17 @@
+package com.matrix.system.fenxiao.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel(value = "UpdateTgjhDto", description = "参数")
+public class UpdateTgtpDto {
+
+ @ApiModelProperty(value = "方案名称")
+ private String imageUrl;
+
+ @ApiModelProperty(hidden = true)
+ private Long companyId;
+
+}
diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java
index 0530ac5..e13c1cc 100644
--- a/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java
+++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java
@@ -26,6 +26,8 @@
import com.matrix.system.fenxiao.dto.ShopSalesmanDetailDto;
import com.matrix.system.fenxiao.dto.UnbundlingSaleManDto;
import com.matrix.system.fenxiao.dto.UpdateFyfaDto;
+import com.matrix.system.fenxiao.dto.UpdateTgjhDto;
+import com.matrix.system.fenxiao.dto.UpdateTgtpDto;
import com.matrix.system.fenxiao.entity.ShopSalesmanApply;
import com.matrix.system.fenxiao.entity.ShopSalesmanGrade;
import com.matrix.system.fenxiao.vo.FyfaManageVo;
@@ -326,6 +328,14 @@
if(StrUtil.isEmpty(name)) {
return AjaxResult.buildFailInstance("请输入方案名称");
}
+ Double sealesCommission = updateFyfaDto.getSealesCommission();
+ if(StrUtil.isEmpty(sealesCommission.toString())) {
+ return AjaxResult.buildFailInstance("请输入正确的推广提成");
+ }
+ Double invitationCommission = updateFyfaDto.getInvitationCommission();
+ if(StrUtil.isEmpty(invitationCommission.toString())) {
+ return AjaxResult.buildFailInstance("请输入正确的邀请提成");
+ }
//设置用户公司ID
QueryUtil.setQueryLimitCom(updateFyfaDto);
selectById.setCompanyId(updateFyfaDto.getCompanyId());
@@ -336,6 +346,30 @@
shopSalesmanGradeDao.updateById(selectById);
return AjaxResult.buildFailInstance("操作成功");
}
+
+ @Transactional(rollbackFor = Exception.class)
+ public AjaxResult updateTgjh(UpdateTgjhDto updateTgjhDto) {
+ //设置用户公司ID
+ QueryUtil.setQueryLimitCom(updateTgjhDto);
+ //获取推广计划的Param
+ Long companyId = updateTgjhDto.getCompanyId();
+ BusParameterSettings busParameterSettings = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_TG_PLAN, companyId);
+ busParameterSettings.setParamValue3(updateTgjhDto.getTgfa());
+ busParameterSettingsDao.updateByModel(busParameterSettings);
+ return AjaxResult.buildFailInstance("保存成功");
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ public AjaxResult updateTgtp(UpdateTgtpDto updateTgtpDto) {
+ //设置用户公司ID
+ QueryUtil.setQueryLimitCom(updateTgtpDto);
+ //获取推广计划的Param
+ Long companyId = updateTgtpDto.getCompanyId();
+ BusParameterSettings busParameterSettings = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_TG_POSTER, companyId);
+ busParameterSettings.setParamValue(updateTgtpDto.getImageUrl());
+ busParameterSettingsDao.updateByModel(busParameterSettings);
+ return AjaxResult.buildFailInstance("保存成功");
+ }
diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesOrderAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesOrderAction.java
index fd85c73..87649b1 100644
--- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesOrderAction.java
+++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesOrderAction.java
@@ -18,6 +18,7 @@
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -52,15 +53,15 @@
private ShopSalesmanOrderDao shopSalesmanOrderDao;
- @ApiOperation(value = "获取下级列表", notes = "keywords=1 推广订单,keywords=2 邀请订单")
+ @ApiOperation(value = "获取推广订单", notes = "")
@PostMapping(value = "/getOrderList")
@ApiResponses({
@ApiResponse(code = 200, message = "ok", response = SalesOrderVo.class)
})
- AjaxResult getInvitationuserList(@RequestBody SaleOrderDto saleOrderDto) {
+ AjaxResult getInvitationuserList(@RequestBody @Validated SaleOrderDto saleOrderDto) {
BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
Page<SalesOrderVo> page=new Page<>(saleOrderDto.getPageNum(),saleOrderDto.getPageSize());
- if(StringUtils.isNotBlank(saleOrderDto.getSort())){
+ if(StringUtils.isBlank(saleOrderDto.getSort())){
saleOrderDto.setSort("create_time");
saleOrderDto.setOrder("desc");
}
diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesProductAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesProductAction.java
new file mode 100644
index 0000000..bdd6dff
--- /dev/null
+++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesProductAction.java
@@ -0,0 +1,65 @@
+package com.matrix.system.shopXcx.api.action;
+
+import com.matrix.core.pojo.AjaxResult;
+import com.matrix.system.common.constance.AppConstance;
+import com.matrix.system.common.interceptor.HostInterceptor;
+import com.matrix.system.shopXcx.api.dto.SaleProductDto;
+import com.matrix.system.shopXcx.bean.ShopProduct;
+import com.matrix.system.shopXcx.bean.ShopProductAttribute;
+import com.matrix.system.shopXcx.dao.ShopProductAttributeDao;
+import com.matrix.system.shopXcx.dao.ShopProductDao;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * @author jyy
+ * @date 2021-03-10
+ **/
+@Api(tags = "分销商品类")
+@RestController
+@RequestMapping(value = "/wxapi/salesProduct")
+public class WxSalesProductAction {
+
+ @Autowired
+ private ShopProductDao shopProductDao;
+
+ @Autowired
+ private ShopProductAttributeDao shopProductAttributeDao;
+
+ @ApiOperation(value = "查询推广商品", notes = "")
+ @PostMapping(value = "/getSalesProductList")
+ @ApiResponses({
+ @ApiResponse(code = 200, message = "ok", response=SaleProductDto.class)
+ })
+ public AjaxResult getShopProductShowList(@RequestBody @Validated SaleProductDto saleProductDto) {
+ ShopProduct shopProduct=new ShopProduct();
+
+ ShopProductAttribute fxsc = shopProductAttributeDao.selectByCode("fxsc", HostInterceptor.getCompanyId());
+ shopProduct.setLimit(saleProductDto.getPageSize());
+ shopProduct.setOffset(saleProductDto.getPageNum()* saleProductDto.getPageSize());
+ shopProduct.setDelFlag(AppConstance.DATA_USEABLE);
+ shopProduct.setStatus(AppConstance.IS_PUTAWAY);
+ shopProduct.setCompanyId(HostInterceptor.getCompanyId());
+ shopProduct.setAttrs(fxsc.getAttrId()+"");
+ List<ShopProduct> shopProducts = shopProductDao.selectByModelWx(shopProduct);
+ AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, shopProducts);
+ return result;
+ }
+
+
+
+
+
+
+
+}
diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopProduct.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopProduct.java
index 6023fa5..3e3e4d5 100644
--- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopProduct.java
+++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopProduct.java
@@ -1,18 +1,15 @@
package com.matrix.system.shopXcx.api.action;
-import com.matrix.core.pojo.AjaxResult;
-import com.matrix.core.pojo.PaginationVO;
-import com.matrix.core.tools.StringUtils;
import com.matrix.biz.bean.BizUser;
-import com.matrix.system.common.bean.CustomerDataDictionary;
-import com.matrix.system.common.dao.CustomerDataDictionaryDao;
import com.matrix.component.redis.RedisUserLoginUtils;
+import com.matrix.core.pojo.AjaxResult;
+import com.matrix.core.tools.StringUtils;
import com.matrix.system.common.constance.AppConstance;
-
+import com.matrix.system.common.dao.CustomerDataDictionaryDao;
import com.matrix.system.common.interceptor.HostInterceptor;
+import com.matrix.system.shopXcx.api.service.WxShopCouponService;
import com.matrix.system.shopXcx.bean.*;
import com.matrix.system.shopXcx.dao.*;
-import com.matrix.system.shopXcx.api.service.WxShopCouponService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@@ -93,7 +90,6 @@
List<ShopProductAttrRef> shopProductAttrRefs = shopProductAttrRefDao.selectByPid(id);
List<ShopProductImg> shopProductImgs = shopProductImgDao.selectByPid(id);
List<ShopSku> shopSkus = shopSkuDao.selectByPid(id);
-// List<ShopSku> shopSkus = shopSkuDao.selectByPidAndShopid(id, shopId);
List<ShopProductParamRef> shopProductParamRefs = shopProductParamRefDao.selectByPid(id);
shopProduct.setAttrRefs(shopProductAttrRefs);
shopProduct.setProductImgs(shopProductImgs);
diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SaleProductDto.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SaleProductDto.java
new file mode 100644
index 0000000..ffd1375
--- /dev/null
+++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SaleProductDto.java
@@ -0,0 +1,18 @@
+package com.matrix.system.shopXcx.api.dto;
+
+import com.matrix.core.pojo.BasePageQueryDto;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel(value = "SaleProductDto", description = "分销产品查询参数接收类")
+public class SaleProductDto extends BasePageQueryDto {
+
+ @ApiModelProperty(value = "产品分类", example = "1")
+ private Integer categoryId;
+
+
+
+
+}
diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderTask.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderTask.java
index d7f846c..b8adbf2 100644
--- a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderTask.java
+++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderTask.java
@@ -93,6 +93,7 @@
ShopOrder order = shopOrderDao.selectById(Integer.valueOf(orderId));
//获取订单详情
List<ShopOrderDetails> orderDetails = shopOrderDetailsDao.selectByOrderId(Integer.valueOf(orderId));
+ order.setDetails(orderDetails);
//处理分销订单
handleExtensionOrder(order);
diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesOrderVo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesOrderVo.java
index 8e837b5..69de0e7 100644
--- a/zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesOrderVo.java
+++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesOrderVo.java
@@ -5,6 +5,7 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
+import javax.validation.constraints.NotNull;
import java.util.Date;
@Data
@@ -34,6 +35,7 @@
@ApiModelProperty(value = "订单金额")
private Double orderMoney;
+
@ApiModelProperty(value = " 收益类型1,推广收益,2邀请收益")
private Integer revenueType;
diff --git a/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml b/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml
index be1fdff..ead840d 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml
@@ -55,10 +55,12 @@
where
a.sales_user_id=#{record.userId}
and a.revenue_type=#{record.revenueType}
- <if test="orderStatus!=null" >
+ <if test="record.orderStatus!=null" >
and a.order_status=#{record.orderStatus}
</if>
- order by #{record.sort} #{record.order}
+ <if test="record.sort!=null and record.order!=null" >
+ order by ${record.sort} ${record.order}
+ </if>
</select>
diff --git a/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html b/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html
index ddfd73b..cc2ebb2 100644
--- a/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html
+++ b/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html
@@ -29,6 +29,29 @@
margin: 0px 0px 10px 0px;
text-align: right;
}
+ .avatar-uploader .el-upload {
+ border: 1px dashed #d9d9d9;
+ border-radius: 6px;
+ cursor: pointer;
+ position: relative;
+ overflow: hidden;
+ }
+ .avatar-uploader .el-upload:hover {
+ border-color: #409EFF;
+ }
+ .avatar-uploader-icon {
+ font-size: 28px;
+ color: #8c939d;
+ width: 178px;
+ height: 178px;
+ line-height: 178px;
+ text-align: center;
+ }
+ .avatar {
+ width: 178px;
+ height: 178px;
+ display: block;
+ }
</style>
</head>
@@ -76,7 +99,7 @@
type="selection">
</el-table-column>
<el-table-column
- label="分销员">
+ label="分销员" width="120">
<template slot-scope="scope">
<img :src="scope.row.avatarUrl" width="40" height="40" class="head_pic"/>
{{scope.row.nickname}}
@@ -84,11 +107,11 @@
</el-table-column>
<el-table-column
prop="parentUser"
- label="邀请人" width="100">
+ label="邀请人">
</el-table-column>
<el-table-column
prop="lowerLevelNum"
- label="下级客户数" width="100">
+ label="下级客户数">
</el-table-column>
<el-table-column
prop="totalRevenue"
@@ -164,14 +187,14 @@
prop="sealesCommission"
label="推广提成 %">
<template slot-scope="scope">
- <el-input class="edit-input" v-model="scope.row.sealesCommission" oninput ="value=value.replace(/[^0-9.]/g,'')" placeholder="推广提成 %"></el-input>
+ <el-input class="edit-input" v-model="scope.row.sealesCommission" oninput ="value=value.replace(/[^0-9.]/g,'')" placeholder="推广提成"></el-input>
</template>
</el-table-column>
<el-table-column
prop="invitationCommission"
label="邀请提成 %">
<template slot-scope="scope">
- <el-input class="edit-input" v-model="scope.row.invitationCommission" oninput ="value=value.replace(/[^0-9.]/g,'')" placeholder="邀请提成 %"></el-input>
+ <el-input class="edit-input" v-model="scope.row.invitationCommission" oninput ="value=value.replace(/[^0-9.]/g,'')" placeholder="邀请提成"></el-input>
</template>
</el-table-column>
<el-table-column
@@ -206,34 +229,32 @@
</el-tab-pane>
<el-tab-pane label="推广文案" name="third">
- <el-row>
- <script style="width: 100%; height: 500px" id="description" name="description"
- type="text/plain"></script>
+ <p class="el-big-title">文案描述</p>
+ <el-row justify="center" type="flex">
+ <script style="height: 400px;width: 375px;" id="description" name="description"
+ type="text/plain">
+ </script>
</el-row>
<el-row justify="center" type="flex">
- <el-button type="primary" @click="submit()">保存</el-button>
+ <el-button type="primary" size="mini" @click="wamsSubmit()">保存</el-button>
</el-row>
</el-tab-pane>
- <el-tab-pane label="分享图片上传" name="fourth">
- <el-row>
- <div class="ibox-content">
- <form class="form-horizontal" id="dataform"
- onsubmit="javascripr:return false;">
- <div class="form-group">
- <label class="col-sm-2 control-label">门店照片</label>
- <div class="col-sm-8">
- <input autocomplete="off" v-model="fxtp.paramValue" name="shopImag" id="info6"
- class="form-control upload-input" type="text" /> <a
- class="btn btn-primary radius upload-a">选择图片
- </a>
- </div>
- </div>
- <el-row justify="center" type="flex">
- <el-button type="primary" @click="submittp(paramValue)">保存</el-button>
- </el-row>
- </form>
- </div>
+ <el-tab-pane label="推广图片" name="fourth">
+ <p class="el-big-title">上传图片</p>
+ <el-row justify="center" type="flex">
+ <el-upload
+ class="avatar-uploader"
+ action="/admin/multipleUploadFile/doUpload"
+ :show-file-list="false"
+ :on-success="handleAvatarSuccess"
+ :before-upload="beforeAvatarUpload">
+ <img v-if="imageUrl" :src="imageUrl" class="avatar">
+ <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+ </el-upload>
+ </el-row>
+ <el-row justify="center" type="flex">
+ <el-button type="primary" size="mini" @click="tgtpSubmit()">保存</el-button>
</el-row>
</el-tab-pane>
@@ -253,20 +274,19 @@
<script>
//百度编辑器
- MUI.initImgUpload(".upload-input");
- var ue = {};
+ var ue = {
+ initialFrameWidth :750
+ };
var app = new Vue({
el: '#app',
data: {
height:'calc(100vh - 240px)',
- fxy:[],
- fenxiaoGrade: "",
- tgwa: "",
activeName: 'first',
- multipleSelection: [],
- fxtp:{},
- mdjf:[],
- scjf:[],
+ fenxiaoGrade: "",
+ //推广文案
+ tgwa: {},
+ //图片上传
+ imageUrl: '',
//分佣方案
fyfaList:{
rows:[],
@@ -274,7 +294,6 @@
pageSize:10,
currentPage:1,
},
-
//分销员管理
shenheAgreeType : 2,
shenheDisagreeType : 3,
@@ -300,16 +319,12 @@
pageSize:10,
currentPage:1,
},
- height:'calc(100vh - 240px)',
},
-
created: function () {
this.loadInfo();
window.addEventListener("keydown", this.keydown);
//初始化编辑器
ue = UE.getEditor('description');
- //百度编辑器
- MUI.initImgUpload(".upload-input");
},
mounted: function () {
},
@@ -319,25 +334,84 @@
let _this = this;
_this.loadParamSetting();
_this.loadFyfaSetting();
+ _this.loadTgwaSetting();
+ _this.loadTgtpSetting();
_this.getSalemanGradeList();
},
- submittp(paramValue) {
- alert(paramValue);
+ //推广文案
+ loadTgwaSetting() {
+ let _this = this;
+ AjaxProxy.requst({
+ app: _this,
+ data:[],
+ url: basePath + '/fenXiao/fenXiaoUser/loadTgwaSetting',
+ callback: function (data) {
+ _this.tgwa = data.mapInfo.tgwa;
+ var ue = UE.getEditor('description');
+ ue.ready(function() {//编辑器初始化完成再赋值
+ ue.setContent(_this.tgwa.paramValue3); //赋值给UEditor
+ });
+ }
+ });
},
- toggleSelection(rows) {
- if (rows) {
- rows.forEach(row => {
- this.$refs.multipleTable.toggleRowSelection(row);
- });
- } else {
- this.$refs.multipleTable.clearSelection();
+ wamsSubmit(){
+ let _this = this;
+ let tgfa = ue.getContent();
+ let data= {
+ tgfa:tgfa,
+ };
+ AjaxProxy.requst({
+ app: _this,
+ data:data,
+ url: basePath + '/fenXiao/fenXiaoUser/updateTgjh',
+ callback: function (data) {
+ _this.$message.success(data.info);
+ _this.loadTgwaSetting();
+ }
+ });
+ },
+ //图片上传
+ loadTgtpSetting() {
+ let _this = this;
+ AjaxProxy.requst({
+ app: _this,
+ data:[],
+ url: basePath + '/fenXiao/fenXiaoUser/loadTgtpSetting',
+ callback: function (data) {
+ _this.imageUrl = data.mapInfo.tgtp.paramValue;
+ }
+ });
+ },
+ tgtpSubmit(){
+ let _this = this;
+ let imageUrl = _this.imageUrl;
+ let data= {
+ imageUrl:imageUrl,
+ };
+ AjaxProxy.requst({
+ app: _this,
+ data:data,
+ url: basePath + '/fenXiao/fenXiaoUser/updateTgtp',
+ callback: function (data) {
+ _this.$message.success(data.info);
+ _this.loadTgtpSetting();
+ }
+ });
+ },
+ handleAvatarSuccess(res, file) {
+ this.imageUrl = URL.createObjectURL(file.raw);
+ },
+ beforeAvatarUpload(file) {
+ const isJPG = file.type === 'image/jpeg';
+ const isLt2M = file.size / 1024 / 1024 < 2;
+
+ if (!isJPG) {
+ this.$message.error('上传头像图片只能是 JPG 格式!');
}
- },
- handleSelectionChange(val) {
- this.multipleSelection = val;
- },
- handleClick(row) {
- console.log(row);
+ if (!isLt2M) {
+ this.$message.error('上传头像图片大小不能超过 2MB!');
+ }
+ return isJPG && isLt2M;
},
//分佣方案
loadFyfaSetting() {
@@ -614,9 +688,6 @@
_this.loadParamSetting();
}
});
- },
-
- submit() {
}
}
})
diff --git a/zq-erp/src/test/java/com/matrix/SourceFlowTests.java b/zq-erp/src/test/java/com/matrix/SourceFlowTests.java
index 9d6d51a..11b72f6 100644
--- a/zq-erp/src/test/java/com/matrix/SourceFlowTests.java
+++ b/zq-erp/src/test/java/com/matrix/SourceFlowTests.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.matrix.component.rabbitmq.RabiitMqTemplate;
+import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil;
import com.matrix.config.RabbitMqConfig;
import com.matrix.core.tools.StringUtils;
import com.matrix.system.fenxiao.dao.ShopSalesmanApplyDao;
@@ -54,6 +55,18 @@
@Autowired
RabiitMqTemplate rabiitMqTemplate;
+@Autowired
+WeixinServiceUtil weixinServiceUtil;
+
+ /**
+ * 企业付款到个人
+ * @throws InterruptedException
+ */
+ @Test
+ public void testPay() throws InterruptedException {
+ weixinServiceUtil.comPay("提现","TX123",1,"oJkRK4yelehsY4S7I6Ee1ydWtQMI",36L);
+ }
+
/**
--
Gitblit v1.9.1