Merge branch 'score_shop' of http://120.27.238.55:7000/r/beauty-erp into score_shop
9 files modified
1 files added
| | |
| | | .project |
| | | .classpath |
| | | .settings |
| | | .metadata |
| | | .metadata |
| | | .gitignore |
| | |
| | | import com.matrix.biz.dao.BizUserDao; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | 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.constance.AppConstance; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant; |
| | | import com.matrix.system.fenxiao.service.FenXiaoSettingService; |
| | | import com.matrix.system.fenxiao.vo.FenXiaoSettingVo; |
| | | import com.matrix.system.hive.bean.ShoppingGoods; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.hive.dao.ShoppingGoodsDao; |
| | | import com.matrix.system.shopXcx.bean.ShopProduct; |
| | | import com.matrix.system.shopXcx.dao.ShopProductDao; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | @Autowired |
| | | private BizUserDao bizUserDao; |
| | | |
| | | @Autowired |
| | | private ShopProductDao shopProductDao; |
| | | |
| | | /** |
| | | *查询分销配置 |
| | |
| | | idsList.add(parseInt); |
| | | } |
| | | } |
| | | List<ShoppingGoods> list = shoppingGoodsDao.selectByIds(idsList); |
| | | result.putInMap("order", list); |
| | | //List<ShoppingGoods> list = shoppingGoodsDao.selectByIds(idsList); |
| | | List<ShopProduct> shopProducts = shopProductDao.selectByIds(idsList); |
| | | result.putInMap("order", shopProducts); |
| | | } |
| | | } |
| | | }else{ |
| | | List<ShopProduct> shopProducts = new ArrayList<>(); |
| | | result.putInMap("order", shopProducts); |
| | | } |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 列表显示 |
| | | */ |
| | | @RequestMapping(value = "/selectProduct") |
| | | public @ResponseBody |
| | | AjaxResult selectProduct(ShopProduct shopProduct, PaginationVO pageVo) { |
| | | QueryUtil.setQueryLimitCom(shopProduct); |
| | | pageVo.setSort("createTime"); |
| | | pageVo.setOrder("desc"); |
| | | shopProduct.setDelFlag(AppConstance.DATA_USEABLE); |
| | | shopProduct.setCompanyId(shopProduct.getCompanyId()); |
| | | List<ShopProduct> dataList = shopProductDao.selectInPage(shopProduct, pageVo); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, |
| | | shopProductDao.selectTotalRecord(shopProduct)); |
| | | return result; |
| | | |
| | | } |
| | | |
| | | /** |
| | | *获取对应的规则设置数据 |
| | | * @param ArrayCode |
| | | * @param ArrayName |
| | |
| | | |
| | | BizUser loginUser=bizUserDao.findByOpenId(openId); |
| | | //验证申请条件 |
| | | VerificationResult verificationResult = isAbleToBeAnSalesman(openId); |
| | | VerificationResult verificationResult = isAbleToBeAnSalesman(openId,loginUser.getCompanyId()); |
| | | if(verificationResult.isJudgeResult()){ |
| | | //校验审核状态,和是否重复发起 |
| | | QueryWrapper<ShopSalesmanApply> queryWrapper = new QueryWrapper<>(); |
| | |
| | | /** |
| | | * 判断是否满足申请成为分销员的条件 |
| | | */ |
| | | public VerificationResult isAbleToBeAnSalesman(String openId) { |
| | | BizUser bizUser = bizUserDao.findByOpenId(openId); |
| | | public VerificationResult isAbleToBeAnSalesman(String openId,Long companyId) { |
| | | |
| | | VerificationResult verificationResult=null; |
| | | //申请条件 |
| | | BusParameterSettings applyCondition = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_APPLY_CONDITION, bizUser.getCompanyId()); |
| | | BusParameterSettings applyCondition = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_APPLY_CONDITION, companyId); |
| | | switch (applyCondition.getParamValue()){ |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_WTJ: |
| | | VerificationResult.buildVerificationResult(true); |
| | | break; |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFZDCP: |
| | | VerificationResult.buildVerificationResult(true); |
| | | int buyZdcpCount= shopOrderV2Dao.countBuyZdcp(openId,applyCondition.getParamValue1()); |
| | |
| | | }else{ |
| | | verificationResult= VerificationResult.buildVerificationResult(false,"不符合申请条件,请消费指定产品后再申请!"); |
| | | } |
| | | |
| | | break; |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFRYCP: |
| | | //判断用户是否有确认收货的产品 |
| | | int receivedOrderCount= shopOrderV2Dao.selectReceivedOrderCount(openId); |
| | |
| | | }else{ |
| | | verificationResult= VerificationResult.buildVerificationResult(false,"不符合申请条件,请消费任意产品后再申请!"); |
| | | } |
| | | break; |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_XCZDJE: |
| | | Double zdje=Double.parseDouble(applyCondition.getParamValue2()); |
| | | Double yxfje=shopOrderV2Dao.countOrderAmount(openId); |
| | |
| | | verificationResult= VerificationResult.buildVerificationResult(false,"不符合申请条件,请消费满"+zdje+"元后再申请!"); |
| | | } |
| | | VerificationResult.buildVerificationResult(true); |
| | | break; |
| | | default: |
| | | VerificationResult.buildVerificationResult(true); |
| | | |
| | | } |
| | | return verificationResult; |
| | | } |
| | |
| | | import com.matrix.component.tools.WxacodeUtil; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | import com.matrix.core.pojo.VerificationResult; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.MD5Util; |
| | | import com.matrix.core.tools.PropertiesUtil; |
| | |
| | | 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.dao.ShopProductDao; |
| | | import com.matrix.system.shopXcx.vo.SalesmanApplyCondition; |
| | | import com.matrix.system.shopXcx.vo.SalesmanCenterInfo; |
| | | import com.matrix.system.shopXcx.vo.SalesmanVo; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.File; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author wzy |
| | |
| | | private BizUserDao bizUserDao; |
| | | @Autowired |
| | | WeChatApiTools weChatApiTools; |
| | | |
| | | @Autowired |
| | | ShopProductDao shopProductDao; |
| | | |
| | | |
| | | @ApiOperation(value = "查询推广计划", notes = "") |
| | | @GetMapping(value = "/getTgPlan") |
| | |
| | | return AjaxResult.buildSuccessInstance(salesmanCenterInfo); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询分销员申请条件", notes = "") |
| | | @PostMapping(value = "/getSalesmanApplyCondition") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = SalesmanApplyCondition.class) |
| | | }) |
| | | AjaxResult getSalesmanApplyCondition() { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | VerificationResult ableToBeAnSalesman = shopSalesmanApplyService.isAbleToBeAnSalesman(loginUser.getOpenId(),loginUser.getCompanyId()); |
| | | SalesmanApplyCondition applyConditionInfo=new SalesmanApplyCondition(); |
| | | applyConditionInfo.setIsAbleApply(ableToBeAnSalesman.isJudgeResult()); |
| | | applyConditionInfo.setMsg(ableToBeAnSalesman.getMsg()); |
| | | |
| | | //申请条件 |
| | | BusParameterSettings applyCondition = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_APPLY_CONDITION, loginUser.getCompanyId()); |
| | | switch (applyCondition.getParamValue()){ |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_WTJ: |
| | | applyConditionInfo.setCondition("无条件"); |
| | | break; |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFZDCP: |
| | | applyConditionInfo.setCondition("消费指定产品确认收货"); |
| | | List<String> strings = StringUtils.strToColl(applyCondition.getParamValue1(), ","); |
| | | applyConditionInfo.setProductList( |
| | | shopProductDao.selectByIds( |
| | | strings.stream().map(i -> Integer.parseInt(i + "")).collect(Collectors.toList()))); |
| | | break; |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFRYCP: |
| | | //判断用户是否有确认收货的产品 |
| | | applyConditionInfo.setCondition("消费任意产品确认收货"); |
| | | break; |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_XCZDJE: |
| | | Double zdje=Double.parseDouble(applyCondition.getParamValue2()); |
| | | applyConditionInfo.setCondition("消费满"+zdje+"元确认收货"); |
| | | applyConditionInfo.setMinAmount(zdje); |
| | | } |
| | | |
| | | return AjaxResult.buildSuccessInstance(applyConditionInfo); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.matrix.system.shopXcx.bean.ShopOrder; |
| | | import com.matrix.system.shopXcx.bean.ShopProduct; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @description 订单表 |
| | |
| | | |
| | | /** 统计是否消费过了指定产品 */ |
| | | int countBuyZdcp(@Param("openId") String openId, @Param("productIds")String productIds); |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.shopXcx.vo; |
| | | |
| | | import com.matrix.system.shopXcx.bean.ShopProduct; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "SalesmanApplyCondition", description = " 销售员申请条件") |
| | | public class SalesmanApplyCondition { |
| | | |
| | | @ApiModelProperty(value = "是否满足申请条件") |
| | | private Boolean isAbleApply; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "申请条件") |
| | | private String condition; |
| | | |
| | | @ApiModelProperty(value = "条件验证结果") |
| | | private String msg; |
| | | |
| | | |
| | | @ApiModelProperty(value = "产品信息") |
| | | private List<ShopProduct> productList; |
| | | |
| | | |
| | | @ApiModelProperty(value = "最底消费金额") |
| | | private Double minAmount ; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | ( SELECT COUNT(*) FROM biz_user |
| | | WHERE parent_open_id = a.user_id AND is_sales = 1 ) invitedNum, |
| | | ( SELECT IFNULL(sum(IFNULL(amount, 0)), 0) FROM shop_salesman_order |
| | | WHERE user_id = a.user_id AND order_status = 2 AND sales_user_id = a.user_id ) totalRevenue, |
| | | WHERE order_status = 2 AND sales_user_id = a.user_id ) totalRevenue, |
| | | ( SELECT IFNULL(sum(IFNULL(amount, 0)), 0) FROM shop_salesman_order |
| | | WHERE user_id = a.user_id AND order_status = 1 AND sales_user_id = a.user_id ) balance, |
| | | WHERE order_status = 1 AND sales_user_id = a.user_id ) balance, |
| | | a.create_time createTime, |
| | | a.apply_status applyStatus, |
| | | a.apply_way applyWay |
| | |
| | | callback: function (data) { |
| | | _this.orderLevelList.rows = data.rows; |
| | | _this.orderLevelList.total = data.total; |
| | | _this.loadFenxiaoOrderBasic(); |
| | | } |
| | | }); |
| | | }, |
| | |
| | | callback: function (data) { |
| | | _this.fxyList.rows = data.rows; |
| | | _this.fxyList.total = data.total; |
| | | _this.loadFenxiaoOrderBasic(); |
| | | } |
| | | }); |
| | | }, |
| | |
| | | <div class="ibox-content" id="app" v-cloak> |
| | | <el-form label-width="120px" > |
| | | <el-row> |
| | | <p class="el-big-title">分享设置</p> |
| | | <p class="el-big-title">分销设置</p> |
| | | </el-row> |
| | | <el-row style="margin-top: 20px;"> |
| | | <el-col> |
| | |
| | | |
| | | |
| | | <el-drawer |
| | | title="业绩设置" |
| | | title="分销产品" |
| | | :visible.sync="drawer" |
| | | :direction="direction" |
| | | size="90%" |
| | |
| | | width="50"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="code" |
| | | label="产品编号" |
| | | width="100"> |
| | | prop="id" |
| | | label="ID"> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="name" |
| | | |
| | | prop="title" |
| | | label="产品名称"> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="sealPice" |
| | | label="售价"> |
| | | prop="price" |
| | | label="价格"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="goodType" |
| | | label="类型"> |
| | | prop="score" |
| | | label="积分"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="cateName" |
| | | label="分类"> |
| | | prop="attrValues" |
| | | label="产品属性"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="是否上架"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.status == 1">是</span> |
| | | <span v-if="scope.row.status == 2">否</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | width="150" |
| | |
| | | :stripe="true" |
| | | :border="true" |
| | | :height="tableHeight" |
| | | :data="order.items" |
| | | :data="order" |
| | | style="width: 100%"> |
| | | <el-table-column |
| | | type="index" |
| | | width="50"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="shoppingGoods.code" |
| | | label="产品编号" |
| | | width="100"> |
| | | prop="id" |
| | | width="280" |
| | | label="产品ID"> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="shoppingGoods.name" |
| | | prop="title" |
| | | width="280" |
| | | label="产品名称"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="shoppingGoods.goodType" |
| | | prop="attrValues" |
| | | width="80" |
| | | label="产品类型"> |
| | | label="产品属性"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="shoppingGoods.sealPice" |
| | | prop="price" |
| | | label="单价"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="address" |
| | | label="操作"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="primary" v-if="order.statu!='欠款'" |
| | | <el-button type="primary" |
| | | size="mini" |
| | | @click="removeItem(scope.$index, scope.row)">删除 |
| | | </el-button> |
| | |
| | | //业绩设置框 |
| | | drawer: false, |
| | | direction: 'rtl', |
| | | order: { |
| | | items: [ |
| | | ], |
| | | }, |
| | | order: [], |
| | | tableHeight: 500, |
| | | /*****搜索表格数据*********/ |
| | | //搜索关键词 |
| | |
| | | } |
| | | _this.shfs = data.mapInfo.shfs; |
| | | _this.sqtj = data.mapInfo.sqtj; |
| | | //_this.order.items = data.mapInfo.order; |
| | | //console.log(_this.order.items); |
| | | _this.order = data.mapInfo.order; |
| | | } |
| | | }); |
| | | }, |
| | |
| | | |
| | | //判断是否被选中 |
| | | let selected = false; |
| | | this.order.items.forEach(item => { |
| | | if (item.shoppingGoods.id == goods.id) { |
| | | for(let i = 0; i < this.order.length; i++){ |
| | | if (this.order[i].id === goods.id) { |
| | | selected = true; |
| | | return; |
| | | } |
| | | }); |
| | | } |
| | | if (!selected) { |
| | | //未选中产品加入列表 |
| | | let item = {}; |
| | | item.shoppingGoods = goods; |
| | | item.ShopProduct = goods; |
| | | item.goodsId = goods.id; |
| | | item.count = 1; |
| | | this.order.items.push(item); |
| | | this.order.push(item.ShopProduct); |
| | | } |
| | | |
| | | }, |
| | |
| | | submitOrder(submitType) { |
| | | let _this = this; |
| | | let submitDate =""; |
| | | for (let i = 0; i < _this.order.items.length; i++) { |
| | | let goods = _this.order.items[i]; |
| | | let goodsId = goods.goodsId; |
| | | for (let i = 0; i < _this.order.length; i++) { |
| | | let ShopProduct = _this.order[i]; |
| | | let goodsId = ShopProduct.id; |
| | | submitDate = submitDate +goodsId+","; |
| | | } |
| | | _this.cpid = submitDate; |
| | | _this.drawer = false |
| | | _this.drawer = false; |
| | | }, |
| | | /** |
| | | * 批量选择产品 |
| | | */ |
| | | chouseGoods() { |
| | | let _this = this; |
| | | // this.multipleSelection.forEach(item => { |
| | | // _this.pushToSelectGoods(item, BUY_TYPE_NOT_FREE); |
| | | // }); |
| | | this.closeXm(); |
| | | }, |
| | | /** |
| | | * 行点击事件 |
| | | */ |
| | | handleClickTableRow(row, event, column) { |
| | | this.$refs.dataTable.toggleRowSelection(row); |
| | | this.pushToSelectGoods(row); |
| | | }, |
| | | /** |
| | | * 删除组合产品 |
| | | */ |
| | | removeItem(index, row) { |
| | | this.order.items.splice(index, 1); |
| | | this.order.splice(index, 1); |
| | | }, |
| | | |
| | | |
| | | /** |
| | | * 搜索项目绑定的产品信息 |
| | | */ |
| | |
| | | contentType: 'application/x-www-form-urlencoded', |
| | | //TODO 优化下拉加载 |
| | | data: {name: _this.queryKey, limit: 10000}, |
| | | url: basePath + "/admin/shoppinggoods/showList", |
| | | url: basePath + "/fenXiao/ruleSetting/selectProduct", |
| | | callback: function (data) { |
| | | _this.searchTableData = data.rows; |
| | | _this.loading = false; |