Merge branch 'score_shop' of http://120.27.238.55:7000/r/beauty-erp into score_shop
16 files added
1 files renamed
32 files modified
| | |
| | | import com.matrix.biz.dao.BizUserDao; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 批量设置为销售员 |
| | | * @param ids |
| | | * @param status 1=销售员,0=普通用户 |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/setUserSales") |
| | | @ResponseBody |
| | | public AjaxResult setUserSales(String ids,Integer status){ |
| | | List<String> userIds = StringUtils.strToCollToString(ids, ","); |
| | | bizUserDao.updateSalesByIds(userIds,status); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS,"修改成功"); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | 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 企业付款 |
New file |
| | |
| | | package com.matrix.core.pojo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 通用的验证返回参数 |
| | | */ |
| | | @Data |
| | | public class VerificationResult { |
| | | |
| | | private boolean judgeResult; |
| | | |
| | | private String msg; |
| | | |
| | | private Object info; |
| | | |
| | | private VerificationResult(){ |
| | | |
| | | } |
| | | |
| | | public static VerificationResult buildVerificationResult(boolean judgeResult){ |
| | | VerificationResult obj=new VerificationResult(); |
| | | obj.judgeResult =judgeResult; |
| | | return obj ; |
| | | } |
| | | |
| | | |
| | | public static VerificationResult buildVerificationResult(boolean judgeResult,String msg){ |
| | | VerificationResult obj=new VerificationResult(); |
| | | obj.judgeResult =judgeResult; |
| | | obj.msg=msg; |
| | | return obj ; |
| | | } |
| | | |
| | | |
| | | public static VerificationResult buildVerificationResult(boolean judgeResult,Object info){ |
| | | VerificationResult obj=new VerificationResult(); |
| | | obj.judgeResult =judgeResult; |
| | | obj.info=info; |
| | | return obj ; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.matrix.core.tools; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.Random; |
| | | import java.util.UUID; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | | import com.matrix.core.exception.GlobleException; |
| | | import net.sourceforge.pinyin4j.PinyinHelper; |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; |
| | |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType; |
| | | import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.*; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | | /** |
| | | * 字符串操作类,转换数据类型,切割字符串,对象比较等操作 |
| | |
| | | return sb.toString(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 用逗号分开的存的id是否包含对应的id 如比较 123,123,124 中是否包含12这个主键 比对的方法是 字符串中是否包含"^12$" |
| | | * "^12,.*" 或者 ".+,12$" 或者 ".+,12,$" 或者 ".+,12,.+" 字符串 |
New file |
| | |
| | | package com.matrix.system.fenxiao.action; |
| | | |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.fenxiao.dto.ChangeSaleManGradeDto; |
| | | import com.matrix.system.fenxiao.dto.LoadFenxiaoOrderBasicDto; |
| | | import com.matrix.system.fenxiao.dto.LoadFenxiaoOrderListDto; |
| | | import com.matrix.system.fenxiao.dto.LoadSetOrderListDtoDto; |
| | | import com.matrix.system.fenxiao.dto.UpdateSetOrderDoneDto; |
| | | import com.matrix.system.fenxiao.service.ShopSalesmanOrderService; |
| | | import com.matrix.system.fenxiao.vo.LoadFenxiaoOrderBasicVo; |
| | | import com.matrix.system.fenxiao.vo.LoadFenxiaoOrderListVo; |
| | | import com.matrix.system.fenxiao.vo.LoadSetOrderListDtoVo; |
| | | |
| | | 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.web.bind.annotation.*; |
| | | |
| | | @RestController |
| | | @RequestMapping(value = "/fenXiao/fenXiaoOrder") |
| | | public class FenXiaoOrderAction { |
| | | |
| | | @Autowired |
| | | private ShopSalesmanOrderService shopSalesmanOrderService; |
| | | |
| | | /** |
| | | * 分销订单基本信息 |
| | | */ |
| | | @ApiOperation(value = "分销订单基本信息") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "OK", response = LoadFenxiaoOrderBasicVo.class) |
| | | }) |
| | | @PostMapping(value = "/loadFenxiaoOrderBasic") |
| | | public @ResponseBody |
| | | AjaxResult loadFenxiaoOrderBasic(@RequestBody LoadFenxiaoOrderBasicDto loadFenxiaoOrderBasicDto) { |
| | | return shopSalesmanOrderService.loadFenxiaoOrderBasic(loadFenxiaoOrderBasicDto); |
| | | } |
| | | |
| | | /** |
| | | * 分销订单 |
| | | */ |
| | | @ApiOperation(value = "分销订单") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "OK", response = LoadFenxiaoOrderListVo.class) |
| | | }) |
| | | @PostMapping(value = "/loadFenxiaoOrderList") |
| | | public @ResponseBody |
| | | AjaxResult loadFenxiaoOrderList(@RequestBody LoadFenxiaoOrderListDto loadFenxiaoOrderListDto) { |
| | | return shopSalesmanOrderService.loadFenxiaoOrderList(loadFenxiaoOrderListDto); |
| | | } |
| | | |
| | | /** |
| | | *批量结算分销订单 |
| | | */ |
| | | @ApiOperation(value = "批量结算分销订单") |
| | | @PostMapping(value = "/updateSetOrderDone") |
| | | public @ResponseBody |
| | | AjaxResult updateSetOrderDone(@RequestBody UpdateSetOrderDoneDto updateSetOrderDoneDto) { |
| | | return shopSalesmanOrderService.updateSetOrderDone(updateSetOrderDoneDto); |
| | | } |
| | | |
| | | /** |
| | | * 结算记录 |
| | | */ |
| | | @ApiOperation(value = "分销订单") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "OK", response = LoadSetOrderListDtoVo.class) |
| | | }) |
| | | @PostMapping(value = "/loadSetOrderList") |
| | | public @ResponseBody |
| | | AjaxResult loadSetOrderList(@RequestBody LoadSetOrderListDtoDto loadSetOrderListDto) { |
| | | return shopSalesmanOrderService.loadSetOrderList(loadSetOrderListDto); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.matrix.system.fenxiao.action; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.matrix.biz.dao.BizUserDao; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | |
| | | 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.dao.ShoppingGoodsDao; |
| | | 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; |
| | | |
| | | import com.matrix.system.hive.bean.ShoppingGoods; |
| | | import com.matrix.system.hive.dao.ShoppingGoodsDao; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | 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.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | @RestController |
| | | @RequestMapping(value = "/fenXiao/ruleSetting") |
| | |
| | | result.putInMap("sqtj", sqtjRuleSettingsVo); |
| | | if(CollUtil.isNotEmpty(sqtjRuleSettingsVo)){ |
| | | for(FenXiaoSettingVo fenXiaoSettingVo : sqtjRuleSettingsVo) { |
| | | if("3".equals(fenXiaoSettingVo.getParamValue())) { |
| | | //选择申请条件条件3时,获得选中产品集合 |
| | | if(FenxiaoSettingConstant.FX_APPLY_CONDITION_XFZDCP.equals(fenXiaoSettingVo.getParamValue())) { |
| | | String paramValue1 = fenXiaoSettingVo.getParamValue1(); |
| | | if(StrUtil.isNotEmpty(paramValue1)) { |
| | | List<Integer> idsList = new ArrayList<>(); |
| | |
| | | AjaxResult addSaleManApply(@RequestBody AddSaleManApplyDto addSaleManApplyDto) { |
| | | String gradeId = addSaleManApplyDto.getGradeId(); |
| | | if(StrUtil.isBlankOrUndefined(gradeId)) { |
| | | return AjaxResult.buildSuccessInstance("请选择分销等级"); |
| | | return AjaxResult.buildFailInstance("请选择分销等级"); |
| | | } |
| | | ShopSalesmanGrade selectById = shopSalesmanGradeDao.selectById(Long.parseLong(gradeId)); |
| | | if(ObjectUtil.isEmpty(selectById)) { |
| | | return AjaxResult.buildSuccessInstance("请选择分销等级"); |
| | | return AjaxResult.buildFailInstance("请选择分销等级"); |
| | | } |
| | | |
| | | //设置用户公司ID |
| | |
| | | */ |
| | | public final static String FX_APPLY_CONDITION = "FX_APPLY_CONDITION"; |
| | | /** |
| | | * 申请条件 1 无条件 |
| | | */ |
| | | public final static String FX_APPLY_CONDITION_WTJ = "1"; |
| | | /** |
| | | * 申请条件 1 消费任意产品 |
| | | */ |
| | | public final static String FX_APPLY_CONDITION_XFRYCP = "2"; |
| | | /** |
| | | * 申请条件 1 消费指定产品 |
| | | */ |
| | | public final static String FX_APPLY_CONDITION_XFZDCP = "3"; |
| | | /** |
| | | * 申请条件 1 消费指定金额 |
| | | */ |
| | | public final static String FX_APPLY_CONDITION_XCZDJE = "4"; |
| | | /** |
| | | * 推广计划 |
| | | */ |
| | | public final static String FX_TG_PLAN = "FX_TG_PLAN"; |
| | |
| | | package com.matrix.system.fenxiao.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.system.fenxiao.entity.ShopRevenueFlow; |
| | | import com.matrix.system.shopXcx.api.dto.RevenueFlowDto; |
| | | import com.matrix.system.shopXcx.vo.SalesOrderVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @description 收益流水 |
| | |
| | | */ |
| | | public interface ShopRevenueFlowDao extends BaseMapper<ShopRevenueFlow> { |
| | | |
| | | IPage<SalesOrderVo> selectRevenuFlowList(Page<SalesOrderVo> page, @Param("record") RevenueFlowDto revenueFlowDto); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.system.fenxiao.dto.LoadFenxiaoOrderListDto; |
| | | import com.matrix.system.fenxiao.dto.LoadSetOrderListDtoDto; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanOrder; |
| | | import com.matrix.system.fenxiao.vo.LoadFenxiaoOrderBasicVo; |
| | | import com.matrix.system.fenxiao.vo.LoadFenxiaoOrderListVo; |
| | | import com.matrix.system.fenxiao.vo.LoadSetOrderListDtoVo; |
| | | import com.matrix.system.shopXcx.api.dto.SaleOrderDto; |
| | | import com.matrix.system.shopXcx.vo.SalesOrderVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | */ |
| | | IPage<SalesOrderVo> selectSalesManOrder(Page<SalesOrderVo> page, @Param("record")SaleOrderDto saleOrderDto); |
| | | |
| | | LoadFenxiaoOrderBasicVo selectFenxiaoOrderBasicByCompanyId(@Param("companyId")Long companyId); |
| | | |
| | | IPage<LoadFenxiaoOrderListVo> findFenxiaoOrderList(Page<LoadFenxiaoOrderListVo> page, |
| | | @Param("record")LoadFenxiaoOrderListDto loadFenxiaoOrderListDto); |
| | | |
| | | IPage<LoadSetOrderListDtoVo> findSetOrderList(Page<LoadSetOrderListDtoVo> page, |
| | | @Param("record")LoadSetOrderListDtoDto loadSetOrderListDto); |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | @ApiModelProperty(value ="会员OPENID") |
| | | private String userId; |
| | | |
| | | @ApiModelProperty(value ="申请记录ID") |
| | | private Long applyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "LoadFenxiaoOrderBasicDto", description = "查询参数") |
| | | public class LoadFenxiaoOrderBasicDto { |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dto; |
| | | |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel(value = "LoadFenxiaoOrderListDto", description = "查询参数") |
| | | public class LoadFenxiaoOrderListDto extends BasePageQueryDto { |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | @ApiModelProperty(value ="订单状态") |
| | | private Integer ddType; |
| | | |
| | | @ApiModelProperty(value ="结算状态") |
| | | private Integer orderType; |
| | | |
| | | @ApiModelProperty(value ="客户名称") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty(value ="推广员名称") |
| | | private String tgy; |
| | | |
| | | @ApiModelProperty(value ="开始时间") |
| | | private Date startTime; |
| | | |
| | | @ApiModelProperty(value ="结束时间") |
| | | private Date endTime; |
| | | |
| | | @ApiModelProperty(value ="结算编号") |
| | | private String jsbh; |
| | | |
| | | @ApiModelProperty(value ="订单号") |
| | | private String ddh; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dto; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "LoadSetOrderListDtoDto", description = "查询参数") |
| | | public class LoadSetOrderListDtoDto extends BasePageQueryDto { |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | @ApiModelProperty(value ="会员姓名") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty(value ="开始时间") |
| | | private Date startTime; |
| | | |
| | | @ApiModelProperty(value ="结束时间") |
| | | private Date endTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "UpdateSetOrderDoneDto", description = "查询参数") |
| | | public class UpdateSetOrderDoneDto { |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | @ApiModelProperty(value ="需要处理的IDs(字符串逗号隔开)") |
| | | private String orderIds; |
| | | |
| | | @ApiModelProperty(value ="结算方式1,线下结算,2余额结算") |
| | | private Integer setType; |
| | | |
| | | @ApiModelProperty(value ="结算人数") |
| | | private Integer manCount; |
| | | |
| | | @ApiModelProperty(value ="结算单数") |
| | | private Integer orderCount; |
| | | |
| | | @ApiModelProperty(value ="结算金额") |
| | | private Double amount; |
| | | |
| | | @ApiModelProperty(value ="备注") |
| | | private String remark; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.matrix.core.anotations.Extend; |
| | | import com.matrix.system.score.entity.BaseEntity; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | |
| | | @Extend |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | /** |
| | | * 推广收益类型 推广收益 |
| | | */ |
| | | public static final String TYPE_TGSY = "推广收益"; |
| | | /** |
| | | * 推广收益类型 邀请收益 |
| | | */ |
| | | |
| | | public static final String TYPE_YQSY = "邀请收益"; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private String userId; |
| | | |
| | | /** |
| | | * 收益说明 |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value = "收益说明") |
| | | private String revenueContent; |
| | | |
| | | /** |
| | | * 收益金额 |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value = "收益金额") |
| | | private Double amount; |
| | | |
| | | /** |
| | | * 原始订单ID |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value = "原始订单ID") |
| | | private Long businessId; |
| | | |
| | | /** |
| | | * 公司ID |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | |
| | |
| | | public class ShopSalemanSettlement extends BaseEntity { |
| | | @Extend |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 结算编号头部编码 |
| | | */ |
| | | public static final String ORDERNO_START = "J"; |
| | | |
| | | /** |
| | | * 结算方式 1 线下结算 |
| | | */ |
| | | public static final Integer SETTLEMENTWAY_XXJS = 1; |
| | | |
| | | /** |
| | | * 结算方式 2 微信余额结算 |
| | | */ |
| | | public static final Integer SETTLEMENTWAY_YEJS = 2; |
| | | |
| | | |
| | | /** |
| | |
| | | package com.matrix.system.fenxiao.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.biz.dao.BizUserDao; |
| | | import com.matrix.biz.service.BizUserService; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.VerificationResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | |
| | | 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.ChangeSaleManGradeDto; |
| | | import com.matrix.system.fenxiao.dto.DelFyfaApplyDto; |
| | | import com.matrix.system.fenxiao.dto.DelSaleManGradeApplyDto; |
| | | import com.matrix.system.fenxiao.dto.FyfaManageDto; |
| | | import com.matrix.system.fenxiao.dto.ShopSalesmanAppliingDto; |
| | | import com.matrix.system.fenxiao.dto.ShopSalesmanApplyDto; |
| | | 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.dto.*; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanApply; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanGrade; |
| | | import com.matrix.system.fenxiao.vo.FyfaManageVo; |
| | | import com.matrix.system.fenxiao.vo.SalesmanBasicDetailVo; |
| | | import com.matrix.system.fenxiao.vo.ShopCustomDetailVo; |
| | | import com.matrix.system.fenxiao.vo.ShopOrderDetailVo; |
| | | import com.matrix.system.fenxiao.vo.ShopSalesmanAppliingVo; |
| | | import com.matrix.system.fenxiao.vo.ShopSalesmanApplyVo; |
| | | import com.matrix.system.fenxiao.vo.ShopSalesmanGradeVo; |
| | | import com.matrix.system.fenxiao.vo.*; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | |
| | | import com.matrix.system.shopXcx.dao.ShopOrderV2Dao; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | @Autowired |
| | | BizUserService bizUserService; |
| | | |
| | | @Autowired |
| | | ShopOrderV2Dao shopOrderV2Dao; |
| | | |
| | | /** |
| | | * 申请成为推广员 |
| | | * @param openId |
| | |
| | | public ShopSalesmanApply applyToBeAnSalesman(String openId,String gradeId,String invitationId,int applyWay) { |
| | | |
| | | BizUser loginUser=bizUserDao.findByOpenId(openId); |
| | | //校验审核状态,和是否重复发起 |
| | | QueryWrapper<ShopSalesmanApply> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("user_id",loginUser.getOpenId()); |
| | | queryWrapper.in("apply_status",Arrays.asList("1,2".split(","))); |
| | | ShopSalesmanApply checkApply = shopSalesmanApplyDao.selectOne(queryWrapper); |
| | | if(checkApply==null|| |
| | | checkApply.getApplyStatus()==ShopSalesmanApply.APPLY_STATUS_WTG){ |
| | | //验证申请条件 |
| | | VerificationResult verificationResult = isAbleToBeAnSalesman(openId); |
| | | if(verificationResult.isJudgeResult()){ |
| | | //校验审核状态,和是否重复发起 |
| | | QueryWrapper<ShopSalesmanApply> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("user_id",loginUser.getOpenId()); |
| | | queryWrapper.in("apply_status",Arrays.asList("1,2".split(","))); |
| | | ShopSalesmanApply checkApply = shopSalesmanApplyDao.selectOne(queryWrapper); |
| | | if(checkApply==null|| |
| | | checkApply.getApplyStatus()==ShopSalesmanApply.APPLY_STATUS_WTG){ |
| | | |
| | | ShopSalesmanApply shopSalesmanApply=new ShopSalesmanApply(); |
| | | shopSalesmanApply.setUserId(openId); |
| | | |
| | | shopSalesmanApply.setCreateBy(loginUser.getNickName()); |
| | | shopSalesmanApply.setApplyWay(ShopSalesmanApply.APPLY_WAY_SELF); |
| | | ShopSalesmanApply shopSalesmanApply=new ShopSalesmanApply(); |
| | | shopSalesmanApply.setUserId(openId); |
| | | |
| | | shopSalesmanApply.setCompanyId(loginUser.getCompanyId()); |
| | | shopSalesmanApply.setUpdateBy(loginUser.getNickName()); |
| | | Date date = new Date(); |
| | | shopSalesmanApply.setCreateTime(date); |
| | | shopSalesmanApply.setUpdateTime(date); |
| | | shopSalesmanApply.setCreateBy(MatrixConstance.SYSTEM_USER); |
| | | shopSalesmanApply.setApplyWay(ShopSalesmanApply.APPLY_WAY_SELF); |
| | | |
| | | if(StringUtils.isNotBlank(invitationId)){ |
| | | shopSalesmanApply.setParentUserId(invitationId); |
| | | }else if(StringUtils.isNotBlank(loginUser.getParentOpenId())){ |
| | | //如果曾经是被邀请进来的则自动绑定为之前邀请人的下级 |
| | | shopSalesmanApply.setParentUserId(loginUser.getParentOpenId()); |
| | | } |
| | | if(StringUtils.isNotBlank(gradeId)){ |
| | | shopSalesmanApply.setGradeId(Long.parseLong(gradeId)); |
| | | shopSalesmanApply.setCompanyId(loginUser.getCompanyId()); |
| | | shopSalesmanApply.setUpdateBy(MatrixConstance.SYSTEM_USER); |
| | | Date date = new Date(); |
| | | shopSalesmanApply.setCreateTime(date); |
| | | shopSalesmanApply.setUpdateTime(date); |
| | | |
| | | if(StringUtils.isNotBlank(invitationId)){ |
| | | shopSalesmanApply.setParentUserId(invitationId); |
| | | }else if(StringUtils.isNotBlank(loginUser.getParentOpenId())){ |
| | | //如果曾经是被邀请进来的则自动绑定为之前邀请人的下级 |
| | | shopSalesmanApply.setParentUserId(loginUser.getParentOpenId()); |
| | | } |
| | | if(StringUtils.isNotBlank(gradeId)){ |
| | | shopSalesmanApply.setGradeId(Long.parseLong(gradeId)); |
| | | }else{ |
| | | //获取初始等级ID(公司id,是否为初始等级) |
| | | QueryWrapper<ShopSalesmanGrade> queryWrapperOrepool = new QueryWrapper<>(); |
| | | queryWrapperOrepool.eq("company_id", loginUser.getCompanyId()); |
| | | queryWrapperOrepool.eq("is_default", 1); |
| | | ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectOne(queryWrapperOrepool); |
| | | shopSalesmanApply.setGradeId(shopSalesmanGrade.getId()); |
| | | } |
| | | shopSalesmanApply.setApplyWay(applyWay); |
| | | |
| | | BusParameterSettings busParameterSettings = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_AUDIT_METHOD, loginUser.getCompanyId()); |
| | | if(busParameterSettings!=null |
| | | &&busParameterSettings.getParamValue().equals("1")){ |
| | | //自动审核 |
| | | shopSalesmanApply.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_TG); |
| | | bizUserService.setToBeAnSalesman(loginUser.getOpenId(),invitationId); |
| | | |
| | | }else{ |
| | | shopSalesmanApply.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_DSH); |
| | | } |
| | | shopSalesmanApplyDao.insert(shopSalesmanApply); |
| | | return shopSalesmanApply; |
| | | }else{ |
| | | //获取初始等级ID(公司id,是否为初始等级) |
| | | Wrapper<ShopSalesmanGrade> queryWrapperOrepool = new QueryWrapper<>(); |
| | | ((QueryWrapper<ShopSalesmanGrade>) queryWrapperOrepool).eq("company_id", loginUser.getCompanyId()); |
| | | ((QueryWrapper<ShopSalesmanGrade>) queryWrapperOrepool).eq("is_default", 1); |
| | | ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectOne(queryWrapperOrepool); |
| | | shopSalesmanApply.setGradeId(shopSalesmanGrade.getId()); |
| | | throw new GlobleException("不能重复申请"); |
| | | } |
| | | shopSalesmanApply.setApplyWay(applyWay); |
| | | |
| | | BusParameterSettings busParameterSettings = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_AUDIT_METHOD, loginUser.getCompanyId()); |
| | | if(busParameterSettings!=null |
| | | &&busParameterSettings.getParamValue().equals("1")){ |
| | | //自动审核 |
| | | shopSalesmanApply.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_TG); |
| | | bizUserService.setToBeAnSalesman(loginUser.getOpenId(),invitationId); |
| | | |
| | | }else{ |
| | | shopSalesmanApply.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_DSH); |
| | | } |
| | | shopSalesmanApplyDao.insert(shopSalesmanApply); |
| | | return shopSalesmanApply; |
| | | }else{ |
| | | throw new GlobleException("不能重复申请"); |
| | | throw new GlobleException(verificationResult.getMsg()); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 判断是否满足申请成为分销员的条件 |
| | | */ |
| | | public VerificationResult isAbleToBeAnSalesman(String openId) { |
| | | BizUser bizUser = bizUserDao.findByOpenId(openId); |
| | | VerificationResult verificationResult=null; |
| | | //申请条件 |
| | | BusParameterSettings applyCondition = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_APPLY_CONDITION, bizUser.getCompanyId()); |
| | | switch (applyCondition.getParamValue()){ |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_WTJ: |
| | | VerificationResult.buildVerificationResult(true); |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFZDCP: |
| | | VerificationResult.buildVerificationResult(true); |
| | | int buyZdcpCount= shopOrderV2Dao.countBuyZdcp(openId,applyCondition.getParamValue1()); |
| | | if(buyZdcpCount>0){ |
| | | verificationResult= VerificationResult.buildVerificationResult(true); |
| | | }else{ |
| | | verificationResult= VerificationResult.buildVerificationResult(false,"不符合申请条件,请消费指定产品后再申请!"); |
| | | } |
| | | |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFRYCP: |
| | | //判断用户是否有确认收货的产品 |
| | | int receivedOrderCount= shopOrderV2Dao.selectReceivedOrderCount(openId); |
| | | if(receivedOrderCount>0){ |
| | | verificationResult= VerificationResult.buildVerificationResult(true); |
| | | }else{ |
| | | verificationResult= VerificationResult.buildVerificationResult(false,"不符合申请条件,请消费任意产品后再申请!"); |
| | | } |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_XCZDJE: |
| | | Double zdje=Double.parseDouble(applyCondition.getParamValue2()); |
| | | Double yxfje=shopOrderV2Dao.countOrderAmount(openId); |
| | | if(zdje<yxfje){ |
| | | verificationResult=VerificationResult.buildVerificationResult(true); |
| | | }else{ |
| | | verificationResult= VerificationResult.buildVerificationResult(false,"不符合申请条件,请消费满"+zdje+"元后再申请!"); |
| | | } |
| | | VerificationResult.buildVerificationResult(true); |
| | | default: |
| | | VerificationResult.buildVerificationResult(true); |
| | | } |
| | | return verificationResult; |
| | | } |
| | | |
| | | |
| | | public IPage<ShopSalesmanApplyVo> findShopSalesmanApplyList(Page<ShopSalesmanApplyVo> page, ShopSalesmanApplyDto shopSalesmanApplyDto) { |
| | | return shopSalesmanApplyDao.findShopSalesmanApplyList(page,shopSalesmanApplyDto); |
| | |
| | | return AjaxResult.buildFailInstance("请输入方案名称"); |
| | | } |
| | | Double sealesCommission = updateFyfaDto.getSealesCommission(); |
| | | if(StrUtil.isEmpty(sealesCommission.toString())) { |
| | | if(ObjectUtil.isEmpty(sealesCommission)) { |
| | | return AjaxResult.buildFailInstance("请输入正确的推广提成"); |
| | | } |
| | | Double invitationCommission = updateFyfaDto.getInvitationCommission(); |
| | | if(StrUtil.isEmpty(invitationCommission.toString())) { |
| | | if(ObjectUtil.isEmpty(invitationCommission)) { |
| | | return AjaxResult.buildFailInstance("请输入正确的邀请提成"); |
| | | } |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(updateFyfaDto); |
| | | selectById.setCompanyId(updateFyfaDto.getCompanyId()); |
| | | selectById.setName(updateFyfaDto.getName()); |
| | | selectById.setSealesCommission(updateFyfaDto.getSealesCommission()); |
| | | selectById.setInvitationCommission(updateFyfaDto.getInvitationCommission()); |
| | | selectById.setSealesCommission(sealesCommission); |
| | | selectById.setInvitationCommission(invitationCommission); |
| | | selectById.setGradeCondition(updateFyfaDto.getGradeCondition()); |
| | | shopSalesmanGradeDao.updateById(selectById); |
| | | return AjaxResult.buildFailInstance("操作成功"); |
| | |
| | | package com.matrix.system.fenxiao.service; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.biz.dao.BizUserDao; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.fenxiao.dao.ShopRevenueFlowDao; |
| | | import com.matrix.system.fenxiao.dao.ShopSalemanSettlementDao; |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanOrderDao; |
| | | import com.matrix.system.fenxiao.dto.LoadFenxiaoOrderBasicDto; |
| | | import com.matrix.system.fenxiao.dto.LoadFenxiaoOrderListDto; |
| | | import com.matrix.system.fenxiao.dto.LoadSetOrderListDtoDto; |
| | | import com.matrix.system.fenxiao.dto.UpdateSetOrderDoneDto; |
| | | import com.matrix.system.fenxiao.entity.ShopRevenueFlow; |
| | | import com.matrix.system.fenxiao.entity.ShopSalemanSettlement; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanOrder; |
| | | import com.matrix.system.fenxiao.vo.LoadFenxiaoOrderBasicVo; |
| | | import com.matrix.system.fenxiao.vo.LoadFenxiaoOrderListVo; |
| | | import com.matrix.system.fenxiao.vo.LoadSetOrderListDtoVo; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.hive.service.CodeService; |
| | | import com.matrix.system.shopXcx.bean.ShopOrder; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderDao; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @description 分销订单 |
| | |
| | | */ |
| | | @Service |
| | | public class ShopSalesmanOrderService extends ServiceImpl<ShopSalesmanOrderDao, ShopSalesmanOrder>{ |
| | | |
| | | @Autowired |
| | | ShopSalesmanOrderDao shopSalesmanOrderDao; |
| | | @Autowired |
| | | CodeService codeService; |
| | | @Autowired |
| | | ShopSalemanSettlementDao shopSalemanSettlementDao; |
| | | @Autowired |
| | | ShopRevenueFlowDao shopRevenueFlowDao; |
| | | @Autowired |
| | | ShopOrderDao shopOrderDao; |
| | | @Autowired |
| | | BizUserDao bizUserDao; |
| | | |
| | | public AjaxResult loadFenxiaoOrderBasic(LoadFenxiaoOrderBasicDto loadFenxiaoOrderBasicDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(loadFenxiaoOrderBasicDto); |
| | | AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); |
| | | //根据OPENID查询基础信息 |
| | | Long companyId = loadFenxiaoOrderBasicDto.getCompanyId(); |
| | | LoadFenxiaoOrderBasicVo loadFenxiaoOrderBasicVo = shopSalesmanOrderDao.selectFenxiaoOrderBasicByCompanyId(companyId); |
| | | result.putInMap("basicdetail", loadFenxiaoOrderBasicVo); |
| | | return result; |
| | | } |
| | | |
| | | public AjaxResult loadFenxiaoOrderList(LoadFenxiaoOrderListDto loadFenxiaoOrderListDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(loadFenxiaoOrderListDto); |
| | | //排序 |
| | | if(StringUtils.isBlank(loadFenxiaoOrderListDto.getSort())){ |
| | | loadFenxiaoOrderListDto.setSort("create_time"); |
| | | loadFenxiaoOrderListDto.setOrder("desc"); |
| | | } |
| | | Page<LoadFenxiaoOrderListVo> page = new Page(loadFenxiaoOrderListDto.getPageNum(), loadFenxiaoOrderListDto.getPageSize()); |
| | | IPage<LoadFenxiaoOrderListVo> loadFenxiaoOrderListVos = shopSalesmanOrderDao.findFenxiaoOrderList(page,loadFenxiaoOrderListDto); |
| | | return AjaxResult.buildSuccessInstance(loadFenxiaoOrderListVos.getRecords(),loadFenxiaoOrderListVos.getTotal()); |
| | | } |
| | | |
| | | public AjaxResult loadSetOrderList(LoadSetOrderListDtoDto loadSetOrderListDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(loadSetOrderListDto); |
| | | //排序 |
| | | if(StringUtils.isBlank(loadSetOrderListDto.getSort())){ |
| | | loadSetOrderListDto.setSort("create_time"); |
| | | loadSetOrderListDto.setOrder("desc"); |
| | | } |
| | | Page<LoadSetOrderListDtoVo> page = new Page(loadSetOrderListDto.getPageNum(), loadSetOrderListDto.getPageSize()); |
| | | IPage<LoadSetOrderListDtoVo> loadFenxiaoOrderListVos = shopSalesmanOrderDao.findSetOrderList(page,loadSetOrderListDto); |
| | | return AjaxResult.buildSuccessInstance(loadFenxiaoOrderListVos.getRecords(),loadFenxiaoOrderListVos.getTotal()); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult updateSetOrderDone(UpdateSetOrderDoneDto updateSetOrderDoneDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(updateSetOrderDoneDto); |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | Long companyId = updateSetOrderDoneDto.getCompanyId(); |
| | | Integer setType = updateSetOrderDoneDto.getSetType(); |
| | | |
| | | String orderIds = updateSetOrderDoneDto.getOrderIds(); |
| | | if(StrUtil.isNotEmpty(orderIds)){ |
| | | List<String> idsStringList = Arrays.asList(orderIds.split(",")); |
| | | if(CollUtil.isEmpty(idsStringList)) { |
| | | return AjaxResult.buildFailInstance("请至少选择一条记录"); |
| | | } |
| | | //产生订单结算记录 |
| | | ShopSalemanSettlement shopSalemanSettlement = new ShopSalemanSettlement(); |
| | | shopSalemanSettlement.setCompanyId(companyId); |
| | | shopSalemanSettlement.setCreateBy(MatrixConstance.SYSTEM_USER); |
| | | shopSalemanSettlement.setUpdateBy(MatrixConstance.SYSTEM_USER); |
| | | shopSalemanSettlement.setCreateTime(new Date()); |
| | | shopSalemanSettlement.setUpdateTime(new Date()); |
| | | shopSalemanSettlement.setOrderNo(codeService.getCodeByTyle(ShopSalemanSettlement.ORDERNO_START)); |
| | | shopSalemanSettlement.setSettlementWay(setType); |
| | | shopSalemanSettlement.setManCount(updateSetOrderDoneDto.getManCount()); |
| | | shopSalemanSettlement.setOrderCount(updateSetOrderDoneDto.getOrderCount()); |
| | | shopSalemanSettlement.setUserId(user.getSuId().intValue()); |
| | | shopSalemanSettlement.setAmount(updateSetOrderDoneDto.getAmount()); |
| | | shopSalemanSettlement.setRemark(updateSetOrderDoneDto.getRemark()); |
| | | shopSalemanSettlement.setCompanyId(companyId); |
| | | shopSalemanSettlementDao.insert(shopSalemanSettlement); |
| | | |
| | | for(String idString : idsStringList) { |
| | | long id = Long.parseLong(idString); |
| | | //更新分销订单 |
| | | ShopSalesmanOrder shopSalesmanOrder = shopSalesmanOrderDao.selectById(id); |
| | | if(!ShopSalesmanOrder.STATUS_DJS.equals(shopSalesmanOrder.getOrderStatus())) { |
| | | return AjaxResult.buildFailInstance("选中记录中存在【已结算】的记录"); |
| | | } |
| | | //判断原始订单的状态【4=待评价, 5=已评价】才能结算 |
| | | ShopOrder shopOrder = shopOrderDao.selectById(shopSalesmanOrder.getOrderId().intValue()); |
| | | if(ShopOrder.ORDER_STATUS_WAIT_REMARK != shopOrder.getOrderStatus() && |
| | | ShopOrder.ORDER_STATUS_ALREADY_REMARK != shopOrder.getOrderStatus()) { |
| | | return AjaxResult.buildFailInstance("未收货订单不允许结算"); |
| | | } |
| | | shopSalesmanOrder.setOrderStatus(ShopSalesmanOrder.STATUS_YJS); |
| | | shopSalesmanOrder.setSettlementId(shopSalemanSettlement.getId()); |
| | | shopSalesmanOrderDao.updateById(shopSalesmanOrder); |
| | | //记录流水 |
| | | ShopRevenueFlow salesRevenueFlow=new ShopRevenueFlow(); |
| | | salesRevenueFlow.setCompanyId(companyId); |
| | | salesRevenueFlow.setCreateBy(MatrixConstance.SYSTEM_USER); |
| | | salesRevenueFlow.setUpdateBy(MatrixConstance.SYSTEM_USER); |
| | | salesRevenueFlow.setCreateTime(new Date()); |
| | | salesRevenueFlow.setUpdateTime(new Date()); |
| | | salesRevenueFlow.setAmount(shopSalesmanOrder.getAmount()); |
| | | salesRevenueFlow.setUserId(shopSalesmanOrder.getSalesUserId()); |
| | | if(ShopSalesmanOrder.REVENUE_TYPE_SALES.equals(shopSalesmanOrder.getRevenueType())) { |
| | | salesRevenueFlow.setRevenueContent(ShopRevenueFlow.TYPE_TGSY); |
| | | } |
| | | if(ShopSalesmanOrder.REVENUE_TYPE_INVITATION.equals(shopSalesmanOrder.getRevenueType())) { |
| | | salesRevenueFlow.setRevenueContent(ShopRevenueFlow.TYPE_YQSY); |
| | | } |
| | | salesRevenueFlow.setBusinessId(shopSalesmanOrder.getId()); |
| | | shopRevenueFlowDao.insert(salesRevenueFlow); |
| | | //选择微信余额支付,更新用户的金额 |
| | | if(ShopSalemanSettlement.SETTLEMENTWAY_YEJS == updateSetOrderDoneDto.getSetType()) { |
| | | BizUser findByOpenId = bizUserDao.findByOpenId(shopSalesmanOrder.getSalesUserId()); |
| | | if(ObjectUtil.isEmpty(findByOpenId)) { |
| | | return AjaxResult.buildFailInstance("收益人信息不存在"); |
| | | } |
| | | Double withdrawalCash = findByOpenId.getWithdrawalCash(); |
| | | Double amount = shopSalesmanOrder.getAmount(); |
| | | withdrawalCash = (withdrawalCash == null?0:withdrawalCash)+(amount== null?0:amount); |
| | | findByOpenId.setWithdrawalCash(withdrawalCash); |
| | | bizUserDao.updateByModel(findByOpenId); |
| | | } |
| | | } |
| | | } |
| | | return AjaxResult.buildSuccessInstance("操作成功"); |
| | | } |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.matrix.system.fenxiao.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel(value = "LoadFenxiaoOrderBasicVo", description = "返回类") |
| | | public class LoadFenxiaoOrderBasicVo { |
| | | |
| | | @ApiModelProperty(value = "待计算金额") |
| | | private BigDecimal balance; |
| | | @ApiModelProperty(value = "待结算人数") |
| | | private Integer waitNum; |
| | | @ApiModelProperty(value = "待结算订单") |
| | | private Integer waitOrderNum; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel(value = "LoadFenxiaoOrderListVo", description = "返回类") |
| | | public class LoadFenxiaoOrderListVo { |
| | | |
| | | @ApiModelProperty(value = "订单ID") |
| | | private Long id; |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String orderNo; |
| | | @ApiModelProperty(value = "订单状态") |
| | | private Integer orderState; |
| | | @ApiModelProperty(value = "实付金额(元)") |
| | | private BigDecimal actualBalance; |
| | | @ApiModelProperty(value = "下单门店") |
| | | private String address; |
| | | @ApiModelProperty(value = "客户") |
| | | private String custom; |
| | | @ApiModelProperty(value = "客户openId") |
| | | private String customUserId; |
| | | @ApiModelProperty(value = "推广员") |
| | | private String parentSale; |
| | | @ApiModelProperty(value = "收益类型") |
| | | private Integer profitType; |
| | | @ApiModelProperty(value = "收益金额") |
| | | private BigDecimal profitBalance; |
| | | @ApiModelProperty(value = "结算状态") |
| | | private Integer settleType; |
| | | @ApiModelProperty(value = "结算编号") |
| | | private String settleNo; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
| | | @ApiModelProperty(value = "结算时间") |
| | | private Date settleTime; |
| | | @ApiModelProperty(value = "结算人") |
| | | private String settler; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel(value = "LoadSetOrderListDtoVo", description = "返回类") |
| | | public class LoadSetOrderListDtoVo { |
| | | |
| | | @ApiModelProperty(value = "ID") |
| | | private Long id; |
| | | @ApiModelProperty(value = "结算编号") |
| | | private String orderNo; |
| | | @ApiModelProperty(value = "结算金额") |
| | | private BigDecimal actualBalance; |
| | | @ApiModelProperty(value = "结算订单数") |
| | | private String setNum; |
| | | @ApiModelProperty(value = "结算人数") |
| | | private String setManNum; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
| | | @ApiModelProperty(value = "结算时间") |
| | | private Date setTime; |
| | | @ApiModelProperty(value = "结算人") |
| | | private String setMan; |
| | | @ApiModelProperty(value = "结算方式") |
| | | private BigDecimal settlementWay; |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | } |
| | |
| | | */ |
| | | public String getOrderCode(); |
| | | |
| | | String get32LenNumberCode(); |
| | | |
| | | public String getFlowCode(); |
| | | /** |
| | | * 生成一个加上typeName前缀的编号 |
| | | * typeName+时间戳+四位随机数 |
| | | * @param typeName |
| | | * @return |
| | | */ |
| | | public String getCodeByTyle(String typeName); |
| | | |
| | | /** |
| | | * 根据一定的规则返回一个随机编号。 |
| | |
| | | import java.text.DateFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.Random; |
| | | |
| | | |
| | | |
| | | /** |
| | | * |
| | | * |
| | |
| | | } |
| | | |
| | | @Override |
| | | public String get32LenNumberCode(){ |
| | | DateFormat fmt = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | Date date=new Date(); |
| | | |
| | | String str = "0123456789"; |
| | | Random random = new Random(); |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (int i = 0; i < 18; i++) { |
| | | int number = random.nextInt(str.length()); |
| | | sb.append(str.charAt(number)); |
| | | } |
| | | return fmt.format(date)+sb.toString(); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public String getFlowCode() { |
| | | return "F" + getNowTimeString(); |
| | | } |
| | | |
| | | @Override |
| | | public String getCodeByTyle(String typeName) { |
| | | return typeName+getNowTimeString()+ StringUtils.getRandomString(4); |
| | | } |
| | | } |
| | |
| | | import com.matrix.system.shopXcx.bean.ShopProductAttribute; |
| | | import com.matrix.system.shopXcx.dao.ShopProductAttributeDao; |
| | | import com.matrix.system.shopXcx.dao.ShopProductDao; |
| | | import com.matrix.system.shopXcx.dao.ShopSkuDao; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | |
| | | @Autowired |
| | | private ShopProductAttributeDao shopProductAttributeDao; |
| | | |
| | | @Autowired |
| | | private ShopSkuDao shopSkuDao; |
| | | |
| | | @ApiOperation(value = "查询推广商品", notes = "") |
| | | @PostMapping(value = "/getSalesProductList") |
| | | @ApiResponses({ |
| | |
| | | |
| | | ShopProductAttribute fxsc = shopProductAttributeDao.selectByCode("fxsc", HostInterceptor.getCompanyId()); |
| | | shopProduct.setLimit(saleProductDto.getPageSize()); |
| | | shopProduct.setOffset(saleProductDto.getPageNum()* saleProductDto.getPageSize()); |
| | | shopProduct.setOffset((saleProductDto.getPageNum()-1)* 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); |
| | | shopProducts.forEach(item->item.setSkus(shopSkuDao.selectByPid(item.getId()))); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, shopProducts); |
| | | return result; |
| | | } |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.biz.dao.BizUserDao; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | import com.matrix.system.fenxiao.dao.ShopRevenueFlowDao; |
| | | import com.matrix.system.fenxiao.entity.ShopRevenueFlow; |
| | | import com.matrix.system.hive.service.CodeService; |
| | | import com.matrix.system.shopXcx.api.dto.RevenueFlowDto; |
| | | import com.matrix.system.shopXcx.api.dto.WithdrawalCashDto; |
| | | import com.matrix.system.shopXcx.vo.SalesOrderVo; |
| | | 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.transaction.annotation.Transactional; |
| | | 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.Date; |
| | | |
| | | /** |
| | | * @author jyy |
| | | * @date 2021-03-10 |
| | | **/ |
| | | @Api(tags = "提现接口类") |
| | | @RestController |
| | | @RequestMapping(value = "/wxapi/salesWithdrawal") |
| | | public class WxSalesWithdrawalAction { |
| | | |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | |
| | | @Autowired |
| | | private BizUserDao bizUserDao; |
| | | |
| | | @Autowired |
| | | private ShopRevenueFlowDao revenueFlowDao; |
| | | |
| | | |
| | | @Autowired |
| | | private ShopRevenueFlowDao shopRevenueFlowDao; |
| | | @Autowired |
| | | WeixinServiceUtil weixinServiceUtil; |
| | | |
| | | @Autowired |
| | | CodeService codeService; |
| | | |
| | | @ApiOperation(value = "获取收支明细", notes = "") |
| | | @PostMapping(value = "/getInvitationuserList") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = ShopRevenueFlow.class) |
| | | }) |
| | | AjaxResult getInvitationuserList(@RequestBody @Validated RevenueFlowDto revenueFlowDto) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | Page<SalesOrderVo> page=new Page<>(revenueFlowDto.getPageNum(),revenueFlowDto.getPageSize()); |
| | | revenueFlowDto.setUserId(loginUser.getOpenId()); |
| | | IPage<SalesOrderVo> shopSalesmanApplyIPage = revenueFlowDao.selectRevenuFlowList(page, revenueFlowDto); |
| | | AjaxResult result=AjaxResult.buildSuccessInstance(shopSalesmanApplyIPage.getRecords()); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "提现", notes = "") |
| | | @PostMapping(value = "/withdrawalCash") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = BasePageQueryDto.class) |
| | | }) |
| | | @Transactional |
| | | AjaxResult withdrawalCash(@RequestBody @Validated WithdrawalCashDto withdrawalCashDto) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | loginUser=bizUserDao.selectById(loginUser.getUserId()); |
| | | if(withdrawalCashDto.getAmount()<1){ |
| | | return AjaxResult.buildFailInstance("最小提现金额为1元"); |
| | | }else if(withdrawalCashDto.getAmount()>20000){ |
| | | return AjaxResult.buildFailInstance("最大提现金额为2万元"); |
| | | }else{ |
| | | if(loginUser.getWithdrawalCash()==null || loginUser.getWithdrawalCash()<withdrawalCashDto.getAmount()){ |
| | | return AjaxResult.buildFailInstance("余额不足"); |
| | | }else{ |
| | | |
| | | String txNo = codeService.get32LenNumberCode(); |
| | | |
| | | /*调试注释 |
| | | weixinServiceUtil.comPay("提现", txNo,Integer.parseInt((withdrawalCashDto.getAmount()*1000)+""), |
| | | loginUser.getOpenId(),loginUser.getCompanyId()); |
| | | */ |
| | | //记录收益流水 |
| | | ShopRevenueFlow invitationRevenueFlow=new ShopRevenueFlow(); |
| | | invitationRevenueFlow.setCompanyId(loginUser.getCompanyId()); |
| | | invitationRevenueFlow.setCreateBy(MatrixConstance.SYSTEM_USER); |
| | | invitationRevenueFlow.setUpdateBy(txNo); |
| | | invitationRevenueFlow.setCreateTime(new Date()); |
| | | invitationRevenueFlow.setUpdateTime(new Date()); |
| | | invitationRevenueFlow.setAmount(-withdrawalCashDto.getAmount()); |
| | | invitationRevenueFlow.setUserId(loginUser.getOpenId()); |
| | | invitationRevenueFlow.setRevenueContent("提现"); |
| | | shopRevenueFlowDao.insert(invitationRevenueFlow); |
| | | //扣除用户剩余提现金额 |
| | | loginUser.setWithdrawalCash(loginUser.getWithdrawalCash()-withdrawalCashDto.getAmount()); |
| | | bizUserDao.updateByModel(loginUser); |
| | | redisUserLoginUtils.updateUserInfo(loginUser); |
| | | |
| | | |
| | | return AjaxResult.buildSuccessInstance("提现成功"); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | 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({ |
| | |
| | | public AjaxResult applyToBeAnSalesman(@RequestBody Map<String,String> param) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | String invitationId = param.get("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); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | 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); |
| | | } |
| | |
| | | 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); |
File was renamed from zq-erp/src/main/java/com/matrix/system/shopXcx/api/WxUserAction.java |
| | |
| | | package com.matrix.system.shopXcx.api; |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.biz.dao.BizUserDao; |
| | | import com.matrix.biz.service.BizUserService; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.tools.HttpCurlUtil; |
| | |
| | | import com.matrix.core.web.BaseAction; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.shopXcx.api.WeChatApiTools; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | @Autowired |
| | | private BizUserDao bizUserDao; |
| | | |
| | | |
| | | @Autowired |
| | | WeChatApiTools weChatApiTools; |
| | |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | String openId = loginUser.getOpenId(); |
| | | BizUser bizUser = bizUserService.findByOpenId(openId); |
| | | |
| | | //处理用户当前所在店铺 |
| | | /* |
| | | if(bizUser.getStaff()!=null){ |
| | | //当前用户是员工账号 |
| | | bizUser.setBusiness(bussinesssDao.selectById(bizUser.getStaff().getBusinessId())); |
| | | bizUser.setRole(bizUser.getStaff().getRole()); |
| | | }else{ |
| | | //当前用户是boss账号 |
| | | bizUser.setBusiness(bussinesssDao.findByUserOpenId(bizUser.getOpenId())); |
| | | bizUser.setRole(AppConstance.User_ROLE_BOSS); |
| | | }*/ |
| | | |
| | | AjaxResult res = new AjaxResult(); |
| | | res.putInMap("userInfo", bizUser); |
| | | res.setStatus(AjaxResult.STATUS_SUCCESS); |
| | | return res; |
| | | } |
| | | |
| | | /** |
| | | * 获取其他用户简化信息 |
| | | * @author JIANGYOUYAO |
| | | * @email 935090232@qq.com |
| | | * @date 2018年9月5日 |
| | | * @param openId |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/getOtherUserInfo/{openId}") |
| | | public @ResponseBody |
| | | AjaxResult getOtherUserInfo(@PathVariable String openId) { |
| | | BizUser bizUser = bizUserService.findByOpenId(openId); |
| | | AjaxResult res = new AjaxResult(); |
| | | res.putInMap("userInfo", bizUser); |
| | | res.setStatus(AjaxResult.STATUS_SUCCESS); |
| | | return res; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 接收用户信息 |
New file |
| | |
| | | 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; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel(value = "RevenueFlowDto", description = "收益流水查询参数接收类") |
| | | public class RevenueFlowDto extends BasePageQueryDto { |
| | | |
| | | @NotNull(message = "查询月份不能为空") |
| | | @ApiModelProperty(value = "查询月份",example = "2021-03") |
| | | private String queryTime; |
| | | |
| | | |
| | | @ApiModelProperty(value = "收益类型 不传全部,1,收入,2支出", example = "1") |
| | | private Integer revenueType; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private String userId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel(value = "WithdrawalCashDto", description = "提现参数接收类") |
| | | public class WithdrawalCashDto { |
| | | |
| | | @NotNull(message = "提现金额不能为空") |
| | | @ApiModelProperty(value = "提现金额", example = "1") |
| | | private Double amount; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | public List<Map<String,Object>> selectOrderStatusCount(String openId); |
| | | |
| | | public int batchUpdateOrderStatus(@Param("list") List<ShopOrder> list); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.shopXcx.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.matrix.system.shopXcx.bean.ShopOrder; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @description 订单表 |
| | | */ |
| | | public interface ShopOrderV2Dao extends BaseMapper<ShopOrder> { |
| | | |
| | | /** 统计已收货订单数 */ |
| | | int selectReceivedOrderCount(String openId); |
| | | /** 统计已收货订单金额 */ |
| | | Double countOrderAmount(String openId); |
| | | |
| | | /** 统计是否消费过了指定产品 */ |
| | | int countBuyZdcp(@Param("openId") String openId, @Param("productIds")String productIds); |
| | | } |
| | |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.fenxiao.dao.ShopRevenueFlowDao; |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao; |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanOrderDao; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanGrade; |
| | |
| | | |
| | | @Autowired |
| | | private ShopSalesmanGradeDao shopSalesmanGradeDao; |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | invitationAmount=invitationAmount*zk; |
| | | invitationOrder.setAmount(invitationAmount); |
| | | shopSalesmanOrderDao.insert(invitationOrder); |
| | | |
| | | |
| | | } |
| | | } |
| | | }else{ |
| | |
| | | @ApiModelProperty(value = "可提现金额") |
| | | private String withdrawalCash; |
| | | |
| | | |
| | | @ApiModelProperty(value = "邀请订单数") |
| | | private String invitationOrderCount; |
| | | |
| | | @ApiModelProperty(value = "推广订单数") |
| | | private String orderCount; |
| | | private String salesorderCount; |
| | | |
| | | |
| | | @ApiModelProperty(value = "客户数") |
| | |
| | | evn=dev |
| | | evn=jyy |
| | | server.port=8080 |
| | | |
| | | |
| | |
| | | maxUploadSize=10485760 |
| | | |
| | | #Matser\u7684ip\u5730\u5740 |
| | | redis.hostname=118.31.227.147 |
| | | redis.hostname=120.27.238.55 |
| | | #\u7AEF\u53E3\u53F7 |
| | | redis.port=6379 |
| | | #\u5982\u679C\u6709\u5BC6\u7801 |
| | | redis.password=123456 |
| | | redis.password=xcong123 |
| | | #\u5BA2\u6237\u7AEF\u8D85\u65F6\u65F6\u95F4\u5355\u4F4D\u662F\u6BEB\u79D2 \u9ED8\u8BA4\u662F2000 |
| | | redis.timeout=10000 |
| | | redis.database=7 |
| | |
| | | maxUploadSize=10485760 |
| | | |
| | | #Matser\u7684ip\u5730\u5740 |
| | | redis.hostname=118.31.227.147 |
| | | redis.hostname=120.27.238.55 |
| | | #\u7AEF\u53E3\u53F7 |
| | | redis.port=6379 |
| | | #\u5982\u679C\u6709\u5BC6\u7801 |
| | | redis.password=123456 |
| | | redis.password=xcong123 |
| | | #\u5BA2\u6237\u7AEF\u8D85\u65F6\u65F6\u95F4\u5355\u4F4D\u662F\u6BEB\u79D2 \u9ED8\u8BA4\u662F2000 |
| | | redis.timeout=10000 |
| | | redis.database=1 |
| | |
| | | maxUploadSize=10485760 |
| | | |
| | | #Matser\u7684ip\u5730\u5740 |
| | | redis.hostname=118.31.227.147 |
| | | redis.hostname=120.27.238.55 |
| | | #\u7AEF\u53E3\u53F7 |
| | | redis.port=6379 |
| | | #\u5982\u679C\u6709\u5BC6\u7801 |
| | | redis.password=123456 |
| | | redis.password=xcong123 |
| | | #\u5BA2\u6237\u7AEF\u8D85\u65F6\u65F6\u95F4\u5355\u4F4D\u662F\u6BEB\u79D2 \u9ED8\u8BA4\u662F2000 |
| | | redis.timeout=10000 |
| | | redis.database=1 |
| | |
| | | |
| | | |
| | | #Matser\u7684ip\u5730\u5740 |
| | | redis.hostname=118.31.227.147 |
| | | redis.hostname=120.27.238.55 |
| | | #\u7AEF\u53E3\u53F7 |
| | | redis.port=6379 |
| | | #\u5982\u679C\u6709\u5BC6\u7801 |
| | | redis.password=123456 |
| | | redis.password=xcong123 |
| | | #\u5BA2\u6237\u7AEF\u8D85\u65F6\u65F6\u95F4\u5355\u4F4D\u662F\u6BEB\u79D2 \u9ED8\u8BA4\u662F2000 |
| | | redis.timeout=10000 |
| | | redis.database=1 |
| | |
| | | |
| | | |
| | | #Matser\u7684ip\u5730\u5740 |
| | | redis.hostname=118.31.227.147 |
| | | redis.hostname=120.27.238.55 |
| | | #\u7AEF\u53E3\u53F7 |
| | | redis.port=6379 |
| | | #\u5982\u679C\u6709\u5BC6\u7801 |
| | | redis.password=123456 |
| | | redis.password=xcong123 |
| | | #\u5BA2\u6237\u7AEF\u8D85\u65F6\u65F6\u95F4\u5355\u4F4D\u662F\u6BEB\u79D2 \u9ED8\u8BA4\u662F2000 |
| | | redis.timeout=10000 |
| | | redis.database=1 |
| | |
| | | <result property="companyId" column="company_id" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectRevenuFlowList" resultType="com.matrix.system.shopXcx.vo.SalesOrderVo"> |
| | | select * from shop_revenue_flow |
| | | where user_id=#{record.userId} |
| | | and DATE_FORMAT(create_time,'%Y-%m')=#{record.queryTime} |
| | | <if test="record.revenueType==1"> |
| | | and amount>0 |
| | | </if> |
| | | <if test="record.revenueType==2"> |
| | | <![CDATA[ and amount<0 ]]> |
| | | </if> |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | ( 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, |
| | | g.NAME grade, |
| | | b.binding_parent_time createTime, |
| | | a.create_time createTime, |
| | | a.apply_status applyStatus, |
| | | a.apply_way applyWay |
| | | FROM |
| | |
| | | IFNULL(sum(IFNULL( b.amount, 0 )),0) |
| | | FROM |
| | | shop_salesman_order b |
| | | WHERE |
| | | b.user_id = a.open_id |
| | | and order_status=2 |
| | | WHERE order_status=2 |
| | | AND b.sales_user_id = #{openId} |
| | | |
| | | ) AS totalRevenue, |
| | |
| | | IFNULL(sum(IFNULL( b.amount, 0 )),0) |
| | | FROM |
| | | shop_salesman_order b |
| | | WHERE |
| | | b.user_id = a.open_id |
| | | and order_status=2 and revenue_type=1 |
| | | WHERE order_status=2 and revenue_type=1 |
| | | AND b.sales_user_id = #{openId} |
| | | |
| | | ) AS salesRevenue, |
| | |
| | | IFNULL(sum(IFNULL( b.amount, 0 )),0) |
| | | FROM |
| | | shop_salesman_order b |
| | | WHERE |
| | | b.user_id = a.open_id |
| | | and order_status=2 and revenue_type=2 |
| | | WHERE order_status=2 and revenue_type=2 |
| | | AND b.sales_user_id = #{openId} |
| | | |
| | | ) AS invitationRevenue, |
| | |
| | | IFNULL(sum(IFNULL( b.amount, 0 )),0) |
| | | FROM |
| | | shop_salesman_order b |
| | | WHERE |
| | | b.user_id = a.open_id |
| | | and order_status=1 |
| | | WHERE order_status=1 |
| | | AND b.sales_user_id = #{openId} |
| | | |
| | | ) AS djsRevenue, |
| | | ( SELECT count( * ) FROM shop_salesman_order c WHERE c.user_id = a.open_id AND c.sales_user_id = #{openId} ) AS orderCount, |
| | | |
| | | ( SELECT count( * ) FROM shop_salesman_order c WHERE c.user_id = a.open_id AND c.sales_user_id = #{openId} and revenue_type =1 ) AS salesorderCount, |
| | | ( SELECT count( * ) FROM shop_salesman_order c WHERE c.user_id = a.open_id AND c.sales_user_id = #{openId} and revenue_type =2 ) AS invitationOrderCount, |
| | | (select count(*) from biz_user where parent_open_id=#{openId} and is_sales=1) as invitationCount, |
| | | (select count(*) from biz_user where parent_open_id=#{openId} and is_sales=2) as customerCount |
| | | from biz_user a where |
| | |
| | | WHERE user_id = a.user_id AND 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, |
| | | b.binding_parent_time createTime, |
| | | a.create_time createTime, |
| | | a.apply_status applyStatus, |
| | | a.apply_way applyWay |
| | | FROM |
| | |
| | | |
| | | </select> |
| | | |
| | | <select id="selectFenxiaoOrderBasicByCompanyId" resultType="com.matrix.system.fenxiao.vo.LoadFenxiaoOrderBasicVo"> |
| | | SELECT |
| | | COUNT(*) num, |
| | | (SELECT IFNULL(sum(IFNULL(amount, 0)), 0) |
| | | FROM shop_salesman_order |
| | | WHERE order_status = 1 and company_id=#{companyId}) balance, |
| | | (SELECT COUNT(*) FROM |
| | | (SELECT DISTINCT user_id |
| | | FROM shop_salesman_order |
| | | WHERE order_status = 1 and company_id=#{companyId} ) a) waitNum, |
| | | (SELECT COUNT(*) |
| | | FROM shop_salesman_order |
| | | WHERE order_status = 1 and company_id=#{companyId}) waitOrderNum |
| | | FROM |
| | | shop_salesman_order |
| | | where company_id=#{companyId} |
| | | </select> |
| | | |
| | | <select id="findFenxiaoOrderList" resultType="com.matrix.system.fenxiao.vo.LoadFenxiaoOrderListVo"> |
| | | SELECT |
| | | a.id id, |
| | | d.order_no, |
| | | d.order_money actualBalance, |
| | | f.shop_name address, |
| | | d.order_status orderState, |
| | | b.nick_name custom, |
| | | b.open_id customUserId, |
| | | e.nick_name parentSale, |
| | | a.revenue_type profitType, |
| | | a.amount profitBalance, |
| | | a.order_status settleType, |
| | | c.order_no settleNo, |
| | | c.create_time settleTime, |
| | | g.su_name settler |
| | | FROM |
| | | shop_salesman_order a |
| | | LEFT JOIN biz_user b on a.user_id = b.open_id |
| | | LEFT JOIN shop_saleman_settlement c on a.settlement_id = c.id |
| | | LEFT JOIN shop_order d on d.id = a.order_id |
| | | LEFT JOIN biz_user e on a.sales_user_id = e.open_id |
| | | LEFT JOIN sys_shop_info f on f.id = d.store_id |
| | | LEFT JOIN sys_users g on c.user_id = g.su_id |
| | | <where> |
| | | a.company_id = #{record.companyId} |
| | | <if test="record.userName != null and record.userName != ''"> |
| | | and b.nick_name like concat('%',#{record.userName},'%') |
| | | </if> |
| | | <if test="record.ddType != null and record.ddType != ''"> |
| | | and d.order_status = #{record.ddType} |
| | | </if> |
| | | <if test="record.startTime != null "> |
| | | and a.create_time >= #{record.startTime} |
| | | </if> |
| | | <if test="record.endTime != null"> |
| | | and #{record.endTime} >= a.create_time |
| | | </if> |
| | | <if test="record.tgy != null and record.tgy != ''"> |
| | | and e.nick_name like concat('%',#{record.tgy},'%') |
| | | </if> |
| | | <if test="record.orderType != null and record.orderType != ''"> |
| | | and a.order_status = #{record.orderType} |
| | | </if> |
| | | <if test="record.jsbh != null and record.jsbh != ''"> |
| | | and c.order_no = #{record.jsbh} |
| | | </if> |
| | | <if test="record.ddh != null and record.ddh != ''"> |
| | | and d.order_no = #{record.ddh} |
| | | </if> |
| | | </where> |
| | | <if test="record.sort !=null"> |
| | | order by |
| | | a.${record.sort} ${record.order} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="findSetOrderList" resultType="com.matrix.system.fenxiao.vo.LoadSetOrderListDtoVo"> |
| | | select |
| | | a.id id, |
| | | a.order_no orderNo, |
| | | a.amount actualBalance, |
| | | a.order_count setNum, |
| | | a.man_count setManNum, |
| | | a.create_time setTime, |
| | | b.su_name setMan, |
| | | a.settlement_way settlementWay, |
| | | a.remark remark |
| | | from |
| | | shop_saleman_settlement a |
| | | left join sys_users b on a.user_id = b.su_id |
| | | <where> |
| | | a.company_id = #{record.companyId} |
| | | <if test="record.userName != null and record.userName != ''"> |
| | | and b.su_name like concat('%',#{record.userName},'%') |
| | | </if> |
| | | <if test="record.startTime != null "> |
| | | and a.create_time >= #{record.startTime} |
| | | </if> |
| | | <if test="record.endTime != null"> |
| | | and #{record.endTime} >= a.create_time |
| | | </if> |
| | | </where> |
| | | <if test="record.sort !=null"> |
| | | order by |
| | | a.${record.sort} ${record.order} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.matrix.system.shopXcx.dao.ShopOrderV2Dao"> |
| | | |
| | | <select id="selectReceivedOrderCount" resultType="java.lang.Integer"> |
| | | select count(*) from shop_order where user_id = #{openId} and order_status in (4,5) |
| | | </select> |
| | | |
| | | <select id="countOrderAmount" resultType="java.lang.Double"> |
| | | select IFNULL(sum(IFNULL( order_money, 0 )),0) from shop_order where user_id = #{openId} and order_status in (4,5) |
| | | </select> |
| | | |
| | | <select id="countBuyZdcp" resultType="java.lang.Integer"> |
| | | select count(*) from shop_order a |
| | | left join shop_order_details b on a.id=b.order_id |
| | | where a.user_id=#{openId} |
| | | and order_status in (4,5) |
| | | and find_in_set(b.p_id,#{productIds}) |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
New file |
| | |
| | | <!DOCTYPE HTML> |
| | | <html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> |
| | | <meta name="renderer" content="webkit|ie-comp|ie-stand"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" |
| | | content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> |
| | | <meta http-equiv="Cache-Control" content="no-siteapp"/> |
| | | <!-- 本框架基本脚本和样式 --> |
| | | <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> |
| | | <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> |
| | | <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> |
| | | <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> |
| | | |
| | | <!-- 富文本编辑器 --> |
| | | <script type="text/javascript" charset="utf-8" |
| | | th:src="@{/plugin/beditor/ueditor.config.js}"></script> |
| | | <script type="text/javascript" charset="utf-8" |
| | | th:src="@{/plugin/beditor/ueditor.all.js}"> |
| | | </script> |
| | | <script type="text/javascript" charset="utf-8" |
| | | th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script> |
| | | <style> |
| | | .paginationStyle{ |
| | | background: #ffffff; |
| | | padding: 10px 10px; |
| | | margin: 0px 0px 10px 0px; |
| | | text-align: right; |
| | | } |
| | | </style> |
| | | </head> |
| | | |
| | | <body> |
| | | <div class="ibox-content" id="app" v-cloak> |
| | | <el-row style="padding: 10px;"> |
| | | <el-row :gutter="100"> |
| | | <el-col class="line" :span="8" style="text-align: center"> |
| | | <el-card class="box-card" style="background-color: #eee;border-radius: 30px;"> |
| | | <div>待计算金额</div> |
| | | <div style="padding: 5px;font-size: 30px;">¥{{basicdetail.balance}}</div> |
| | | </el-card > |
| | | </el-col> |
| | | <el-col class="line" :span="8" style="text-align: center"> |
| | | <el-card class="box-card" style="background-color: #eee;border-radius: 30px;"> |
| | | <div>待结算人数</div> |
| | | <div style="padding: 5px;font-size: 30px;">{{basicdetail.waitNum}}人</div> |
| | | </el-card > |
| | | </el-col> |
| | | <el-col class="line" :span="8" style="text-align: center"> |
| | | <el-card class="box-card" style="background-color: #eee;border-radius: 30px;"> |
| | | <div>待结算订单</div> |
| | | <div style="padding: 5px;font-size: 30px;">{{basicdetail.waitOrderNum}}笔</div> |
| | | </el-card > |
| | | </el-col> |
| | | </el-row> |
| | | </el-row> |
| | | <el-row> |
| | | <el-tabs v-model="activeName" > |
| | | <el-tab-pane label="分销订单" name="first"> |
| | | <el-row justify="space-between" type="flex"> |
| | | <el-col :span="6"> |
| | | <el-button type="primary" @click="setOrderDone()">批量结算</el-button> |
| | | </el-col> |
| | | <el-dialog title="本次结算分销订单" :visible.sync="dialogFormVisible"> |
| | | <el-form :model="formSelect"> |
| | | <el-form-item label="结算金额:" :label-width="formLabelWidth"> |
| | | <div style="font-size: 30px;color: #ff0000">¥{{formSelect.jsje}}</div> |
| | | </el-form-item> |
| | | <el-form-item label="结算订单:" :label-width="formLabelWidth"> |
| | | <div style="font-size: 20px;">{{formSelect.jsdds}}单</div> |
| | | </el-form-item> |
| | | <el-form-item label="结算人数:" :label-width="formLabelWidth"> |
| | | <div style="font-size: 20px;">{{formSelect.jsrs}}人</div> |
| | | </el-form-item> |
| | | <el-form-item label="结算方式:" :label-width="formLabelWidth"> |
| | | <el-radio-group v-model="formSelect.jsfs"> |
| | | <el-radio-button label="1">线下结算</el-radio-button> |
| | | <el-radio-button label="2">微信余额支付</el-radio-button> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="备注:" :label-width="formLabelWidth"> |
| | | <el-input type="textarea" :rows="3" v-model="formSelect.bz" autocomplete="off"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialogFormVisible = false">取 消</el-button> |
| | | <el-button type="primary" @click="updateSetOrderDone()">确 定</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <el-col> |
| | | <el-form ref="form" :model="form" inline > |
| | | <el-form-item label="订单状态" prop="ddType"> |
| | | <el-select v-model="form.ddType" placeholder="订单状态"> |
| | | <el-option |
| | | v-for="item in ddTypeList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="结算状态" prop="orderType"> |
| | | <el-select v-model="form.orderType" placeholder="结算状态"> |
| | | <el-option |
| | | v-for="item in orderTypeList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item prop="userName" > |
| | | <el-input v-model="form.userName" placeholder="请输入客户名称"></el-input> |
| | | </el-form-item> |
| | | <el-form-item prop="tgy" > |
| | | <el-input v-model="form.tgy" placeholder="请输入推广员名称"></el-input> |
| | | </el-form-item> |
| | | <el-form-item prop="ddsj" > |
| | | <el-date-picker |
| | | v-model="form.ddsj" |
| | | type="datetimerange" |
| | | :picker-options="pickerOptions" |
| | | range-separator="至" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | align="right"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item prop="jsbh" > |
| | | <el-input v-model="form.jsbh" placeholder="请输入结算编号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item prop="ddh" > |
| | | <el-input v-model="form.ddh" placeholder="请输入订单号"></el-input> |
| | | </el-form-item> |
| | | <el-button type="primary" @click="search" >搜索</el-button> |
| | | <el-button @click="resetForm('form')">重置</el-button> |
| | | </el-form> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row class="table-style" > |
| | | <el-table ref="multipleTable" |
| | | :data="fxyList.rows" |
| | | :height="height" |
| | | stripe:true |
| | | @sort-change="sortChange" |
| | | @selection-change="handleSelectionChange"> |
| | | <el-table-column |
| | | type="selection"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="orderNo" |
| | | label="订单编号"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="actualBalance" |
| | | label="实付金额(元)"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="订单状态"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.orderState == 1">待付款</span> |
| | | <span v-if="scope.row.orderState == 2">待配送</span> |
| | | <span v-if="scope.row.orderState == 3">待收货</span> |
| | | <span v-if="scope.row.orderState == 4">待评价</span> |
| | | <span v-if="scope.row.orderState == 5">已评价</span> |
| | | <span v-if="scope.row.orderState == 6">申请退款</span> |
| | | <span v-if="scope.row.orderState == 7">退款成功</span> |
| | | <span v-if="scope.row.orderState == 8">退款拒绝</span> |
| | | <span v-if="scope.row.orderState == 9">已取消</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="address" |
| | | label="下单门店"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="custom" |
| | | label="客户"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="parentSale" |
| | | label="推广员"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="收益类型"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.profitType == 1">推广收益</span> |
| | | <span v-if="scope.row.profitType == 2">邀请收益</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="profitBalance" |
| | | label="收益金额"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="结算状态"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.settleType == 1">待结算</span> |
| | | <span v-if="scope.row.settleType == 2">已结算</span> |
| | | <span v-if="scope.row.settleType == 3">已退款</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="settleNo" |
| | | label="结算编号" width="150"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="settleTime" |
| | | label="结算时间"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="settler" |
| | | label="结算人"> |
| | | </el-table-column> |
| | | <el-table-column label="操作"> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-row> |
| | | <el-row class="paginationStyle" > |
| | | <el-pagination background |
| | | @size-change="changePageSize" |
| | | @current-change="changeCurrentPage" |
| | | :current-page="fxyList.currentPage" |
| | | :page-sizes="[10, 20, 30, 50]" |
| | | :page-size="fxyList.pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="fxyList.total"> |
| | | </el-pagination> |
| | | </el-row> |
| | | </el-tab-pane> |
| | | |
| | | <el-tab-pane label="结算记录" name="second"> |
| | | <el-row style="display:flex;align-items: center;text-align: right;"> |
| | | <el-col> |
| | | <el-form ref="formOrder" :model="formOrder" inline > |
| | | <el-form-item prop="jssj" > |
| | | <el-date-picker |
| | | v-model="formOrder.jssj" |
| | | type="datetimerange" |
| | | :picker-options="pickerOptions" |
| | | range-separator="至" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | align="right"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item prop="userName"> |
| | | <el-input v-model="formOrder.userName" placeholder="请输入结算人姓名"></el-input> |
| | | </el-form-item> |
| | | <el-button type="primary" @click="searchFormOrder" >搜索</el-button> |
| | | <el-button @click="resetFormOrder('formOrder')">重置</el-button> |
| | | </el-form> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row class="table-style" > |
| | | <el-table :data="orderLevelList.rows" :height="height" stripe:true @sort-change="sortChange"> |
| | | <el-table-column |
| | | prop="orderNo" |
| | | label="结算编号"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="actualBalance" |
| | | label="结算金额"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="setNum" |
| | | label="结算订单数"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="setManNum" |
| | | label="结算人数"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="setTime" |
| | | label="结算时间"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="setMan" |
| | | label="结算人"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="结算方式"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.settlementWay == 1">线下结算</span> |
| | | <span v-if="scope.row.settlementWay == 2">微信余额结算</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="remark" |
| | | label="备注"> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-row> |
| | | <el-row class="paginationStyle" > |
| | | <el-pagination background |
| | | @size-change="changePageSizeOrder" |
| | | @current-change="changeCurrentPageOrder" |
| | | :current-page="orderLevelList.currentPage" |
| | | :page-sizes="[10, 20, 30, 50]" |
| | | :page-size="orderLevelList.pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="orderLevelList.total"> |
| | | </el-pagination> |
| | | </el-row> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </el-row> |
| | | </div> |
| | | </body> |
| | | <script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> |
| | | <script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> |
| | | <script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> |
| | | <script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> |
| | | <script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> |
| | | |
| | | <script> |
| | | //获取传输的USERID对象 |
| | | var userId = $.query.get("userId"); |
| | | var applyId = $.query.get("applyId"); |
| | | |
| | | var app = new Vue({ |
| | | el: '#app', |
| | | data: { |
| | | activeName: 'first', |
| | | height:'calc(100vh - 240px)', |
| | | //--基本数据 |
| | | basicdetail:{}, |
| | | //--时间选择 |
| | | pickerOptions: { |
| | | shortcuts: [{ |
| | | text: '最近一周', |
| | | onClick(picker) { |
| | | const end = new Date(); |
| | | const start = new Date(); |
| | | start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); |
| | | picker.$emit('pick', [start, end]); |
| | | } |
| | | }, { |
| | | text: '最近一个月', |
| | | onClick(picker) { |
| | | const end = new Date(); |
| | | const start = new Date(); |
| | | start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); |
| | | picker.$emit('pick', [start, end]); |
| | | } |
| | | }, { |
| | | text: '最近三个月', |
| | | onClick(picker) { |
| | | const end = new Date(); |
| | | const start = new Date(); |
| | | start.setTime(start.getTime() - 3600 * 1000 * 24 * 90); |
| | | picker.$emit('pick', [start, end]); |
| | | } |
| | | }] |
| | | }, |
| | | |
| | | //--批量审核选中操作 |
| | | multipleSelection: [], |
| | | orderIds:"", |
| | | orderNums:0, |
| | | orderNumsDones:0, |
| | | dialogFormVisible: false, |
| | | formSelect: { |
| | | jsje: '', |
| | | jsdds: '', |
| | | jsrs: '', |
| | | jsfs: 1, |
| | | bz: '' |
| | | }, |
| | | formLabelWidth: '120px', |
| | | //--分销订单 |
| | | // 条件查询结算状态 |
| | | orderTypeList:[ |
| | | {value:'',label:'全部'}, |
| | | {value:1,label:'待结算'}, |
| | | {value:2,label:'已结算'}, |
| | | {value:3,label:'已退款'} |
| | | ], |
| | | ddTypeList:[ |
| | | {value:'',label:'全部'}, |
| | | {value:1,label:'待付款'}, |
| | | {value:2,label:'待配送'}, |
| | | {value:3,label:'待收货'}, |
| | | {value:4,label:'待评价'}, |
| | | {value:5,label:'已评价'}, |
| | | {value:6,label:'申请退款'}, |
| | | {value:7,label:'退款成功'}, |
| | | {value:8,label:'退款拒绝'}, |
| | | {value:9,label:'已取消'} |
| | | ], |
| | | form:{ |
| | | userName:'', |
| | | orderType:'', |
| | | ddType:'', |
| | | ddsj: '', |
| | | tgy:'', |
| | | jsbh:'', |
| | | ddh:'', |
| | | order:'', |
| | | sort:'' |
| | | }, |
| | | fxyList:{ |
| | | rows:[], |
| | | total:0, |
| | | pageSize:10, |
| | | currentPage:1, |
| | | }, |
| | | //--结算记录 |
| | | formOrder:{ |
| | | userName:'', |
| | | jssj:'', |
| | | order:'', |
| | | sort:'' |
| | | }, |
| | | orderLevelList:{ |
| | | rows:[], |
| | | total:0, |
| | | pageSize:10, |
| | | currentPage:1, |
| | | }, |
| | | }, |
| | | created: function () { |
| | | this.loadInfo(); |
| | | }, |
| | | mounted: function () { |
| | | }, |
| | | methods: { |
| | | //加载分类 |
| | | loadInfo() { |
| | | let _this = this; |
| | | _this.loadFenxiaoOrderBasic(); |
| | | _this.loadFenxiaoOrderList(); |
| | | _this.loadSetOrderList(); |
| | | }, |
| | | //--基础数据 |
| | | loadFenxiaoOrderBasic() { |
| | | let _this = this; |
| | | let obj = {}; |
| | | AjaxProxy.requst({ |
| | | app: _this, |
| | | data:obj, |
| | | url: basePath + '/fenXiao/fenXiaoOrder/loadFenxiaoOrderBasic', |
| | | callback: function (data) { |
| | | _this.basicdetail = data.mapInfo.basicdetail; |
| | | } |
| | | }); |
| | | }, |
| | | //--结算记录 |
| | | loadSetOrderList() { |
| | | let _this = this; |
| | | let data=_this.getRequestParamOrder(); |
| | | data.pageSize=_this.orderLevelList.pageSize; |
| | | data.pageNum=_this.orderLevelList.currentPage; |
| | | AjaxProxy.requst({ |
| | | app: _this, |
| | | data:data, |
| | | url: basePath + '/fenXiao/fenXiaoOrder/loadSetOrderList', |
| | | callback: function (data) { |
| | | _this.orderLevelList.rows = data.rows; |
| | | _this.orderLevelList.total = data.total; |
| | | } |
| | | }); |
| | | }, |
| | | //查询参数 |
| | | getRequestParamOrder(){ |
| | | let _this = this; |
| | | let startTime = ''; |
| | | let endTime = ''; |
| | | if(_this.formOrder.jssj.length > 0){ |
| | | startTime = _this.formOrder.jssj[0]; |
| | | endTime = _this.formOrder.jssj[1]; |
| | | } |
| | | return { |
| | | userName:_this.formOrder.userName, |
| | | startTime:startTime, |
| | | endTime:endTime, |
| | | order:_this.formOrder.order, |
| | | sort:_this.formOrder.sort, |
| | | } |
| | | }, |
| | | //查询 |
| | | searchFormOrder:function(){ |
| | | this.orderLevelList.currentPage=1; |
| | | this.loadSetOrderList(); |
| | | }, |
| | | //重置 |
| | | resetFormOrder(formName) { |
| | | this.$refs[formName].resetFields(); |
| | | }, |
| | | changePageSizeOrder(val) { |
| | | this.orderLevelList.pageSize = val; |
| | | this.loadSetOrderList(); |
| | | }, |
| | | changeCurrentPageOrder(val) { |
| | | this.orderLevelList.currentPage = val; |
| | | this.loadSetOrderList(); |
| | | }, |
| | | //--分销订单 |
| | | loadFenxiaoOrderList() { |
| | | let _this = this; |
| | | let data=_this.getRequestParam(); |
| | | data.pageSize=_this.fxyList.pageSize; |
| | | data.pageNum=_this.fxyList.currentPage; |
| | | AjaxProxy.requst({ |
| | | app: _this, |
| | | data:data, |
| | | url: basePath + '/fenXiao/fenXiaoOrder/loadFenxiaoOrderList', |
| | | callback: function (data) { |
| | | _this.fxyList.rows = data.rows; |
| | | _this.fxyList.total = data.total; |
| | | } |
| | | }); |
| | | }, |
| | | //查询参数 |
| | | getRequestParam(){ |
| | | let _this = this; |
| | | let startTime = ''; |
| | | let endTime = ''; |
| | | if(_this.form.ddsj.length > 0){ |
| | | startTime = _this.form.ddsj[0]; |
| | | endTime = _this.form.ddsj[1]; |
| | | } |
| | | return { |
| | | orderType:_this.form.orderType, |
| | | ddType:_this.form.ddType, |
| | | tgy:_this.form.tgy, |
| | | userName:_this.form.userName, |
| | | jsbh:_this.form.jsbh, |
| | | startTime:startTime, |
| | | endTime:endTime, |
| | | ddh:_this.form.ddh, |
| | | order:_this.form.order, |
| | | sort:_this.form.sort, |
| | | } |
| | | }, |
| | | //查询 |
| | | search:function(){ |
| | | this.fxyList.currentPage=1; |
| | | this.loadFenxiaoOrderList(); |
| | | }, |
| | | //重置 |
| | | resetForm(formName) { |
| | | this.$refs[formName].resetFields(); |
| | | }, |
| | | changePageSize(val) { |
| | | this.fxyList.pageSize = val; |
| | | this.loadFenxiaoOrderList(); |
| | | }, |
| | | changeCurrentPage(val) { |
| | | this.fxyList.currentPage = val; |
| | | this.loadFenxiaoOrderList(); |
| | | }, |
| | | //排序 |
| | | sortChange:function (column){ |
| | | if(column.order){ |
| | | if(column.order.indexOf("desc")){ |
| | | this.form.order="desc"; |
| | | }else{ |
| | | this.form.order="asc"; |
| | | } |
| | | this.form.sort=column.prop; |
| | | this.loadInfo(); |
| | | } |
| | | }, |
| | | //选择 |
| | | handleSelectionChange(val) { |
| | | let _this = this; |
| | | _this.multipleSelection = val; |
| | | //拼接出一个逗号隔开的字符串 |
| | | let submitDate = ""; |
| | | let orderNum = 0; |
| | | let orderBalance = 0; |
| | | let orderNumsDone = 0; |
| | | let name = []; |
| | | for (let i = 0; i < _this.multipleSelection.length; i++) { |
| | | let order = _this.multipleSelection[i]; |
| | | //待审核的计算到弹出框 |
| | | let orderState = order.orderState; |
| | | if(orderState == 4 || orderState == 5){ |
| | | let orderId = order.id; |
| | | name.push(order.customUserId); |
| | | orderNum = orderNum + 1; |
| | | orderBalance = orderBalance + order.profitBalance; |
| | | submitDate = submitDate +orderId+","; |
| | | }else{ |
| | | orderNumsDone = orderNumsDone + 1; |
| | | } |
| | | } |
| | | _this.orderNumsDones = orderNumsDone; |
| | | _this.orderIds = submitDate; |
| | | _this.orderNums = orderNum; |
| | | _this.formSelect.jsdds = orderNum; |
| | | _this.formSelect.jsje = orderBalance; |
| | | _this.formSelect.jsrs = _this.distinctFunction(name).length; |
| | | }, |
| | | //去重 |
| | | distinctFunction(name){ |
| | | var arr = name, |
| | | result = [], |
| | | i, |
| | | j, |
| | | len = arr.length; |
| | | for(i = 0; i < len; i++){ |
| | | for(j = i + 1; j < len; j++){ |
| | | if(arr[i] === arr[j]){ |
| | | j = ++i; |
| | | } |
| | | } |
| | | result.push(arr[i]); |
| | | } |
| | | return result; |
| | | }, |
| | | //批量结算 |
| | | setOrderDone() { |
| | | if(this.orderNumsDones > 0){ |
| | | this.$message({ |
| | | message: '订单状态【待评价】和【已评价】才允许结算', |
| | | type: 'warning' |
| | | }); |
| | | }else if(this.orderNums > 0){ |
| | | this.dialogFormVisible = true; |
| | | }else{ |
| | | this.$message({ |
| | | message: '至少需要选中一条数据', |
| | | type: 'warning' |
| | | }); |
| | | } |
| | | }, |
| | | updateSetOrderDone(){ |
| | | let _this = this; |
| | | let obj = { |
| | | orderIds: _this.orderIds, |
| | | setType: _this.formSelect.jsfs, |
| | | manCount: _this.formSelect.jsrs, |
| | | orderCount: _this.formSelect.jsdds, |
| | | amount: _this.formSelect.jsje, |
| | | remark: _this.formSelect.bz, |
| | | } |
| | | AjaxProxy.requst({ |
| | | app: _this, |
| | | data:obj, |
| | | url: basePath + '/fenXiao/fenXiaoOrder/updateSetOrderDone', |
| | | callback: function (data) { |
| | | _this.$message.success(data.info); |
| | | _this.loadFenxiaoOrderList(); |
| | | _this.dialogFormVisible = false; |
| | | } |
| | | }); |
| | | }, |
| | | } |
| | | }) |
| | | </script> |
| | | |
| | | </body> |
| | | </html> |
| | |
| | | </template> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row style="margin-top: 20px;"> |
| | | <el-col> |
| | | <template v-for="paramSettingTwo in fxms"> |
| | |
| | | </template> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row style="margin-top: 20px;"> |
| | | <el-col> |
| | | <template v-for="paramSettingThree in sqfs"> |
| | | <el-form-item> |
| | | <span slot="label">{{paramSettingThree.paramName}}</span> |
| | | <el-col> |
| | | <el-radio-group v-model="paramSettingThree.paramValue"> |
| | | <el-radio-group v-model="paramSettingThree.paramValue" @change="sqfsChange"> |
| | | <div style="margin-top: 12px;"><el-radio :label="'1'">无需申请满足条件自动成为分销员</el-radio></div> |
| | | <div style="margin-top: 20px;"><el-radio :label="'2'">需要客户主动申请</el-radio></div> |
| | | </el-radio-group> |
| | |
| | | </template> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 20px;"> |
| | | <el-col> |
| | | <template v-for="paramSettingFour in shfs"> |
| | | <el-form-item> |
| | | <span slot="label">{{paramSettingFour.paramName}}</span> |
| | | <el-col> |
| | | <el-radio-group v-model="paramSettingFour.paramValue"> |
| | | <div style="margin-top: 12px;"><el-radio :label="'1'">系统自动审核</el-radio></div> |
| | | <div style="margin-top: 20px;"><el-radio :label="'2'">人工审核</el-radio></div> |
| | | </el-radio-group> |
| | | </el-col> |
| | | </el-form-item > |
| | | </template> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="margin-top: 20px;"> |
| | | |
| | | <el-row v-show="isShow" style="margin-top: 20px;"> |
| | | <el-col> |
| | | <template v-for="paramSettingFive in sqtj"> |
| | | <el-form-item> |
| | |
| | | </template> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row v-show="isShow" style="margin-top: 20px;"> |
| | | <el-col> |
| | | <template v-for="paramSettingFour in shfs"> |
| | | <el-form-item> |
| | | <span slot="label">{{paramSettingFour.paramName}}</span> |
| | | <el-col> |
| | | <el-radio-group v-model="paramSettingFour.paramValue"> |
| | | <div style="margin-top: 12px;"><el-radio :label="'1'">系统自动审核</el-radio></div> |
| | | <div style="margin-top: 20px;"><el-radio :label="'2'">人工审核</el-radio></div> |
| | | </el-radio-group> |
| | | </el-col> |
| | | </el-form-item > |
| | | </template> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | |
| | | <el-drawer |
| | | title="业绩设置" |
| | | :visible.sync="drawer" |
| | |
| | | //表格加载效果 |
| | | loading: false, |
| | | /******搜索表格数据END********/ |
| | | val:'', |
| | | isShow:true, |
| | | fxkg:[], |
| | | fxms:[], |
| | | sqfs:[], |
| | |
| | | let _this = this; |
| | | _this.loadParamSetting(); |
| | | }, |
| | | sqfsChange(val){ |
| | | let _this = this; |
| | | _this.isShow=(val==2)?true:false; |
| | | }, |
| | | loadParamSetting() { |
| | | let _this = this; |
| | | //加载配置 |
| | |
| | | _this.fxkg = data.mapInfo.fxkg; |
| | | _this.fxms = data.mapInfo.fxms; |
| | | _this.sqfs = data.mapInfo.sqfs; |
| | | if(_this.sqfs.length > 0){ |
| | | let paramssqfs = _this.sqfs[0].paramValue; |
| | | if(paramssqfs == 2){ |
| | | _this.isShow = true; |
| | | }else{ |
| | | _this.isShow = false; |
| | | } |
| | | } |
| | | _this.shfs = data.mapInfo.shfs; |
| | | _this.sqtj = data.mapInfo.sqtj; |
| | | //_this.order.items = data.mapInfo.order; |
| | |
| | | }); |
| | | }, |
| | | handleAvatarSuccess(res, file) { |
| | | this.imageUrl = URL.createObjectURL(file.raw); |
| | | this.imageUrl = res.path; |
| | | }, |
| | | beforeAvatarUpload(file) { |
| | | const isJPG = file.type === 'image/jpeg'; |
| | |
| | | } |
| | | }, |
| | | changePageSize(val) { |
| | | this.table.pageSize = val; |
| | | this.fxyList.pageSize = val; |
| | | this.loadParamSetting(); |
| | | }, |
| | | changeCurrentPage(val) { |
| | | this.table.currentPage = val; |
| | | this.fxyList.currentPage = val; |
| | | this.loadParamSetting(); |
| | | }, |
| | | //时间格式化 |
| | |
| | | <div class="col-md-2 col-xs-12"> |
| | | <!-- 功能按钮部分 --> |
| | | <div class=""> |
| | | <button onclick="setUserSales('1')" type="button" |
| | | class="btn btn-success btn-sm" matrix:btn="shopUser-exchangeScore"> |
| | | <i class="fa fa-plus"></i>设为销售员 |
| | | </button> |
| | | <button onclick="setUserSales('0')" type="button" |
| | | class="btn btn-success btn-sm" matrix:btn="shopUser-exchangeScore"> |
| | | <i class="fa fa-minus-square"></i> 解除销售员 |
| | | </button> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="col-md-10 col-xs-12"> |
| | |
| | | function buildOperate(value, row, index){ |
| | | var html = ""; |
| | | html += '<div class="btn-group">' |
| | | if (row.userVip == 1) { |
| | | html += btns[0].replace('VALUE',value) |
| | | html += btns[1].replace('VALUE',value) |
| | | } |
| | | html += '</div>'; |
| | | return html; |
| | | } |
| | | |
| | | function exchangeScore(_userId) { |
| | | layer.open({ |
| | | type : 2, |
| | | title : "兑换积分", |
| | | area : [ MUI.SIZE_L, '400px' ], |
| | | maxmin : true, |
| | | content : [ basePath+'/admin/bizUserScore/intoExchangePage?userId=' + _userId] |
| | | }) |
| | | } |
| | | |
| | | function getScoreFlow(_userId) { |
| | | layer.open({ |
| | | type : 2, |
| | | title : "积分流水", |
| | | area : [ MUI.SIZE_L, '400px' ], |
| | | maxmin : true, |
| | | content : [ basePath+'/admin/redirect/shop/user-score-flow?userId=' + _userId] |
| | | }) |
| | | } |
| | | |
| | | //设置用户销售员身份 |
| | | function setUserSales(_status) { |
| | | |
| | | var ids = myGrid.getSelectItemsIds("userId"); |
| | | if(ids.length < 1){ |
| | | layer.msg("请选择要操作的数据", { |
| | | icon : 5 |
| | | }); |
| | | return false; |
| | | } |
| | | var url = basePath + "/admin/bizUser/setUserSales?ids=" + ids + "&status=" + _status; |
| | | |
| | | if(_status == '1'){ |
| | | MTools.handleItem(url,"确认要将这" + ids.split(",").length + "个用户设置为销售员吗?",function(){ |
| | | myGrid.serchData(1) |
| | | }); |
| | | } else { |
| | | MTools.handleItem(url,"确认要取消这" + ids.split(",").length + "个用户的销售员身份吗?",function(){ |
| | | myGrid.serchData(1) |
| | | }); |
| | | } |
| | | } |
| | | </script> |
| | | <!--权限按钮--> |
| | | <script matrix:btn="shopUser-exchangeScore"> |
| | | btns[0] = '<button type="button" class="btn btn-info mr10" onClick="exchangeScore(\'VALUE\')">兑换积分</button>' |
| | | </script> |
| | | <script matrix:btn="shopUser-scoreFlow"> |
| | | btns[1] = '<button type="button" class="btn btn-primary ml10" onClick="getScoreFlow(\'VALUE\')">查看流水</button>' |
| | | </script> |
| | | |
| | | </body> |
| | | </html> |
New file |
| | |
| | | package com.matrix; |
| | | |
| | | import com.matrix.system.shopXcx.dao.ShopOrderV2Dao; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | /** |
| | | * 测试类示例 |
| | | * |
| | | * @author jiangyouyao |
| | | * @email 512061637@qq.com |
| | | * @date 2019年2月25日 |
| | | */ |
| | | @RunWith(SpringRunner.class) |
| | | @SpringBootTest(classes = {ZqErpApplication.class},webEnvironment =SpringBootTest.WebEnvironment.RANDOM_PORT) |
| | | public class JyyTests { |
| | | |
| | | |
| | | @Autowired |
| | | private ShopOrderV2Dao shopOrderV2Dao; |
| | | |
| | | |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @Test |
| | | public void testSelectReceivedOrderCount() throws InterruptedException { |
| | | System.out.println( shopOrderV2Dao.selectReceivedOrderCount("oJkRK4yelehsY4S7I6Ee1ydWtQMI")); |
| | | } |
| | | |
| | | @Test |
| | | public void testCountOrderAmount() throws InterruptedException { |
| | | System.out.println( shopOrderV2Dao.countOrderAmount("oJkRK4yelehsY4S7I6Ee1ydWtQMI")); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void countBuyZdcp() throws InterruptedException { |
| | | System.out.println( shopOrderV2Dao.countBuyZdcp("oJkRK4yelehsY4S7I6Ee1ydWtQMI","1167,1263,1262")); |
| | | } |
| | | |
| | | |
| | | } |