Pre Merge pull request !216 from 吴贝/release-v0.0.1
This commit is contained in:
commit
8c1c433171
9
pom.xml
9
pom.xml
|
|
@ -214,6 +214,13 @@
|
|||
<version>${ruoyi.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 商业代码-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-business</artifactId>
|
||||
<version>${ruoyi.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
|
@ -224,6 +231,8 @@
|
|||
<module>ruoyi-quartz</module>
|
||||
<module>ruoyi-generator</module>
|
||||
<module>ruoyi-common</module>
|
||||
<module>ruoyi-business</module>
|
||||
<!-- <module>ruoyi-vue-ui</module>-->
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
|
|
|
|||
|
|
@ -79,6 +79,12 @@
|
|||
<artifactId>ruoyi-generator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 商业代码-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-business</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
@ -106,7 +112,32 @@
|
|||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
<warName>${project.artifactId}</warName>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy Vue.js frontend content</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>src/main/resources/public</outputDirectory>
|
||||
<overwrite>true</overwrite>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${project.parent.basedir}/ruoyi-vue-ui/target/dist</directory>
|
||||
<includes>
|
||||
<include>static/</include>
|
||||
<include>index.html</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
</build>
|
||||
|
|
|
|||
|
|
@ -6,9 +6,12 @@ spring:
|
|||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://www.ks1.top:20336/Bizz?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true
|
||||
username: root
|
||||
password: password
|
||||
password: 123456
|
||||
#url: jdbc:mysql://101.200.139.69:3306/majiang?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
#username: root
|
||||
#password: jaLZ;nr+O2rC
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ ruoyi:
|
|||
# 版权年份
|
||||
copyrightYear: 2019
|
||||
# 实例演示开关
|
||||
demoEnabled: true
|
||||
demoEnabled: false
|
||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||
profile: D:/ruoyi/uploadPath
|
||||
# 获取ip地址开关
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="/home/ruoyi/logs" />
|
||||
<property name="log.path" value="${BUILD_FOLDER:-logs}" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,119 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>4.4.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>jar</packaging>
|
||||
<artifactId>ruoyi-business</artifactId>
|
||||
|
||||
<description>
|
||||
商业代码
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringBoot集成thymeleaf模板 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- spring-boot-devtools -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<optional>true</optional> <!-- 表示依赖不会传递 -->
|
||||
</dependency>
|
||||
|
||||
<!-- swagger2-->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger2</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--防止进入swagger页面报类型转换错误,排除2.9.2中的引用,手动增加1.5.21版本-->
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
<version>1.5.21</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
<version>1.5.21</version>
|
||||
</dependency>
|
||||
|
||||
<!-- swagger2-UI-->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql驱动包 -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 核心模块-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-framework</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 定时任务-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-quartz</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 代码生成-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-generator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel</artifactId>
|
||||
<version>2.2.6</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>2.1.1.RELEASE</version>
|
||||
<configuration>
|
||||
<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<configuration>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
<warName>${project.artifactId}</warName>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package com.ruoyi.business.ajax;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.business.ajax.request.LoginRequest;
|
||||
import com.ruoyi.business.domain.BizMember;
|
||||
import com.ruoyi.business.model.Member;
|
||||
import com.ruoyi.business.service.IBizMemberService;
|
||||
import com.ruoyi.business.utils.Encrypt;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.JWTUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
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 javax.annotation.Resource;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 前端用户登录
|
||||
* @author bei.wu
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ajax")
|
||||
public class AjaxLoginController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private IBizMemberService bizMemberService;
|
||||
|
||||
@PostMapping("/login")
|
||||
public AjaxResult login(@RequestBody LoginRequest request) {
|
||||
if (StringUtils.isBlank(request.getMobile()) || StringUtils.isBlank(request.getPassword())) {
|
||||
return AjaxResult.warn("请输入用户名密码");
|
||||
}
|
||||
|
||||
BizMember bizMember = bizMemberService.selectBizMemberByMobile(request.getMobile());
|
||||
if (Objects.isNull(bizMember)) {
|
||||
return AjaxResult.warn("用户名或密码错误");
|
||||
}
|
||||
// DES加密
|
||||
String encryptPassword = Encrypt.encrypt(request.getPassword());
|
||||
if (!encryptPassword.equals(bizMember.getPassword())) {
|
||||
return AjaxResult.warn("用户名或密码错误");
|
||||
}
|
||||
|
||||
if (bizMember.getIsEnable() == 0) {
|
||||
return AjaxResult.warn("账户已禁用,请联系系统管理员");
|
||||
}
|
||||
|
||||
Member member = new Member(bizMember.getId(), bizMember.getMemberName(), bizMember.getMobile());
|
||||
|
||||
Long day = 1000L * 60L * 60L;
|
||||
String token = JWTUtil.createJWT(member.toJsonString(), day);
|
||||
return AjaxResult.success(token);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
package com.ruoyi.business.ajax;
|
||||
|
||||
import com.ruoyi.business.domain.BizCashInfo;
|
||||
import com.ruoyi.business.domain.BizMember;
|
||||
import com.ruoyi.business.domain.BizMemberAddress;
|
||||
import com.ruoyi.business.service.IBizCashInfoService;
|
||||
import com.ruoyi.business.service.IBizMemberAddressService;
|
||||
import com.ruoyi.business.service.IBizMemberService;
|
||||
import com.ruoyi.common.annotation.AjaxLogin;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@AjaxLogin
|
||||
@RestController
|
||||
@RequestMapping("/ajax/member")
|
||||
public class AjaxMemberController extends AuthController {
|
||||
|
||||
@Resource
|
||||
private IBizMemberService bizMemberService;
|
||||
|
||||
@Resource
|
||||
private IBizMemberAddressService bizMemberAddressService;
|
||||
|
||||
@Resource
|
||||
private IBizCashInfoService bizCashInfoService;
|
||||
|
||||
//个人中心
|
||||
@PostMapping("/center")
|
||||
public AjaxResult center()
|
||||
{
|
||||
Long userID = getUserID();
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
BizMember member = bizMemberService.selectBizMemberById(userID);
|
||||
resultMap.put("name", member.getMemberName());
|
||||
resultMap.put("mobile", member.getMobile());
|
||||
resultMap.put("douBalance", member.getDouBalance());
|
||||
resultMap.put("douPerson", member.getDouPerson());
|
||||
resultMap.put("douTeam", member.getDouTeam());
|
||||
resultMap.put("douSpecial", member.getDouSpecial());
|
||||
resultMap.put("douField", member.getDouField());
|
||||
return AjaxResult.success(resultMap);
|
||||
}
|
||||
|
||||
//读取我的地址列表
|
||||
@PostMapping("/addressList")
|
||||
public AjaxResult addressList()
|
||||
{
|
||||
Long userID = getUserID();
|
||||
return AjaxResult.success(bizMemberAddressService.selectBizMemberAddressList(userID));
|
||||
}
|
||||
|
||||
//我的地址详细
|
||||
@PostMapping("/addressDetail")
|
||||
public AjaxResult addressDetail(Long addressID)
|
||||
{
|
||||
Long userID = getUserID();
|
||||
BizMemberAddress address = bizMemberAddressService.selectBizMemberAddressById(addressID);
|
||||
if (address == null || address.getMemberID() != userID) {
|
||||
return AjaxResult.error("操作有误请重试");
|
||||
}
|
||||
return AjaxResult.success(address);
|
||||
}
|
||||
|
||||
//编辑我的地址
|
||||
@PostMapping("/addressEdit")
|
||||
public AjaxResult addressDetail(BizMemberAddress bizMemberAddress)
|
||||
{
|
||||
Long userID = getUserID();
|
||||
BizMemberAddress address = bizMemberAddressService.selectBizMemberAddressById(bizMemberAddress.getId());
|
||||
if (address == null || address.getMemberID() != userID) {
|
||||
return AjaxResult.error("操作有误请重试");
|
||||
}
|
||||
return AjaxResult.success(bizMemberAddressService.updateBizMemberAddress(bizMemberAddress));
|
||||
}
|
||||
|
||||
//删除我的地址
|
||||
@PostMapping("/addressDelete")
|
||||
public AjaxResult addressDelete(Long addressID)
|
||||
{
|
||||
Long userID = getUserID();
|
||||
BizMemberAddress address = bizMemberAddressService.selectBizMemberAddressById(addressID);
|
||||
if (address == null || address.getMemberID() != userID) {
|
||||
return AjaxResult.error("操作有误请重试");
|
||||
}
|
||||
if (bizMemberAddressService.selectBizMemberAddressList(userID).size() <= 1) {
|
||||
return AjaxResult.error("不能删除默认收货地址");
|
||||
}
|
||||
return AjaxResult.success(bizMemberAddressService.deleteBizMemberAddressById(addressID));
|
||||
}
|
||||
|
||||
//提现信息
|
||||
@PostMapping("/getCashInfo")
|
||||
public AjaxResult getCashInfo(int type)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
//提现申请
|
||||
@PostMapping("/addCashInfo")
|
||||
public AjaxResult addCashInfo(BizCashInfo bizCashInfo)
|
||||
{
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
//我的提现信息列表
|
||||
@PostMapping("/listCashInfo")
|
||||
public AjaxResult listCashInfo()
|
||||
{
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
package com.ruoyi.business.ajax;
|
||||
|
||||
import com.ruoyi.business.domain.*;
|
||||
import com.ruoyi.business.service.*;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/ajax/order")
|
||||
public class AjaxOrderController extends AuthController {
|
||||
|
||||
@Resource
|
||||
private IBizOrderService bizOrderService;
|
||||
|
||||
@Resource
|
||||
private IBizProductService bizProductService;
|
||||
|
||||
@Resource
|
||||
private IBizMemberService bizMemberService;
|
||||
|
||||
@Resource
|
||||
private IBizMemberAddressService bizMemberAddressService;
|
||||
|
||||
|
||||
//我的订单(status-1取全部订单)
|
||||
@PostMapping("/orderList")
|
||||
public AjaxResult orderList(Integer status)
|
||||
{
|
||||
Long userID = getUserID();
|
||||
BizOrder order = new BizOrder();
|
||||
order.setMemberId(userID);
|
||||
order.setOrderStatus(status);
|
||||
return AjaxResult.success(bizOrderService.selectBizOrderList(order));
|
||||
}
|
||||
|
||||
//我的订单详情
|
||||
@PostMapping("/orderDetail")
|
||||
public AjaxResult orderDetail(Long orderID)
|
||||
{
|
||||
Long userID = getUserID();
|
||||
BizOrder order = bizOrderService.selectBizOrderById(orderID);
|
||||
if (order == null || !userID.equals(order.getMemberId())) {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
return AjaxResult.success(order);
|
||||
}
|
||||
|
||||
//订单结账
|
||||
@PostMapping("/orderConclude")
|
||||
public AjaxResult orderConclude(Long productID, Integer productNum)
|
||||
{
|
||||
Long userID = getUserID();
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
//取出福豆余额
|
||||
resultMap.put("douBalance", bizMemberService.selectBizMemberDou(userID, BizAccount.DOU_BALANCE));
|
||||
//取出默认地址
|
||||
BizMemberAddress defaultAddress = bizMemberAddressService.selectDefaultAddressByMemberId(userID);
|
||||
resultMap.put("defaultAddress", defaultAddress);
|
||||
//取出商品
|
||||
BizProduct product = bizProductService.selectBizProductById(productID);
|
||||
if (product == null || product.getOnlineStatus() == 0) { //检测上架
|
||||
return AjaxResult.error("该商品不存在");
|
||||
}
|
||||
resultMap.put("productName", product.getProductName());
|
||||
resultMap.put("productNum", productNum);
|
||||
resultMap.put("productPrice", product.getAmount());
|
||||
resultMap.put("orderPrice", product.getAmount().multiply(new BigDecimal(productNum)));
|
||||
return AjaxResult.success(resultMap);
|
||||
}
|
||||
|
||||
//下订单
|
||||
@PostMapping("/orderAdd")
|
||||
public AjaxResult orderAdd(Long productID, Integer productNum, Long addressID, String remark)
|
||||
{
|
||||
Long userID = getUserID();
|
||||
|
||||
return bizOrderService.orderAdd(userID, productID, productNum, addressID, remark);
|
||||
}
|
||||
|
||||
//取消订单
|
||||
@PostMapping("/orderCancel")
|
||||
public AjaxResult orderCancel(Long orderID)
|
||||
{
|
||||
Long userID = getUserID();
|
||||
|
||||
//TODO 取消订单延后(专项划拨处理??)
|
||||
return bizOrderService.orderConfirm(userID, orderID);
|
||||
}
|
||||
|
||||
//订单收货
|
||||
@PostMapping("/orderConfirm")
|
||||
public AjaxResult orderConfirm(Long orderID)
|
||||
{
|
||||
Long userID = getUserID();
|
||||
|
||||
return bizOrderService.orderConfirm(userID, orderID);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
package com.ruoyi.business.ajax;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.ExcelReader;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.ruoyi.business.domain.BizProduct;
|
||||
import com.ruoyi.business.domain.BizProductType;
|
||||
import com.ruoyi.business.mapper.BizAccountMapper;
|
||||
import com.ruoyi.business.mapper.BizMemberMapper;
|
||||
import com.ruoyi.business.service.IBizProductService;
|
||||
import com.ruoyi.business.service.IBizProductTypeService;
|
||||
import com.ruoyi.business.sync.UserData;
|
||||
import com.ruoyi.business.sync.UserDataListener;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/ajax/product")
|
||||
public class AjaxProductController extends AuthController {
|
||||
|
||||
@Resource
|
||||
private IBizProductService bizProductService;
|
||||
|
||||
@Resource
|
||||
private IBizProductTypeService bizProductTypeService;
|
||||
|
||||
//分类和推荐商品
|
||||
@PostMapping("/center")
|
||||
public AjaxResult center()
|
||||
{
|
||||
PageHelper.startPage(1, 10);
|
||||
//首页分类
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
BizProductType productType = new BizProductType();
|
||||
productType.setIsEnable(1);
|
||||
resultMap.put("typeList", bizProductTypeService.selectBizProductTypeList(productType));
|
||||
|
||||
//首页商品
|
||||
BizProduct product = new BizProduct();
|
||||
product.setOnlineStatus(1);
|
||||
resultMap.put("productList", getSimpleProductList(bizProductService.selectBizProductList(product)));
|
||||
return AjaxResult.success(resultMap);
|
||||
}
|
||||
|
||||
//产品列表
|
||||
@PostMapping("/list")
|
||||
public AjaxResult list(Long typeID)
|
||||
{
|
||||
PageHelper.startPage(1, 20);
|
||||
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
BizProductType productType = new BizProductType();
|
||||
productType.setIsEnable(1);
|
||||
resultMap.put("typeList", bizProductTypeService.selectBizProductTypeList(productType));
|
||||
|
||||
BizProduct product = new BizProduct();
|
||||
product.setOnlineStatus(1);
|
||||
product.setProductTypeId(typeID);
|
||||
resultMap.put("productList", getSimpleProductList(bizProductService.selectBizProductList(product)));
|
||||
resultMap.put("typeID", typeID);
|
||||
return AjaxResult.success(resultMap);
|
||||
}
|
||||
|
||||
//读取产品
|
||||
@PostMapping("/load")
|
||||
public AjaxResult load(Long productId)
|
||||
{
|
||||
BizProduct bizProduct = bizProductService.selectBizProductById(productId);
|
||||
return AjaxResult.success(bizProduct);
|
||||
}
|
||||
|
||||
//简易商品列表
|
||||
private List<Map> getSimpleProductList(List<BizProduct> productList)
|
||||
{
|
||||
List<Map> resultList = new ArrayList<Map>();
|
||||
for (BizProduct bizProduct : productList) {
|
||||
Map map = new HashMap();
|
||||
map.put("name", bizProduct.getProductName());
|
||||
map.put("mainImage", bizProduct.getMainImage());
|
||||
map.put("price", bizProduct.getAmount());
|
||||
resultList.add(map);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.ruoyi.business.ajax;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.business.model.Member;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
public class AuthController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private HttpServletRequest request;
|
||||
|
||||
//获取前端登录用户ID
|
||||
public Long getUserID() {
|
||||
return getMember().getId();
|
||||
}
|
||||
|
||||
public Member getMember() {
|
||||
String jsonString = (String) request.getAttribute("member");
|
||||
return JSONObject.parseObject(jsonString, Member.class);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,139 @@
|
|||
package com.ruoyi.business.ajax;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.ExcelReader;
|
||||
import com.ruoyi.business.domain.BizAccount;
|
||||
import com.ruoyi.business.domain.BizMember;
|
||||
import com.ruoyi.business.mapper.*;
|
||||
import com.ruoyi.business.service.IBizMemberService;
|
||||
import com.ruoyi.business.sync.*;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/ajax/data")
|
||||
public class SyncDataController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private BizMemberMapper memberMapper;
|
||||
@Resource
|
||||
private BizAccountMapper accountMapper;
|
||||
@Resource
|
||||
private BizProductMapper productMapper;
|
||||
@Resource
|
||||
private BizProductTypeMapper productTypeMapper;
|
||||
@Resource
|
||||
private BizMemberAddressMapper memberAddressMapper;
|
||||
@Resource
|
||||
private BizOrderMapper orderMapper;
|
||||
|
||||
@PostMapping("/user")
|
||||
public AjaxResult user(@RequestParam("file") MultipartFile file) {
|
||||
ExcelReader reader = null;
|
||||
try {
|
||||
reader = EasyExcel.read(file.getInputStream(), UserData.class, new UserDataListener(memberMapper, accountMapper)).build();
|
||||
reader.readAll();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
assert reader != null;
|
||||
reader.finish();
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PostMapping("/goods")
|
||||
public AjaxResult goods(@RequestParam("file") MultipartFile file) {
|
||||
ExcelReader reader = null;
|
||||
try {
|
||||
reader = EasyExcel.read(file.getInputStream(), GoodsData.class, new GoodsDataListener(productMapper, productTypeMapper)).build();
|
||||
reader.readAll();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
assert reader != null;
|
||||
reader.finish();
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PostMapping("/memberAddress")
|
||||
public AjaxResult memberAddress(@RequestParam("file") MultipartFile file) {
|
||||
ExcelReader reader = null;
|
||||
try {
|
||||
reader = EasyExcel.read(file.getInputStream(), UserAddressData.class, new UserAddressDataListener(memberAddressMapper, memberMapper)).build();
|
||||
reader.readAll();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
assert reader != null;
|
||||
reader.finish();
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PostMapping("/order")
|
||||
public AjaxResult order(@RequestParam("file") MultipartFile file) {
|
||||
ExcelReader reader = null;
|
||||
try {
|
||||
reader = EasyExcel.read(file.getInputStream(), OrderData.class, new OrderDataListener(orderMapper, memberMapper, productMapper)).build();
|
||||
reader.readAll();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
assert reader != null;
|
||||
reader.finish();
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PostMapping("/initUserTree")
|
||||
public AjaxResult initUserTree() {
|
||||
List<BizMember> memberList = memberMapper.selectBizMemberAll();
|
||||
BizMember member = memberMapper.selectBizMemberByMobile("13971055153");
|
||||
getChild(member, memberList);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
private void getChild(BizMember member, List<BizMember> memberList) {
|
||||
for (BizMember m : memberList) {
|
||||
if (member.getMobile().equals(m.getRecommendMobile())) {
|
||||
m.setRecommendId(member.getId());
|
||||
memberMapper.updateBizMember(m);
|
||||
getChild(m, memberList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/initRecommendIds")
|
||||
public AjaxResult initRecommendIds() {
|
||||
List<BizMember> memberList = memberMapper.selectBizMemberAll();
|
||||
for (BizMember member : memberList) {
|
||||
String id = getChildIds(member, memberList, new StringBuffer());
|
||||
member.setRecommendAllId(id.substring(0, id.length() - 1));
|
||||
memberMapper.updateBizMember(member);
|
||||
}
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
private String getChildIds(BizMember member, List<BizMember> memberList, StringBuffer sb) {
|
||||
for (BizMember m : memberList) {
|
||||
if (member.getRecommendId().equals(m.getId())) {
|
||||
String id = m.getId() + ",";
|
||||
sb.insert(0, id);
|
||||
getChildIds(m, memberList, sb);
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.ruoyi.business.ajax.request;
|
||||
|
||||
public class LoginRequest {
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String mobile;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
public String getMobile() {
|
||||
return mobile;
|
||||
}
|
||||
|
||||
public void setMobile(String mobile) {
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
package com.ruoyi.business.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.business.domain.BizCashInfo;
|
||||
import com.ruoyi.business.service.IBizCashInfoService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 兑现申请记录Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-23
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/business/cash")
|
||||
public class BizCashInfoController extends BaseController
|
||||
{
|
||||
private String prefix = "business/cash";
|
||||
|
||||
@Resource
|
||||
private IBizCashInfoService bizCashInfoService;
|
||||
|
||||
@RequiresPermissions("business:cash:view")
|
||||
@GetMapping()
|
||||
public String cash()
|
||||
{
|
||||
return prefix + "/cash";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询兑现申请记录列表
|
||||
*/
|
||||
@RequiresPermissions("business:cash:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(BizCashInfo bizCashInfo)
|
||||
{
|
||||
startPage();
|
||||
List<BizCashInfo> list = bizCashInfoService.selectBizCashInfoList(bizCashInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出兑现申请记录列表
|
||||
*/
|
||||
@RequiresPermissions("business:cash:export")
|
||||
@Log(title = "兑现申请记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(BizCashInfo bizCashInfo)
|
||||
{
|
||||
List<BizCashInfo> list = bizCashInfoService.selectBizCashInfoList(bizCashInfo);
|
||||
ExcelUtil<BizCashInfo> util = new ExcelUtil<BizCashInfo>(BizCashInfo.class);
|
||||
return util.exportExcel(list, "cash");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批准兑现申请记录
|
||||
*/
|
||||
@RequiresPermissions("business:cash:edit")
|
||||
@Log(title = "兑现申请记录", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/agree")
|
||||
@ResponseBody
|
||||
public AjaxResult agreeInfo(Long cashInfoID)
|
||||
{
|
||||
BizCashInfo cashInfo = bizCashInfoService.selectBizCashInfoById(cashInfoID);
|
||||
if (cashInfo.getStatus() == BizCashInfo.CASH_INFO_STATUS_INITIAL) {
|
||||
cashInfo.setStatus(BizCashInfo.CASH_INFO_STATUS_AGREE);
|
||||
bizCashInfoService.updateBizCashInfo(cashInfo);
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,311 @@
|
|||
package com.ruoyi.business.controller;
|
||||
|
||||
import com.ruoyi.business.domain.BizAccountDetail;
|
||||
import com.ruoyi.business.domain.BizMember;
|
||||
import com.ruoyi.business.service.IBizAccountService;
|
||||
import com.ruoyi.business.service.IBizMemberService;
|
||||
import com.ruoyi.business.service.IBizProductService;
|
||||
import com.ruoyi.business.task.BusinessTask;
|
||||
import com.ruoyi.business.utils.Encrypt;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.SysDictData;
|
||||
import com.ruoyi.system.utils.DictUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 会员Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-11
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/business/member")
|
||||
public class BizMemberController extends BaseController
|
||||
{
|
||||
private String prefix = "business/member";
|
||||
|
||||
@Autowired
|
||||
private IBizMemberService bizMemberService;
|
||||
|
||||
@Autowired
|
||||
private IBizAccountService bizAccountService;
|
||||
|
||||
@Autowired
|
||||
private IBizProductService bizProductService;
|
||||
|
||||
@RequiresPermissions("business:member:view")
|
||||
@GetMapping()
|
||||
public String member()
|
||||
{
|
||||
return prefix + "/member";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员列表
|
||||
*/
|
||||
@RequiresPermissions("business:member:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(BizMember bizMember)
|
||||
{
|
||||
startPage();
|
||||
List<BizMember> list = bizMemberService.selectBizMemberList(bizMember);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员账户明细
|
||||
*/
|
||||
@RequiresPermissions("business:member:view")
|
||||
@GetMapping("/accountDetail")
|
||||
public String accountDetail(Long memberID, int accountType, ModelMap mmap)
|
||||
{
|
||||
BizMember bizMember = bizMemberService.selectBizMemberSimple(memberID);
|
||||
mmap.put("memberID", memberID);
|
||||
mmap.put("mobile", bizMember.getMobile());
|
||||
mmap.put("memberName", bizMember.getMemberName());
|
||||
mmap.put("accountType", accountType);
|
||||
return prefix + "/accountDetail";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员账户明细
|
||||
*/
|
||||
@RequiresPermissions("business:member:view")
|
||||
@PostMapping("/listAccountDetail")
|
||||
@ResponseBody
|
||||
public TableDataInfo listAccountDetail(BizAccountDetail bizAccountDetail)
|
||||
{
|
||||
startPage();
|
||||
List<BizAccountDetail> list = bizAccountService.selectBizAccountDetailList(bizAccountDetail);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员架构
|
||||
*/
|
||||
@RequiresPermissions("business:member:view")
|
||||
@GetMapping("/accountTeam")
|
||||
public String accountTeam(Long memberID, ModelMap mmap)
|
||||
{
|
||||
BizMember bizMember = bizMemberService.selectBizMemberSimple(memberID);
|
||||
mmap.put("memberID", memberID);
|
||||
mmap.put("memberName", bizMember.getMemberName());
|
||||
mmap.put("productList", bizProductService.selectTeamProductList());
|
||||
return prefix + "/accountTeam";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员架构
|
||||
*/
|
||||
@RequiresPermissions("business:member:view")
|
||||
@PostMapping("/accountTeamDetail")
|
||||
@ResponseBody
|
||||
public AjaxResult accountTeamDetail(Long memberID, Long productID)
|
||||
{
|
||||
Map paramMap = new HashMap();
|
||||
paramMap.put("memberID", memberID);
|
||||
paramMap.put("productID", productID);
|
||||
List<Map> teamList = bizMemberService.selectTeamData(paramMap);
|
||||
Map temp = new HashMap();
|
||||
Map temp2 = new HashMap();
|
||||
long teamNum = 0;
|
||||
//取出架构人员数据
|
||||
for (Map item : teamList) {
|
||||
Long rID = (Long) item.get("recommend_id");
|
||||
List<Map> chList = (List<Map>) temp.get(rID);
|
||||
if (chList == null) {
|
||||
chList = new ArrayList();
|
||||
temp.put(rID, chList);
|
||||
}
|
||||
chList.add(item);
|
||||
teamNum += ((BigDecimal) item.get("num")).longValue();
|
||||
}
|
||||
//重组数据
|
||||
for (Map item : teamList) {
|
||||
Long id = (Long) item.get("id");
|
||||
List<Map> chList = (List<Map>) temp.get(id);
|
||||
if (chList != null) {
|
||||
item.put("children", chList);
|
||||
}
|
||||
}
|
||||
//取出团队盒数等级配置
|
||||
List<SysDictData> levels = DictUtils.getDictCache("busi_teamaward_level");
|
||||
int numLimit = Integer.parseInt(DictUtils.getDictLabel("busi_award_set", "1"));
|
||||
long teamDou = getTeamDou(teamNum, levels, numLimit);
|
||||
//归总直属下级盒数
|
||||
List<Map> list = (List<Map>) temp.get(memberID);
|
||||
if (list != null) {
|
||||
for (Map item : list) {
|
||||
Long id = (Long) item.get("id");
|
||||
long num = ((BigDecimal) item.get("num")).longValue();
|
||||
item.put("totalNum", num);
|
||||
getTeamNum((List<Map>) temp.get(id), item);
|
||||
item.put("desc", getTeamDesc((Long) item.get("totalNum"), levels, numLimit, teamDou));
|
||||
}
|
||||
}
|
||||
Map resultMap = new HashMap();
|
||||
resultMap.put("teamNum", teamNum);
|
||||
resultMap.put("memberList", list);
|
||||
return AjaxResult.success(resultMap);
|
||||
}
|
||||
|
||||
//取出子级团队盒数
|
||||
private void getTeamNum(List<Map> chList, Map parent)
|
||||
{
|
||||
if (chList == null) return;
|
||||
for (Map item : chList) {
|
||||
long num = ((BigDecimal) item.get("num")).longValue();
|
||||
long totalNum = (Long) parent.get("totalNum");
|
||||
parent.put("totalNum", totalNum + num);
|
||||
List<Map> children = (List<Map>) item.get("children");
|
||||
if (children != null) {
|
||||
getTeamNum(children, parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//取得当前团队盒数对应分成
|
||||
public static long getTeamDou(long totalNum, List<SysDictData> levels, int numLimit)
|
||||
{
|
||||
if (totalNum <= numLimit) return 0L;
|
||||
for (SysDictData data : levels) {
|
||||
String label = data.getDictLabel();
|
||||
long dou = Long.parseLong(data.getDictValue());
|
||||
String[] split = label.split("-");
|
||||
long begin = Long.parseLong(split[0]);
|
||||
long end = Long.parseLong(split[1]);
|
||||
if (totalNum >= begin && totalNum <= end) {
|
||||
return dou;
|
||||
}
|
||||
}
|
||||
return 0L;
|
||||
}
|
||||
|
||||
//取出团队盒数说明
|
||||
private String getTeamDesc(long totalNum, List<SysDictData> levels, int numLimit, long teamDou)
|
||||
{
|
||||
long dou = getTeamDou(totalNum, levels, numLimit);
|
||||
if (teamDou == 0) {
|
||||
return "[团队盒数" + totalNum + " 无分成]";
|
||||
}
|
||||
return "[团队盒数" + totalNum + " 分成" + teamDou + "-" + dou + "=" + (teamDou - dou) + "福豆]";
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出会员列表
|
||||
*/
|
||||
@RequiresPermissions("business:member:export")
|
||||
@Log(title = "会员", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(BizMember bizMember)
|
||||
{
|
||||
List<BizMember> list = bizMemberService.selectBizMemberList(bizMember);
|
||||
ExcelUtil<BizMember> util = new ExcelUtil<BizMember>(BizMember.class);
|
||||
return util.exportExcel(list, "member");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增会员
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存会员
|
||||
*/
|
||||
@RequiresPermissions("business:member:add")
|
||||
@Log(title = "会员", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(BizMember bizMember)
|
||||
{
|
||||
return toAjax(bizMemberService.insertBizMember(bizMember));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员
|
||||
*/
|
||||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
||||
{
|
||||
BizMember bizMember = bizMemberService.selectBizMemberById(id);
|
||||
mmap.put("bizMember", bizMember);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存会员
|
||||
*/
|
||||
@RequiresPermissions("business:member:edit")
|
||||
@Log(title = "会员", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(BizMember bizMember)
|
||||
{
|
||||
return toAjax(bizMemberService.updateBizMemberAndDou(bizMember));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看会员密码
|
||||
*/
|
||||
@RequiresPermissions("business:member:edit")
|
||||
@Log(title = "会员密码", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/showPassword")
|
||||
@ResponseBody
|
||||
public AjaxResult showPassword(Long memberID)
|
||||
{
|
||||
BizMember bizMember = bizMemberService.selectBizMemberSimple(memberID);
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
resultMap.put("pwd", Encrypt.decrypt(bizMember.getPassword()));
|
||||
return AjaxResult.success(resultMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员密码
|
||||
*/
|
||||
@RequiresPermissions("business:member:edit")
|
||||
@Log(title = "会员密码", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/editPassword")
|
||||
@ResponseBody
|
||||
public AjaxResult editPassword(Long memberID, String password)
|
||||
{
|
||||
BizMember bizMember = bizMemberService.selectBizMemberSimple(memberID);
|
||||
if(bizMember == null || StringUtils.isEmpty(password)) return toAjax(0);
|
||||
//加密
|
||||
bizMember.setPassword(Encrypt.encrypt(password));
|
||||
return toAjax(bizMemberService.updateBizMember(bizMember));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员
|
||||
*/
|
||||
@RequiresPermissions("business:member:remove")
|
||||
@Log(title = "会员", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(bizMemberService.deleteBizMemberByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,162 @@
|
|||
package com.ruoyi.business.controller;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.business.domain.BizOrder;
|
||||
import com.ruoyi.business.service.IBizOrderService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 订单Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-09
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/business/order")
|
||||
public class BizOrderController extends BaseController
|
||||
{
|
||||
private String prefix = "business/order";
|
||||
|
||||
@Autowired
|
||||
private IBizOrderService bizOrderService;
|
||||
|
||||
@RequiresPermissions("business:order:view")
|
||||
@GetMapping()
|
||||
public String order()
|
||||
{
|
||||
return prefix + "/order";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*/
|
||||
@RequiresPermissions("business:order:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(BizOrder bizOrder)
|
||||
{
|
||||
startPage();
|
||||
List<BizOrder> list = bizOrderService.selectBizOrderList(bizOrder);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出订单列表
|
||||
*/
|
||||
@RequiresPermissions("business:order:export")
|
||||
@Log(title = "订单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(BizOrder bizOrder)
|
||||
{
|
||||
List<BizOrder> list = bizOrderService.selectBizOrderList(bizOrder);
|
||||
ExcelUtil<BizOrder> util = new ExcelUtil<BizOrder>(BizOrder.class);
|
||||
return util.exportExcel(list, "order");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存订单
|
||||
*/
|
||||
@RequiresPermissions("business:order:add")
|
||||
@Log(title = "订单", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(BizOrder bizOrder)
|
||||
{
|
||||
return toAjax(bizOrderService.insertBizOrder(bizOrder));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*/
|
||||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable(value = "id", required = true) Long id, ModelMap mmap)
|
||||
{
|
||||
BizOrder bizOrder = bizOrderService.selectBizOrderById(id);
|
||||
mmap.put("bizOrder", bizOrder);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存订单
|
||||
*/
|
||||
@RequiresPermissions("business:order:edit")
|
||||
@Log(title = "订单", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(BizOrder bizOrder)
|
||||
{
|
||||
return toAjax(bizOrderService.updateBizOrder(bizOrder));
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单发货
|
||||
*/
|
||||
@RequiresPermissions("business:order:edit")
|
||||
@Log(title = "订单发货", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/deliver")
|
||||
@ResponseBody
|
||||
public AjaxResult editDeliver(Long orderID)
|
||||
{
|
||||
return toAjax(bizOrderService.deliverBizOrder(orderID));
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单修改地址/备注
|
||||
*/
|
||||
@RequiresPermissions("business:order:edit")
|
||||
@Log(title = "订单修改地址/备注", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/updateAddressOrRemark")
|
||||
@ResponseBody
|
||||
public AjaxResult updateAddressOrRemark(Long orderID, String content, Integer type)
|
||||
{
|
||||
BizOrder bizOrder = bizOrderService.selectBizOrderById(orderID);
|
||||
if (bizOrder == null) return toAjax(0);
|
||||
if (type == 0) {
|
||||
bizOrder.setAddressDetail(content);
|
||||
} else {
|
||||
bizOrder.setRemark(content);
|
||||
}
|
||||
bizOrder.setUpdateBy(ShiroUtils.getLoginName());
|
||||
bizOrder.setUpdateTime(new Date());
|
||||
return toAjax(bizOrderService.updateBizOrder(bizOrder));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单
|
||||
*/
|
||||
@RequiresPermissions("business:order:remove")
|
||||
@Log(title = "订单", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(bizOrderService.deleteBizOrderByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,160 @@
|
|||
package com.ruoyi.business.controller;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.business.domain.BizProductType;
|
||||
import com.ruoyi.business.service.IBizProductTypeService;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.business.domain.BizProduct;
|
||||
import com.ruoyi.business.service.IBizProductService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 产品Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-06
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/business/product")
|
||||
public class BizProductController extends BaseController
|
||||
{
|
||||
private String prefix = "business/product";
|
||||
|
||||
@Autowired
|
||||
private IBizProductService bizProductService;
|
||||
|
||||
@Autowired
|
||||
private IBizProductTypeService bizProductTypeService;
|
||||
|
||||
@RequiresPermissions("business:product:view")
|
||||
@GetMapping()
|
||||
public String product(ModelMap mmap)
|
||||
{
|
||||
mmap.put("productTypeList", bizProductTypeService.selectBizProductTypeList(new BizProductType()));
|
||||
return prefix + "/product";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询产品列表
|
||||
*/
|
||||
@RequiresPermissions("business:product:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(BizProduct bizProduct)
|
||||
{
|
||||
startPage();
|
||||
List<BizProduct> list = bizProductService.selectBizProductList(bizProduct);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出产品列表
|
||||
*/
|
||||
@RequiresPermissions("business:product:export")
|
||||
@Log(title = "产品", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(BizProduct bizProduct)
|
||||
{
|
||||
List<BizProduct> list = bizProductService.selectBizProductList(bizProduct);
|
||||
ExcelUtil<BizProduct> util = new ExcelUtil<BizProduct>(BizProduct.class);
|
||||
return util.exportExcel(list, "product");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产品
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add(ModelMap mmap)
|
||||
{
|
||||
mmap.put("productTypeList", bizProductTypeService.selectBizProductTypeList(new BizProductType()));
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存产品
|
||||
*/
|
||||
@RequiresPermissions("business:product:add")
|
||||
@Log(title = "产品", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(BizProduct bizProduct)
|
||||
{
|
||||
Date now = new Date();
|
||||
bizProduct.setCreateBy(ShiroUtils.getLoginName());
|
||||
bizProduct.setCreateTime(now);
|
||||
bizProduct.setProductCode("BPD" + DateUtils.getMilliTime());
|
||||
//如果上架设置上架时间
|
||||
if (bizProduct.getOnlineStatus() == 1) {
|
||||
bizProduct.setOnlineTime(now);
|
||||
}
|
||||
return toAjax(bizProductService.insertBizProduct(bizProduct));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改产品
|
||||
*/
|
||||
@GetMapping("/edit/{productId}")
|
||||
public String edit(@PathVariable(value = "productId", required = true) Long productId, ModelMap mmap)
|
||||
{
|
||||
BizProduct bizProduct = bizProductService.selectBizProductById(productId);
|
||||
mmap.put("bizProduct", bizProduct);
|
||||
mmap.put("productTypeList", bizProductTypeService.selectBizProductTypeList(new BizProductType()));
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存产品
|
||||
*/
|
||||
@RequiresPermissions("business:product:edit")
|
||||
@Log(title = "产品", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(BizProduct bizProduct)
|
||||
{
|
||||
bizProduct.setUpdateBy(ShiroUtils.getLoginName());
|
||||
bizProduct.setUpdateTime(new Date());
|
||||
return toAjax(bizProductService.updateBizProduct(bizProduct));
|
||||
}
|
||||
|
||||
/**
|
||||
* 上架下架产品
|
||||
*/
|
||||
@RequiresPermissions("business:product:edit")
|
||||
@Log(title = "产品状态", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/status")
|
||||
@ResponseBody
|
||||
public AjaxResult editStatus(@PathVariable(value = "productId", required = true) Long productID)
|
||||
{
|
||||
return toAjax(bizProductService.updateBizProductStatus(productID));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除产品
|
||||
*/
|
||||
@RequiresPermissions("business:product:remove")
|
||||
@Log(title = "产品", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(bizProductService.deleteBizProductByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,135 @@
|
|||
package com.ruoyi.business.controller;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.business.domain.BizProductType;
|
||||
import com.ruoyi.business.service.IBizProductTypeService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 产品分类Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-05
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/business/productType")
|
||||
public class BizProductTypeController extends BaseController
|
||||
{
|
||||
private String prefix = "business/productType";
|
||||
|
||||
@Autowired
|
||||
private IBizProductTypeService bizProductTypeService;
|
||||
|
||||
@RequiresPermissions("business:productType:view")
|
||||
@GetMapping()
|
||||
public String productType()
|
||||
{
|
||||
return prefix + "/productType";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询产品分类列表
|
||||
*/
|
||||
@RequiresPermissions("business:productType:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(BizProductType bizProductType)
|
||||
{
|
||||
startPage();
|
||||
List<BizProductType> list = bizProductTypeService.selectBizProductTypeList(bizProductType);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出产品分类列表
|
||||
*/
|
||||
@RequiresPermissions("business:productType:export")
|
||||
@Log(title = "产品分类", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(BizProductType bizProductType)
|
||||
{
|
||||
List<BizProductType> list = bizProductTypeService.selectBizProductTypeList(bizProductType);
|
||||
ExcelUtil<BizProductType> util = new ExcelUtil<BizProductType>(BizProductType.class);
|
||||
return util.exportExcel(list, "productType");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产品分类
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存产品分类
|
||||
*/
|
||||
@RequiresPermissions("business:productType:add")
|
||||
@Log(title = "产品分类", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(BizProductType bizProductType)
|
||||
{
|
||||
bizProductType.setCreateBy(ShiroUtils.getLoginName());
|
||||
bizProductType.setCreateTime(new Date());
|
||||
bizProductType.setProductTypeCode("BPT" + DateUtils.getMilliTime());
|
||||
return toAjax(bizProductTypeService.insertBizProductType(bizProductType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改产品分类
|
||||
*/
|
||||
@GetMapping("/edit/{productTypeId}")
|
||||
public String edit(@PathVariable(value = "productTypeId", required = true) Long productTypeId, ModelMap mmap)
|
||||
{
|
||||
BizProductType bizProductType = bizProductTypeService.selectBizProductTypeById(productTypeId);
|
||||
mmap.put("bizProductType", bizProductType);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存产品分类
|
||||
*/
|
||||
@RequiresPermissions("business:productType:edit")
|
||||
@Log(title = "产品分类", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(BizProductType bizProductType)
|
||||
{
|
||||
bizProductType.setUpdateBy(ShiroUtils.getLoginName());
|
||||
bizProductType.setUpdateTime(new Date());
|
||||
return toAjax(bizProductTypeService.updateBizProductType(bizProductType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除产品分类
|
||||
*/
|
||||
@RequiresPermissions("business:productType:remove")
|
||||
@Log(title = "产品分类", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(bizProductTypeService.deleteBizProductTypeByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.ruoyi.business.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.business.domain.BizTeamReward;
|
||||
import com.ruoyi.business.service.IBizTeamRewardService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 团队奖励明细Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-22
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/business/reward")
|
||||
public class BizTeamRewardController extends BaseController
|
||||
{
|
||||
private String prefix = "business/reward";
|
||||
|
||||
@Resource
|
||||
private IBizTeamRewardService bizTeamRewardService;
|
||||
|
||||
@RequiresPermissions("business:member:view")
|
||||
@GetMapping()
|
||||
public String reward(Long memberID, String rewardDate, ModelMap mmap)
|
||||
{
|
||||
mmap.put("memberID", memberID);
|
||||
//检索当前一天结算
|
||||
mmap.put("rewardDate", DateUtils.getDate(-1, rewardDate));
|
||||
mmap.put("rewardType", BizTeamReward.TEAM_REWARD_TYPE_TEAM);
|
||||
return prefix + "/reward";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询团队奖励明细列表
|
||||
*/
|
||||
@RequiresPermissions("business:member:view")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(BizTeamReward bizTeamReward)
|
||||
{
|
||||
startPage();
|
||||
List<BizTeamReward> list = bizTeamRewardService.selectBizTeamRewardList(bizTeamReward);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
package com.ruoyi.business.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 会员账户对象 biz_account
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-14
|
||||
*/
|
||||
public class BizAccount extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
//用户豆账户(0-福豆余额,1-个人福豆,2-团队福豆,3-专项福豆, 4-福豆田)
|
||||
public static final int DOU_BALANCE = 0;
|
||||
public static final int DOU_PERSON = 1;
|
||||
public static final int DOU_TEAM = 2;
|
||||
public static final int DOU_SPECIAL = 3;
|
||||
public static final int DOU_FIELD = 4;
|
||||
|
||||
//二级直推拥有有效下级用户数量条件
|
||||
public static final int SECOND_AWARD_CHILD_LIMIT = 3;
|
||||
|
||||
/** 会员账户ID */
|
||||
private Long id;
|
||||
|
||||
/** 会员ID */
|
||||
@Excel(name = "会员ID")
|
||||
private Long memberId;
|
||||
|
||||
/** 账户类型:0-福豆余额,1-个人福豆,2-团队福豆,3-专项福豆,4-福豆田 */
|
||||
@Excel(name = "账户类型:0-福豆余额,1-个人福豆,2-团队福豆,3-专项福豆,4-福豆田")
|
||||
private Integer accountType;
|
||||
|
||||
/** 账户金额 */
|
||||
@Excel(name = "账户金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setMemberId(Long memberId)
|
||||
{
|
||||
this.memberId = memberId;
|
||||
}
|
||||
|
||||
public Long getMemberId()
|
||||
{
|
||||
return memberId;
|
||||
}
|
||||
public void setAccountType(Integer accountType)
|
||||
{
|
||||
this.accountType = accountType;
|
||||
}
|
||||
|
||||
public Integer getAccountType()
|
||||
{
|
||||
return accountType;
|
||||
}
|
||||
public void setAmount(BigDecimal amount)
|
||||
{
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public BigDecimal getAmount()
|
||||
{
|
||||
return amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("memberId", getMemberId())
|
||||
.append("accountType", getAccountType())
|
||||
.append("amount", getAmount())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,199 @@
|
|||
package com.ruoyi.business.domain;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
/**
|
||||
* 会员账户明细对象 biz_account_detail
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-17
|
||||
*/
|
||||
public class BizAccountDetail extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
//福豆改变类型
|
||||
public static final int DOU_CHANGE_TYPE_ADD = 1;
|
||||
public static final int DOU_CHANGE_TYPE_REDUSE = -1;
|
||||
//福豆使用类型
|
||||
public static final int DOU_DETAIL_TYPE_CHARGE = 1;
|
||||
public static final int DOU_DETAIL_TYPE_DRAW = 2;
|
||||
public static final int DOU_DETAIL_TYPE_EXCHANGE = 3;
|
||||
public static final int DOU_DETAIL_TYPE_RESET = 4;
|
||||
public static final int DOU_DETAIL_TYPE_ORDER = 5;
|
||||
public static final int DOU_DETAIL_TYPE_SYSTEM = 6;
|
||||
//福豆使用备注
|
||||
public static final String DOU_DESC_RECOMM = "直推奖励";
|
||||
public static final String DOU_DESC_SECOND = "二级推荐奖励";
|
||||
public static final String DOU_DESC_TEAM = "团队奖励";
|
||||
public static final String DOU_DESC_SPECIAL1 = "专项账户充值";
|
||||
public static final String DOU_DESC_SPECIAL2 = "专项划拨";
|
||||
public static final String DOU_DESC_ORDER = "订单消费";
|
||||
public static final String DOU_DESC_SYSTEM = "系统调整";
|
||||
|
||||
/** 会员账户明细ID */
|
||||
private Long id;
|
||||
|
||||
/** 会员ID */
|
||||
@Excel(name = "会员ID")
|
||||
private Long memberId;
|
||||
|
||||
/** 会员账户ID */
|
||||
@Excel(name = "会员账户ID")
|
||||
private Long accountId;
|
||||
|
||||
/** 账户类型:0-福豆余额,1-个人福豆,2-团队福豆,3-专项福豆,4-福豆田 */
|
||||
@Excel(name = "账户类型:0-福豆余额,1-个人福豆,2-团队福豆,3-专项福豆,4-福豆田")
|
||||
private Integer accountType;
|
||||
|
||||
/** 业务订单编号: 三方支付/兑现申请/团队明细 */
|
||||
@Excel(name = "业务订单编号: 三方支付/兑现申请/团队明细")
|
||||
private String businessNo;
|
||||
|
||||
/** 变更类型;1:收入(加);-1:支出(减) */
|
||||
@Excel(name = "变更类型;1:收入(加);-1:支出(减)")
|
||||
private Integer changeType;
|
||||
|
||||
/** 变动详情.1:充值;2:提现;3:转账;4:冲正;5:支付 */
|
||||
@Excel(name = "变动详情.1:充值;2:提现;3:转账;4:冲正;5:支付")
|
||||
private Integer typeDetail;
|
||||
|
||||
/** 账户变更金额 */
|
||||
@Excel(name = "账户变更金额")
|
||||
private Long amount;
|
||||
|
||||
/** 账户变更前金额 */
|
||||
@Excel(name = "账户变更前金额")
|
||||
private Long beforeAmount;
|
||||
|
||||
/** 账户变更后金额 */
|
||||
@Excel(name = "账户变更后金额")
|
||||
private Long afterAmount;
|
||||
|
||||
/** 交易备注:充值【一级推荐奖励】,充值【二级推荐奖励】,充值【团队奖励】,充值【专项划拨】,转账【专项划拨】 */
|
||||
@Excel(name = "交易备注:充值【一级推荐奖励】,充值【二级推荐奖励】,充值【团队奖励】,充值【专项划拨】,转账【专项划拨】")
|
||||
private String changeDesc;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setMemberId(Long memberId)
|
||||
{
|
||||
this.memberId = memberId;
|
||||
}
|
||||
|
||||
public Long getMemberId()
|
||||
{
|
||||
return memberId;
|
||||
}
|
||||
public void setAccountId(Long accountId)
|
||||
{
|
||||
this.accountId = accountId;
|
||||
}
|
||||
|
||||
public Long getAccountId()
|
||||
{
|
||||
return accountId;
|
||||
}
|
||||
public void setAccountType(Integer accountType)
|
||||
{
|
||||
this.accountType = accountType;
|
||||
}
|
||||
|
||||
public Integer getAccountType()
|
||||
{
|
||||
return accountType;
|
||||
}
|
||||
public void setBusinessNo(String businessNo)
|
||||
{
|
||||
this.businessNo = businessNo;
|
||||
}
|
||||
|
||||
public String getBusinessNo()
|
||||
{
|
||||
return businessNo;
|
||||
}
|
||||
public void setChangeType(Integer changeType)
|
||||
{
|
||||
this.changeType = changeType;
|
||||
}
|
||||
|
||||
public Integer getChangeType()
|
||||
{
|
||||
return changeType;
|
||||
}
|
||||
public void setTypeDetail(Integer typeDetail)
|
||||
{
|
||||
this.typeDetail = typeDetail;
|
||||
}
|
||||
|
||||
public Integer getTypeDetail()
|
||||
{
|
||||
return typeDetail;
|
||||
}
|
||||
public void setBeforeAmount(Long beforeAmount)
|
||||
{
|
||||
this.beforeAmount = beforeAmount;
|
||||
}
|
||||
|
||||
public Long getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(Long amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public Long getBeforeAmount()
|
||||
{
|
||||
return beforeAmount;
|
||||
}
|
||||
public void setAfterAmount(Long afterAmount)
|
||||
{
|
||||
this.afterAmount = afterAmount;
|
||||
}
|
||||
|
||||
public Long getAfterAmount()
|
||||
{
|
||||
return afterAmount;
|
||||
}
|
||||
public void setChangeDesc(String changeDesc)
|
||||
{
|
||||
this.changeDesc = changeDesc;
|
||||
}
|
||||
|
||||
public String getChangeDesc()
|
||||
{
|
||||
return changeDesc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("memberId", getMemberId())
|
||||
.append("accountId", getAccountId())
|
||||
.append("accountType", getAccountType())
|
||||
.append("businessNo", getBusinessNo())
|
||||
.append("changeType", getChangeType())
|
||||
.append("typeDetail", getTypeDetail())
|
||||
.append("beforeAmount", getBeforeAmount())
|
||||
.append("afterAmount", getAfterAmount())
|
||||
.append("changeDesc", getChangeDesc())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,183 @@
|
|||
package com.ruoyi.business.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 兑现申请记录对象 biz_cash_info
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-23
|
||||
*/
|
||||
public class BizCashInfo extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
//提现申请状态
|
||||
public static final int CASH_INFO_STATUS_INITIAL = 0;
|
||||
public static final int CASH_INFO_STATUS_AGREE = 1;
|
||||
public static final int CASH_INFO_STATUS_DENY = 2;
|
||||
|
||||
/** 兑现申请ID */
|
||||
private Long id;
|
||||
|
||||
/** 会员ID */
|
||||
private Long memberId;
|
||||
|
||||
/** 会员姓名 */
|
||||
@Excel(name = "会员姓名")
|
||||
private String memberName;
|
||||
|
||||
/** 会员账户ID */
|
||||
private Long accountId;
|
||||
|
||||
/** 账户类型 */
|
||||
@Excel(name = "账户类型")
|
||||
private Integer accountType;
|
||||
|
||||
/** 开户银行 */
|
||||
@Excel(name = "开户银行")
|
||||
private Integer bankId;
|
||||
|
||||
/** 开户人 */
|
||||
@Excel(name = "开户人")
|
||||
private String bankUser;
|
||||
|
||||
/** 开户地 */
|
||||
@Excel(name = "开户地")
|
||||
private String bankCity;
|
||||
|
||||
/** 卡号 */
|
||||
@Excel(name = "卡号")
|
||||
private String bankCard;
|
||||
|
||||
/** 提现金额 */
|
||||
@Excel(name = "提现金额")
|
||||
private Integer drawMoney;
|
||||
|
||||
/** 0-默认 1-通过 2-驳回 */
|
||||
@Excel(name = "0-默认 1-通过 2-驳回")
|
||||
private Integer status;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setMemberId(Long memberId)
|
||||
{
|
||||
this.memberId = memberId;
|
||||
}
|
||||
|
||||
public Long getMemberId()
|
||||
{
|
||||
return memberId;
|
||||
}
|
||||
|
||||
public String getMemberName() {
|
||||
return memberName;
|
||||
}
|
||||
|
||||
public void setMemberName(String memberName) {
|
||||
this.memberName = memberName;
|
||||
}
|
||||
|
||||
public void setAccountId(Long accountId)
|
||||
{
|
||||
this.accountId = accountId;
|
||||
}
|
||||
|
||||
public Long getAccountId()
|
||||
{
|
||||
return accountId;
|
||||
}
|
||||
public void setAccountType(Integer accountType)
|
||||
{
|
||||
this.accountType = accountType;
|
||||
}
|
||||
|
||||
public Integer getAccountType()
|
||||
{
|
||||
return accountType;
|
||||
}
|
||||
public void setBankId(Integer bankId)
|
||||
{
|
||||
this.bankId = bankId;
|
||||
}
|
||||
|
||||
public Integer getBankId()
|
||||
{
|
||||
return bankId;
|
||||
}
|
||||
public void setBankUser(String bankUser)
|
||||
{
|
||||
this.bankUser = bankUser;
|
||||
}
|
||||
|
||||
public String getBankUser()
|
||||
{
|
||||
return bankUser;
|
||||
}
|
||||
public void setBankCity(String bankCity)
|
||||
{
|
||||
this.bankCity = bankCity;
|
||||
}
|
||||
|
||||
public String getBankCity()
|
||||
{
|
||||
return bankCity;
|
||||
}
|
||||
public void setBankCard(String bankCard)
|
||||
{
|
||||
this.bankCard = bankCard;
|
||||
}
|
||||
|
||||
public String getBankCard()
|
||||
{
|
||||
return bankCard;
|
||||
}
|
||||
public void setDrawMoney(Integer drawMoney)
|
||||
{
|
||||
this.drawMoney = drawMoney;
|
||||
}
|
||||
|
||||
public Integer getDrawMoney()
|
||||
{
|
||||
return drawMoney;
|
||||
}
|
||||
public void setStatus(Integer status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("memberId", getMemberId())
|
||||
.append("accountId", getAccountId())
|
||||
.append("accountType", getAccountType())
|
||||
.append("bankId", getBankId())
|
||||
.append("bankUser", getBankUser())
|
||||
.append("bankCity", getBankCity())
|
||||
.append("bankCard", getBankCard())
|
||||
.append("drawMoney", getDrawMoney())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,244 @@
|
|||
package com.ruoyi.business.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 会员对象 biz_member
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-11
|
||||
*/
|
||||
public class BizMember extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 会员ID */
|
||||
private Long id;
|
||||
|
||||
/** 手机号码 */
|
||||
@Excel(name = "手机号码")
|
||||
private String mobile;
|
||||
|
||||
/** 用户姓名 */
|
||||
@Excel(name = "用户姓名")
|
||||
private String memberName;
|
||||
|
||||
/** 用户密码 */
|
||||
private String password;
|
||||
|
||||
/** 推荐人ID */
|
||||
@Excel(name = "推荐人ID")
|
||||
private Long recommendId;
|
||||
|
||||
/** 所有推荐人ID */
|
||||
private String recommendAllId;
|
||||
|
||||
/** 推荐人手机 */
|
||||
private String recommendMobile;
|
||||
|
||||
/** 推荐人姓名 */
|
||||
private String recommendName;
|
||||
|
||||
/** 会员类型 */
|
||||
@Excel(name = "会员类型")
|
||||
private Integer memberType;
|
||||
|
||||
/** 专项返还等级:0-出局,1-第一次 */
|
||||
private Integer specialLevel;
|
||||
|
||||
/** 是否删除:0-否,1-是 */
|
||||
private Integer isDelete;
|
||||
|
||||
/** 是否禁用:0-否,1-是 */
|
||||
@Excel(name = "是否禁用:0-否,1-是")
|
||||
private Integer isEnable;
|
||||
|
||||
/** 福豆相关数据 */
|
||||
@Excel(name = "福豆余额")
|
||||
private Long douBalance;
|
||||
|
||||
@Excel(name = "福豆余额")
|
||||
private Long douPerson;
|
||||
|
||||
@Excel(name = "团队福豆")
|
||||
private Long douTeam;
|
||||
|
||||
@Excel(name = "专项福豆")
|
||||
private Long douSpecial;
|
||||
|
||||
@Excel(name = "福豆田")
|
||||
private Long douField;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setMobile(String mobile)
|
||||
{
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
public String getMobile()
|
||||
{
|
||||
return mobile;
|
||||
}
|
||||
public void setMemberName(String memberName)
|
||||
{
|
||||
this.memberName = memberName;
|
||||
}
|
||||
|
||||
public String getMemberName()
|
||||
{
|
||||
return memberName;
|
||||
}
|
||||
public void setPassword(String password)
|
||||
{
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getPassword()
|
||||
{
|
||||
return password;
|
||||
}
|
||||
public void setRecommendId(Long recommendId)
|
||||
{
|
||||
this.recommendId = recommendId;
|
||||
}
|
||||
|
||||
public Long getRecommendId()
|
||||
{
|
||||
return recommendId;
|
||||
}
|
||||
|
||||
public String getRecommendAllId() {
|
||||
return recommendAllId;
|
||||
}
|
||||
|
||||
public void setRecommendAllId(String recommendAllId) {
|
||||
this.recommendAllId = recommendAllId;
|
||||
}
|
||||
|
||||
public void setRecommendMobile(String recommendMobile)
|
||||
{
|
||||
this.recommendMobile = recommendMobile;
|
||||
}
|
||||
|
||||
public String getRecommendMobile()
|
||||
{
|
||||
return recommendMobile;
|
||||
}
|
||||
public void setRecommendName(String recommendName)
|
||||
{
|
||||
this.recommendName = recommendName;
|
||||
}
|
||||
|
||||
public String getRecommendName()
|
||||
{
|
||||
return recommendName;
|
||||
}
|
||||
public void setMemberType(Integer memberType)
|
||||
{
|
||||
this.memberType = memberType;
|
||||
}
|
||||
|
||||
public Integer getMemberType()
|
||||
{
|
||||
return memberType;
|
||||
}
|
||||
|
||||
public Integer getSpecialLevel() {
|
||||
return specialLevel;
|
||||
}
|
||||
|
||||
public void setSpecialLevel(Integer specialLevel) {
|
||||
this.specialLevel = specialLevel;
|
||||
}
|
||||
|
||||
public void setIsDelete(Integer isDelete)
|
||||
{
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public Integer getIsDelete()
|
||||
{
|
||||
return isDelete;
|
||||
}
|
||||
public void setIsEnable(Integer isEnable)
|
||||
{
|
||||
this.isEnable = isEnable;
|
||||
}
|
||||
|
||||
public Integer getIsEnable()
|
||||
{
|
||||
return isEnable;
|
||||
}
|
||||
|
||||
public Long getDouBalance() {
|
||||
return douBalance;
|
||||
}
|
||||
|
||||
public void setDouBalance(Long douBalance) {
|
||||
this.douBalance = douBalance;
|
||||
}
|
||||
|
||||
public Long getDouPerson() {
|
||||
return douPerson;
|
||||
}
|
||||
|
||||
public void setDouPerson(Long douPerson) {
|
||||
this.douPerson = douPerson;
|
||||
}
|
||||
|
||||
public Long getDouTeam() {
|
||||
return douTeam;
|
||||
}
|
||||
|
||||
public void setDouTeam(Long douTeam) {
|
||||
this.douTeam = douTeam;
|
||||
}
|
||||
|
||||
public Long getDouSpecial() {
|
||||
return douSpecial;
|
||||
}
|
||||
|
||||
public void setDouSpecial(Long douSpecial) {
|
||||
this.douSpecial = douSpecial;
|
||||
}
|
||||
|
||||
public Long getDouField() {
|
||||
return douField;
|
||||
}
|
||||
|
||||
public void setDouField(Long douField) {
|
||||
this.douField = douField;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("mobile", getMobile())
|
||||
.append("memberName", getMemberName())
|
||||
.append("password", getPassword())
|
||||
.append("recommendId", getRecommendId())
|
||||
.append("recommendAllId", getRecommendAllId())
|
||||
.append("recommendMobile", getRecommendMobile())
|
||||
.append("recommendName", getRecommendName())
|
||||
.append("memberType", getMemberType())
|
||||
.append("isDelete", getIsDelete())
|
||||
.append("isEnable", getIsEnable())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,205 @@
|
|||
package com.ruoyi.business.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 会员收货地址对象 biz_member_address
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-11
|
||||
*/
|
||||
public class BizMemberAddress extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 会员地址ID */
|
||||
private Long id;
|
||||
|
||||
/** 会员ID */
|
||||
@Excel(name = "会员ID")
|
||||
private Long memberID;
|
||||
|
||||
/** 手机号码 */
|
||||
@Excel(name = "手机号码")
|
||||
private String mobile;
|
||||
|
||||
/** 收货人姓名 */
|
||||
@Excel(name = "收货人姓名")
|
||||
private String memberName;
|
||||
|
||||
/** 收货人地址 */
|
||||
@Excel(name = "收货人地址")
|
||||
private String address;
|
||||
|
||||
/** 省编码 */
|
||||
@Excel(name = "省编码")
|
||||
private String provinceCode;
|
||||
|
||||
/** 省名称 */
|
||||
@Excel(name = "省名称")
|
||||
private String provinceName;
|
||||
|
||||
/** 市编码 */
|
||||
@Excel(name = "市编码")
|
||||
private String cityCode;
|
||||
|
||||
/** 市名称 */
|
||||
@Excel(name = "市名称")
|
||||
private String cityName;
|
||||
|
||||
/** 区编码 */
|
||||
@Excel(name = "区编码")
|
||||
private String areaCode;
|
||||
|
||||
/** 区名称 */
|
||||
@Excel(name = "区名称")
|
||||
private String areaName;
|
||||
|
||||
/** 是否删除:0-否,1-是 */
|
||||
@Excel(name = "是否删除:0-否,1-是")
|
||||
private Integer isDelete;
|
||||
|
||||
/** 是否默认:0-否,1-是 */
|
||||
private Integer isDefault;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setMobile(String mobile)
|
||||
{
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
public Long getMemberID() {
|
||||
return memberID;
|
||||
}
|
||||
|
||||
public void setMemberID(Long memberID) {
|
||||
this.memberID = memberID;
|
||||
}
|
||||
|
||||
public String getMobile()
|
||||
{
|
||||
return mobile;
|
||||
}
|
||||
public void setMemberName(String memberName)
|
||||
{
|
||||
this.memberName = memberName;
|
||||
}
|
||||
|
||||
public String getMemberName()
|
||||
{
|
||||
return memberName;
|
||||
}
|
||||
public void setAddress(String address)
|
||||
{
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getAddress()
|
||||
{
|
||||
return address;
|
||||
}
|
||||
public void setProvinceCode(String provinceCode)
|
||||
{
|
||||
this.provinceCode = provinceCode;
|
||||
}
|
||||
|
||||
public String getProvinceCode()
|
||||
{
|
||||
return provinceCode;
|
||||
}
|
||||
public void setProvinceName(String provinceName)
|
||||
{
|
||||
this.provinceName = provinceName;
|
||||
}
|
||||
|
||||
public String getProvinceName()
|
||||
{
|
||||
return provinceName;
|
||||
}
|
||||
public void setCityCode(String cityCode)
|
||||
{
|
||||
this.cityCode = cityCode;
|
||||
}
|
||||
|
||||
public String getCityCode()
|
||||
{
|
||||
return cityCode;
|
||||
}
|
||||
public void setCityName(String cityName)
|
||||
{
|
||||
this.cityName = cityName;
|
||||
}
|
||||
|
||||
public String getCityName()
|
||||
{
|
||||
return cityName;
|
||||
}
|
||||
public void setAreaCode(String areaCode)
|
||||
{
|
||||
this.areaCode = areaCode;
|
||||
}
|
||||
|
||||
public String getAreaCode()
|
||||
{
|
||||
return areaCode;
|
||||
}
|
||||
public void setAreaName(String areaName)
|
||||
{
|
||||
this.areaName = areaName;
|
||||
}
|
||||
|
||||
public String getAreaName()
|
||||
{
|
||||
return areaName;
|
||||
}
|
||||
public void setIsDelete(Integer isDelete)
|
||||
{
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public Integer getIsDelete()
|
||||
{
|
||||
return isDelete;
|
||||
}
|
||||
|
||||
public Integer getIsDefault() {
|
||||
return isDefault;
|
||||
}
|
||||
|
||||
public void setIsDefault(Integer isDefault) {
|
||||
this.isDefault = isDefault;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("mobile", getMobile())
|
||||
.append("memberName", getMemberName())
|
||||
.append("address", getAddress())
|
||||
.append("provinceCode", getProvinceCode())
|
||||
.append("provinceName", getProvinceName())
|
||||
.append("cityCode", getCityCode())
|
||||
.append("cityName", getCityName())
|
||||
.append("areaCode", getAreaCode())
|
||||
.append("areaName", getAreaName())
|
||||
.append("isDelete", getIsDelete())
|
||||
.append("isDefault", getIsDefault())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,270 @@
|
|||
package com.ruoyi.business.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 订单对象 biz_order
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-09
|
||||
*/
|
||||
public class BizOrder extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
//订单状态(0-待支付,1-已支付,2-已取消, 3-待收货, 4-已完成)
|
||||
public static final int STATUS_INITIAL = 0;
|
||||
public static final int STATUS_PAYED = 1;
|
||||
public static final int STATUS_CANCELED = 2;
|
||||
public static final int STATUS_DELIVERY = 3;
|
||||
public static final int STATUS_COMPLETED = 4;
|
||||
|
||||
/** 订单ID */
|
||||
private Long id;
|
||||
|
||||
/** 订单编码 */
|
||||
@Excel(name = "订单编码")
|
||||
private String orderSn;
|
||||
|
||||
/** 会员ID */
|
||||
private Long memberId;
|
||||
|
||||
/** 手机号码 */
|
||||
@Excel(name = "手机号码")
|
||||
private String mobile;
|
||||
|
||||
/** 用户姓名 */
|
||||
@Excel(name = "用户姓名")
|
||||
private String memberName;
|
||||
|
||||
/** 订单金额 */
|
||||
@Excel(name = "订单金额")
|
||||
private BigDecimal orderAmount;
|
||||
|
||||
/** 订单状态:0-待支付,1-已支付,2-已取消, 3-待收货, 4-已完成 */
|
||||
@Excel(name = "0-待支付,1-已支付,2-已取消, 3-待收货, 4-已完成")
|
||||
private Integer orderStatus;
|
||||
|
||||
/** 是否团队福豆影响 */
|
||||
private Integer isTeam;
|
||||
|
||||
/** 订单备注 */
|
||||
@Excel(name = "订单备注")
|
||||
private String remark;
|
||||
|
||||
/** 收货人详细地址 */
|
||||
@Excel(name = "收货人详细地址")
|
||||
private String addressDetail;
|
||||
|
||||
/** 收货人地址ID */
|
||||
private Long addressId;
|
||||
|
||||
/** 商品信息 */
|
||||
@Excel(name = "商品名称")
|
||||
private String productName;
|
||||
|
||||
@Excel(name = "商品单价")
|
||||
private Long productAmount;
|
||||
|
||||
@Excel(name = "商品数量")
|
||||
private Integer productCount;
|
||||
|
||||
/** 收货人地址信息 */
|
||||
@Excel(name = "收货人姓名")
|
||||
private String addressName;
|
||||
|
||||
@Excel(name = "收货人手机")
|
||||
private String addressMobile;
|
||||
|
||||
@Excel(name = "收货人省份")
|
||||
private String addressProvince;
|
||||
|
||||
@Excel(name = "收货人城市")
|
||||
private String addressCity;
|
||||
|
||||
@Excel(name = "收货人区域")
|
||||
private String addressArea;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setOrderSn(String orderSn)
|
||||
{
|
||||
this.orderSn = orderSn;
|
||||
}
|
||||
|
||||
public String getOrderSn()
|
||||
{
|
||||
return orderSn;
|
||||
}
|
||||
public void setMemberId(Long memberId)
|
||||
{
|
||||
this.memberId = memberId;
|
||||
}
|
||||
|
||||
public Long getMemberId()
|
||||
{
|
||||
return memberId;
|
||||
}
|
||||
public void setMobile(String mobile)
|
||||
{
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
public String getMobile()
|
||||
{
|
||||
return mobile;
|
||||
}
|
||||
public void setMemberName(String memberName)
|
||||
{
|
||||
this.memberName = memberName;
|
||||
}
|
||||
|
||||
public String getMemberName()
|
||||
{
|
||||
return memberName;
|
||||
}
|
||||
public void setOrderAmount(BigDecimal orderAmount)
|
||||
{
|
||||
this.orderAmount = orderAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getOrderAmount()
|
||||
{
|
||||
return orderAmount;
|
||||
}
|
||||
public void setOrderStatus(Integer orderStatus)
|
||||
{
|
||||
this.orderStatus = orderStatus;
|
||||
}
|
||||
|
||||
public Integer getOrderStatus()
|
||||
{
|
||||
return orderStatus;
|
||||
}
|
||||
|
||||
public Integer getIsTeam() {
|
||||
return isTeam;
|
||||
}
|
||||
|
||||
public void setIsTeam(Integer isTeam) {
|
||||
this.isTeam = isTeam;
|
||||
}
|
||||
|
||||
public void setAddressId(Long addressId)
|
||||
{
|
||||
this.addressId = addressId;
|
||||
}
|
||||
|
||||
public Long getAddressId()
|
||||
{
|
||||
return addressId;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getAddressDetail() {
|
||||
return addressDetail;
|
||||
}
|
||||
|
||||
public void setAddressDetail(String addressDetail) {
|
||||
this.addressDetail = addressDetail;
|
||||
}
|
||||
|
||||
public String getProductName() {
|
||||
return productName;
|
||||
}
|
||||
|
||||
public void setProductName(String productName) {
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public Long getProductAmount() {
|
||||
return productAmount;
|
||||
}
|
||||
|
||||
public void setProductAmount(Long productAmount) {
|
||||
this.productAmount = productAmount;
|
||||
}
|
||||
|
||||
public Integer getProductCount() {
|
||||
return productCount;
|
||||
}
|
||||
|
||||
public void setProductCount(Integer productCount) {
|
||||
this.productCount = productCount;
|
||||
}
|
||||
|
||||
public String getAddressName() {
|
||||
return addressName;
|
||||
}
|
||||
|
||||
public void setAddressName(String addressName) {
|
||||
this.addressName = addressName;
|
||||
}
|
||||
|
||||
public String getAddressMobile() {
|
||||
return addressMobile;
|
||||
}
|
||||
|
||||
public void setAddressMobile(String addressMobile) {
|
||||
this.addressMobile = addressMobile;
|
||||
}
|
||||
|
||||
public String getAddressProvince() {
|
||||
return addressProvince;
|
||||
}
|
||||
|
||||
public void setAddressProvince(String addressProvince) {
|
||||
this.addressProvince = addressProvince;
|
||||
}
|
||||
|
||||
public String getAddressCity() {
|
||||
return addressCity;
|
||||
}
|
||||
|
||||
public void setAddressCity(String addressCity) {
|
||||
this.addressCity = addressCity;
|
||||
}
|
||||
|
||||
public String getAddressArea() {
|
||||
return addressArea;
|
||||
}
|
||||
|
||||
public void setAddressArea(String addressArea) {
|
||||
this.addressArea = addressArea;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("orderSn", getOrderSn())
|
||||
.append("memberId", getMemberId())
|
||||
.append("mobile", getMobile())
|
||||
.append("memberName", getMemberName())
|
||||
.append("orderAmount", getOrderAmount())
|
||||
.append("orderStatus", getOrderStatus())
|
||||
.append("addressId", getAddressId())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
package com.ruoyi.business.domain;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
/**
|
||||
* 订单明细对象 biz_order_detail
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-17
|
||||
*/
|
||||
public class BizOrderDetail extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 订单明细ID */
|
||||
private Long id;
|
||||
|
||||
/** 订单ID */
|
||||
@Excel(name = "订单ID")
|
||||
private Long orderId;
|
||||
|
||||
/** 订单编码 */
|
||||
@Excel(name = "订单编码")
|
||||
private String orderSn;
|
||||
|
||||
/** 产品ID */
|
||||
@Excel(name = "产品ID")
|
||||
private Long productId;
|
||||
|
||||
/** 产品编码 */
|
||||
@Excel(name = "产品编码")
|
||||
private String productCode;
|
||||
|
||||
/** 商品数量 */
|
||||
@Excel(name = "商品数量")
|
||||
private Integer productCount;
|
||||
|
||||
/** 商品金额 */
|
||||
@Excel(name = "商品金额")
|
||||
private BigDecimal productAmount;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
public void setOrderSn(String orderSn)
|
||||
{
|
||||
this.orderSn = orderSn;
|
||||
}
|
||||
|
||||
public String getOrderSn()
|
||||
{
|
||||
return orderSn;
|
||||
}
|
||||
public void setProductId(Long productId)
|
||||
{
|
||||
this.productId = productId;
|
||||
}
|
||||
|
||||
public Long getProductId()
|
||||
{
|
||||
return productId;
|
||||
}
|
||||
public void setProductCode(String productCode)
|
||||
{
|
||||
this.productCode = productCode;
|
||||
}
|
||||
|
||||
public String getProductCode()
|
||||
{
|
||||
return productCode;
|
||||
}
|
||||
public void setProductCount(Integer productCount)
|
||||
{
|
||||
this.productCount = productCount;
|
||||
}
|
||||
|
||||
public Integer getProductCount()
|
||||
{
|
||||
return productCount;
|
||||
}
|
||||
public void setProductAmount(BigDecimal productAmount)
|
||||
{
|
||||
this.productAmount = productAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getProductAmount()
|
||||
{
|
||||
return productAmount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("orderId", getOrderId())
|
||||
.append("orderSn", getOrderSn())
|
||||
.append("productId", getProductId())
|
||||
.append("productCode", getProductCode())
|
||||
.append("productCount", getProductCount())
|
||||
.append("productAmount", getProductAmount())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,210 @@
|
|||
package com.ruoyi.business.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 产品对象 biz_product
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-06
|
||||
*/
|
||||
public class BizProduct extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 产品ID */
|
||||
private Long id;
|
||||
|
||||
/** 产品编码 */
|
||||
@Excel(name = "产品编码")
|
||||
private String productCode;
|
||||
|
||||
/** 产品名称 */
|
||||
@Excel(name = "产品名称")
|
||||
private String productName;
|
||||
|
||||
/** 产品分类ID */
|
||||
@Excel(name = "产品分类ID")
|
||||
private Long productTypeId;
|
||||
|
||||
/** 产品类型 */
|
||||
@Excel(name = "产品类型")
|
||||
private Integer productClass;
|
||||
|
||||
/** 产品单价 */
|
||||
@Excel(name = "产品单价")
|
||||
private BigDecimal amount;
|
||||
|
||||
/** 产品返现金额 */
|
||||
@Excel(name = "产品返现金额")
|
||||
private BigDecimal cashbackAmount;
|
||||
|
||||
/** 排序 */
|
||||
@Excel(name = "排序")
|
||||
private Integer sort;
|
||||
|
||||
/** 是否上架 */
|
||||
@Excel(name = "是否上架")
|
||||
private Integer onlineStatus;
|
||||
|
||||
/** 上架时间 */
|
||||
@Excel(name = "上架时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date onlineTime;
|
||||
|
||||
/** 下架时间 */
|
||||
private Date offlineTime;
|
||||
|
||||
/** 产品图片信息 */
|
||||
private String mainImage;
|
||||
private List<String> detailImages;
|
||||
private List<String> loopImages;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setProductCode(String productCode)
|
||||
{
|
||||
this.productCode = productCode;
|
||||
}
|
||||
|
||||
public String getProductCode()
|
||||
{
|
||||
return productCode;
|
||||
}
|
||||
public void setProductName(String productName)
|
||||
{
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public String getProductName()
|
||||
{
|
||||
return productName;
|
||||
}
|
||||
public void setProductTypeId(Long productTypeId)
|
||||
{
|
||||
this.productTypeId = productTypeId;
|
||||
}
|
||||
|
||||
public Long getProductTypeId()
|
||||
{
|
||||
return productTypeId;
|
||||
}
|
||||
public void setProductClass(Integer productClass)
|
||||
{
|
||||
this.productClass = productClass;
|
||||
}
|
||||
|
||||
public Integer getProductClass()
|
||||
{
|
||||
return productClass;
|
||||
}
|
||||
public void setAmount(BigDecimal amount)
|
||||
{
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public BigDecimal getAmount()
|
||||
{
|
||||
return amount;
|
||||
}
|
||||
public void setSort(Integer sort)
|
||||
{
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public BigDecimal getCashbackAmount() {
|
||||
return cashbackAmount;
|
||||
}
|
||||
|
||||
public void setCashbackAmount(BigDecimal cashbackAmount) {
|
||||
this.cashbackAmount = cashbackAmount;
|
||||
}
|
||||
|
||||
public Integer getSort()
|
||||
{
|
||||
return sort;
|
||||
}
|
||||
public void setOnlineStatus(Integer onlineStatus)
|
||||
{
|
||||
this.onlineStatus = onlineStatus;
|
||||
}
|
||||
|
||||
public Integer getOnlineStatus()
|
||||
{
|
||||
return onlineStatus;
|
||||
}
|
||||
public void setOnlineTime(Date onlineTime)
|
||||
{
|
||||
this.onlineTime = onlineTime;
|
||||
}
|
||||
|
||||
public Date getOnlineTime()
|
||||
{
|
||||
return onlineTime;
|
||||
}
|
||||
public void setOfflineTime(Date offlineTime)
|
||||
{
|
||||
this.offlineTime = offlineTime;
|
||||
}
|
||||
|
||||
public Date getOfflineTime()
|
||||
{
|
||||
return offlineTime;
|
||||
}
|
||||
|
||||
public String getMainImage() {
|
||||
return mainImage;
|
||||
}
|
||||
|
||||
public void setMainImage(String mainImage) {
|
||||
this.mainImage = mainImage;
|
||||
}
|
||||
|
||||
public List<String> getDetailImages() {
|
||||
return detailImages;
|
||||
}
|
||||
|
||||
public void setDetailImages(List<String> detailImages) {
|
||||
this.detailImages = detailImages;
|
||||
}
|
||||
|
||||
public List<String> getLoopImages() {
|
||||
return loopImages;
|
||||
}
|
||||
|
||||
public void setLoopImages(List<String> loopImages) {
|
||||
this.loopImages = loopImages;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("productCode", getProductCode())
|
||||
.append("productName", getProductName())
|
||||
.append("productTypeId", getProductTypeId())
|
||||
.append("productClass", getProductClass())
|
||||
.append("amount", getAmount())
|
||||
.append("sort", getSort())
|
||||
.append("onlineStatus", getOnlineStatus())
|
||||
.append("onlineTime", getOnlineTime())
|
||||
.append("offlineTime", getOfflineTime())
|
||||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package com.ruoyi.business.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 产品图片对象 biz_product_image
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-06
|
||||
*/
|
||||
public class BizProductImage extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 产品图片ID */
|
||||
private Long id;
|
||||
|
||||
/** 产品ID */
|
||||
private Long productId;
|
||||
|
||||
/** 附件类型:0-主图,1-详情图,2-轮播图 */
|
||||
private Integer imageType;
|
||||
|
||||
/** 附件地址 */
|
||||
private String imageUrl;
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setProductId(Long productId)
|
||||
{
|
||||
this.productId = productId;
|
||||
}
|
||||
|
||||
public Long getProductId()
|
||||
{
|
||||
return productId;
|
||||
}
|
||||
public void setImageType(Integer imageType)
|
||||
{
|
||||
this.imageType = imageType;
|
||||
}
|
||||
|
||||
public Integer getImageType() {
|
||||
return imageType;
|
||||
}
|
||||
|
||||
public void setImageUrl(String imageUrl) {
|
||||
this.imageUrl = imageUrl;
|
||||
}
|
||||
|
||||
public String getImageUrl()
|
||||
{
|
||||
return imageUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("productId", getProductId())
|
||||
.append("imageUrl", getImageUrl())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
package com.ruoyi.business.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 产品分类对象 biz_product_type
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-05
|
||||
*/
|
||||
public class BizProductType extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 产品分类ID */
|
||||
private Long id;
|
||||
|
||||
/** 产品分类编码 */
|
||||
@Excel(name = "产品分类编码")
|
||||
private String productTypeCode;
|
||||
|
||||
/** 产品分类名称 */
|
||||
@Excel(name = "产品分类名称")
|
||||
private String productTypeName;
|
||||
|
||||
/** 附件地址 */
|
||||
private String imageUrl;
|
||||
|
||||
/** 排序 */
|
||||
@Excel(name = "排序")
|
||||
private Long sort;
|
||||
|
||||
/** 是否禁用:0-否,1-是 */
|
||||
@Excel(name = "是否禁用:0-否,1-是")
|
||||
private Integer isEnable;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setProductTypeCode(String productTypeCode)
|
||||
{
|
||||
this.productTypeCode = productTypeCode;
|
||||
}
|
||||
|
||||
public String getProductTypeCode()
|
||||
{
|
||||
return productTypeCode;
|
||||
}
|
||||
public void setProductTypeName(String productTypeName)
|
||||
{
|
||||
this.productTypeName = productTypeName;
|
||||
}
|
||||
|
||||
public String getProductTypeName()
|
||||
{
|
||||
return productTypeName;
|
||||
}
|
||||
public void setImageUrl(String imageUrl)
|
||||
{
|
||||
this.imageUrl = imageUrl;
|
||||
}
|
||||
|
||||
public String getImageUrl()
|
||||
{
|
||||
return imageUrl;
|
||||
}
|
||||
public void setSort(Long sort)
|
||||
{
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public Long getSort()
|
||||
{
|
||||
return sort;
|
||||
}
|
||||
public void setIsEnable(Integer isEnable)
|
||||
{
|
||||
this.isEnable = isEnable;
|
||||
}
|
||||
|
||||
public Integer getIsEnable()
|
||||
{
|
||||
return isEnable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("productTypeCode", getProductTypeCode())
|
||||
.append("productTypeName", getProductTypeName())
|
||||
.append("imageUrl", getImageUrl())
|
||||
.append("sort", getSort())
|
||||
.append("isEnable", getIsEnable())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,158 @@
|
|||
package com.ruoyi.business.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 团队奖励明细对象 biz_team_reward
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-22
|
||||
*/
|
||||
public class BizTeamReward extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
//团队奖励明细类型
|
||||
public static final int TEAM_REWARD_TYPE_RECOMM = 0;
|
||||
public static final int TEAM_REWARD_TYPE_SECOND = 1;
|
||||
public static final int TEAM_REWARD_TYPE_TEAM = 2;
|
||||
|
||||
/** 团队奖励ID */
|
||||
private Long id;
|
||||
|
||||
/** 会员ID */
|
||||
@Excel(name = "会员ID")
|
||||
private Long memberId;
|
||||
|
||||
/** 团队用户ID */
|
||||
@Excel(name = "团队用户ID")
|
||||
private Long rewardMemberId;
|
||||
|
||||
/** 团队用户名称 */
|
||||
@Excel(name = "团队用户名称")
|
||||
private String rewardMemberName;
|
||||
|
||||
/** 用户购买产品数量 */
|
||||
@Excel(name = "用户购买产品数量")
|
||||
private Long rewardProductCount;
|
||||
|
||||
/** 奖励的福豆数量 */
|
||||
@Excel(name = "奖励的福豆数量")
|
||||
private Long rewardAmount;
|
||||
|
||||
/** 产品ID */
|
||||
@Excel(name = "产品ID")
|
||||
private Long productId;
|
||||
|
||||
/** 奖励类型:0:一级直推;1:二级推荐;2:平级; */
|
||||
@Excel(name = "奖励类型:0:一级直推;1:二级推荐;2:团队;")
|
||||
private Integer rewardType;
|
||||
|
||||
/** 奖励日期(xxxx-xx-xx) */
|
||||
@Excel(name = "奖励日期(xxxx-xx-xx)")
|
||||
private String rewardDate;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setMemberId(Long memberId)
|
||||
{
|
||||
this.memberId = memberId;
|
||||
}
|
||||
|
||||
public Long getMemberId()
|
||||
{
|
||||
return memberId;
|
||||
}
|
||||
|
||||
public String getRewardMemberName() {
|
||||
return rewardMemberName;
|
||||
}
|
||||
|
||||
public void setRewardMemberName(String rewardMemberName) {
|
||||
this.rewardMemberName = rewardMemberName;
|
||||
}
|
||||
|
||||
public void setRewardMemberId(Long rewardMemberId)
|
||||
{
|
||||
this.rewardMemberId = rewardMemberId;
|
||||
}
|
||||
|
||||
public Long getRewardMemberId()
|
||||
{
|
||||
return rewardMemberId;
|
||||
}
|
||||
public void setRewardProductCount(Long rewardProductCount)
|
||||
{
|
||||
this.rewardProductCount = rewardProductCount;
|
||||
}
|
||||
|
||||
public Long getRewardProductCount()
|
||||
{
|
||||
return rewardProductCount;
|
||||
}
|
||||
public void setRewardAmount(Long rewardAmount)
|
||||
{
|
||||
this.rewardAmount = rewardAmount;
|
||||
}
|
||||
|
||||
public Long getRewardAmount()
|
||||
{
|
||||
return rewardAmount;
|
||||
}
|
||||
public void setProductId(Long productId)
|
||||
{
|
||||
this.productId = productId;
|
||||
}
|
||||
|
||||
public Long getProductId()
|
||||
{
|
||||
return productId;
|
||||
}
|
||||
public void setRewardType(Integer rewardType)
|
||||
{
|
||||
this.rewardType = rewardType;
|
||||
}
|
||||
|
||||
public Integer getRewardType()
|
||||
{
|
||||
return rewardType;
|
||||
}
|
||||
public void setRewardDate(String rewardDate)
|
||||
{
|
||||
this.rewardDate = rewardDate;
|
||||
}
|
||||
|
||||
public String getRewardDate()
|
||||
{
|
||||
return rewardDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("memberId", getMemberId())
|
||||
.append("rewardMemberId", getRewardMemberId())
|
||||
.append("rewardProductCount", getRewardProductCount())
|
||||
.append("rewardAmount", getRewardAmount())
|
||||
.append("productId", getProductId())
|
||||
.append("rewardType", getRewardType())
|
||||
.append("rewardDate", getRewardDate())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
package com.ruoyi.business.mapper;
|
||||
|
||||
import com.ruoyi.business.domain.BizAccount;
|
||||
import com.ruoyi.business.domain.BizAccountDetail;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员账户Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-14
|
||||
*/
|
||||
public interface BizAccountMapper
|
||||
{
|
||||
/**
|
||||
* 查询会员账户
|
||||
*
|
||||
* @param id 会员账户ID
|
||||
* @return 会员账户
|
||||
*/
|
||||
public BizAccount selectBizAccountById(Long id);
|
||||
|
||||
/**
|
||||
* 查询会员账户列表
|
||||
*
|
||||
* @param bizAccount 会员账户
|
||||
* @return 会员账户集合
|
||||
*/
|
||||
public List<BizAccount> selectBizAccountList(BizAccount bizAccount);
|
||||
|
||||
/**
|
||||
* 新增会员账户
|
||||
*
|
||||
* @param bizAccount 会员账户
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBizAccount(BizAccount bizAccount);
|
||||
|
||||
/**
|
||||
* 修改会员账户
|
||||
*
|
||||
* @param bizAccount 会员账户
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBizAccount(BizAccount bizAccount);
|
||||
|
||||
/**
|
||||
* 删除会员账户
|
||||
*
|
||||
* @param id 会员账户ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizAccountById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除会员账户
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizAccountByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 查询会员账户明细列表
|
||||
*
|
||||
* @param bizAccountDetail 会员账户明细
|
||||
* @return 会员账户明细集合
|
||||
*/
|
||||
public List<BizAccountDetail> selectBizAccountDetailList(BizAccountDetail bizAccountDetail);
|
||||
|
||||
/**
|
||||
* 新增会员账户明细
|
||||
*
|
||||
* @param bizAccountDetail 会员账户明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBizAccountDetail(BizAccountDetail bizAccountDetail);
|
||||
|
||||
/**
|
||||
* 清空福豆田
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
public void clearAllDouField();
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ruoyi.business.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.business.domain.BizCashInfo;
|
||||
|
||||
/**
|
||||
* 兑现申请记录Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-23
|
||||
*/
|
||||
public interface BizCashInfoMapper
|
||||
{
|
||||
/**
|
||||
* 查询兑现申请记录
|
||||
*
|
||||
* @param id 兑现申请记录ID
|
||||
* @return 兑现申请记录
|
||||
*/
|
||||
public BizCashInfo selectBizCashInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询兑现申请记录列表
|
||||
*
|
||||
* @param bizCashInfo 兑现申请记录
|
||||
* @return 兑现申请记录集合
|
||||
*/
|
||||
public List<BizCashInfo> selectBizCashInfoList(BizCashInfo bizCashInfo);
|
||||
|
||||
/**
|
||||
* 新增兑现申请记录
|
||||
*
|
||||
* @param bizCashInfo 兑现申请记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBizCashInfo(BizCashInfo bizCashInfo);
|
||||
|
||||
/**
|
||||
* 修改兑现申请记录
|
||||
*
|
||||
* @param bizCashInfo 兑现申请记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBizCashInfo(BizCashInfo bizCashInfo);
|
||||
|
||||
/**
|
||||
* 删除兑现申请记录
|
||||
*
|
||||
* @param id 兑现申请记录ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizCashInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除兑现申请记录
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizCashInfoByIds(String[] ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
package com.ruoyi.business.mapper;
|
||||
|
||||
|
||||
import com.ruoyi.business.domain.BizMemberAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员收货地址Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-17
|
||||
*/
|
||||
public interface BizMemberAddressMapper
|
||||
{
|
||||
/**
|
||||
* 查询会员收货地址
|
||||
*
|
||||
* @param id 会员收货地址ID
|
||||
* @return 会员收货地址
|
||||
*/
|
||||
public BizMemberAddress selectBizMemberAddressById(Long id);
|
||||
|
||||
/**
|
||||
* 查询会员默认收货地址
|
||||
*
|
||||
* @param memberID 会员ID
|
||||
* @return 会员收货地址
|
||||
*/
|
||||
public BizMemberAddress selectDefaultAddressByMemberId(Long memberID);
|
||||
|
||||
/**
|
||||
* 取消默认收货地址
|
||||
*
|
||||
* @param memberID 会员ID
|
||||
* @return int
|
||||
*/
|
||||
public int cancelDefaultAddress(Long memberID);
|
||||
|
||||
/**
|
||||
* 查询会员收货地址列表
|
||||
*
|
||||
* @param memberID 会员ID
|
||||
* @return 会员收货地址集合
|
||||
*/
|
||||
public List<BizMemberAddress> selectBizMemberAddressList(Long memberID);
|
||||
|
||||
/**
|
||||
* 新增会员收货地址
|
||||
*
|
||||
* @param bizMemberAddress 会员收货地址
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBizMemberAddress(BizMemberAddress bizMemberAddress);
|
||||
|
||||
/**
|
||||
* 修改会员收货地址
|
||||
*
|
||||
* @param bizMemberAddress 会员收货地址
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBizMemberAddress(BizMemberAddress bizMemberAddress);
|
||||
|
||||
/**
|
||||
* 删除会员收货地址
|
||||
*
|
||||
* @param id 会员收货地址ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizMemberAddressById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除会员收货地址
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizMemberAddressByIds(String[] ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
package com.ruoyi.business.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.ruoyi.business.domain.BizMember;
|
||||
|
||||
/**
|
||||
* 会员Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-11
|
||||
*/
|
||||
public interface BizMemberMapper
|
||||
{
|
||||
/**
|
||||
* 查询会员
|
||||
*
|
||||
* @param id 会员ID
|
||||
* @return 会员
|
||||
*/
|
||||
public BizMember selectBizMemberById(Long id);
|
||||
|
||||
/**
|
||||
* 查询会员
|
||||
*
|
||||
* @param id 会员ID
|
||||
* @return 会员
|
||||
*/
|
||||
public BizMember selectBizMemberSimple(Long id);
|
||||
|
||||
/**
|
||||
* 查询会员
|
||||
*
|
||||
* @param mobile 手机号
|
||||
* @return 会员
|
||||
*/
|
||||
public BizMember selectBizMemberByMobile(String mobile);
|
||||
|
||||
/**
|
||||
* 查询会员列表
|
||||
*
|
||||
* @param bizMember 会员
|
||||
* @return 会员集合
|
||||
*/
|
||||
public List<BizMember> selectBizMemberList(BizMember bizMember);
|
||||
|
||||
/**
|
||||
* 查询所有会员
|
||||
* @return 会员集合
|
||||
*/
|
||||
public List<BizMember> selectBizMemberAll();
|
||||
|
||||
/**
|
||||
* 会员福豆余额
|
||||
*
|
||||
* @param map
|
||||
* @return 结果
|
||||
*/
|
||||
public Long selectBizMemberDou(Map map);
|
||||
|
||||
/**
|
||||
* 新增会员
|
||||
*
|
||||
* @param bizMember 会员
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBizMember(BizMember bizMember);
|
||||
|
||||
/**
|
||||
* 修改会员
|
||||
*
|
||||
* @param bizMember 会员
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBizMember(BizMember bizMember);
|
||||
|
||||
/**
|
||||
* 删除会员
|
||||
*
|
||||
* @param id 会员ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizMemberById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除会员
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizMemberByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 取出有效下级数量(有订单)
|
||||
*
|
||||
* @param memberID 上级用户ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int getValidChildCount(Long memberID);
|
||||
|
||||
/**
|
||||
* 取出会员等级明细及商品购买数
|
||||
*
|
||||
* @param paramMap
|
||||
* @return 结果
|
||||
*/
|
||||
public List<Map> selectTeamData(Map paramMap);
|
||||
|
||||
/**
|
||||
* 查询专项划拨任务会员列表
|
||||
*
|
||||
* @param minValue 专项划拨每日金额
|
||||
* @return 会员集合
|
||||
*/
|
||||
public List<BizMember> selectSpecialMember(int minValue);
|
||||
|
||||
/**
|
||||
* 取出某用户团队盒数
|
||||
*
|
||||
* @param memberID 上级用户ID
|
||||
* @return 结果
|
||||
*/
|
||||
public long getMemberTeamCount(Long memberID);
|
||||
|
||||
/**
|
||||
* 修改会员出局等级
|
||||
*
|
||||
* @param bizMember 会员
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMemberLevel(BizMember bizMember);
|
||||
|
||||
/**
|
||||
* 查询需结算团队分成会员列表
|
||||
*
|
||||
* @param minValue 团队分成最少盒数
|
||||
* @return 会员集合
|
||||
*/
|
||||
public List<Map> selectTeamBenefitMember(int minValue);
|
||||
|
||||
/**
|
||||
* 查询直接下级会员列表
|
||||
*
|
||||
* @param memberID 会员ID
|
||||
* @return 会员ID集合
|
||||
*/
|
||||
public List<Long> selectSubMember(Long memberID);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package com.ruoyi.business.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.ruoyi.business.domain.BizOrder;
|
||||
import com.ruoyi.business.domain.BizOrderDetail;
|
||||
|
||||
/**
|
||||
* 订单Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-09
|
||||
*/
|
||||
public interface BizOrderMapper
|
||||
{
|
||||
/**
|
||||
* 查询订单
|
||||
*
|
||||
* @param id 订单ID
|
||||
* @return 订单
|
||||
*/
|
||||
public BizOrder selectBizOrderById(Long id);
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*
|
||||
* @param bizOrder 订单
|
||||
* @return 订单集合
|
||||
*/
|
||||
public List<BizOrder> selectBizOrderList(BizOrder bizOrder);
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
*
|
||||
* @param bizOrder 订单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBizOrder(BizOrder bizOrder);
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*
|
||||
* @param bizOrder 订单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBizOrder(BizOrder bizOrder);
|
||||
|
||||
/**
|
||||
* 删除订单
|
||||
*
|
||||
* @param id 订单ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizOrderById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除订单
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizOrderByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 新增订单明细
|
||||
*
|
||||
* @param bizOrderDetail 订单明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBizOrderDetail(BizOrderDetail bizOrderDetail);
|
||||
|
||||
/**
|
||||
* 查询团队订单
|
||||
*
|
||||
* @param memberID 会员ID
|
||||
* @return 订单集合
|
||||
*/
|
||||
public List<Map> selectTeamBizOrder(Long memberID);
|
||||
}
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
package com.ruoyi.business.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.business.domain.BizProduct;
|
||||
import com.ruoyi.business.domain.BizProductImage;
|
||||
|
||||
/**
|
||||
* 产品Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-06
|
||||
*/
|
||||
public interface BizProductMapper
|
||||
{
|
||||
/**
|
||||
* 查询产品
|
||||
*
|
||||
* @param productId 产品ID
|
||||
* @return 产品
|
||||
*/
|
||||
public BizProduct selectBizProductById(Long productId);
|
||||
|
||||
/**
|
||||
* 查询产品
|
||||
*
|
||||
* @param productCode 产品编码
|
||||
* @return 产品
|
||||
*/
|
||||
public BizProduct selectBizProductByCode(String productCode);
|
||||
|
||||
/**
|
||||
* 查询产品图片列表
|
||||
*
|
||||
* @param productId 产品ID
|
||||
* @return 产品图片列表
|
||||
*/
|
||||
public List<BizProductImage> selectBizProductImageList(Long productId);
|
||||
|
||||
/**
|
||||
* 查询产品列表
|
||||
*
|
||||
* @param bizProduct 产品
|
||||
* @return 产品集合
|
||||
*/
|
||||
public List<BizProduct> selectBizProductList(BizProduct bizProduct);
|
||||
|
||||
/**
|
||||
* 查询团队产品列表
|
||||
*
|
||||
* @param
|
||||
* @return 产品集合
|
||||
*/
|
||||
public List<BizProduct> selectTeamProductList();
|
||||
|
||||
/**
|
||||
* 新增产品
|
||||
*
|
||||
* @param bizProduct 产品
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBizProduct(BizProduct bizProduct);
|
||||
|
||||
/**
|
||||
* 修改产品
|
||||
*
|
||||
* @param bizProduct 产品
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBizProduct(BizProduct bizProduct);
|
||||
|
||||
/**
|
||||
* 删除产品
|
||||
*
|
||||
* @param productId 产品ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizProductById(Long productId);
|
||||
|
||||
/**
|
||||
* 批量删除产品
|
||||
*
|
||||
* @param productIds 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizProductByIds(String[] productIds);
|
||||
|
||||
/**
|
||||
* 批量删除产品图片
|
||||
*
|
||||
* @param productIds 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizProductImageByProductIds(String[] productIds);
|
||||
|
||||
/**
|
||||
* 批量新增产品图片
|
||||
*
|
||||
* @param bizProductImageList 产品图片列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchBizProductImage(List<BizProductImage> bizProductImageList);
|
||||
|
||||
|
||||
/**
|
||||
* 通过产品ID删除产品图片信息
|
||||
*
|
||||
* @param productId 角色ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizProductImageByProductId(Long productId);
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package com.ruoyi.business.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.business.domain.BizProductType;
|
||||
|
||||
/**
|
||||
* 产品分类Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-05
|
||||
*/
|
||||
public interface BizProductTypeMapper
|
||||
{
|
||||
/**
|
||||
* 查询产品分类
|
||||
*
|
||||
* @param productTypeId 产品分类ID
|
||||
* @return 产品分类
|
||||
*/
|
||||
public BizProductType selectBizProductTypeById(Long productTypeId);
|
||||
|
||||
/**
|
||||
* 查询产品分类
|
||||
*
|
||||
* @param productTypeCode 产品分类Code
|
||||
* @return 产品分类
|
||||
*/
|
||||
public BizProductType selectBizProductTypeByCode(String productTypeCode);
|
||||
|
||||
/**
|
||||
* 查询产品分类列表
|
||||
*
|
||||
* @param bizProductType 产品分类
|
||||
* @return 产品分类集合
|
||||
*/
|
||||
public List<BizProductType> selectBizProductTypeList(BizProductType bizProductType);
|
||||
|
||||
/**
|
||||
* 新增产品分类
|
||||
*
|
||||
* @param bizProductType 产品分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBizProductType(BizProductType bizProductType);
|
||||
|
||||
/**
|
||||
* 修改产品分类
|
||||
*
|
||||
* @param bizProductType 产品分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBizProductType(BizProductType bizProductType);
|
||||
|
||||
/**
|
||||
* 删除产品分类
|
||||
*
|
||||
* @param productTypeId 产品分类ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizProductTypeById(Long productTypeId);
|
||||
|
||||
/**
|
||||
* 批量删除产品分类
|
||||
*
|
||||
* @param productTypeIds 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizProductTypeByIds(String[] productTypeIds);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ruoyi.business.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.business.domain.BizTeamReward;
|
||||
|
||||
/**
|
||||
* 团队奖励明细Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-22
|
||||
*/
|
||||
public interface BizTeamRewardMapper
|
||||
{
|
||||
/**
|
||||
* 查询团队奖励明细
|
||||
*
|
||||
* @param id 团队奖励明细ID
|
||||
* @return 团队奖励明细
|
||||
*/
|
||||
public BizTeamReward selectBizTeamRewardById(Long id);
|
||||
|
||||
/**
|
||||
* 查询团队奖励明细列表
|
||||
*
|
||||
* @param bizTeamReward 团队奖励明细
|
||||
* @return 团队奖励明细集合
|
||||
*/
|
||||
public List<BizTeamReward> selectBizTeamRewardList(BizTeamReward bizTeamReward);
|
||||
|
||||
/**
|
||||
* 新增团队奖励明细
|
||||
*
|
||||
* @param bizTeamReward 团队奖励明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBizTeamReward(BizTeamReward bizTeamReward);
|
||||
|
||||
/**
|
||||
* 修改团队奖励明细
|
||||
*
|
||||
* @param bizTeamReward 团队奖励明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBizTeamReward(BizTeamReward bizTeamReward);
|
||||
|
||||
/**
|
||||
* 删除团队奖励明细
|
||||
*
|
||||
* @param id 团队奖励明细ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizTeamRewardById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除团队奖励明细
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizTeamRewardByIds(String[] ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ruoyi.business.model;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* 用户实体
|
||||
* @author bei.wu
|
||||
*/
|
||||
public class Member {
|
||||
|
||||
/**
|
||||
* 用户主键
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 用户手机号
|
||||
*/
|
||||
private String mobile;
|
||||
|
||||
public Member() {
|
||||
|
||||
}
|
||||
|
||||
public Member(Long id, String name, String mobile) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getMobile() {
|
||||
return mobile;
|
||||
}
|
||||
|
||||
public void setMobile(String mobile) {
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
public String toJsonString() {
|
||||
return JSONObject.toJSONString(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
package com.ruoyi.business.service;
|
||||
|
||||
import com.ruoyi.business.domain.BizAccount;
|
||||
import com.ruoyi.business.domain.BizAccountDetail;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员账户Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-14
|
||||
*/
|
||||
public interface IBizAccountService
|
||||
{
|
||||
/**
|
||||
* 查询会员账户
|
||||
*
|
||||
* @param id 会员账户ID
|
||||
* @return 会员账户
|
||||
*/
|
||||
public BizAccount selectBizAccountById(Long id);
|
||||
|
||||
/**
|
||||
* 查询会员账户列表
|
||||
*
|
||||
* @param bizAccount 会员账户
|
||||
* @return 会员账户集合
|
||||
*/
|
||||
public List<BizAccount> selectBizAccountList(BizAccount bizAccount);
|
||||
|
||||
/**
|
||||
* 新增会员账户
|
||||
*
|
||||
* @param bizAccount 会员账户
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBizAccount(BizAccount bizAccount);
|
||||
|
||||
/**
|
||||
* 修改会员账户
|
||||
*
|
||||
* @param bizAccount 会员账户
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBizAccount(BizAccount bizAccount);
|
||||
|
||||
/**
|
||||
* 批量删除会员账户
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizAccountByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除会员账户信息
|
||||
*
|
||||
* @param id 会员账户ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizAccountById(Long id);
|
||||
|
||||
/**
|
||||
* 查询会员账户明细列表
|
||||
*
|
||||
* @param bizAccountDetail 会员账户明细
|
||||
* @return 会员账户明细集合
|
||||
*/
|
||||
public List<BizAccountDetail> selectBizAccountDetailList(BizAccountDetail bizAccountDetail);
|
||||
|
||||
/**
|
||||
* 会员福豆变动明细
|
||||
*
|
||||
* @param memberID accountType detailType money businessInfo desc
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean accountChange(Long memberID, int accountType, int detailType, Long money, String businessInfo, String desc);
|
||||
|
||||
/**
|
||||
* 清空福豆田
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
public void clearAllDouField();
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ruoyi.business.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.business.domain.BizCashInfo;
|
||||
|
||||
/**
|
||||
* 兑现申请记录Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-23
|
||||
*/
|
||||
public interface IBizCashInfoService
|
||||
{
|
||||
/**
|
||||
* 查询兑现申请记录
|
||||
*
|
||||
* @param id 兑现申请记录ID
|
||||
* @return 兑现申请记录
|
||||
*/
|
||||
public BizCashInfo selectBizCashInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询兑现申请记录列表
|
||||
*
|
||||
* @param bizCashInfo 兑现申请记录
|
||||
* @return 兑现申请记录集合
|
||||
*/
|
||||
public List<BizCashInfo> selectBizCashInfoList(BizCashInfo bizCashInfo);
|
||||
|
||||
/**
|
||||
* 新增兑现申请记录
|
||||
*
|
||||
* @param bizCashInfo 兑现申请记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBizCashInfo(BizCashInfo bizCashInfo);
|
||||
|
||||
/**
|
||||
* 修改兑现申请记录
|
||||
*
|
||||
* @param bizCashInfo 兑现申请记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBizCashInfo(BizCashInfo bizCashInfo);
|
||||
|
||||
/**
|
||||
* 批量删除兑现申请记录
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizCashInfoByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除兑现申请记录信息
|
||||
*
|
||||
* @param id 兑现申请记录ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizCashInfoById(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
package com.ruoyi.business.service;
|
||||
|
||||
import com.ruoyi.business.domain.BizMemberAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员收货地址Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-17
|
||||
*/
|
||||
public interface IBizMemberAddressService
|
||||
{
|
||||
/**
|
||||
* 查询会员收货地址
|
||||
*
|
||||
* @param id 会员收货地址ID
|
||||
* @return 会员收货地址
|
||||
*/
|
||||
public BizMemberAddress selectBizMemberAddressById(Long id);
|
||||
|
||||
/**
|
||||
* 查询会员默认收货地址
|
||||
*
|
||||
* @param memberID 会员ID
|
||||
* @return 会员收货地址
|
||||
*/
|
||||
public BizMemberAddress selectDefaultAddressByMemberId(Long memberID);
|
||||
|
||||
/**
|
||||
* 取消默认收货地址
|
||||
*
|
||||
* @param memberID 会员ID
|
||||
* @return int
|
||||
*/
|
||||
public int cancelDefaultAddress(Long memberID);
|
||||
|
||||
/**
|
||||
* 查询会员收货地址列表
|
||||
*
|
||||
* @param memberID 会员ID
|
||||
* @return 会员收货地址集合
|
||||
*/
|
||||
public List<BizMemberAddress> selectBizMemberAddressList(Long memberID);
|
||||
|
||||
/**
|
||||
* 新增会员收货地址
|
||||
*
|
||||
* @param bizMemberAddress 会员收货地址
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBizMemberAddress(BizMemberAddress bizMemberAddress);
|
||||
|
||||
/**
|
||||
* 修改会员收货地址
|
||||
*
|
||||
* @param bizMemberAddress 会员收货地址
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBizMemberAddress(BizMemberAddress bizMemberAddress);
|
||||
|
||||
/**
|
||||
* 删除会员收货地址
|
||||
*
|
||||
* @param id 会员收货地址ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizMemberAddressById(Long id);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,118 @@
|
|||
package com.ruoyi.business.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.ruoyi.business.domain.BizMember;
|
||||
|
||||
/**
|
||||
* 会员Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-11
|
||||
*/
|
||||
public interface IBizMemberService
|
||||
{
|
||||
/**
|
||||
* 查询会员
|
||||
*
|
||||
* @param id 会员ID
|
||||
* @return 会员
|
||||
*/
|
||||
public BizMember selectBizMemberById(Long id);
|
||||
|
||||
/**
|
||||
* 查询会员
|
||||
*
|
||||
* @param id 会员ID
|
||||
* @return 会员
|
||||
*/
|
||||
public BizMember selectBizMemberSimple(Long id);
|
||||
|
||||
/**
|
||||
* 查询会员
|
||||
* @param mobile 手机号
|
||||
* @return 会员
|
||||
*/
|
||||
public BizMember selectBizMemberByMobile(String mobile);
|
||||
|
||||
/**
|
||||
* 查询会员列表
|
||||
*
|
||||
* @param bizMember 会员
|
||||
* @return 会员集合
|
||||
*/
|
||||
public List<BizMember> selectBizMemberList(BizMember bizMember);
|
||||
|
||||
/**
|
||||
* 会员福豆余额
|
||||
*
|
||||
* @param memberID type
|
||||
* @return 结果
|
||||
*/
|
||||
public Long selectBizMemberDou(Long memberID, int type);
|
||||
|
||||
/**
|
||||
* 新增会员
|
||||
*
|
||||
* @param bizMember 会员
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBizMember(BizMember bizMember);
|
||||
|
||||
/**
|
||||
* 修改会员
|
||||
*
|
||||
* @param bizMember 会员
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBizMember(BizMember bizMember);
|
||||
|
||||
/**
|
||||
* 修改会员
|
||||
*
|
||||
* @param bizMember 会员
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBizMemberAndDou(BizMember bizMember);
|
||||
|
||||
/**
|
||||
* 批量删除会员
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizMemberByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除会员信息
|
||||
*
|
||||
* @param id 会员ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizMemberById(Long id);
|
||||
|
||||
/**
|
||||
* 取出会员等级明细及商品购买数
|
||||
*
|
||||
* @param paramMap
|
||||
* @return 结果
|
||||
*/
|
||||
public List<Map> selectTeamData(Map paramMap);
|
||||
|
||||
/**
|
||||
* 执行专项划拨每日任务
|
||||
*
|
||||
* @param
|
||||
* @return 结果
|
||||
*/
|
||||
public int doSpecialTask();
|
||||
|
||||
/**
|
||||
* 执行团队福豆分成每日任务
|
||||
*
|
||||
* @param
|
||||
* @return 结果
|
||||
*/
|
||||
public int doTeamTask();
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
package com.ruoyi.business.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.business.domain.BizOrder;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
|
||||
/**
|
||||
* 订单Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-09
|
||||
*/
|
||||
public interface IBizOrderService
|
||||
{
|
||||
/**
|
||||
* 查询订单
|
||||
*
|
||||
* @param id 订单ID
|
||||
* @return 订单
|
||||
*/
|
||||
public BizOrder selectBizOrderById(Long id);
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*
|
||||
* @param bizOrder 订单
|
||||
* @return 订单集合
|
||||
*/
|
||||
public List<BizOrder> selectBizOrderList(BizOrder bizOrder);
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
*
|
||||
* @param bizOrder 订单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBizOrder(BizOrder bizOrder);
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*
|
||||
* @param bizOrder 订单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBizOrder(BizOrder bizOrder);
|
||||
|
||||
/**
|
||||
* 订单发货
|
||||
*
|
||||
* @param orderID 订单ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deliverBizOrder(Long orderID);
|
||||
|
||||
/**
|
||||
* 批量删除订单
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizOrderByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除订单信息
|
||||
*
|
||||
* @param id 订单ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizOrderById(Long id);
|
||||
|
||||
/**
|
||||
* 添加订单
|
||||
*
|
||||
* @param
|
||||
* @return AjaxResult
|
||||
*/
|
||||
public AjaxResult orderAdd(Long memberID, Long productID, int productNum, Long addressID, String remark);
|
||||
|
||||
/**
|
||||
* 订单收货
|
||||
*
|
||||
* @param
|
||||
* @return AjaxResult
|
||||
*/
|
||||
public AjaxResult orderConfirm(Long userID, Long orderID);
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
package com.ruoyi.business.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.business.domain.BizProduct;
|
||||
import com.ruoyi.business.domain.BizProductImage;
|
||||
|
||||
/**
|
||||
* 产品Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-06
|
||||
*/
|
||||
public interface IBizProductService
|
||||
{
|
||||
/**
|
||||
* 查询产品
|
||||
*
|
||||
* @param productId 产品ID
|
||||
* @return 产品
|
||||
*/
|
||||
public BizProduct selectBizProductById(Long productId);
|
||||
|
||||
/**
|
||||
* 查询产品列表
|
||||
*
|
||||
* @param bizProduct 产品
|
||||
* @return 产品集合
|
||||
*/
|
||||
public List<BizProduct> selectBizProductList(BizProduct bizProduct);
|
||||
|
||||
/**
|
||||
* 查询团队产品列表
|
||||
*
|
||||
* @param
|
||||
* @return 产品集合
|
||||
*/
|
||||
public List<BizProduct> selectTeamProductList();
|
||||
|
||||
/**
|
||||
* 新增产品
|
||||
*
|
||||
* @param bizProduct 产品
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBizProduct(BizProduct bizProduct);
|
||||
|
||||
/**
|
||||
* 修改产品
|
||||
*
|
||||
* @param bizProduct 产品
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBizProduct(BizProduct bizProduct);
|
||||
|
||||
/**
|
||||
* 上架下架产品
|
||||
*
|
||||
* @param productID 产品
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBizProductStatus(Long productID);
|
||||
|
||||
/**
|
||||
* 批量删除产品
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizProductByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除产品信息
|
||||
*
|
||||
* @param productId 产品ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizProductById(Long productId);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ruoyi.business.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.business.domain.BizProductType;
|
||||
|
||||
/**
|
||||
* 产品分类Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-05
|
||||
*/
|
||||
public interface IBizProductTypeService
|
||||
{
|
||||
/**
|
||||
* 查询产品分类
|
||||
*
|
||||
* @param productTypeId 产品分类ID
|
||||
* @return 产品分类
|
||||
*/
|
||||
public BizProductType selectBizProductTypeById(Long productTypeId);
|
||||
|
||||
/**
|
||||
* 查询产品分类列表
|
||||
*
|
||||
* @param bizProductType 产品分类
|
||||
* @return 产品分类集合
|
||||
*/
|
||||
public List<BizProductType> selectBizProductTypeList(BizProductType bizProductType);
|
||||
|
||||
/**
|
||||
* 新增产品分类
|
||||
*
|
||||
* @param bizProductType 产品分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBizProductType(BizProductType bizProductType);
|
||||
|
||||
/**
|
||||
* 修改产品分类
|
||||
*
|
||||
* @param bizProductType 产品分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBizProductType(BizProductType bizProductType);
|
||||
|
||||
/**
|
||||
* 批量删除产品分类
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizProductTypeByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除产品分类信息
|
||||
*
|
||||
* @param productTypeId 产品分类ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizProductTypeById(Long productTypeId);
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package com.ruoyi.business.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.business.domain.BizTeamReward;
|
||||
|
||||
/**
|
||||
* 团队奖励明细Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-22
|
||||
*/
|
||||
public interface IBizTeamRewardService
|
||||
{
|
||||
/**
|
||||
* 查询团队奖励明细
|
||||
*
|
||||
* @param id 团队奖励明细ID
|
||||
* @return 团队奖励明细
|
||||
*/
|
||||
public BizTeamReward selectBizTeamRewardById(Long id);
|
||||
|
||||
/**
|
||||
* 查询团队奖励明细列表
|
||||
*
|
||||
* @param bizTeamReward 团队奖励明细
|
||||
* @return 团队奖励明细集合
|
||||
*/
|
||||
public List<BizTeamReward> selectBizTeamRewardList(BizTeamReward bizTeamReward);
|
||||
|
||||
/**
|
||||
* 新增团队奖励明细
|
||||
*
|
||||
* @param bizTeamReward 团队奖励明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBizTeamReward(BizTeamReward bizTeamReward);
|
||||
|
||||
/**
|
||||
* 插入团队明细
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
public void addTeamReward(Long memberID, Long rewardMemberId, Long rewardProductCount, Long rewardAmount, Long productId, int rewardType, String rewardDate);
|
||||
|
||||
/**
|
||||
* 修改团队奖励明细
|
||||
*
|
||||
* @param bizTeamReward 团队奖励明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBizTeamReward(BizTeamReward bizTeamReward);
|
||||
|
||||
/**
|
||||
* 批量删除团队奖励明细
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizTeamRewardByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除团队奖励明细信息
|
||||
*
|
||||
* @param id 团队奖励明细ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBizTeamRewardById(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,176 @@
|
|||
package com.ruoyi.business.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.business.domain.BizAccount;
|
||||
import com.ruoyi.business.domain.BizAccountDetail;
|
||||
import com.ruoyi.business.mapper.BizAccountMapper;
|
||||
import com.ruoyi.business.service.IBizAccountService;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 会员账户Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-14
|
||||
*/
|
||||
@Service
|
||||
public class BizAccountServiceImpl implements IBizAccountService
|
||||
{
|
||||
@Resource
|
||||
private BizAccountMapper bizAccountMapper;
|
||||
|
||||
/**
|
||||
* 查询会员账户
|
||||
*
|
||||
* @param id 会员账户ID
|
||||
* @return 会员账户
|
||||
*/
|
||||
@Override
|
||||
public BizAccount selectBizAccountById(Long id)
|
||||
{
|
||||
return bizAccountMapper.selectBizAccountById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员账户列表
|
||||
*
|
||||
* @param bizAccount 会员账户
|
||||
* @return 会员账户
|
||||
*/
|
||||
@Override
|
||||
public List<BizAccount> selectBizAccountList(BizAccount bizAccount)
|
||||
{
|
||||
return bizAccountMapper.selectBizAccountList(bizAccount);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增会员账户
|
||||
*
|
||||
* @param bizAccount 会员账户
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBizAccount(BizAccount bizAccount)
|
||||
{
|
||||
bizAccount.setCreateTime(DateUtils.getNowDate());
|
||||
return bizAccountMapper.insertBizAccount(bizAccount);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员账户
|
||||
*
|
||||
* @param bizAccount 会员账户
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBizAccount(BizAccount bizAccount)
|
||||
{
|
||||
bizAccount.setUpdateTime(DateUtils.getNowDate());
|
||||
return bizAccountMapper.updateBizAccount(bizAccount);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员账户对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBizAccountByIds(String ids)
|
||||
{
|
||||
return bizAccountMapper.deleteBizAccountByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员账户信息
|
||||
*
|
||||
* @param id 会员账户ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBizAccountById(Long id)
|
||||
{
|
||||
return bizAccountMapper.deleteBizAccountById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询会员账户明细列表
|
||||
*
|
||||
* @param bizAccountDetail 会员账户明细
|
||||
* @return 会员账户明细集合
|
||||
*/
|
||||
public List<BizAccountDetail> selectBizAccountDetailList(BizAccountDetail bizAccountDetail)
|
||||
{
|
||||
return bizAccountMapper.selectBizAccountDetailList(bizAccountDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员福豆变动明细
|
||||
*
|
||||
* @param memberID accountType detailType money businessInfo desc
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean accountChange(Long memberID, int accountType, int detailType, Long money, String businessInfo, String desc)
|
||||
{
|
||||
//取出用户账户
|
||||
BizAccount bizAccount = new BizAccount();
|
||||
bizAccount.setMemberId(memberID);
|
||||
bizAccount.setAccountType(accountType);
|
||||
List<BizAccount> accountList = bizAccountMapper.selectBizAccountList(bizAccount);
|
||||
if (accountList.size() == 0) {
|
||||
return false;
|
||||
}
|
||||
bizAccount = accountList.get(0);
|
||||
//减去的话判断金额
|
||||
int changeType = money >= 0 ? BizAccountDetail.DOU_CHANGE_TYPE_ADD : BizAccountDetail.DOU_CHANGE_TYPE_REDUSE;
|
||||
Long beforeMoney = bizAccount.getAmount().longValue();
|
||||
if (changeType == BizAccountDetail.DOU_CHANGE_TYPE_REDUSE && beforeMoney < -money) {
|
||||
return false;
|
||||
}
|
||||
//增加余额
|
||||
Long afterMoney = beforeMoney + money;
|
||||
bizAccount.setAmount(new BigDecimal(afterMoney));
|
||||
bizAccountMapper.updateBizAccount(bizAccount);
|
||||
|
||||
//详细记录
|
||||
BizAccountDetail detail = new BizAccountDetail();
|
||||
detail.setMemberId(memberID);
|
||||
detail.setAccountId(bizAccount.getId());
|
||||
detail.setAccountType(accountType);
|
||||
detail.setBusinessNo(businessInfo);
|
||||
detail.setChangeType(changeType);
|
||||
detail.setTypeDetail(detailType);
|
||||
detail.setAmount(money);
|
||||
detail.setBeforeAmount(beforeMoney);
|
||||
detail.setAfterAmount(afterMoney);
|
||||
detail.setChangeDesc(desc);
|
||||
detail.setCreateTime(new Date());
|
||||
bizAccountMapper.insertBizAccountDetail(detail);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空福豆田
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void clearAllDouField()
|
||||
{
|
||||
|
||||
bizAccountMapper.clearAllDouField();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
package com.ruoyi.business.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.business.mapper.BizCashInfoMapper;
|
||||
import com.ruoyi.business.domain.BizCashInfo;
|
||||
import com.ruoyi.business.service.IBizCashInfoService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* 兑现申请记录Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-23
|
||||
*/
|
||||
@Service
|
||||
public class BizCashInfoServiceImpl implements IBizCashInfoService
|
||||
{
|
||||
@Autowired
|
||||
private BizCashInfoMapper bizCashInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询兑现申请记录
|
||||
*
|
||||
* @param id 兑现申请记录ID
|
||||
* @return 兑现申请记录
|
||||
*/
|
||||
@Override
|
||||
public BizCashInfo selectBizCashInfoById(Long id)
|
||||
{
|
||||
return bizCashInfoMapper.selectBizCashInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询兑现申请记录列表
|
||||
*
|
||||
* @param bizCashInfo 兑现申请记录
|
||||
* @return 兑现申请记录
|
||||
*/
|
||||
@Override
|
||||
public List<BizCashInfo> selectBizCashInfoList(BizCashInfo bizCashInfo)
|
||||
{
|
||||
return bizCashInfoMapper.selectBizCashInfoList(bizCashInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增兑现申请记录
|
||||
*
|
||||
* @param bizCashInfo 兑现申请记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBizCashInfo(BizCashInfo bizCashInfo)
|
||||
{
|
||||
bizCashInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return bizCashInfoMapper.insertBizCashInfo(bizCashInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改兑现申请记录
|
||||
*
|
||||
* @param bizCashInfo 兑现申请记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBizCashInfo(BizCashInfo bizCashInfo)
|
||||
{
|
||||
bizCashInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
return bizCashInfoMapper.updateBizCashInfo(bizCashInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除兑现申请记录对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBizCashInfoByIds(String ids)
|
||||
{
|
||||
return bizCashInfoMapper.deleteBizCashInfoByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除兑现申请记录信息
|
||||
*
|
||||
* @param id 兑现申请记录ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBizCashInfoById(Long id)
|
||||
{
|
||||
return bizCashInfoMapper.deleteBizCashInfoById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
package com.ruoyi.business.service.impl;
|
||||
|
||||
import com.ruoyi.business.domain.BizMemberAddress;
|
||||
import com.ruoyi.business.mapper.BizMemberAddressMapper;
|
||||
import com.ruoyi.business.service.IBizMemberAddressService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 会员收货地址Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-17
|
||||
*/
|
||||
@Service
|
||||
public class BizMemberAddressServiceImpl implements IBizMemberAddressService
|
||||
{
|
||||
@Resource
|
||||
private BizMemberAddressMapper bizMemberAddressMapper;
|
||||
|
||||
/**
|
||||
* 查询会员收货地址
|
||||
*
|
||||
* @param id 会员收货地址ID
|
||||
* @return 会员收货地址
|
||||
*/
|
||||
@Override
|
||||
public BizMemberAddress selectBizMemberAddressById(Long id)
|
||||
{
|
||||
return bizMemberAddressMapper.selectBizMemberAddressById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员默认收货地址
|
||||
*
|
||||
* @param memberID 会员ID
|
||||
* @return 会员收货地址
|
||||
*/
|
||||
@Override
|
||||
public BizMemberAddress selectDefaultAddressByMemberId(Long memberID)
|
||||
{
|
||||
return bizMemberAddressMapper.selectDefaultAddressByMemberId(memberID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消默认收货地址
|
||||
*
|
||||
* @param memberID 会员ID
|
||||
* @return int
|
||||
*/
|
||||
@Override
|
||||
public int cancelDefaultAddress(Long memberID)
|
||||
{
|
||||
return bizMemberAddressMapper.cancelDefaultAddress(memberID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员收货地址列表
|
||||
*
|
||||
* @param memberID 会员ID
|
||||
* @return 会员收货地址
|
||||
*/
|
||||
@Override
|
||||
public List<BizMemberAddress> selectBizMemberAddressList(Long memberID)
|
||||
{
|
||||
return bizMemberAddressMapper.selectBizMemberAddressList(memberID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增会员收货地址
|
||||
*
|
||||
* @param bizMemberAddress 会员收货地址
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBizMemberAddress(BizMemberAddress bizMemberAddress)
|
||||
{
|
||||
bizMemberAddress.setCreateTime(DateUtils.getNowDate());
|
||||
if (bizMemberAddress.getIsDelete() == 1) { //默认收货地址
|
||||
bizMemberAddressMapper.cancelDefaultAddress(bizMemberAddress.getMemberID());
|
||||
}
|
||||
return bizMemberAddressMapper.insertBizMemberAddress(bizMemberAddress);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员收货地址
|
||||
*
|
||||
* @param bizMemberAddress 会员收货地址
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBizMemberAddress(BizMemberAddress bizMemberAddress)
|
||||
{
|
||||
bizMemberAddress.setUpdateTime(DateUtils.getNowDate());
|
||||
if (bizMemberAddress.getIsDelete() == 1) { //默认收货地址
|
||||
bizMemberAddressMapper.cancelDefaultAddress(bizMemberAddress.getMemberID());
|
||||
}
|
||||
return bizMemberAddressMapper.updateBizMemberAddress(bizMemberAddress);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员收货地址信息
|
||||
*
|
||||
* @param id 会员收货地址ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBizMemberAddressById(Long id)
|
||||
{
|
||||
return bizMemberAddressMapper.deleteBizMemberAddressById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,373 @@
|
|||
package com.ruoyi.business.service.impl;
|
||||
|
||||
import com.ruoyi.business.controller.BizMemberController;
|
||||
import com.ruoyi.business.domain.BizAccount;
|
||||
import com.ruoyi.business.domain.BizAccountDetail;
|
||||
import com.ruoyi.business.domain.BizMember;
|
||||
import com.ruoyi.business.domain.BizTeamReward;
|
||||
import com.ruoyi.business.mapper.BizAccountMapper;
|
||||
import com.ruoyi.business.mapper.BizMemberMapper;
|
||||
import com.ruoyi.business.mapper.BizOrderMapper;
|
||||
import com.ruoyi.business.service.IBizAccountService;
|
||||
import com.ruoyi.business.service.IBizMemberService;
|
||||
import com.ruoyi.business.service.IBizTeamRewardService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.system.domain.SysDictData;
|
||||
import com.ruoyi.system.utils.DictUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 会员Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-11
|
||||
*/
|
||||
@Service
|
||||
public class BizMemberServiceImpl implements IBizMemberService
|
||||
{
|
||||
@Resource
|
||||
private BizMemberMapper bizMemberMapper;
|
||||
|
||||
@Resource
|
||||
private BizOrderMapper bizOrderMapper;
|
||||
|
||||
@Resource
|
||||
private IBizAccountService bizAccountService;
|
||||
|
||||
@Resource
|
||||
private IBizTeamRewardService bizTeamRewardService;
|
||||
|
||||
@Resource
|
||||
private BizAccountMapper bizAccountMapper;
|
||||
|
||||
/**
|
||||
* 查询会员
|
||||
*
|
||||
* @param id 会员ID
|
||||
* @return 会员
|
||||
*/
|
||||
@Override
|
||||
public BizMember selectBizMemberById(Long id)
|
||||
{
|
||||
return bizMemberMapper.selectBizMemberById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员
|
||||
*
|
||||
* @param id 会员ID
|
||||
* @return 会员
|
||||
*/
|
||||
@Override
|
||||
public BizMember selectBizMemberSimple(Long id)
|
||||
{
|
||||
return bizMemberMapper.selectBizMemberSimple(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BizMember selectBizMemberByMobile(String mobile) {
|
||||
return bizMemberMapper.selectBizMemberByMobile(mobile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员列表
|
||||
*
|
||||
* @param bizMember 会员
|
||||
* @return 会员
|
||||
*/
|
||||
@Override
|
||||
public List<BizMember> selectBizMemberList(BizMember bizMember)
|
||||
{
|
||||
return bizMemberMapper.selectBizMemberList(bizMember);
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员福豆余额
|
||||
*
|
||||
* @param memberID type
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public Long selectBizMemberDou(Long memberID, int type)
|
||||
{
|
||||
Map map = new HashMap<>();
|
||||
map.put("memberID", memberID);
|
||||
map.put("type", type);
|
||||
return bizMemberMapper.selectBizMemberDou(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增会员
|
||||
*
|
||||
* @param bizMember 会员
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBizMember(BizMember bizMember)
|
||||
{
|
||||
bizMember.setCreateTime(DateUtils.getNowDate());
|
||||
return bizMemberMapper.insertBizMember(bizMember);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员
|
||||
*
|
||||
* @param bizMember 会员
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBizMember(BizMember bizMember)
|
||||
{
|
||||
bizMember.setUpdateTime(DateUtils.getNowDate());
|
||||
return bizMemberMapper.updateBizMember(bizMember);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员
|
||||
*
|
||||
* @param bizMember 会员
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBizMemberAndDou(BizMember bizMember)
|
||||
{
|
||||
Long memberId = bizMember.getId();
|
||||
//修改姓名和手机号
|
||||
BizMember oldBizMember = selectBizMemberSimple(memberId);
|
||||
oldBizMember.setMobile(bizMember.getMobile());
|
||||
oldBizMember.setMemberName(bizMember.getMemberName());
|
||||
updateBizMember(oldBizMember);
|
||||
//修改五项福豆
|
||||
BizAccount bizAccount = new BizAccount();
|
||||
bizAccount.setMemberId(memberId);
|
||||
List<BizAccount> accountList = bizAccountMapper.selectBizAccountList(bizAccount);
|
||||
for (BizAccount account : accountList) {
|
||||
Long oldAmount = account.getAmount().longValue();
|
||||
Long newAmount = 0L;
|
||||
switch (account.getAccountType()) {
|
||||
case BizAccount.DOU_BALANCE:
|
||||
newAmount = bizMember.getDouBalance();
|
||||
break;
|
||||
case BizAccount.DOU_PERSON:
|
||||
newAmount = bizMember.getDouPerson();
|
||||
break;
|
||||
case BizAccount.DOU_TEAM:
|
||||
newAmount = bizMember.getDouTeam();
|
||||
break;
|
||||
case BizAccount.DOU_SPECIAL:
|
||||
newAmount = bizMember.getDouSpecial();
|
||||
break;
|
||||
case BizAccount.DOU_FIELD:
|
||||
newAmount = bizMember.getDouField();
|
||||
break;
|
||||
}
|
||||
//数据不一致则更新最新账户余额
|
||||
if (!newAmount.equals(oldAmount)) {
|
||||
//account.setAmount(new BigDecimal(newAmount));
|
||||
//bizAccountMapper.updateBizAccount(account);
|
||||
bizAccountService.accountChange(memberId, account.getAccountType(), BizAccountDetail.DOU_DETAIL_TYPE_SYSTEM, newAmount - oldAmount, "", BizAccountDetail.DOU_DESC_SYSTEM);
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBizMemberByIds(String ids)
|
||||
{
|
||||
return bizMemberMapper.deleteBizMemberByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员信息
|
||||
*
|
||||
* @param id 会员ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBizMemberById(Long id)
|
||||
{
|
||||
return bizMemberMapper.deleteBizMemberById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取出会员等级明细及商品购买数
|
||||
*
|
||||
* @param paramMap
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public List<Map> selectTeamData(Map paramMap)
|
||||
{
|
||||
return bizMemberMapper.selectTeamData(paramMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行专项划拨每日任务
|
||||
*
|
||||
* @param
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int doSpecialTask()
|
||||
{
|
||||
//划拨金额
|
||||
int dailyAmount = Integer.parseInt(DictUtils.getDictLabel("busi_award_set", "2"));
|
||||
//出局次数
|
||||
int maxLevel = Integer.parseInt(DictUtils.getDictLabel("busi_award_set", "5"));
|
||||
//团队盒数标准
|
||||
int teamCountLimit = Integer.parseInt(DictUtils.getDictLabel("busi_award_set", "3"));
|
||||
|
||||
List<BizMember> memberList = bizMemberMapper.selectSpecialMember(dailyAmount);
|
||||
int accessCount = 0;
|
||||
for (BizMember member : memberList) {
|
||||
Long memberID = member.getId();
|
||||
Long douSpecial = member.getDouSpecial();
|
||||
//先扣款
|
||||
boolean result = bizAccountService.accountChange(memberID, BizAccount.DOU_SPECIAL, BizAccountDetail.DOU_DETAIL_TYPE_EXCHANGE, (long) -dailyAmount, "", BizAccountDetail.DOU_DESC_SPECIAL2);
|
||||
if (result) {
|
||||
//加入个人账户
|
||||
result = bizAccountService.accountChange(memberID, BizAccount.DOU_PERSON, BizAccountDetail.DOU_DETAIL_TYPE_CHARGE, (long) dailyAmount, "", BizAccountDetail.DOU_DESC_SPECIAL2);
|
||||
if (result) {
|
||||
accessCount ++;
|
||||
if (douSpecial <= dailyAmount) {
|
||||
//已经划拨完余额为0,更新用户出局情况
|
||||
long teamCount = bizMemberMapper.getMemberTeamCount(memberID);
|
||||
int specialLevel = member.getSpecialLevel();
|
||||
if (teamCount < teamCountLimit) { //团队盒数不足设定值盒则更新level
|
||||
//达到最大等级则出局
|
||||
specialLevel = specialLevel == maxLevel ? 0 : (specialLevel + 1);
|
||||
member.setSpecialLevel(specialLevel);
|
||||
bizMemberMapper.updateMemberLevel(member);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return accessCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行团队福豆分成每日任务
|
||||
*
|
||||
* @param
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int doTeamTask()
|
||||
{
|
||||
//分成标准
|
||||
List<SysDictData> levels = DictUtils.getDictCache("busi_teamaward_level");
|
||||
//分成盒数限制
|
||||
int numLimit = Integer.parseInt(DictUtils.getDictLabel("busi_award_set", "1"));
|
||||
//日期记录上一天的
|
||||
String dateStr = DateUtils.getDate(-1);
|
||||
|
||||
List<Map> memberList = bizMemberMapper.selectTeamBenefitMember(numLimit);
|
||||
int accessCount = 0;
|
||||
for (Map member : memberList) {
|
||||
Long memberID = (Long) member.get("id");
|
||||
Long totalNum = ((BigDecimal) member.get("totalNum")).longValue();
|
||||
long selfDou = BizMemberController.getTeamDou(totalNum, levels, numLimit);
|
||||
|
||||
//存入直接子级的团队盒数和团队成员数据
|
||||
Map<Long, Map> temp = new HashMap();
|
||||
//存入每个子团队用户的结算盒数
|
||||
Map<Long, Integer> numMap = new HashMap();
|
||||
//直接下级列表
|
||||
List<Long> subList = bizMemberMapper.selectSubMember(memberID);
|
||||
for (Long subID : subList) {
|
||||
Map map = new HashMap();
|
||||
map.put("num", 0);
|
||||
map.put("teamMembers", new ArrayList());
|
||||
temp.put(subID, map);
|
||||
}
|
||||
|
||||
List<Map> orderList = bizOrderMapper.selectTeamBizOrder(memberID);
|
||||
int counter = 0; //剔除前numLimit盒
|
||||
for (Map order : orderList) {
|
||||
Long buyerID = (Long) order.get("id");
|
||||
String allID = (String) order.get("all_id");
|
||||
int count = (Integer) order.get("product_count");
|
||||
for (Long subID : subList) {
|
||||
if (buyerID.equals(subID) || testContains(allID, subID)) { //是自己或子级
|
||||
Map subMap = temp.get(subID);
|
||||
int num = (Integer) subMap.get("num");
|
||||
subMap.put("num", num + count);
|
||||
List chList = (List) subMap.get("teamMembers");
|
||||
if (!chList.contains(buyerID)) {
|
||||
chList.add(buyerID);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
//筛选出没到限制盒数的无效订单
|
||||
int oldCount = counter;
|
||||
counter += count;
|
||||
if (counter <= numLimit) continue;
|
||||
if (oldCount <= numLimit) {
|
||||
//有可能一个订单同时包含有效盒和无效盒
|
||||
count = counter - numLimit;
|
||||
}
|
||||
//存入每个团队成员的明细
|
||||
Integer chTotal = (Integer) numMap.get(buyerID);
|
||||
if (chTotal == null) chTotal = 0;
|
||||
chTotal += count;
|
||||
numMap.put(buyerID, chTotal);
|
||||
}
|
||||
//根据直接下级计算数据
|
||||
long totalBenefit = 0L;
|
||||
for (Long subID : subList) {
|
||||
Map subMap = temp.get(subID);
|
||||
int subTeamNum = (Integer) subMap.get("num");
|
||||
//比较subDou和selfDou得出子团队分成数值
|
||||
long subDou = BizMemberController.getTeamDou(subTeamNum, levels, numLimit);
|
||||
long getDou = selfDou - subDou;
|
||||
if (getDou <= 0) continue;
|
||||
//子团队用户列表取出
|
||||
List<Long> chList = (List<Long>) subMap.get("teamMembers");
|
||||
//每个子级用户添加teamAward数据
|
||||
for (Long chID : chList) {
|
||||
//子级盒数
|
||||
Integer chTotal = numMap.get(chID);
|
||||
if (chTotal == null || chTotal <= 0) continue;
|
||||
long benefit = getDou * chTotal; //该子用户分成
|
||||
//插入数据
|
||||
bizTeamRewardService.addTeamReward(memberID, chID, (long) chTotal, benefit, null, BizTeamReward.TEAM_REWARD_TYPE_TEAM, dateStr);
|
||||
totalBenefit += benefit;
|
||||
}
|
||||
}
|
||||
//团队福豆及福豆田
|
||||
if (totalBenefit > 0) {
|
||||
accessCount ++;
|
||||
bizAccountService.accountChange(memberID, BizAccount.DOU_TEAM, BizAccountDetail.DOU_DETAIL_TYPE_CHARGE, totalBenefit,"", BizAccountDetail.DOU_DESC_TEAM);
|
||||
bizAccountService.accountChange(memberID, BizAccount.DOU_FIELD, BizAccountDetail.DOU_DETAIL_TYPE_CHARGE, totalBenefit,"", BizAccountDetail.DOU_DESC_TEAM);
|
||||
}
|
||||
}
|
||||
return accessCount;
|
||||
}
|
||||
|
||||
//测试all包含字符串
|
||||
private boolean testContains(String allID, Long id)
|
||||
{
|
||||
return ("," + allID + ",").indexOf("," + id + ",") >= 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,283 @@
|
|||
package com.ruoyi.business.service.impl;
|
||||
|
||||
import com.ruoyi.business.domain.*;
|
||||
import com.ruoyi.business.mapper.BizMemberAddressMapper;
|
||||
import com.ruoyi.business.mapper.BizMemberMapper;
|
||||
import com.ruoyi.business.mapper.BizOrderMapper;
|
||||
import com.ruoyi.business.mapper.BizProductMapper;
|
||||
import com.ruoyi.business.service.IBizOrderService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.system.utils.DictUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-09
|
||||
*/
|
||||
@Service
|
||||
public class BizOrderServiceImpl implements IBizOrderService
|
||||
{
|
||||
@Resource
|
||||
private BizOrderMapper bizOrderMapper;
|
||||
|
||||
@Resource
|
||||
private BizProductMapper bizProductMapper;
|
||||
|
||||
@Resource
|
||||
private BizMemberMapper bizMemberMapper;
|
||||
|
||||
@Resource
|
||||
private BizMemberAddressMapper bizMemberAddressMapper;
|
||||
|
||||
@Resource
|
||||
private BizAccountServiceImpl bizAccountService;
|
||||
|
||||
@Resource
|
||||
private BizTeamRewardServiceImpl bizTeamRewardService;
|
||||
|
||||
/**
|
||||
* 查询订单
|
||||
*
|
||||
* @param id 订单ID
|
||||
* @return 订单
|
||||
*/
|
||||
@Override
|
||||
public BizOrder selectBizOrderById(Long id)
|
||||
{
|
||||
return bizOrderMapper.selectBizOrderById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*
|
||||
* @param bizOrder 订单
|
||||
* @return 订单
|
||||
*/
|
||||
@Override
|
||||
public List<BizOrder> selectBizOrderList(BizOrder bizOrder)
|
||||
{
|
||||
return bizOrderMapper.selectBizOrderList(bizOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
*
|
||||
* @param bizOrder 订单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBizOrder(BizOrder bizOrder)
|
||||
{
|
||||
bizOrder.setCreateTime(DateUtils.getNowDate());
|
||||
return bizOrderMapper.insertBizOrder(bizOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*
|
||||
* @param bizOrder 订单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBizOrder(BizOrder bizOrder)
|
||||
{
|
||||
bizOrder.setUpdateTime(DateUtils.getNowDate());
|
||||
return bizOrderMapper.updateBizOrder(bizOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单发货
|
||||
*
|
||||
* @param orderID 订单ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deliverBizOrder(Long orderID)
|
||||
{
|
||||
BizOrder bizOrder = bizOrderMapper.selectBizOrderById(orderID);
|
||||
if (bizOrder == null) {
|
||||
return 0;
|
||||
}
|
||||
//校验订单状态
|
||||
if (bizOrder.getOrderStatus() != BizOrder.STATUS_PAYED) {
|
||||
return 0;
|
||||
}
|
||||
bizOrder.setOrderStatus(BizOrder.STATUS_DELIVERY);
|
||||
bizOrder.setUpdateBy(ShiroUtils.getLoginName());
|
||||
bizOrder.setUpdateTime(new Date());
|
||||
return bizOrderMapper.updateBizOrder(bizOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBizOrderByIds(String ids)
|
||||
{
|
||||
return bizOrderMapper.deleteBizOrderByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单信息
|
||||
*
|
||||
* @param id 订单ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBizOrderById(Long id)
|
||||
{
|
||||
return bizOrderMapper.deleteBizOrderById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加订单
|
||||
*
|
||||
* @param
|
||||
* @return AjaxResult
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public AjaxResult orderAdd(Long memberID, Long productID, int productNum, Long addressID, String remark)
|
||||
{
|
||||
if (productNum <= 0 || productNum > 99) { //检测数量
|
||||
return AjaxResult.error("商品数目异常");
|
||||
}
|
||||
if (StringUtils.isEmpty(remark) || remark.length() > 30) { //检测备注
|
||||
return AjaxResult.error("备注信息异常");
|
||||
}
|
||||
//取出商品
|
||||
BizProduct product = bizProductMapper.selectBizProductById(productID);
|
||||
if (product == null || product.getOnlineStatus() == 0) { //检测上架
|
||||
return AjaxResult.error("该商品不存在");
|
||||
}
|
||||
//订单总价
|
||||
BigDecimal amount = product.getAmount();
|
||||
BigDecimal orderTotal = amount.multiply(new BigDecimal(productNum));
|
||||
//判断余额
|
||||
BizMember member = bizMemberMapper.selectBizMemberById(memberID);
|
||||
Long douBalance = member.getDouBalance();
|
||||
if (douBalance < orderTotal.longValue()) {
|
||||
return AjaxResult.error("福豆余额不足");
|
||||
}
|
||||
//判断专项划拨相关金额
|
||||
int decreaseAmount = Integer.parseInt(DictUtils.getDictLabel("busi_award_set", "4"));
|
||||
BigDecimal cashbackAmount = product.getCashbackAmount();
|
||||
boolean isTeam = cashbackAmount.longValue() > 0;
|
||||
Integer specialLevel = member.getSpecialLevel();
|
||||
BigDecimal cashbackTotalAmount = new BigDecimal(0);
|
||||
if (specialLevel != null && specialLevel > 0) { //未出局
|
||||
//重新计算专项金额
|
||||
cashbackAmount = cashbackAmount.add(new BigDecimal((specialLevel - 1) * decreaseAmount));
|
||||
cashbackTotalAmount = cashbackAmount.multiply(new BigDecimal(productNum));
|
||||
}
|
||||
|
||||
//判断地址
|
||||
BizMemberAddress address = bizMemberAddressMapper.selectBizMemberAddressById(addressID);
|
||||
if (address == null || !address.getMemberID().equals(memberID)) {
|
||||
return AjaxResult.error("收货地址不正确");
|
||||
}
|
||||
|
||||
//创建订单
|
||||
BizOrder order = new BizOrder();
|
||||
order.setOrderSn("ORD" + DateUtils.getMilliTime());
|
||||
order.setMemberId(memberID);
|
||||
order.setMobile(address.getMobile());
|
||||
order.setMemberName(member.getMemberName());
|
||||
order.setOrderAmount(orderTotal);
|
||||
order.setOrderStatus(BizOrder.STATUS_PAYED); //已支付
|
||||
order.setIsTeam(isTeam ? 1 : 0); //是否团队福豆影响订单
|
||||
order.setRemark(remark);
|
||||
order.setAddressDetail(address.getAddress());
|
||||
order.setAddressId(addressID);
|
||||
insertBizOrder(order);
|
||||
//订单详情
|
||||
BizOrderDetail orderDetail = new BizOrderDetail();
|
||||
orderDetail.setOrderId(order.getId());
|
||||
orderDetail.setOrderSn(order.getOrderSn());
|
||||
orderDetail.setProductId(productID);
|
||||
orderDetail.setProductCode(product.getProductName());
|
||||
orderDetail.setProductCount(productNum);
|
||||
orderDetail.setProductAmount(amount);
|
||||
bizOrderMapper.insertBizOrderDetail(orderDetail);
|
||||
|
||||
String businessCode = String.valueOf(order.getOrderSn());
|
||||
//减去福豆余额账户
|
||||
boolean result = bizAccountService.accountChange(memberID, BizAccount.DOU_BALANCE, BizAccountDetail.DOU_DETAIL_TYPE_ORDER, -orderTotal.longValue(), businessCode, BizAccountDetail.DOU_DESC_ORDER);
|
||||
if (!result) {
|
||||
return AjaxResult.error("扣款失败,请联系管理员");
|
||||
}
|
||||
//增加专项账户
|
||||
if(isTeam) {
|
||||
if (cashbackTotalAmount.longValue() > 0) {
|
||||
result = bizAccountService.accountChange(memberID, BizAccount.DOU_SPECIAL, BizAccountDetail.DOU_DETAIL_TYPE_CHARGE, cashbackTotalAmount.longValue(), businessCode, BizAccountDetail.DOU_DESC_SPECIAL1);
|
||||
if (!result) {
|
||||
return AjaxResult.error("扣款失败,请联系管理员");
|
||||
}
|
||||
}
|
||||
|
||||
//增加直推奖励(团队福豆账户)
|
||||
Long recMemberID = member.getRecommendId();
|
||||
if (recMemberID != null && recMemberID != 0) {
|
||||
//取出直推奖励金额
|
||||
long award1 = productNum * Long.parseLong(DictUtils.getDictLabel("busi_recommend_award", "1"));
|
||||
result = bizAccountService.accountChange(recMemberID, BizAccount.DOU_TEAM, BizAccountDetail.DOU_DETAIL_TYPE_CHARGE, award1, businessCode, BizAccountDetail.DOU_DESC_RECOMM);
|
||||
if (!result) {
|
||||
return AjaxResult.error("扣款失败,请联系管理员");
|
||||
}
|
||||
//增加团队积分数据(直推)
|
||||
String dateStr = DateUtils.getDate(-1); //日期记录上一天的
|
||||
bizTeamRewardService.addTeamReward(recMemberID, memberID, (long) productNum, award1, productID, BizTeamReward.TEAM_REWARD_TYPE_RECOMM, dateStr);
|
||||
//判断二级直推(需要3个下级)
|
||||
BizMember recommendMember = bizMemberMapper.selectBizMemberSimple(recMemberID);
|
||||
Long topMemberID = recommendMember.getRecommendId();
|
||||
//判断有效下级数不少于三个
|
||||
if (recMemberID != null && bizMemberMapper.getValidChildCount(topMemberID) >= BizAccount.SECOND_AWARD_CHILD_LIMIT) {
|
||||
long award2 = productNum * Long.parseLong(DictUtils.getDictLabel("busi_recommend_award", "2"));
|
||||
result = bizAccountService.accountChange(topMemberID, BizAccount.DOU_TEAM, BizAccountDetail.DOU_DETAIL_TYPE_CHARGE, award2, businessCode, BizAccountDetail.DOU_DESC_SECOND);
|
||||
if (!result) {
|
||||
return AjaxResult.error("扣款失败,请联系管理员");
|
||||
}
|
||||
//增加团队积分数据(二推)
|
||||
bizTeamRewardService.addTeamReward(topMemberID, memberID, (long) productNum, award2, productID, BizTeamReward.TEAM_REWARD_TYPE_SECOND, dateStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单收货
|
||||
*
|
||||
* @param
|
||||
* @return AjaxResult
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public AjaxResult orderConfirm(Long userID, Long orderID)
|
||||
{
|
||||
BizOrder order = selectBizOrderById(orderID);
|
||||
//验证
|
||||
if (order == null || !order.getMemberId().equals(userID) || order.getOrderStatus() != BizOrder.STATUS_DELIVERY) {
|
||||
return AjaxResult.error("订单操作失败");
|
||||
}
|
||||
order.setOrderStatus(BizOrder.STATUS_COMPLETED);
|
||||
order.setUpdateBy(String.valueOf(userID));
|
||||
updateBizOrder(order);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,213 @@
|
|||
package com.ruoyi.business.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.system.utils.DictUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.ArrayList;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.ruoyi.business.domain.BizProductImage;
|
||||
import com.ruoyi.business.mapper.BizProductMapper;
|
||||
import com.ruoyi.business.domain.BizProduct;
|
||||
import com.ruoyi.business.service.IBizProductService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 产品Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-06
|
||||
*/
|
||||
@Service
|
||||
public class BizProductServiceImpl implements IBizProductService
|
||||
{
|
||||
@Resource
|
||||
private BizProductMapper bizProductMapper;
|
||||
|
||||
/**
|
||||
* 查询产品
|
||||
*
|
||||
* @param productId 产品ID
|
||||
* @return 产品
|
||||
*/
|
||||
@Override
|
||||
public BizProduct selectBizProductById(Long productId)
|
||||
{
|
||||
BizProduct bizProduct = bizProductMapper.selectBizProductById(productId);
|
||||
List<BizProductImage> imageList = bizProductMapper.selectBizProductImageList(productId);
|
||||
List<String> detailImages = new ArrayList<String>();
|
||||
List<String> loopImages = new ArrayList<String>();
|
||||
//取出商品三种图片数据
|
||||
for (BizProductImage image : imageList) {
|
||||
String url = image.getImageUrl();
|
||||
switch (image.getImageType()) {
|
||||
case 0:
|
||||
bizProduct.setMainImage(url);
|
||||
break;
|
||||
case 1:
|
||||
detailImages.add(url);
|
||||
break;
|
||||
case 2:
|
||||
loopImages.add(url);
|
||||
break;
|
||||
}
|
||||
}
|
||||
bizProduct.setDetailImages(detailImages);
|
||||
bizProduct.setLoopImages(loopImages);
|
||||
return bizProduct;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询产品列表
|
||||
*
|
||||
* @param bizProduct 产品
|
||||
* @return 产品
|
||||
*/
|
||||
@Override
|
||||
public List<BizProduct> selectBizProductList(BizProduct bizProduct)
|
||||
{
|
||||
return bizProductMapper.selectBizProductList(bizProduct);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询团队产品列表
|
||||
*
|
||||
* @param
|
||||
* @return 产品集合
|
||||
*/
|
||||
@Override
|
||||
public List<BizProduct> selectTeamProductList()
|
||||
{
|
||||
return bizProductMapper.selectTeamProductList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产品
|
||||
*
|
||||
* @param bizProduct 产品
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int insertBizProduct(BizProduct bizProduct)
|
||||
{
|
||||
bizProduct.setCreateTime(DateUtils.getNowDate());
|
||||
int rows = bizProductMapper.insertBizProduct(bizProduct);
|
||||
insertBizProductImage(bizProduct);
|
||||
return rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改产品
|
||||
*
|
||||
* @param bizProduct 产品
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int updateBizProduct(BizProduct bizProduct)
|
||||
{
|
||||
bizProduct.setUpdateTime(DateUtils.getNowDate());
|
||||
bizProductMapper.deleteBizProductImageByProductId(bizProduct.getId());
|
||||
insertBizProductImage(bizProduct);
|
||||
return bizProductMapper.updateBizProduct(bizProduct);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上架下架产品
|
||||
*
|
||||
* @param productID 产品
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int updateBizProductStatus(Long productID)
|
||||
{
|
||||
BizProduct bizProduct = bizProductMapper.selectBizProductById(productID);
|
||||
Date now = new Date();
|
||||
switch (bizProduct.getOnlineStatus())
|
||||
{
|
||||
case 0:
|
||||
bizProduct.setOnlineTime(now);
|
||||
bizProduct.setOnlineStatus(1);
|
||||
break;
|
||||
case 1:
|
||||
bizProduct.setOfflineTime(now);
|
||||
bizProduct.setOnlineStatus(0);
|
||||
break;
|
||||
}
|
||||
return bizProductMapper.updateBizProduct(bizProduct);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除产品对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int deleteBizProductByIds(String ids)
|
||||
{
|
||||
bizProductMapper.deleteBizProductImageByProductIds(Convert.toStrArray(ids));
|
||||
return bizProductMapper.deleteBizProductByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除产品信息
|
||||
*
|
||||
* @param productId 产品ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBizProductById(Long productId)
|
||||
{
|
||||
bizProductMapper.deleteBizProductImageByProductId(productId);
|
||||
return bizProductMapper.deleteBizProductById(productId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产品图片信息
|
||||
*
|
||||
* @param bizProduct 产品对象
|
||||
*/
|
||||
public void insertBizProductImage(BizProduct bizProduct)
|
||||
{
|
||||
List<String> detailImages = bizProduct.getDetailImages();
|
||||
List<String> loopImages = bizProduct.getLoopImages();
|
||||
String mainImage = bizProduct.getMainImage();
|
||||
Long productId = bizProduct.getId();
|
||||
List<BizProductImage> list = new ArrayList<BizProductImage>();
|
||||
//插入三类产品图片
|
||||
if (StringUtils.isNotEmpty(mainImage)) {
|
||||
list.add(getInsertProductImage(productId, 0, mainImage));
|
||||
}
|
||||
if (StringUtils.isNotNull(detailImages)) {
|
||||
for (String url : detailImages) {
|
||||
list.add(getInsertProductImage(productId, 1, url));
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotNull(loopImages)) {
|
||||
for (String url : loopImages) {
|
||||
list.add(getInsertProductImage(productId, 2, url));
|
||||
}
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
bizProductMapper.batchBizProductImage(list);
|
||||
}
|
||||
}
|
||||
|
||||
//新增企业图片
|
||||
public BizProductImage getInsertProductImage(Long productId, Integer type, String url) {
|
||||
BizProductImage productImage = new BizProductImage();
|
||||
productImage.setProductId(productId);
|
||||
productImage.setImageType(type);
|
||||
productImage.setImageUrl(url);
|
||||
return productImage;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
package com.ruoyi.business.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.business.mapper.BizProductTypeMapper;
|
||||
import com.ruoyi.business.domain.BizProductType;
|
||||
import com.ruoyi.business.service.IBizProductTypeService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 产品分类Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-05
|
||||
*/
|
||||
@Service
|
||||
public class BizProductTypeServiceImpl implements IBizProductTypeService
|
||||
{
|
||||
@Resource
|
||||
private BizProductTypeMapper bizProductTypeMapper;
|
||||
|
||||
/**
|
||||
* 查询产品分类
|
||||
*
|
||||
* @param productTypeId 产品分类ID
|
||||
* @return 产品分类
|
||||
*/
|
||||
@Override
|
||||
public BizProductType selectBizProductTypeById(Long productTypeId)
|
||||
{
|
||||
return bizProductTypeMapper.selectBizProductTypeById(productTypeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询产品分类列表
|
||||
*
|
||||
* @param bizProductType 产品分类
|
||||
* @return 产品分类
|
||||
*/
|
||||
@Override
|
||||
public List<BizProductType> selectBizProductTypeList(BizProductType bizProductType)
|
||||
{
|
||||
return bizProductTypeMapper.selectBizProductTypeList(bizProductType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产品分类
|
||||
*
|
||||
* @param bizProductType 产品分类
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBizProductType(BizProductType bizProductType)
|
||||
{
|
||||
bizProductType.setCreateTime(DateUtils.getNowDate());
|
||||
return bizProductTypeMapper.insertBizProductType(bizProductType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改产品分类
|
||||
*
|
||||
* @param bizProductType 产品分类
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBizProductType(BizProductType bizProductType)
|
||||
{
|
||||
bizProductType.setUpdateTime(DateUtils.getNowDate());
|
||||
return bizProductTypeMapper.updateBizProductType(bizProductType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除产品分类对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBizProductTypeByIds(String ids)
|
||||
{
|
||||
return bizProductTypeMapper.deleteBizProductTypeByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除产品分类信息
|
||||
*
|
||||
* @param productTypeId 产品分类ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBizProductTypeById(Long productTypeId)
|
||||
{
|
||||
return bizProductTypeMapper.deleteBizProductTypeById(productTypeId);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
package com.ruoyi.business.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.business.mapper.BizTeamRewardMapper;
|
||||
import com.ruoyi.business.domain.BizTeamReward;
|
||||
import com.ruoyi.business.service.IBizTeamRewardService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 团队奖励明细Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2020-09-22
|
||||
*/
|
||||
@Service
|
||||
public class BizTeamRewardServiceImpl implements IBizTeamRewardService
|
||||
{
|
||||
@Resource
|
||||
private BizTeamRewardMapper bizTeamRewardMapper;
|
||||
|
||||
/**
|
||||
* 查询团队奖励明细
|
||||
*
|
||||
* @param id 团队奖励明细ID
|
||||
* @return 团队奖励明细
|
||||
*/
|
||||
@Override
|
||||
public BizTeamReward selectBizTeamRewardById(Long id)
|
||||
{
|
||||
return bizTeamRewardMapper.selectBizTeamRewardById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询团队奖励明细列表
|
||||
*
|
||||
* @param bizTeamReward 团队奖励明细
|
||||
* @return 团队奖励明细
|
||||
*/
|
||||
@Override
|
||||
public List<BizTeamReward> selectBizTeamRewardList(BizTeamReward bizTeamReward)
|
||||
{
|
||||
return bizTeamRewardMapper.selectBizTeamRewardList(bizTeamReward);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增团队奖励明细
|
||||
*
|
||||
* @param bizTeamReward 团队奖励明细
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBizTeamReward(BizTeamReward bizTeamReward)
|
||||
{
|
||||
bizTeamReward.setCreateTime(DateUtils.getNowDate());
|
||||
return bizTeamRewardMapper.insertBizTeamReward(bizTeamReward);
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入团队明细
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void addTeamReward(Long memberID, Long rewardMemberId, Long rewardProductCount, Long rewardAmount, Long productId, int rewardType, String rewardDate)
|
||||
{
|
||||
BizTeamReward bizTeamReward = new BizTeamReward();
|
||||
bizTeamReward.setMemberId(memberID);
|
||||
bizTeamReward.setRewardMemberId(rewardMemberId);
|
||||
bizTeamReward.setRewardProductCount(rewardProductCount);
|
||||
bizTeamReward.setRewardAmount(rewardAmount);
|
||||
bizTeamReward.setProductId(productId);
|
||||
bizTeamReward.setRewardType(rewardType);
|
||||
bizTeamReward.setRewardDate(rewardDate);
|
||||
bizTeamReward.setCreateTime(new Date());
|
||||
insertBizTeamReward(bizTeamReward);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改团队奖励明细
|
||||
*
|
||||
* @param bizTeamReward 团队奖励明细
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBizTeamReward(BizTeamReward bizTeamReward)
|
||||
{
|
||||
bizTeamReward.setUpdateTime(DateUtils.getNowDate());
|
||||
return bizTeamRewardMapper.updateBizTeamReward(bizTeamReward);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除团队奖励明细对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBizTeamRewardByIds(String ids)
|
||||
{
|
||||
return bizTeamRewardMapper.deleteBizTeamRewardByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除团队奖励明细信息
|
||||
*
|
||||
* @param id 团队奖励明细ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBizTeamRewardById(Long id)
|
||||
{
|
||||
return bizTeamRewardMapper.deleteBizTeamRewardById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,203 @@
|
|||
package com.ruoyi.business.sync;
|
||||
|
||||
public class GoodsData {
|
||||
|
||||
private String id;
|
||||
private String goodsId;
|
||||
private String goodsName;
|
||||
private String isProduct;
|
||||
private String goodsType;
|
||||
private String goodsLevel;
|
||||
private String unitPrice;
|
||||
private String goodsDescribe;
|
||||
private String goodsMainImg;
|
||||
private String goodsDetailsImg;
|
||||
private String itemPoints;
|
||||
private String directPoints;
|
||||
private String indirectPoints;
|
||||
private String stockCount;
|
||||
private String goodsFreight;
|
||||
private String enable;
|
||||
private String addtime;
|
||||
private String exterd1;
|
||||
private String exterd2;
|
||||
private String exterd3;
|
||||
private String goodsLevelName;
|
||||
private String goodsLevelText;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getGoodsId() {
|
||||
return goodsId;
|
||||
}
|
||||
|
||||
public void setGoodsId(String goodsId) {
|
||||
this.goodsId = goodsId;
|
||||
}
|
||||
|
||||
public String getGoodsName() {
|
||||
return goodsName;
|
||||
}
|
||||
|
||||
public void setGoodsName(String goodsName) {
|
||||
this.goodsName = goodsName;
|
||||
}
|
||||
|
||||
public String getIsProduct() {
|
||||
return isProduct;
|
||||
}
|
||||
|
||||
public void setIsProduct(String isProduct) {
|
||||
this.isProduct = isProduct;
|
||||
}
|
||||
|
||||
public String getGoodsType() {
|
||||
return goodsType;
|
||||
}
|
||||
|
||||
public void setGoodsType(String goodsType) {
|
||||
this.goodsType = goodsType;
|
||||
}
|
||||
|
||||
public String getGoodsLevel() {
|
||||
return goodsLevel;
|
||||
}
|
||||
|
||||
public void setGoodsLevel(String goodsLevel) {
|
||||
this.goodsLevel = goodsLevel;
|
||||
}
|
||||
|
||||
public String getUnitPrice() {
|
||||
return unitPrice;
|
||||
}
|
||||
|
||||
public void setUnitPrice(String unitPrice) {
|
||||
this.unitPrice = unitPrice;
|
||||
}
|
||||
|
||||
public String getGoodsDescribe() {
|
||||
return goodsDescribe;
|
||||
}
|
||||
|
||||
public void setGoodsDescribe(String goodsDescribe) {
|
||||
this.goodsDescribe = goodsDescribe;
|
||||
}
|
||||
|
||||
public String getGoodsMainImg() {
|
||||
return goodsMainImg;
|
||||
}
|
||||
|
||||
public void setGoodsMainImg(String goodsMainImg) {
|
||||
this.goodsMainImg = goodsMainImg;
|
||||
}
|
||||
|
||||
public String getGoodsDetailsImg() {
|
||||
return goodsDetailsImg;
|
||||
}
|
||||
|
||||
public void setGoodsDetailsImg(String goodsDetailsImg) {
|
||||
this.goodsDetailsImg = goodsDetailsImg;
|
||||
}
|
||||
|
||||
public String getItemPoints() {
|
||||
return itemPoints;
|
||||
}
|
||||
|
||||
public void setItemPoints(String itemPoints) {
|
||||
this.itemPoints = itemPoints;
|
||||
}
|
||||
|
||||
public String getDirectPoints() {
|
||||
return directPoints;
|
||||
}
|
||||
|
||||
public void setDirectPoints(String directPoints) {
|
||||
this.directPoints = directPoints;
|
||||
}
|
||||
|
||||
public String getIndirectPoints() {
|
||||
return indirectPoints;
|
||||
}
|
||||
|
||||
public void setIndirectPoints(String indirectPoints) {
|
||||
this.indirectPoints = indirectPoints;
|
||||
}
|
||||
|
||||
public String getStockCount() {
|
||||
return stockCount;
|
||||
}
|
||||
|
||||
public void setStockCount(String stockCount) {
|
||||
this.stockCount = stockCount;
|
||||
}
|
||||
|
||||
public String getGoodsFreight() {
|
||||
return goodsFreight;
|
||||
}
|
||||
|
||||
public void setGoodsFreight(String goodsFreight) {
|
||||
this.goodsFreight = goodsFreight;
|
||||
}
|
||||
|
||||
public String getEnable() {
|
||||
return enable;
|
||||
}
|
||||
|
||||
public void setEnable(String enable) {
|
||||
this.enable = enable;
|
||||
}
|
||||
|
||||
public String getAddtime() {
|
||||
return addtime;
|
||||
}
|
||||
|
||||
public void setAddtime(String addtime) {
|
||||
this.addtime = addtime;
|
||||
}
|
||||
|
||||
public String getExterd1() {
|
||||
return exterd1;
|
||||
}
|
||||
|
||||
public void setExterd1(String exterd1) {
|
||||
this.exterd1 = exterd1;
|
||||
}
|
||||
|
||||
public String getExterd2() {
|
||||
return exterd2;
|
||||
}
|
||||
|
||||
public void setExterd2(String exterd2) {
|
||||
this.exterd2 = exterd2;
|
||||
}
|
||||
|
||||
public String getExterd3() {
|
||||
return exterd3;
|
||||
}
|
||||
|
||||
public void setExterd3(String exterd3) {
|
||||
this.exterd3 = exterd3;
|
||||
}
|
||||
|
||||
public String getGoodsLevelName() {
|
||||
return goodsLevelName;
|
||||
}
|
||||
|
||||
public void setGoodsLevelName(String goodsLevelName) {
|
||||
this.goodsLevelName = goodsLevelName;
|
||||
}
|
||||
|
||||
public String getGoodsLevelText() {
|
||||
return goodsLevelText;
|
||||
}
|
||||
|
||||
public void setGoodsLevelText(String goodsLevelText) {
|
||||
this.goodsLevelText = goodsLevelText;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
package com.ruoyi.business.sync;
|
||||
|
||||
import com.alibaba.excel.context.AnalysisContext;
|
||||
import com.alibaba.excel.event.AnalysisEventListener;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.ruoyi.business.domain.BizProduct;
|
||||
import com.ruoyi.business.domain.BizProductImage;
|
||||
import com.ruoyi.business.domain.BizProductType;
|
||||
import com.ruoyi.business.mapper.BizProductMapper;
|
||||
import com.ruoyi.business.mapper.BizProductTypeMapper;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class GoodsDataListener extends AnalysisEventListener<GoodsData> {
|
||||
|
||||
private BizProductMapper productMapper;
|
||||
|
||||
private BizProductTypeMapper productTypeMapper;
|
||||
|
||||
public GoodsDataListener(BizProductMapper productMapper, BizProductTypeMapper productTypeMapper) {
|
||||
this.productMapper = productMapper;
|
||||
this.productTypeMapper = productTypeMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invoke(GoodsData goodsData, AnalysisContext analysisContext) {
|
||||
BizProduct product = new BizProduct();
|
||||
product.setId(Long.valueOf(goodsData.getId()));
|
||||
product.setAmount(new BigDecimal(goodsData.getUnitPrice()));
|
||||
product.setProductName(goodsData.getGoodsName());
|
||||
product.setProductCode(goodsData.getGoodsId());
|
||||
product.setRemark(goodsData.getGoodsDescribe());
|
||||
product.setSort(1);
|
||||
product.setOnlineStatus("Y".equals(goodsData.getEnable()) ? 1 : 0);
|
||||
product.setOnlineTime(DateUtils.parseDate(goodsData.getAddtime()));
|
||||
product.setCreateBy("admin");
|
||||
product.setCreateTime(DateUtils.parseDate(goodsData.getAddtime()));
|
||||
product.setProductClass("Y".equals(goodsData.getIsProduct()) ? 1 : 0);
|
||||
|
||||
BizProductType productType = productTypeMapper.selectBizProductTypeByCode(goodsData.getGoodsType());
|
||||
if (!Objects.isNull(productType)) {
|
||||
product.setProductTypeId(productType.getId());
|
||||
productMapper.insertBizProduct(product);
|
||||
}
|
||||
|
||||
List<BizProductImage> images = Lists.newArrayList();
|
||||
if (StringUtils.isNotEmpty(goodsData.getExterd1())) {
|
||||
BizProductImage mainImage = new BizProductImage();
|
||||
mainImage.setProductId(product.getId());
|
||||
mainImage.setImageUrl(goodsData.getExterd1());
|
||||
mainImage.setImageType(0);
|
||||
images.add(mainImage);
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(goodsData.getExterd2())) {
|
||||
String[] detailImages = goodsData.getExterd2().split(",");
|
||||
for (String image : detailImages) {
|
||||
BizProductImage detailImage = new BizProductImage();
|
||||
detailImage.setProductId(product.getId());
|
||||
detailImage.setImageUrl(image);
|
||||
detailImage.setImageType(1);
|
||||
images.add(detailImage);
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(goodsData.getExterd3())) {
|
||||
String[] runImages = goodsData.getExterd3().split(",");
|
||||
for (String image : runImages) {
|
||||
BizProductImage runImage = new BizProductImage();
|
||||
runImage.setProductId(product.getId());
|
||||
runImage.setImageUrl(image);
|
||||
runImage.setImageType(2);
|
||||
images.add(runImage);
|
||||
}
|
||||
}
|
||||
|
||||
if (!CollectionUtils.isEmpty(images)) {
|
||||
productMapper.batchBizProductImage(images);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,158 @@
|
|||
package com.ruoyi.business.sync;
|
||||
|
||||
public class OrderData {
|
||||
|
||||
private String id;
|
||||
private String orderNumber;
|
||||
private String userId;
|
||||
private String goodsId;
|
||||
private String addressId;
|
||||
private String goodsUnitPrice;
|
||||
private String buyGoodsNums;
|
||||
private String payCount;
|
||||
private String orderStatus;
|
||||
private String usePorintsType;
|
||||
private String payMethod;
|
||||
private String goodsFreight;
|
||||
private String orderRemark;
|
||||
private String addtime;
|
||||
private String detailsAddress;
|
||||
private String addId;
|
||||
private String userTelephone;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getOrderNumber() {
|
||||
return orderNumber;
|
||||
}
|
||||
|
||||
public void setOrderNumber(String orderNumber) {
|
||||
this.orderNumber = orderNumber;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getGoodsId() {
|
||||
return goodsId;
|
||||
}
|
||||
|
||||
public void setGoodsId(String goodsId) {
|
||||
this.goodsId = goodsId;
|
||||
}
|
||||
|
||||
public String getAddressId() {
|
||||
return addressId;
|
||||
}
|
||||
|
||||
public void setAddressId(String addressId) {
|
||||
this.addressId = addressId;
|
||||
}
|
||||
|
||||
public String getGoodsUnitPrice() {
|
||||
return goodsUnitPrice;
|
||||
}
|
||||
|
||||
public void setGoodsUnitPrice(String goodsUnitPrice) {
|
||||
this.goodsUnitPrice = goodsUnitPrice;
|
||||
}
|
||||
|
||||
public String getBuyGoodsNums() {
|
||||
return buyGoodsNums;
|
||||
}
|
||||
|
||||
public void setBuyGoodsNums(String buyGoodsNums) {
|
||||
this.buyGoodsNums = buyGoodsNums;
|
||||
}
|
||||
|
||||
public String getPayCount() {
|
||||
return payCount;
|
||||
}
|
||||
|
||||
public void setPayCount(String payCount) {
|
||||
this.payCount = payCount;
|
||||
}
|
||||
|
||||
public String getOrderStatus() {
|
||||
return orderStatus;
|
||||
}
|
||||
|
||||
public void setOrderStatus(String orderStatus) {
|
||||
this.orderStatus = orderStatus;
|
||||
}
|
||||
|
||||
public String getUsePorintsType() {
|
||||
return usePorintsType;
|
||||
}
|
||||
|
||||
public void setUsePorintsType(String usePorintsType) {
|
||||
this.usePorintsType = usePorintsType;
|
||||
}
|
||||
|
||||
public String getPayMethod() {
|
||||
return payMethod;
|
||||
}
|
||||
|
||||
public void setPayMethod(String payMethod) {
|
||||
this.payMethod = payMethod;
|
||||
}
|
||||
|
||||
public String getGoodsFreight() {
|
||||
return goodsFreight;
|
||||
}
|
||||
|
||||
public void setGoodsFreight(String goodsFreight) {
|
||||
this.goodsFreight = goodsFreight;
|
||||
}
|
||||
|
||||
public String getOrderRemark() {
|
||||
return orderRemark;
|
||||
}
|
||||
|
||||
public void setOrderRemark(String orderRemark) {
|
||||
this.orderRemark = orderRemark;
|
||||
}
|
||||
|
||||
public String getAddtime() {
|
||||
return addtime;
|
||||
}
|
||||
|
||||
public void setAddtime(String addtime) {
|
||||
this.addtime = addtime;
|
||||
}
|
||||
|
||||
public String getDetailsAddress() {
|
||||
return detailsAddress;
|
||||
}
|
||||
|
||||
public void setDetailsAddress(String detailsAddress) {
|
||||
this.detailsAddress = detailsAddress;
|
||||
}
|
||||
|
||||
public String getAddId() {
|
||||
return addId;
|
||||
}
|
||||
|
||||
public void setAddId(String addId) {
|
||||
this.addId = addId;
|
||||
}
|
||||
|
||||
public String getUserTelephone() {
|
||||
return userTelephone;
|
||||
}
|
||||
|
||||
public void setUserTelephone(String userTelephone) {
|
||||
this.userTelephone = userTelephone;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
package com.ruoyi.business.sync;
|
||||
|
||||
import com.alibaba.excel.context.AnalysisContext;
|
||||
import com.alibaba.excel.event.AnalysisEventListener;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.ruoyi.business.domain.*;
|
||||
import com.ruoyi.business.mapper.BizMemberMapper;
|
||||
import com.ruoyi.business.mapper.BizOrderMapper;
|
||||
import com.ruoyi.business.mapper.BizProductMapper;
|
||||
import com.ruoyi.business.mapper.BizProductTypeMapper;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class OrderDataListener extends AnalysisEventListener<OrderData> {
|
||||
|
||||
private BizOrderMapper orderMapper;
|
||||
|
||||
private BizMemberMapper memberMapper;
|
||||
|
||||
private BizProductMapper productMapper;
|
||||
|
||||
public OrderDataListener(BizOrderMapper orderMapper, BizMemberMapper memberMapper, BizProductMapper productMapper) {
|
||||
this.orderMapper = orderMapper;
|
||||
this.memberMapper = memberMapper;
|
||||
this.productMapper = productMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invoke(OrderData orderData, AnalysisContext analysisContext) {
|
||||
BizOrder order = new BizOrder();
|
||||
order.setId(Long.valueOf(orderData.getId()));
|
||||
order.setOrderSn(orderData.getOrderNumber());
|
||||
order.setMobile(orderData.getUserTelephone());
|
||||
order.setOrderAmount(new BigDecimal(orderData.getPayCount()));
|
||||
|
||||
int status;
|
||||
if ("2".equals(orderData.getOrderStatus())) {
|
||||
status = 3;
|
||||
} else if ("3".equals(orderData.getOrderStatus())) {
|
||||
status = 4;
|
||||
} else {
|
||||
status = Integer.parseInt(orderData.getOrderStatus());
|
||||
}
|
||||
order.setOrderStatus(status);
|
||||
order.setCreateBy("admin");
|
||||
order.setCreateTime(DateUtils.parseDate(orderData.getAddtime()));
|
||||
order.setAddressId(StringUtils.isBlank(orderData.getAddId()) ? 0L : Long.parseLong(orderData.getAddId()));
|
||||
order.setAddressDetail(orderData.getDetailsAddress());
|
||||
order.setRemark(orderData.getOrderRemark());
|
||||
|
||||
BizMember member = memberMapper.selectBizMemberByMobile(order.getMobile());
|
||||
if (Objects.isNull(member)) {
|
||||
order.setMemberId(0L);
|
||||
order.setMemberName("");
|
||||
} else {
|
||||
order.setMemberId(member.getId());
|
||||
order.setMemberName(member.getMemberName());
|
||||
}
|
||||
orderMapper.insertBizOrder(order);
|
||||
|
||||
BizOrderDetail orderDetail = new BizOrderDetail();
|
||||
orderDetail.setOrderId(order.getId());
|
||||
orderDetail.setOrderSn(order.getOrderSn());
|
||||
orderDetail.setProductAmount(new BigDecimal(orderData.getGoodsUnitPrice()));
|
||||
orderDetail.setProductCode(orderData.getGoodsId());
|
||||
orderDetail.setProductCount(Integer.parseInt(orderData.getBuyGoodsNums()));
|
||||
orderDetail.setCreateBy("admin");
|
||||
orderDetail.setCreateTime(order.getCreateTime());
|
||||
|
||||
BizProduct product = productMapper.selectBizProductByCode(orderData.getGoodsId());
|
||||
if (Objects.isNull(product)) {
|
||||
orderDetail.setProductId(0L);
|
||||
} else {
|
||||
orderDetail.setProductId(product.getId());
|
||||
}
|
||||
|
||||
orderMapper.insertBizOrderDetail(orderDetail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,122 @@
|
|||
package com.ruoyi.business.sync;
|
||||
|
||||
public class UserAddressData {
|
||||
|
||||
private String id;
|
||||
private String addressId;
|
||||
private String userId;
|
||||
private String receiveUser;
|
||||
private String receiveTelephone;
|
||||
private String receiveAreaCode;
|
||||
private String receiveAreaName;
|
||||
private String receiveCityName;
|
||||
private String receiveCityCode;
|
||||
private String receiveProvinceName;
|
||||
private String receiveProvinceCode;
|
||||
private String detailsAddress;
|
||||
private String isDefalut;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getAddressId() {
|
||||
return addressId;
|
||||
}
|
||||
|
||||
public void setAddressId(String addressId) {
|
||||
this.addressId = addressId;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getReceiveUser() {
|
||||
return receiveUser;
|
||||
}
|
||||
|
||||
public void setReceiveUser(String receiveUser) {
|
||||
this.receiveUser = receiveUser;
|
||||
}
|
||||
|
||||
public String getReceiveTelephone() {
|
||||
return receiveTelephone;
|
||||
}
|
||||
|
||||
public void setReceiveTelephone(String receiveTelephone) {
|
||||
this.receiveTelephone = receiveTelephone;
|
||||
}
|
||||
|
||||
public String getReceiveAreaCode() {
|
||||
return receiveAreaCode;
|
||||
}
|
||||
|
||||
public void setReceiveAreaCode(String receiveAreaCode) {
|
||||
this.receiveAreaCode = receiveAreaCode;
|
||||
}
|
||||
|
||||
public String getReceiveAreaName() {
|
||||
return receiveAreaName;
|
||||
}
|
||||
|
||||
public void setReceiveAreaName(String receiveAreaName) {
|
||||
this.receiveAreaName = receiveAreaName;
|
||||
}
|
||||
|
||||
public String getReceiveCityName() {
|
||||
return receiveCityName;
|
||||
}
|
||||
|
||||
public void setReceiveCityName(String receiveCityName) {
|
||||
this.receiveCityName = receiveCityName;
|
||||
}
|
||||
|
||||
public String getReceiveCityCode() {
|
||||
return receiveCityCode;
|
||||
}
|
||||
|
||||
public void setReceiveCityCode(String receiveCityCode) {
|
||||
this.receiveCityCode = receiveCityCode;
|
||||
}
|
||||
|
||||
public String getReceiveProvinceName() {
|
||||
return receiveProvinceName;
|
||||
}
|
||||
|
||||
public void setReceiveProvinceName(String receiveProvinceName) {
|
||||
this.receiveProvinceName = receiveProvinceName;
|
||||
}
|
||||
|
||||
public String getReceiveProvinceCode() {
|
||||
return receiveProvinceCode;
|
||||
}
|
||||
|
||||
public void setReceiveProvinceCode(String receiveProvinceCode) {
|
||||
this.receiveProvinceCode = receiveProvinceCode;
|
||||
}
|
||||
|
||||
public String getDetailsAddress() {
|
||||
return detailsAddress;
|
||||
}
|
||||
|
||||
public void setDetailsAddress(String detailsAddress) {
|
||||
this.detailsAddress = detailsAddress;
|
||||
}
|
||||
|
||||
public String getIsDefalut() {
|
||||
return isDefalut;
|
||||
}
|
||||
|
||||
public void setIsDefalut(String isDefalut) {
|
||||
this.isDefalut = isDefalut;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package com.ruoyi.business.sync;
|
||||
|
||||
import com.alibaba.excel.context.AnalysisContext;
|
||||
import com.alibaba.excel.event.AnalysisEventListener;
|
||||
import com.ruoyi.business.domain.BizMember;
|
||||
import com.ruoyi.business.domain.BizMemberAddress;
|
||||
import com.ruoyi.business.mapper.BizMemberAddressMapper;
|
||||
import com.ruoyi.business.mapper.BizMemberMapper;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class UserAddressDataListener extends AnalysisEventListener<UserAddressData> {
|
||||
|
||||
private BizMemberAddressMapper memberAddressMapper;
|
||||
|
||||
private BizMemberMapper memberMapper;
|
||||
|
||||
public UserAddressDataListener(BizMemberAddressMapper memberAddressMapper, BizMemberMapper memberMapper) {
|
||||
this.memberAddressMapper = memberAddressMapper;
|
||||
this.memberMapper = memberMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invoke(UserAddressData userAddressData, AnalysisContext analysisContext) {
|
||||
BizMemberAddress memberAddress = new BizMemberAddress();
|
||||
memberAddress.setId(Long.valueOf(userAddressData.getId()));
|
||||
memberAddress.setAddress(userAddressData.getDetailsAddress());
|
||||
memberAddress.setProvinceCode(userAddressData.getReceiveProvinceCode());
|
||||
memberAddress.setProvinceName(userAddressData.getReceiveProvinceName());
|
||||
memberAddress.setCityCode(userAddressData.getReceiveCityCode());
|
||||
memberAddress.setCityName(userAddressData.getReceiveCityName());
|
||||
memberAddress.setAreaCode(userAddressData.getReceiveAreaCode());
|
||||
memberAddress.setAreaName(userAddressData.getReceiveAreaName());
|
||||
memberAddress.setIsDefault("Y".equals(userAddressData.getIsDefalut()) ? 1 : 0);
|
||||
memberAddress.setIsDelete(0);
|
||||
memberAddress.setMobile(userAddressData.getReceiveTelephone());
|
||||
memberAddress.setMemberName(userAddressData.getReceiveUser());
|
||||
memberAddress.setCreateBy("admin");
|
||||
memberAddress.setCreateTime(DateUtils.getNowDate());
|
||||
|
||||
BizMember member = memberMapper.selectBizMemberByMobile(userAddressData.getReceiveTelephone());
|
||||
if (!Objects.isNull(member)) {
|
||||
memberAddress.setMemberID(member.getId());
|
||||
} else {
|
||||
memberAddress.setMemberID(0L);
|
||||
}
|
||||
memberAddressMapper.insertBizMemberAddress(memberAddress);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,185 @@
|
|||
package com.ruoyi.business.sync;
|
||||
|
||||
public class UserData {
|
||||
|
||||
private String id;
|
||||
private String userId;
|
||||
private String name;
|
||||
private String userTelephone;
|
||||
private String referrer;
|
||||
private String referrerTelephone;
|
||||
private String password;
|
||||
private String userType;
|
||||
private String tourismPorints;
|
||||
private String isAdmin;
|
||||
private String enable;
|
||||
private String isHold;
|
||||
private String addtim;
|
||||
private String exterd1;
|
||||
private String exterd2;
|
||||
private String exterd3;
|
||||
private String pecialItemPorints;
|
||||
private String porintsSurplus;
|
||||
private String treamPorints;
|
||||
private String fieldsPorint;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getUserTelephone() {
|
||||
return userTelephone;
|
||||
}
|
||||
|
||||
public void setUserTelephone(String userTelephone) {
|
||||
this.userTelephone = userTelephone;
|
||||
}
|
||||
|
||||
public String getReferrer() {
|
||||
return referrer;
|
||||
}
|
||||
|
||||
public void setReferrer(String referrer) {
|
||||
this.referrer = referrer;
|
||||
}
|
||||
|
||||
public String getReferrerTelephone() {
|
||||
return referrerTelephone;
|
||||
}
|
||||
|
||||
public void setReferrerTelephone(String referrerTelephone) {
|
||||
this.referrerTelephone = referrerTelephone;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getUserType() {
|
||||
return userType;
|
||||
}
|
||||
|
||||
public void setUserType(String userType) {
|
||||
this.userType = userType;
|
||||
}
|
||||
|
||||
public String getTourismPorints() {
|
||||
return tourismPorints;
|
||||
}
|
||||
|
||||
public void setTourismPorints(String tourismPorints) {
|
||||
this.tourismPorints = tourismPorints;
|
||||
}
|
||||
|
||||
public String getIsAdmin() {
|
||||
return isAdmin;
|
||||
}
|
||||
|
||||
public void setIsAdmin(String isAdmin) {
|
||||
this.isAdmin = isAdmin;
|
||||
}
|
||||
|
||||
public String getEnable() {
|
||||
return enable;
|
||||
}
|
||||
|
||||
public void setEnable(String enable) {
|
||||
this.enable = enable;
|
||||
}
|
||||
|
||||
public String getIsHold() {
|
||||
return isHold;
|
||||
}
|
||||
|
||||
public void setIsHold(String isHold) {
|
||||
this.isHold = isHold;
|
||||
}
|
||||
|
||||
public String getAddtim() {
|
||||
return addtim;
|
||||
}
|
||||
|
||||
public void setAddtim(String addtim) {
|
||||
this.addtim = addtim;
|
||||
}
|
||||
|
||||
public String getExterd1() {
|
||||
return exterd1;
|
||||
}
|
||||
|
||||
public void setExterd1(String exterd1) {
|
||||
this.exterd1 = exterd1;
|
||||
}
|
||||
|
||||
public String getExterd2() {
|
||||
return exterd2;
|
||||
}
|
||||
|
||||
public void setExterd2(String exterd2) {
|
||||
this.exterd2 = exterd2;
|
||||
}
|
||||
|
||||
public String getExterd3() {
|
||||
return exterd3;
|
||||
}
|
||||
|
||||
public void setExterd3(String exterd3) {
|
||||
this.exterd3 = exterd3;
|
||||
}
|
||||
|
||||
public String getPecialItemPorints() {
|
||||
return pecialItemPorints;
|
||||
}
|
||||
|
||||
public void setPecialItemPorints(String pecialItemPorints) {
|
||||
this.pecialItemPorints = pecialItemPorints;
|
||||
}
|
||||
|
||||
public String getPorintsSurplus() {
|
||||
return porintsSurplus;
|
||||
}
|
||||
|
||||
public void setPorintsSurplus(String porintsSurplus) {
|
||||
this.porintsSurplus = porintsSurplus;
|
||||
}
|
||||
|
||||
public String getTreamPorints() {
|
||||
return treamPorints;
|
||||
}
|
||||
|
||||
public void setTreamPorints(String treamPorints) {
|
||||
this.treamPorints = treamPorints;
|
||||
}
|
||||
|
||||
public String getFieldsPorint() {
|
||||
return fieldsPorint;
|
||||
}
|
||||
|
||||
public void setFieldsPorint(String fieldsPorint) {
|
||||
this.fieldsPorint = fieldsPorint;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
package com.ruoyi.business.sync;
|
||||
|
||||
import com.alibaba.excel.context.AnalysisContext;
|
||||
import com.alibaba.excel.event.AnalysisEventListener;
|
||||
import com.ruoyi.business.domain.BizAccount;
|
||||
import com.ruoyi.business.domain.BizMember;
|
||||
import com.ruoyi.business.mapper.BizAccountMapper;
|
||||
import com.ruoyi.business.mapper.BizMemberMapper;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class UserDataListener extends AnalysisEventListener<UserData> {
|
||||
|
||||
private BizMemberMapper memberMapper;
|
||||
|
||||
private BizAccountMapper accountMapper;
|
||||
|
||||
public UserDataListener(BizMemberMapper memberMapper, BizAccountMapper accountMapper) {
|
||||
this.memberMapper = memberMapper;
|
||||
this.accountMapper = accountMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invoke(UserData userData, AnalysisContext analysisContext) {
|
||||
BizMember member = new BizMember();
|
||||
member.setMemberName(userData.getName());
|
||||
member.setPassword(userData.getPassword());
|
||||
member.setIsDelete(0);
|
||||
member.setIsEnable("Y".equals(userData.getEnable()) ? 1 : 0);
|
||||
member.setCreateTime(DateUtils.parseDate(userData.getAddtim()));
|
||||
member.setUpdateTime(DateUtils.parseDate(userData.getAddtim()));
|
||||
member.setMobile(userData.getUserTelephone());
|
||||
member.setRecommendMobile(userData.getReferrerTelephone());
|
||||
member.setRecommendName(userData.getReferrer());
|
||||
member.setId(Long.valueOf(userData.getId()));
|
||||
memberMapper.insertBizMember(member);
|
||||
|
||||
// 创建专项福豆账户
|
||||
BizAccount account = new BizAccount();
|
||||
account.setMemberId(member.getId());
|
||||
account.setAccountType(3);
|
||||
account.setAmount(new BigDecimal(userData.getTourismPorints()));
|
||||
account.setCreateBy("admin");
|
||||
account.setCreateTime(member.getCreateTime());
|
||||
account.setUpdateTime(member.getUpdateTime());
|
||||
accountMapper.insertBizAccount(account);
|
||||
|
||||
// 创建福豆余额账户
|
||||
BizAccount account1 = new BizAccount();
|
||||
account1.setMemberId(member.getId());
|
||||
account1.setAccountType(0);
|
||||
account1.setAmount(new BigDecimal(userData.getPorintsSurplus()));
|
||||
account1.setCreateBy("admin");
|
||||
account1.setCreateTime(member.getCreateTime());
|
||||
account1.setUpdateTime(member.getUpdateTime());
|
||||
accountMapper.insertBizAccount(account1);
|
||||
|
||||
// 创建个人(可用)福豆账户
|
||||
BizAccount account2 = new BizAccount();
|
||||
account2.setMemberId(member.getId());
|
||||
account2.setAccountType(1);
|
||||
account2.setAmount(new BigDecimal(userData.getPecialItemPorints()));
|
||||
account2.setCreateBy("admin");
|
||||
account2.setCreateTime(member.getCreateTime());
|
||||
account2.setUpdateTime(member.getUpdateTime());
|
||||
accountMapper.insertBizAccount(account2);
|
||||
|
||||
// 创建团队福豆账户
|
||||
BizAccount account3 = new BizAccount();
|
||||
account3.setMemberId(member.getId());
|
||||
account3.setAccountType(2);
|
||||
account3.setAmount(new BigDecimal(userData.getTreamPorints()));
|
||||
account3.setCreateBy("admin");
|
||||
account3.setCreateTime(member.getCreateTime());
|
||||
account3.setUpdateTime(member.getUpdateTime());
|
||||
accountMapper.insertBizAccount(account3);
|
||||
|
||||
// 创建福豆田账户
|
||||
BizAccount account4 = new BizAccount();
|
||||
account4.setMemberId(member.getId());
|
||||
account4.setAccountType(4);
|
||||
account4.setAmount(new BigDecimal(userData.getFieldsPorint()));
|
||||
account4.setCreateBy("admin");
|
||||
account4.setCreateTime(member.getCreateTime());
|
||||
account4.setUpdateTime(member.getUpdateTime());
|
||||
accountMapper.insertBizAccount(account4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,144 @@
|
|||
package com.ruoyi.business.task;
|
||||
|
||||
import com.ruoyi.business.domain.BizAccountDetail;
|
||||
import com.ruoyi.business.mapper.BizAccountMapper;
|
||||
import com.ruoyi.business.service.IBizAccountService;
|
||||
import com.ruoyi.business.service.IBizMemberService;
|
||||
import com.ruoyi.framework.util.LogUtils;
|
||||
import com.ruoyi.system.domain.SysDictData;
|
||||
import com.ruoyi.system.utils.DictUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 定时任务调度
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Component("businessTask")
|
||||
public class BusinessTask {
|
||||
|
||||
@Autowired
|
||||
private IBizMemberService bizMemberService;
|
||||
|
||||
@Autowired
|
||||
private IBizAccountService bizAccountService;
|
||||
|
||||
/**
|
||||
执行每日定时任务
|
||||
*/
|
||||
public void doTask()
|
||||
{
|
||||
//每日清空福豆田
|
||||
doClearField();
|
||||
//判断节假日
|
||||
if (isInHoliday()) {
|
||||
LogUtils.getAccessLog().info("======今日休息,不执行福豆相关任务======");
|
||||
return;
|
||||
}
|
||||
LogUtils.getAccessLog().info("======今日非休息日,开始执行福豆相关任务======");
|
||||
|
||||
//专项划拨任务
|
||||
//doSpecialTask();
|
||||
|
||||
//团队福豆分成任务
|
||||
doTeamTask();
|
||||
|
||||
LogUtils.getAccessLog().info("======今日所有任务执行完成======");
|
||||
}
|
||||
|
||||
//福豆田清零任务
|
||||
private void doClearField()
|
||||
{
|
||||
try {
|
||||
bizAccountService.clearAllDouField();
|
||||
LogUtils.getAccessLog().info("======执行福豆田清零任务完成======");
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
LogUtils.getAccessLog().error("======执行福豆田清零任务出错======" + ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
//专项划拨任务
|
||||
private void doSpecialTask()
|
||||
{
|
||||
try {
|
||||
int accessCount = bizMemberService.doSpecialTask();
|
||||
|
||||
LogUtils.getAccessLog().info("======执行专项划拨任务完成,处理会员数据" + accessCount + "条======");
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
LogUtils.getAccessLog().error("======执行专项划拨任务出错======" + ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
//团队福豆分成任务
|
||||
private void doTeamTask()
|
||||
{
|
||||
try {
|
||||
int accessCount = bizMemberService.doTeamTask();
|
||||
|
||||
LogUtils.getAccessLog().info("======执行团队福豆分成任务完成,处理会员数据" + accessCount + "条======");
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
LogUtils.getAccessLog().error("======执行团队福豆分成任务出错======" + ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
//是否节假日(不结算)
|
||||
public static boolean isInHoliday(int ... monthDayWeek)
|
||||
{
|
||||
Calendar now = Calendar.getInstance();
|
||||
int month, day, weekday;
|
||||
if (monthDayWeek.length > 0) {
|
||||
month = monthDayWeek[0];
|
||||
} else {
|
||||
month = now.get(Calendar.MONTH) + 1;
|
||||
}
|
||||
if (monthDayWeek.length > 1) {
|
||||
day = monthDayWeek[1];
|
||||
} else {
|
||||
day = now.get(Calendar.DAY_OF_MONTH);
|
||||
}
|
||||
if (monthDayWeek.length > 2) {
|
||||
weekday = monthDayWeek[2];
|
||||
} else {
|
||||
weekday = now.get(Calendar.DAY_OF_WEEK);
|
||||
}
|
||||
//字典配置
|
||||
List<SysDictData> holidays = DictUtils.getDictCache("busi_holidays");
|
||||
List<SysDictData> workdays = DictUtils.getDictCache("busi_workdays");
|
||||
//节假日
|
||||
if (holidays != null && isInDictDays(holidays, month, day)) return true;
|
||||
//工作日
|
||||
if (workdays != null && isInDictDays(workdays, month, day)) return false;
|
||||
//普通的周六周日
|
||||
return weekday == Calendar.SUNDAY || weekday == Calendar.SATURDAY;
|
||||
}
|
||||
|
||||
//是否在设定范围内
|
||||
public static boolean isInDictDays(List<SysDictData> days, int month, int day) {
|
||||
for (SysDictData data : days) {
|
||||
String label = data.getDictLabel();
|
||||
String[] split = label.split("-");
|
||||
String begin = split[0];
|
||||
String end = split.length > 1 ? split[1] : begin;
|
||||
String[] beginStr = begin.split("[.]");
|
||||
int beginMonth = Integer.parseInt(beginStr[0]);
|
||||
int beginDay = Integer.parseInt(beginStr[1]);
|
||||
String[] endStr = end.split("[.]");
|
||||
int endMonth = Integer.parseInt(endStr[0]);
|
||||
int endDay = Integer.parseInt(endStr[1]);
|
||||
if (month >= beginMonth && month <= endMonth && day >= beginDay && day <= endDay) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
package com.ruoyi.business.utils;
|
||||
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.security.Md5Utils;
|
||||
import com.ruoyi.system.utils.DictUtils;
|
||||
|
||||
import javax.crypto.*;
|
||||
import javax.crypto.spec.DESKeySpec;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
/* DES加密工具 */
|
||||
public class Encrypt {
|
||||
//秘钥
|
||||
private static final String KEY = "ZF_desencrypt_2020";
|
||||
|
||||
//加密解密工具
|
||||
private static Cipher enCipher = null;
|
||||
private static Cipher deCipher = null;
|
||||
|
||||
//初始化加密工具
|
||||
static {
|
||||
try {
|
||||
int keyLen = 8;
|
||||
String key8 = Md5Utils.hash(KEY).substring(0, keyLen).toUpperCase();
|
||||
//C# MD5 ResultString Fix
|
||||
StringBuffer keys = new StringBuffer();
|
||||
for (int i = 0; i < keyLen; i += 2) {
|
||||
keys.append(key8.substring(i, i + 2)).append("-");
|
||||
}
|
||||
byte[] KeyStr = keys.substring(0, keyLen).getBytes("utf-8");
|
||||
DESKeySpec keySpec = new DESKeySpec(KeyStr);// 设置密钥参数
|
||||
IvParameterSpec iv = new IvParameterSpec(KeyStr);// 设置向量
|
||||
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");// 获得密钥工厂
|
||||
SecretKey key = keyFactory.generateSecret(keySpec);
|
||||
enCipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
|
||||
enCipher.init(Cipher.ENCRYPT_MODE, key, iv);// 设置工作模式为加密模式,给出密钥和向量
|
||||
deCipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
|
||||
deCipher.init(Cipher.DECRYPT_MODE, key, iv);// 设置工作模式为加密模式,给出密钥和向量
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
//加密
|
||||
public static String encrypt(String text)
|
||||
{
|
||||
if (StringUtils.isEmpty(text)) return null;
|
||||
|
||||
byte[] pasByte = null;
|
||||
try {
|
||||
pasByte = enCipher.doFinal(text.getBytes("utf-8"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
return new String(byte2hex(pasByte));
|
||||
}
|
||||
|
||||
//解密
|
||||
public static String decrypt(String crypt)
|
||||
{
|
||||
if (StringUtils.isEmpty(crypt)) return null;
|
||||
byte[] pasByte = null;
|
||||
try {
|
||||
pasByte = deCipher.doFinal(hex2byte(crypt.getBytes("utf-8")));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
return new String(pasByte);
|
||||
}
|
||||
|
||||
public static void main(String args[]) {
|
||||
//System.out.println(encrypt("x123456"));
|
||||
System.out.println(decrypt("83A0D00DA5194E0E88CDC5FCADED588F"));
|
||||
|
||||
//System.out.println(DictUtils.getDictLabel("busi_recommend_award", "1"));
|
||||
}
|
||||
|
||||
private static final String HEX_CHAR = "0123456789ABCDEF";
|
||||
private static final byte[] HEX_STRING_BYTE = HEX_CHAR.getBytes();
|
||||
|
||||
//10进制转16进制
|
||||
private static byte[] byte2hex(byte[] b) {
|
||||
int length = b.length;
|
||||
byte[] b2 = new byte[length << 1];
|
||||
int pos;
|
||||
for(int i=0; i<length; i++) {
|
||||
pos = 2*i;
|
||||
b2[pos] = HEX_STRING_BYTE[(b[i] & 0xf0) >> 4];
|
||||
b2[pos+1] = HEX_STRING_BYTE[b[i] & 0x0f];
|
||||
}
|
||||
return b2;
|
||||
}
|
||||
|
||||
//16进制转10进制
|
||||
public static byte[] hex2byte(byte[] b) {
|
||||
if(b.length%2 != 0) {
|
||||
throw new IllegalArgumentException("byte array length is not even!");
|
||||
}
|
||||
|
||||
int length = b.length >> 1;
|
||||
byte[] b2 = new byte[length];
|
||||
int pos;
|
||||
for(int i=0; i<length; i++) {
|
||||
pos = i << 1;
|
||||
b2[i] = (byte) (HEX_CHAR.indexOf( b[pos] ) << 4 | HEX_CHAR.indexOf( b[pos+1] ) );
|
||||
}
|
||||
return b2;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,154 @@
|
|||
<?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.ruoyi.business.mapper.BizAccountMapper">
|
||||
|
||||
<resultMap type="BizAccount" id="BizAccountResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="memberId" column="member_id" />
|
||||
<result property="accountType" column="account_type" />
|
||||
<result property="amount" column="amount" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="BizAccountDetail" id="BizAccountDetailResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="memberId" column="member_id" />
|
||||
<result property="accountId" column="account_id" />
|
||||
<result property="accountType" column="account_type" />
|
||||
<result property="businessNo" column="business_no" />
|
||||
<result property="changeType" column="change_type" />
|
||||
<result property="typeDetail" column="type_detail" />
|
||||
<result property="amount" column="amount" />
|
||||
<result property="beforeAmount" column="before_amount" />
|
||||
<result property="afterAmount" column="after_amount" />
|
||||
<result property="changeDesc" column="change_desc" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBizAccountVo">
|
||||
select id, member_id, account_type, amount, create_by, create_time, update_by, update_time from biz_account
|
||||
</sql>
|
||||
|
||||
<select id="selectBizAccountList" parameterType="BizAccount" resultMap="BizAccountResult">
|
||||
<include refid="selectBizAccountVo"/>
|
||||
<where>
|
||||
<if test="memberId != null "> and member_id = #{memberId}</if>
|
||||
<if test="accountType != null "> and account_type = #{accountType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBizAccountById" parameterType="Long" resultMap="BizAccountResult">
|
||||
<include refid="selectBizAccountVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBizAccount" parameterType="BizAccount" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into biz_account
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="memberId != null">member_id,</if>
|
||||
<if test="accountType != null">account_type,</if>
|
||||
<if test="amount != null">amount,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="memberId != null">#{memberId},</if>
|
||||
<if test="accountType != null">#{accountType},</if>
|
||||
<if test="amount != null">#{amount},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBizAccount" parameterType="BizAccount">
|
||||
update biz_account
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="memberId != null">member_id = #{memberId},</if>
|
||||
<if test="accountType != null">account_type = #{accountType},</if>
|
||||
<if test="amount != null">amount = #{amount},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBizAccountById" parameterType="Long">
|
||||
delete from biz_account where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBizAccountByIds" parameterType="String">
|
||||
delete from biz_account where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectBizAccountDetailList" parameterType="BizAccountDetail" resultMap="BizAccountDetailResult">
|
||||
select id, member_id, account_id, account_type, business_no, change_type, type_detail, amount, before_amount, after_amount, change_desc, create_by, create_time, update_by, update_time from biz_account_detail
|
||||
<where>
|
||||
<if test="memberId != null "> and member_id = #{memberId}</if>
|
||||
<if test="accountId != null "> and account_id = #{accountId}</if>
|
||||
<if test="accountType != null "> and account_type = #{accountType}</if>
|
||||
<if test="typeDetail != null "> and type_detail = #{typeDetail}</if>
|
||||
</where>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<insert id="insertBizAccountDetail" parameterType="BizAccountDetail" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into biz_account_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="memberId != null">member_id,</if>
|
||||
<if test="accountId != null">account_id,</if>
|
||||
<if test="accountType != null">account_type,</if>
|
||||
<if test="businessNo != null and businessNo != ''">business_no,</if>
|
||||
<if test="changeType != null">change_type,</if>
|
||||
<if test="typeDetail != null">type_detail,</if>
|
||||
<if test="amount != null">amount,</if>
|
||||
<if test="beforeAmount != null">before_amount,</if>
|
||||
<if test="afterAmount != null">after_amount,</if>
|
||||
<if test="changeDesc != null">change_desc,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="memberId != null">#{memberId},</if>
|
||||
<if test="accountId != null">#{accountId},</if>
|
||||
<if test="accountType != null">#{accountType},</if>
|
||||
<if test="businessNo != null and businessNo != ''">#{businessNo},</if>
|
||||
<if test="changeType != null">#{changeType},</if>
|
||||
<if test="typeDetail != null">#{typeDetail},</if>
|
||||
<if test="amount != null">#{amount},</if>
|
||||
<if test="beforeAmount != null">#{beforeAmount},</if>
|
||||
<if test="afterAmount != null">#{afterAmount},</if>
|
||||
<if test="changeDesc != null">#{changeDesc},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="clearAllDouField">
|
||||
insert into biz_account_detail(member_id,account_id,account_type,change_type,type_detail,amount,before_amount,after_amount,create_time)
|
||||
select member_id,id,account_type,-1,4,-amount,amount,0,now()
|
||||
from biz_account
|
||||
where account_type = 4 and amount > 0;
|
||||
update biz_account set amount = 0 where account_type = 4 and amount > 0;
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
<?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.ruoyi.business.mapper.BizCashInfoMapper">
|
||||
|
||||
<resultMap type="BizCashInfo" id="BizCashInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="memberId" column="member_id" />
|
||||
<result property="accountId" column="account_id" />
|
||||
<result property="accountType" column="account_type" />
|
||||
<result property="bankId" column="bank_id" />
|
||||
<result property="bankUser" column="bank_user" />
|
||||
<result property="bankCity" column="bank_city" />
|
||||
<result property="bankCard" column="bank_card" />
|
||||
<result property="drawMoney" column="draw_money" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBizCashInfoVo">
|
||||
select a.id, a.member_id, (concat(b.member_name, b.mobile)) memberName, account_id, account_type, bank_id, bank_user, bank_city, bank_card, draw_money, status, a.create_by, a.create_time, a.update_by, a.update_time from biz_cash_info a
|
||||
left join biz_member b on a.member_id = b.id
|
||||
</sql>
|
||||
|
||||
<select id="selectBizCashInfoList" parameterType="BizCashInfo" resultMap="BizCashInfoResult">
|
||||
<include refid="selectBizCashInfoVo"/>
|
||||
<where>
|
||||
<if test="memberId != null "> and member_id = #{memberId}</if>
|
||||
<if test="memberName != null and memberName != ''"> and (b.member_name like concat('%', #{memberName}, '%') or b.mobile like concat('%', #{memberName}, '%'))</if>
|
||||
<if test="accountId != null "> and account_id = #{accountId}</if>
|
||||
<if test="accountType != null "> and account_type = #{accountType}</if>
|
||||
<if test="bankId != null "> and bank_id = #{bankId}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
</where>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<select id="selectBizCashInfoById" parameterType="Long" resultMap="BizCashInfoResult">
|
||||
<include refid="selectBizCashInfoVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBizCashInfo" parameterType="BizCashInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into biz_cash_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="memberId != null">member_id,</if>
|
||||
<if test="accountId != null">account_id,</if>
|
||||
<if test="accountType != null">account_type,</if>
|
||||
<if test="bankId != null">bank_id,</if>
|
||||
<if test="bankUser != null and bankUser != ''">bank_user,</if>
|
||||
<if test="bankCity != null and bankCity != ''">bank_city,</if>
|
||||
<if test="bankCard != null and bankCard != ''">bank_card,</if>
|
||||
<if test="drawMoney != null">draw_money,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="memberId != null">#{memberId},</if>
|
||||
<if test="accountId != null">#{accountId},</if>
|
||||
<if test="accountType != null">#{accountType},</if>
|
||||
<if test="bankId != null">#{bankId},</if>
|
||||
<if test="bankUser != null and bankUser != ''">#{bankUser},</if>
|
||||
<if test="bankCity != null and bankCity != ''">#{bankCity},</if>
|
||||
<if test="bankCard != null and bankCard != ''">#{bankCard},</if>
|
||||
<if test="drawMoney != null">#{drawMoney},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBizCashInfo" parameterType="BizCashInfo">
|
||||
update biz_cash_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="memberId != null">member_id = #{memberId},</if>
|
||||
<if test="accountId != null">account_id = #{accountId},</if>
|
||||
<if test="accountType != null">account_type = #{accountType},</if>
|
||||
<if test="bankId != null">bank_id = #{bankId},</if>
|
||||
<if test="bankUser != null and bankUser != ''">bank_user = #{bankUser},</if>
|
||||
<if test="bankCity != null and bankCity != ''">bank_city = #{bankCity},</if>
|
||||
<if test="bankCard != null and bankCard != ''">bank_card = #{bankCard},</if>
|
||||
<if test="drawMoney != null">draw_money = #{drawMoney},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBizCashInfoById" parameterType="Long">
|
||||
delete from biz_cash_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBizCashInfoByIds" parameterType="String">
|
||||
delete from biz_cash_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
<?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.ruoyi.business.mapper.BizMemberAddressMapper">
|
||||
|
||||
<resultMap type="BizMemberAddress" id="BizMemberAddressResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="mobile" column="mobile" />
|
||||
<result property="memberID" column="member_id" />
|
||||
<result property="memberName" column="member_name" />
|
||||
<result property="address" column="address" />
|
||||
<result property="provinceCode" column="province_code" />
|
||||
<result property="provinceName" column="province_name" />
|
||||
<result property="cityCode" column="city_code" />
|
||||
<result property="cityName" column="city_name" />
|
||||
<result property="areaCode" column="area_code" />
|
||||
<result property="areaName" column="area_name" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBizMemberAddressVo">
|
||||
select id, mobile, member_id, member_name, address, province_code, province_name, city_code, city_name, area_code, area_name, is_delete, create_by, create_time, update_by, update_time from biz_member_address
|
||||
</sql>
|
||||
|
||||
<select id="selectBizMemberAddressList" parameterType="Long" resultMap="BizMemberAddressResult">
|
||||
<include refid="selectBizMemberAddressVo"/>
|
||||
<where>
|
||||
<if test="memberID != null"> and member_id = #{memberID}</if>
|
||||
</where>
|
||||
order by id
|
||||
</select>
|
||||
|
||||
<select id="selectBizMemberAddressById" parameterType="Long" resultMap="BizMemberAddressResult">
|
||||
<include refid="selectBizMemberAddressVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectDefaultAddressByMemberId" parameterType="Long" resultMap="BizMemberAddressResult">
|
||||
<include refid="selectBizMemberAddressVo"/>
|
||||
where member_id = #{memberID}
|
||||
order by is_delete desc, id limit 1
|
||||
</select>
|
||||
|
||||
<update id="cancelDefaultAddress" parameterType="Long">
|
||||
update biz_member_address
|
||||
set is_delete = 0 where member_id = #{memberID}
|
||||
</update>
|
||||
|
||||
<insert id="insertBizMemberAddress" parameterType="BizMemberAddress" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into biz_member_address
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="mobile != null and mobile != ''">mobile,</if>
|
||||
<if test="memberID != null">member_id,</if>
|
||||
<if test="memberName != null and memberName != ''">member_name,</if>
|
||||
<if test="address != null and address != ''">address,</if>
|
||||
<if test="provinceCode != null and provinceCode != ''">province_code,</if>
|
||||
<if test="provinceName != null and provinceName != ''">province_name,</if>
|
||||
<if test="cityCode != null and cityCode != ''">city_code,</if>
|
||||
<if test="cityName != null and cityName != ''">city_name,</if>
|
||||
<if test="areaCode != null and areaCode != ''">area_code,</if>
|
||||
<if test="areaName != null and areaName != ''">area_name,</if>
|
||||
<if test="isDelete != null">is_delete,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="mobile != null and mobile != ''">#{mobile},</if>
|
||||
<if test="memberID != null">#{memberID},</if>
|
||||
<if test="memberName != null and memberName != ''">#{memberName},</if>
|
||||
<if test="address != null and address != ''">#{address},</if>
|
||||
<if test="provinceCode != null and provinceCode != ''">#{provinceCode},</if>
|
||||
<if test="provinceName != null and provinceName != ''">#{provinceName},</if>
|
||||
<if test="cityCode != null and cityCode != ''">#{cityCode},</if>
|
||||
<if test="cityName != null and cityName != ''">#{cityName},</if>
|
||||
<if test="areaCode != null and areaCode != ''">#{areaCode},</if>
|
||||
<if test="areaName != null and areaName != ''">#{areaName},</if>
|
||||
<if test="isDelete != null">#{isDelete},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBizMemberAddress" parameterType="BizMemberAddress">
|
||||
update biz_member_address
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="mobile != null and mobile != ''">mobile = #{mobile},</if>
|
||||
<if test="memberName != null and memberName != ''">member_name = #{memberName},</if>
|
||||
<if test="address != null and address != ''">address = #{address},</if>
|
||||
<if test="provinceCode != null and provinceCode != ''">province_code = #{provinceCode},</if>
|
||||
<if test="provinceName != null and provinceName != ''">province_name = #{provinceName},</if>
|
||||
<if test="cityCode != null and cityCode != ''">city_code = #{cityCode},</if>
|
||||
<if test="cityName != null and cityName != ''">city_name = #{cityName},</if>
|
||||
<if test="areaCode != null and areaCode != ''">area_code = #{areaCode},</if>
|
||||
<if test="areaName != null and areaName != ''">area_name = #{areaName},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBizMemberAddressById" parameterType="Long">
|
||||
delete from biz_member_address where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBizMemberAddressByIds" parameterType="String">
|
||||
delete from biz_member_address where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,200 @@
|
|||
<?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.ruoyi.business.mapper.BizMemberMapper">
|
||||
|
||||
<resultMap type="BizMember" id="BizMemberResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="mobile" column="mobile" />
|
||||
<result property="memberName" column="member_name" />
|
||||
<result property="password" column="password" />
|
||||
<result property="recommendId" column="recommend_id" />
|
||||
<result property="recommendMobile" column="recommend_mobile" />
|
||||
<result property="recommendName" column="recommend_name" />
|
||||
<result property="memberType" column="member_type" />
|
||||
<result property="specialLevel" column="special_level" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
<result property="isEnable" column="is_enable" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBizMemberVo">
|
||||
select a.id, mobile, member_name, password, recommend_id, recommend_mobile, recommend_name, member_type, special_level, is_delete, is_enable, create_by, create_time, update_by, update_time,
|
||||
(select amount from biz_account where member_id = a.id and account_type = 0) douBalance,
|
||||
(select amount from biz_account where member_id = a.id and account_type = 1) douPerson,
|
||||
(select amount from biz_account where member_id = a.id and account_type = 2) douTeam,
|
||||
(select amount from biz_account where member_id = a.id and account_type = 3) douSpecial,
|
||||
(select amount from biz_account where member_id = a.id and account_type = 4) douField
|
||||
from biz_member a
|
||||
</sql>
|
||||
|
||||
<sql id="selectBizMemberAllVo">
|
||||
select id, mobile, member_name, password, recommend_id, recommend_mobile, recommend_name, member_type, is_delete, is_enable, create_by, create_time, update_by, update_time
|
||||
from biz_member a
|
||||
</sql>
|
||||
|
||||
<select id="selectBizMemberList" parameterType="BizMember" resultMap="BizMemberResult">
|
||||
<include refid="selectBizMemberVo"/>
|
||||
<where>
|
||||
<if test="memberName != null and memberName != ''"> and (a.member_name like concat('%', #{memberName}, '%') or a.mobile like concat('%', #{memberName}, '%'))</if>
|
||||
and a.is_delete = 0
|
||||
</where>
|
||||
order by a.id desc
|
||||
</select>
|
||||
|
||||
<select id="selectBizMemberAll" resultMap="BizMemberResult">
|
||||
<include refid="selectBizMemberAllVo"/>
|
||||
</select>
|
||||
|
||||
<select id="selectBizMemberById" parameterType="Long" resultMap="BizMemberResult">
|
||||
<include refid="selectBizMemberVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectBizMemberDou" parameterType="java.util.Map" resultType="java.lang.Long">
|
||||
select amount from biz_account where member_id = #{memberID} and account_type = #{type}
|
||||
</select>
|
||||
|
||||
<select id="selectBizMemberSimple" parameterType="Long" resultMap="BizMemberResult">
|
||||
select id, mobile, member_name, password, recommend_id, recommend_mobile, recommend_name, member_type, special_level, is_delete, is_enable, create_by, create_time, update_by, update_time
|
||||
from biz_member where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectBizMemberByMobile" resultMap="BizMemberResult">
|
||||
select id, mobile, member_name, password, recommend_id, recommend_mobile, recommend_name, member_type, is_delete, is_enable, create_by, create_time, update_by, update_time
|
||||
from biz_member where mobile = #{mobile}
|
||||
</select>
|
||||
|
||||
<insert id="insertBizMember" parameterType="BizMember" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into biz_member
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="mobile != null and mobile != ''">mobile,</if>
|
||||
<if test="memberName != null and memberName != ''">member_name,</if>
|
||||
<if test="password != null and password != ''">password,</if>
|
||||
<if test="recommendId != null">recommend_id,</if>
|
||||
<if test="recommendAllId != null and recommendAllId != ''">recommend_all_id,</if>
|
||||
<if test="recommendMobile != null and recommendMobile != ''">recommend_mobile,</if>
|
||||
<if test="recommendName != null and recommendName != ''">recommend_name,</if>
|
||||
<if test="memberType != null">member_type,</if>
|
||||
<if test="isDelete != null">is_delete,</if>
|
||||
<if test="isEnable != null">is_enable,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="mobile != null and mobile != ''">#{mobile},</if>
|
||||
<if test="memberName != null and memberName != ''">#{memberName},</if>
|
||||
<if test="password != null and password != ''">#{password},</if>
|
||||
<if test="recommendId != null">#{recommendId},</if>
|
||||
<if test="recommendAllId != null and recommendAllId != ''">#{recommendAllId},</if>
|
||||
<if test="recommendMobile != null and recommendMobile != ''">#{recommendMobile},</if>
|
||||
<if test="recommendName != null and recommendName != ''">#{recommendName},</if>
|
||||
<if test="memberType != null">#{memberType},</if>
|
||||
<if test="isDelete != null">#{isDelete},</if>
|
||||
<if test="isEnable != null">#{isEnable},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBizMember" parameterType="BizMember">
|
||||
update biz_member
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="mobile != null and mobile != ''">mobile = #{mobile},</if>
|
||||
<if test="memberName != null and memberName != ''">member_name = #{memberName},</if>
|
||||
<if test="password != null and password != ''">password = #{password},</if>
|
||||
<if test="recommendId != null">recommend_id = #{recommendId},</if>
|
||||
<if test="recommendAllId != null and recommendAllId != ''">recommend_all_id = #{recommendAllId},</if>
|
||||
<if test="recommendMobile != null and recommendMobile != ''">recommend_mobile = #{recommendMobile},</if>
|
||||
<if test="recommendName != null and recommendName != ''">recommend_name = #{recommendName},</if>
|
||||
<if test="memberType != null">member_type = #{memberType},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
<if test="isEnable != null">is_enable = #{isEnable},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBizMemberById" parameterType="Long">
|
||||
delete from biz_member where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBizMemberByIds" parameterType="String">
|
||||
update biz_member set is_delete = 1 where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getValidChildCount" parameterType="Long" resultType="java.lang.Integer">
|
||||
select count(id) from biz_member a where recommend_id = #{memberID}
|
||||
and exists(select id from biz_order b where b.member_id = a.id and is_team = 1)
|
||||
</select>
|
||||
|
||||
<select id="selectTeamData" parameterType="Map" resultType="java.util.Map">
|
||||
select a.id,a.mobile,a.member_name,a.recommend_id, sum(IF(c.product_count IS NULL,0,c.product_count)) as num from biz_member a
|
||||
left join biz_order b on a.id = b.member_id and b.order_status > 0 and b.is_team = 1
|
||||
left join biz_order_detail c on c.order_id = b.id
|
||||
<if test="productId != null">and c.product_id = #{productId}</if>
|
||||
where concat(',', recommend_all_id, ',') like concat('%,', #{memberID}, ',%')
|
||||
group by a.id,a.member_name,a.recommend_id
|
||||
</select>
|
||||
|
||||
<select id="selectSpecialMember" parameterType="Integer" resultMap="BizMemberResult">
|
||||
select a.id, special_level, b.amount douSpecial from biz_member a
|
||||
left join biz_account b on a.id = b.member_id and b.account_type = 3
|
||||
where is_delete = 0 and b.amount >= #{minValue}
|
||||
</select>
|
||||
|
||||
<select id="getMemberTeamCount" parameterType="Long" resultType="Long">
|
||||
select IF(sum(num) IS NULL,0,sum(num)) totalNum from (
|
||||
select a.id, sum(IF(c.product_count IS NULL,0,c.product_count)) as num from biz_member a
|
||||
left join biz_order b on a.id = b.member_id and b.order_status > 0 and b.is_team = 1
|
||||
left join biz_order_detail c on c.order_id = b.id
|
||||
where concat(',', recommend_all_id, ',') like concat('%,', #{memberID}, ',%')
|
||||
group by a.id
|
||||
) t
|
||||
</select>
|
||||
|
||||
<update id="updateMemberLevel" parameterType="BizMember">
|
||||
update biz_member
|
||||
set special_level = #{specialLevel}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="selectTeamBenefitMember" parameterType="Integer" resultType="Map">
|
||||
select id, totalNum from (
|
||||
select t1.id, IF(sum(num) IS NULL,0,sum(num)) totalNum from (
|
||||
select distinct(m1.id) from biz_member m1
|
||||
inner join biz_order o1 on m1.id = o1.member_id and o1.order_status > 0 and o1.is_team = 1
|
||||
where m1.is_delete = 0 and (select count(id) from biz_member m2 where m2.recommend_id=m1.id) >= 3
|
||||
) t1
|
||||
inner join
|
||||
(
|
||||
select a.id, a.recommend_all_id, sum(IF(c.product_count IS NULL,0,c.product_count)) as num from biz_member a
|
||||
left join biz_order b on a.id = b.member_id and b.order_status > 0 and b.is_team = 1
|
||||
left join biz_order_detail c on c.order_id = b.id
|
||||
where a.is_delete = 0
|
||||
group by a.id
|
||||
) t2 on concat(',', t2.recommend_all_id, ',') like concat('%', t1.id, '%') and t2.num > 0
|
||||
group by t1.id
|
||||
) t3
|
||||
where totalNum > #{minValue}
|
||||
order by id
|
||||
</select>
|
||||
|
||||
<select id="selectSubMember" parameterType="Long" resultType="Long">
|
||||
select id from biz_member where recommend_id = #{memberID}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,166 @@
|
|||
<?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.ruoyi.business.mapper.BizOrderMapper">
|
||||
|
||||
<resultMap type="BizOrder" id="BizOrderResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="orderSn" column="order_sn" />
|
||||
<result property="memberId" column="member_id" />
|
||||
<result property="mobile" column="mobile" />
|
||||
<result property="memberName" column="member_name" />
|
||||
<result property="orderAmount" column="order_amount" />
|
||||
<result property="orderStatus" column="order_status" />
|
||||
<result property="isTeam" column="is_team" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="addressDetail" column="address_detail" />
|
||||
<result property="addressId" column="address_id" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="BizOrderDetail" id="BizOrderDetailResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="orderSn" column="order_sn" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="productCode" column="product_code" />
|
||||
<result property="productCount" column="product_count" />
|
||||
<result property="productAmount" column="product_amount" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBizOrderVo">
|
||||
select a.id, order_sn, a.member_id, a.mobile, a.member_name, order_amount, order_status, remark, address_detail, address_id, a.create_by, a.create_time, a.update_by, a.update_time,
|
||||
b.mobile addressMobile, b.member_name addressName, b.province_name addressProvince, b.city_name addressCity, b.area_name addressArea,
|
||||
c.productName, c.productCount, c.productAmount
|
||||
from biz_order a
|
||||
left join biz_member_address b on a.member_id = b.member_id
|
||||
left join (select max(id), order_id, product_code productName, product_count productCount, product_amount productAmount from biz_order_detail group by order_id) c
|
||||
on a.id = c.order_id
|
||||
</sql>
|
||||
|
||||
<select id="selectBizOrderList" parameterType="BizOrder" resultMap="BizOrderResult">
|
||||
<include refid="selectBizOrderVo"/>
|
||||
<where>
|
||||
<if test="memberName != null and memberName != ''"> and (a.member_name like concat('%', #{memberName}, '%') or a.mobile like concat('%', #{memberName}, '%'))</if>
|
||||
<if test="memberId != null"> and a.member_id = #{memberId}</if>
|
||||
<if test="orderStatus != null and orderStatus != -1"> and a.order_status = #{orderStatus}</if>
|
||||
</where>
|
||||
order by a.id desc
|
||||
</select>
|
||||
|
||||
<select id="selectBizOrderById" parameterType="Long" resultMap="BizOrderResult">
|
||||
<include refid="selectBizOrderVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBizOrder" parameterType="BizOrder" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into biz_order
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="orderSn != null and orderSn != ''">order_sn,</if>
|
||||
<if test="memberId != null">member_id,</if>
|
||||
<if test="mobile != null and mobile != ''">mobile,</if>
|
||||
<if test="memberName != null and memberName != ''">member_name,</if>
|
||||
<if test="orderAmount != null">order_amount,</if>
|
||||
<if test="orderStatus != null">order_status,</if>
|
||||
<if test="isTeam != null">is_team,</if>
|
||||
<if test="addressDetail != null">address_detail,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="addressId != null">address_id,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="orderSn != null and orderSn != ''">#{orderSn},</if>
|
||||
<if test="memberId != null">#{memberId},</if>
|
||||
<if test="mobile != null and mobile != ''">#{mobile},</if>
|
||||
<if test="memberName != null and memberName != ''">#{memberName},</if>
|
||||
<if test="orderAmount != null">#{orderAmount},</if>
|
||||
<if test="orderStatus != null">#{orderStatus},</if>
|
||||
<if test="isTeam != null">#{isTeam},</if>
|
||||
<if test="addressDetail != null">#{addressDetail},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="addressId != null">#{addressId},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBizOrder" parameterType="BizOrder">
|
||||
update biz_order
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="orderSn != null and orderSn != ''">order_sn = #{orderSn},</if>
|
||||
<if test="memberId != null">member_id = #{memberId},</if>
|
||||
<if test="mobile != null and mobile != ''">mobile = #{mobile},</if>
|
||||
<if test="memberName != null and memberName != ''">member_name = #{memberName},</if>
|
||||
<if test="orderAmount != null">order_amount = #{orderAmount},</if>
|
||||
<if test="orderStatus != null">order_status = #{orderStatus},</if>
|
||||
<if test="addressDetail != null">address_detail = #{addressDetail},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="addressId != null">address_id = #{addressId},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBizOrderById" parameterType="Long">
|
||||
delete from biz_order where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBizOrderByIds" parameterType="String">
|
||||
delete from biz_order where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="insertBizOrderDetail" parameterType="BizOrderDetail" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into biz_order_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="orderId != null">order_id,</if>
|
||||
<if test="orderSn != null and orderSn != ''">order_sn,</if>
|
||||
<if test="productId != null">product_id,</if>
|
||||
<if test="productCode != null and productCode != ''">product_code,</if>
|
||||
<if test="productCount != null">product_count,</if>
|
||||
<if test="productAmount != null">product_amount,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="orderId != null">#{orderId},</if>
|
||||
<if test="orderSn != null and orderSn != ''">#{orderSn},</if>
|
||||
<if test="productId != null">#{productId},</if>
|
||||
<if test="productCode != null and productCode != ''">#{productCode},</if>
|
||||
<if test="productCount != null">#{productCount},</if>
|
||||
<if test="productAmount != null">#{productAmount},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<select id="selectTeamBizOrder" parameterType="Long" resultType="Map">
|
||||
select b.id, b.recommend_all_id all_id, c.product_count from biz_order a
|
||||
left join biz_member b on a.member_id = b.id
|
||||
left join (select max(id), order_id, product_id, product_count from biz_order_detail group by order_id) c on a.id = c.order_id
|
||||
where a.order_status > 0 and a.is_team = 1 and concat(',', b.recommend_all_id, ',') like concat('%', #{memberID}, '%')
|
||||
order by a.id asc
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,157 @@
|
|||
<?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.ruoyi.business.mapper.BizProductMapper">
|
||||
|
||||
<resultMap type="BizProduct" id="BizProductResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="productCode" column="product_code" />
|
||||
<result property="productName" column="product_name" />
|
||||
<result property="productTypeId" column="product_type_id" />
|
||||
<result property="productClass" column="product_class" />
|
||||
<result property="amount" column="amount" />
|
||||
<result property="cashbackAmount" column="cashback_amount" />
|
||||
<result property="sort" column="sort" />
|
||||
<result property="onlineStatus" column="online_status" />
|
||||
<result property="onlineTime" column="online_time" />
|
||||
<result property="offlineTime" column="offline_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="BizProductImage" id="BizProductImageResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="imageType" column="image_type" />
|
||||
<result property="imageUrl" column="image_url" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBizProductVo">
|
||||
select id, product_code, product_name, product_type_id, product_class, amount, cashback_amount, sort, online_status, online_time, offline_time, remark, create_by, create_time, update_by, update_time from biz_product
|
||||
</sql>
|
||||
|
||||
<select id="selectBizProductList" parameterType="BizProduct" resultMap="BizProductResult">
|
||||
<include refid="selectBizProductVo"/>
|
||||
<where>
|
||||
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
|
||||
<if test="productTypeId != null "> and product_type_id = #{productTypeId}</if>
|
||||
<if test="productClass != null "> and product_class = #{productClass}</if>
|
||||
</where>
|
||||
order by sort desc, id desc
|
||||
</select>
|
||||
|
||||
<select id="selectTeamProductList" resultMap="BizProductResult">
|
||||
select id, product_name from biz_product where cashback_amount > 0 and online_status = 1 order by sort desc, id desc
|
||||
</select>
|
||||
|
||||
<select id="selectBizProductById" parameterType="Long" resultMap="BizProductResult">
|
||||
<include refid="selectBizProductVo"/>
|
||||
where id = #{productId}
|
||||
</select>
|
||||
|
||||
<select id="selectBizProductByCode" parameterType="Long" resultMap="BizProductResult">
|
||||
<include refid="selectBizProductVo"/>
|
||||
where product_code = #{productCode} limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectBizProductImageList" parameterType="Long" resultMap="BizProductImageResult">
|
||||
select id, product_id, image_type, image_url
|
||||
from biz_product_image
|
||||
where product_id = #{productId}
|
||||
order by id
|
||||
</select>
|
||||
|
||||
<insert id="insertBizProduct" parameterType="BizProduct" useGeneratedKeys="true" keyProperty="productId">
|
||||
insert into biz_product
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="productCode != null and productCode != ''">product_code,</if>
|
||||
<if test="productName != null and productName != ''">product_name,</if>
|
||||
<if test="productTypeId != null">product_type_id,</if>
|
||||
<if test="productClass != null">product_class,</if>
|
||||
<if test="amount != null">amount,</if>
|
||||
<if test="cashbackAmount != null">cashback_amount,</if>
|
||||
<if test="sort != null">sort,</if>
|
||||
<if test="onlineStatus != null">online_status,</if>
|
||||
<if test="onlineTime != null">online_time,</if>
|
||||
<if test="offlineTime != null">offline_time,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="productCode != null and productCode != ''">#{productCode},</if>
|
||||
<if test="productName != null and productName != ''">#{productName},</if>
|
||||
<if test="productTypeId != null">#{productTypeId},</if>
|
||||
<if test="productClass != null">#{productClass},</if>
|
||||
<if test="amount != null">#{amount},</if>
|
||||
<if test="cashbackAmount != null">#{cashbackAmount},</if>
|
||||
<if test="sort != null">#{sort},</if>
|
||||
<if test="onlineStatus != null">#{onlineStatus},</if>
|
||||
<if test="onlineTime != null">#{onlineTime},</if>
|
||||
<if test="offlineTime != null">#{offlineTime},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBizProduct" parameterType="BizProduct">
|
||||
update biz_product
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="productCode != null and productCode != ''">product_code = #{productCode},</if>
|
||||
<if test="productName != null and productName != ''">product_name = #{productName},</if>
|
||||
<if test="productTypeId != null">product_type_id = #{productTypeId},</if>
|
||||
<if test="productClass != null">product_class = #{productClass},</if>
|
||||
<if test="amount != null">amount = #{amount},</if>
|
||||
<if test="cashbackAmount != null">cashback_amount = #{cashbackAmount},</if>
|
||||
<if test="sort != null">sort = #{sort},</if>
|
||||
<if test="onlineStatus != null">online_status = #{onlineStatus},</if>
|
||||
<if test="onlineTime != null">online_time = #{onlineTime},</if>
|
||||
<if test="offlineTime != null">offline_time = #{offlineTime},</if>
|
||||
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{productId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBizProductById" parameterType="Long">
|
||||
delete from biz_product where id = #{productId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBizProductByIds" parameterType="String">
|
||||
delete from biz_product where id in
|
||||
<foreach item="productId" collection="array" open="(" separator="," close=")">
|
||||
#{productId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBizProductImageByProductIds" parameterType="String">
|
||||
delete from biz_product_image where product_id in
|
||||
<foreach item="productId" collection="array" open="(" separator="," close=")">
|
||||
#{productId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBizProductImageByProductId" parameterType="Long">
|
||||
delete from biz_product_image where product_id = #{productId}
|
||||
</delete>
|
||||
|
||||
<insert id="batchBizProductImage">
|
||||
insert into biz_product_image( product_id, image_type, image_url ) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.productId}, #{item.imageType}, #{item.imageUrl} )
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
<?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.ruoyi.business.mapper.BizProductTypeMapper">
|
||||
|
||||
<resultMap type="BizProductType" id="BizProductTypeResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="productTypeCode" column="product_type_code" />
|
||||
<result property="productTypeName" column="product_type_name" />
|
||||
<result property="imageUrl" column="image_url" />
|
||||
<result property="sort" column="sort" />
|
||||
<result property="isEnable" column="is_enable" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBizProductTypeVo">
|
||||
select id, product_type_code, product_type_name, image_url, sort, is_enable, create_by, create_time, update_by, update_time from biz_product_type
|
||||
</sql>
|
||||
|
||||
<select id="selectBizProductTypeList" parameterType="BizProductType" resultMap="BizProductTypeResult">
|
||||
<include refid="selectBizProductTypeVo"/>
|
||||
<where>
|
||||
<if test="productTypeName != null and productTypeName != ''"> and product_type_name like concat('%', #{productTypeName}, '%')</if>
|
||||
<if test="isEnable != null "> and is_enable = #{isEnable}</if>
|
||||
</where>
|
||||
order by sort desc, id desc
|
||||
</select>
|
||||
|
||||
<select id="selectBizProductTypeById" parameterType="Long" resultMap="BizProductTypeResult">
|
||||
<include refid="selectBizProductTypeVo"/>
|
||||
where id = #{productTypeId}
|
||||
</select>
|
||||
|
||||
<select id="selectBizProductTypeByCode" parameterType="String" resultMap="BizProductTypeResult">
|
||||
<include refid="selectBizProductTypeVo"/>
|
||||
where product_type_code = #{productTypeCode} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertBizProductType" parameterType="BizProductType" useGeneratedKeys="true" keyProperty="productTypeId">
|
||||
insert into biz_product_type
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="productTypeCode != null">product_type_code,</if>
|
||||
<if test="productTypeName != null and productTypeName != ''">product_type_name,</if>
|
||||
<if test="imageUrl != null and imageUrl != ''">image_url,</if>
|
||||
<if test="sort != null">sort,</if>
|
||||
<if test="isEnable != null">is_enable,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="productTypeCode != null">#{productTypeCode},</if>
|
||||
<if test="productTypeName != null and productTypeName != ''">#{productTypeName},</if>
|
||||
<if test="imageUrl != null and imageUrl != ''">#{imageUrl},</if>
|
||||
<if test="sort != null">#{sort},</if>
|
||||
<if test="isEnable != null">#{isEnable},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBizProductType" parameterType="BizProductType">
|
||||
update biz_product_type
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="productTypeCode != null">product_type_code = #{productTypeCode},</if>
|
||||
<if test="productTypeName != null and productTypeName != ''">product_type_name = #{productTypeName},</if>
|
||||
<if test="imageUrl != null and imageUrl != ''">image_url = #{imageUrl},</if>
|
||||
<if test="sort != null">sort = #{sort},</if>
|
||||
<if test="isEnable != null">is_enable = #{isEnable},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{productTypeId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBizProductTypeById" parameterType="Long">
|
||||
delete from biz_product_type where id = #{productTypeId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBizProductTypeByIds" parameterType="String">
|
||||
delete from biz_product_type where id in
|
||||
<foreach item="productTypeId" collection="array" open="(" separator="," close=")">
|
||||
#{productTypeId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
<?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.ruoyi.business.mapper.BizTeamRewardMapper">
|
||||
|
||||
<resultMap type="BizTeamReward" id="BizTeamRewardResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="memberId" column="member_id" />
|
||||
<result property="rewardMemberId" column="reward_member_id" />
|
||||
<result property="rewardProductCount" column="reward_product_count" />
|
||||
<result property="rewardAmount" column="reward_amount" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="rewardType" column="reward_type" />
|
||||
<result property="rewardDate" column="reward_date" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBizTeamRewardVo">
|
||||
select a.id, a.member_id, reward_member_id, (concat(b.member_name, b.mobile)) rewardMemberName, reward_product_count, reward_amount, product_id, reward_type, reward_date, a.create_by, a.create_time, a.update_by, a.update_time from biz_team_reward a
|
||||
left join biz_member b on a.reward_member_id = b.id
|
||||
</sql>
|
||||
|
||||
<select id="selectBizTeamRewardList" parameterType="BizTeamReward" resultMap="BizTeamRewardResult">
|
||||
<include refid="selectBizTeamRewardVo"/>
|
||||
<where>
|
||||
<if test="memberId != null "> and member_id = #{memberId}</if>
|
||||
<if test="productId != null "> and product_id = #{productId}</if>
|
||||
<if test="rewardType != null "> and reward_type = #{rewardType}</if>
|
||||
<if test="rewardDate != null and rewardDate != ''"> and reward_date = #{rewardDate}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBizTeamRewardById" parameterType="Long" resultMap="BizTeamRewardResult">
|
||||
<include refid="selectBizTeamRewardVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBizTeamReward" parameterType="BizTeamReward" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into biz_team_reward
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="memberId != null">member_id,</if>
|
||||
<if test="rewardMemberId != null">reward_member_id,</if>
|
||||
<if test="rewardProductCount != null">reward_product_count,</if>
|
||||
<if test="rewardAmount != null">reward_amount,</if>
|
||||
<if test="productId != null">product_id,</if>
|
||||
<if test="rewardType != null">reward_type,</if>
|
||||
<if test="rewardDate != null and rewardDate != ''">reward_date,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="memberId != null">#{memberId},</if>
|
||||
<if test="rewardMemberId != null">#{rewardMemberId},</if>
|
||||
<if test="rewardProductCount != null">#{rewardProductCount},</if>
|
||||
<if test="rewardAmount != null">#{rewardAmount},</if>
|
||||
<if test="productId != null">#{productId},</if>
|
||||
<if test="rewardType != null">#{rewardType},</if>
|
||||
<if test="rewardDate != null and rewardDate != ''">#{rewardDate},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBizTeamReward" parameterType="BizTeamReward">
|
||||
update biz_team_reward
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="memberId != null">member_id = #{memberId},</if>
|
||||
<if test="rewardMemberId != null">reward_member_id = #{rewardMemberId},</if>
|
||||
<if test="rewardProductCount != null">reward_product_count = #{rewardProductCount},</if>
|
||||
<if test="rewardAmount != null">reward_amount = #{rewardAmount},</if>
|
||||
<if test="productId != null">product_id = #{productId},</if>
|
||||
<if test="rewardType != null">reward_type = #{rewardType},</if>
|
||||
<if test="rewardDate != null and rewardDate != ''">reward_date = #{rewardDate},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBizTeamRewardById" parameterType="Long">
|
||||
delete from biz_team_reward where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBizTeamRewardByIds" parameterType="String">
|
||||
delete from biz_team_reward where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,162 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('兑现申请记录列表')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
<label>会员姓名:</label>
|
||||
<input type="text" name="memberName" placeholder="会员姓名或手机号"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>开户银行:</label>
|
||||
<select name="bankId">
|
||||
<option value="">所有</option>
|
||||
<option class="bankOption" th:each="dict:${@dict.getType('busi_cashdraw_bank')}" th:value="*{dict.dictValue}" th:text="*{dict.dictLabel}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!--
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="business:cash:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="business:cash:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="business:cash:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="business:cash:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>-->
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<style>
|
||||
.fixed-table-toolbar{height: 0;overflow: hidden}
|
||||
</style>
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('business:cash:edit')}]];
|
||||
var prefix = ctx + "business/cash";
|
||||
|
||||
//取银行数据
|
||||
var bankDict = {};
|
||||
$(".bankOption").each(function(){bankDict[$(this).val()] = $(this).text()});
|
||||
var accountTypes = ["福豆余额", "个人福豆", "团队福豆", "专项福豆", "福豆田"];
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "兑现申请记录",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'id',
|
||||
title: '兑现申请ID',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'memberName',
|
||||
title: '申请会员'
|
||||
},
|
||||
{
|
||||
field: 'accountType',
|
||||
title: '提现类型',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
return accountTypes[value];
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'drawMoney',
|
||||
title: '提现金额',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
field: 'bankId',
|
||||
title: '开户银行',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
return bankDict[value];
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'bankUser',
|
||||
title: '开户人姓名'
|
||||
},
|
||||
{
|
||||
field: 'bankCity',
|
||||
title: '开户地'
|
||||
},
|
||||
{
|
||||
field: 'bankCard',
|
||||
title: '卡号'
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: '申请状态',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
switch (value){
|
||||
case 0: return "<span style='color:#5c5c5c'>待处理</span>";
|
||||
case 1: return "<span style='color:#db8301'>已处理</span>";
|
||||
case 2: return "<span style='color:#ad3636'>已驳回</span>";
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '申请时间',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
if(row.status == 0){
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="agreeRequest(\'' + row.id + '\')"><i class="fa fa-sign-out"></i>通过申请</a> ');
|
||||
}
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
|
||||
function agreeRequest(id){
|
||||
$.modal.confirm("此操作设置该提现申请为已处理完毕, 是否继续?", function() {
|
||||
$.operate.post(prefix + "/agree", {
|
||||
cashInfoID:id
|
||||
}, function(response){
|
||||
if(response.code == 0){
|
||||
$.modal.alertSuccess('操作成功!')
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('会员账户明细列表')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
<label style="font-size:20px;width:600px;text-align: left">
|
||||
<a class="btn btn-success " onclick="history.back()">
|
||||
<i class="fa fa-reply"></i> 返回
|
||||
</a>
|
||||
<span th:text="*{memberName}"></span><span th:text="*{mobile}"></span>
|
||||
|
||||
<select style="font-size: 16px;display: inline" class="form-control" id="accountType" name="accountType" th:value="*{accountType}" onchange="$.table.search()">
|
||||
<option value="0" th:selected="*{accountType==0}">福豆余额</option>
|
||||
<option value="1" th:selected="*{accountType==1}">个人福豆</option>
|
||||
<option value="2" th:selected="*{accountType==2}">团队福豆</option>
|
||||
<option value="3" th:selected="*{accountType==3}">专项福豆</option>
|
||||
<option value="4" th:selected="*{accountType==4}">福豆田</option>
|
||||
</select>
|
||||
</label>
|
||||
<input id="memberId" name="memberId" th:value="*{memberID}" type="hidden">
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!--
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="business:detail:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="business:detail:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="business:detail:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="business:detail:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>-->
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<style>
|
||||
.fixed-table-toolbar{height: 0;overflow: hidden}
|
||||
</style>
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('business:detail:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('business:detail:remove')}]];
|
||||
var prefix = ctx + "business/member";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/listAccountDetail",
|
||||
modalName: "会员账户明细",
|
||||
columns: [
|
||||
{
|
||||
field: 'id',
|
||||
title: '会员账户明细ID',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'typeDetail',
|
||||
title: '变动类型',
|
||||
formatter: function(value, row, index) {
|
||||
switch (value){
|
||||
case 1:return "账户充值";
|
||||
case 2:return "账户提现";
|
||||
case 3:return "转账";
|
||||
case 4:return "冲正";
|
||||
case 5:return "支付";
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'amount',
|
||||
title: '变更金额',
|
||||
formatter: function(value, row, index) {
|
||||
let type = value >= 0;
|
||||
return "<span style='color:" + (type ? "#00AA00" : "#FF0000") + "'>" + (value > 0 ? "+" : "") + value + "</span>"
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'beforeAmount',
|
||||
title: '变更前金额'
|
||||
},
|
||||
{
|
||||
field: 'afterAmount',
|
||||
title: '变更后金额'
|
||||
},
|
||||
{
|
||||
field: 'changeDesc',
|
||||
title: '交易备注',
|
||||
formatter: function(value, row, index) {
|
||||
let isTeam = value == "团队奖励";
|
||||
return isTeam ? (value + " <a href='javascript:;' onclick='showTeamDetail(\"" + row.createTime + "\")'>[查看详细]</a>") : value;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'businessNo',
|
||||
title: '业务相关'
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '交易时间'
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
|
||||
//团队奖励明细
|
||||
function showTeamDetail(createTime){
|
||||
let dateStr = createTime.split(" ")[0];
|
||||
$.modal.open(dateStr + "团队奖励明细", ctx + "business/reward?memberID=" + $("#memberId").val() + "&rewardDate=" + dateStr);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('会员架构')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<input id="memberID" th:value="*{memberID}" type="hidden">
|
||||
<div class="form-group">
|
||||
<div class="col-sm-8">
|
||||
<select id="productID" class="form-control" onchange="showTeam(this.value)">
|
||||
<option th:each="product:${productList}" th:value="*{product.id}" th:text="*{product.productName}"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-1" style="width: 30%;line-height: 31px;font-size:16px">
|
||||
团队总盒数:<span id="numSpan">0</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="childDiv" style="display: none"></div>
|
||||
<div id="container" class="col-sm-8" style="width: 90%;margin-top: 10px;">
|
||||
<!--<input name="memberName" th:field="*{memberName}" class="form-control" type="text" required maxlength="10">-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<style>
|
||||
.childDiv{padding:7px 0 0 0}
|
||||
.childDiv .cont{padding-left: 20px}
|
||||
.childDiv span{display:block;font-size: 14px;line-height: 24px;padding:0 0 4px 4px;cursor:pointer;border-radius: 5px;border:1px solid #AAAAAA}
|
||||
.childDiv span.noneChild{padding-left: 19px;padding-top: 2px;padding-bottom: 2px}
|
||||
.childDiv span ss{font-family: 宋体}
|
||||
</style>
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "business/member";
|
||||
var clone = $(".childDiv");
|
||||
|
||||
$(function() {
|
||||
showTeam($("#productID").val());
|
||||
});
|
||||
|
||||
//读取团队架构
|
||||
function showTeam(productID){
|
||||
$.post(prefix + "/accountTeamDetail", "memberID=" + $("#memberID").val() + "&productID=" + productID, function(resp){
|
||||
if(resp.code != 0) return;
|
||||
$("#numSpan").text(resp.data.teamNum);
|
||||
let members = resp.data.memberList;
|
||||
if(!members){
|
||||
$("#container").html(" 该用户没有子级");
|
||||
return;
|
||||
}
|
||||
showChildren($("#container"), members, true);
|
||||
$("#container .cont").hide();
|
||||
});
|
||||
}
|
||||
|
||||
//列出子级
|
||||
function showChildren(div, list, flag){
|
||||
for(let i=0;i<list.length;i++){
|
||||
let item = list[i];
|
||||
let children = item.children;
|
||||
let child = clone.clone().show();
|
||||
child.html("<span class='" + (children ? "glyphicon glyphicon-chevron-right" : "noneChild") + "'><ss> " + item.member_name + item.mobile + "(" + item.num + "盒) <b style='color:#0000FF'>" + (flag ? item.desc : "") + "</b></ss></span>");
|
||||
div.append(child);
|
||||
if(children){
|
||||
child.append("<div class='cont'></div>");
|
||||
showChildren(child.find(".cont").eq(0), children);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//点击事件
|
||||
$("#container").on("click", ".childDiv span", function(){
|
||||
let cont = $(this).next(".cont");
|
||||
let isShow = cont.css("display") != "none";
|
||||
isShow ? cont.hide() : cont.show();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增会员')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-member-add">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">手机号码:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="mobile" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">用户姓名:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="memberName" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">推荐人ID:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="recommendId" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">会员类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="memberType" class="form-control m-b" required>
|
||||
<option value="">所有</option>
|
||||
</select>
|
||||
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">是否禁用:0-否,1-是:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="isEnable" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "business/member"
|
||||
$("#form-member-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-member-add').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('修改会员')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-member-edit" th:object="${bizMember}">
|
||||
<input name="id" th:field="*{id}" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">手机号码:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="mobile" th:field="*{mobile}" class="form-control" type="text" required maxlength="11">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">用户姓名:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="memberName" th:field="*{memberName}" class="form-control" type="text" required maxlength="10">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">福豆余额:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="amount" th:field="*{douBalance}" class="form-control" type="text" required digits="true" min="0" max="100000">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">可用福豆:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="amount" th:field="*{douPerson}" class="form-control" type="text" required digits="true" min="0" max="100000">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">专项福豆:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="amount" th:field="*{douSpecial}" class="form-control" type="text" required digits="true" min="0" max="100000">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">团队福豆:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="amount" th:field="*{douTeam}" class="form-control" type="text" required digits="true" min="0" max="100000">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">福豆田:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="amount" th:field="*{douField}" class="form-control" type="text" required digits="true" min="0" max="100000">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "business/member";
|
||||
$("#form-member-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-member-edit').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,201 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('会员列表')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
<label>会员搜索:</label>
|
||||
<input type="text" name="memberName" placeholder="请输入会员姓名或手机号"/>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<!--<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="business:member:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>-->
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="business:member:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="business:member:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="business:member:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('business:member:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('business:member:remove')}]];
|
||||
var prefix = ctx + "business/member";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "会员",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'id',
|
||||
title: '会员ID',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'memberName',
|
||||
title: '会员姓名'
|
||||
},
|
||||
{
|
||||
field: 'mobile',
|
||||
title: '会员手机号码'
|
||||
},
|
||||
{
|
||||
field: 'recommendName',
|
||||
title: '推荐人姓名'
|
||||
},
|
||||
{
|
||||
field: 'recommendMobile',
|
||||
title: '推荐人手机号码'
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '注册时间'
|
||||
},
|
||||
{
|
||||
field: 'douBalance',
|
||||
align: 'center',
|
||||
title: '福豆余额',
|
||||
formatter: function(value, row, index) {
|
||||
return "<a href='javascript:void(0)' onclick='showDetail(" + row.id + ", 0)'>" + value + "</a>";
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'douPerson',
|
||||
align: 'center',
|
||||
title: '个人福豆',
|
||||
formatter: function(value, row, index) {
|
||||
return "<a href='javascript:void(0)' onclick='showDetail(" + row.id + ", 1)'>" + value + "</a>";
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'douTeam',
|
||||
align: 'center',
|
||||
title: '团队福豆',
|
||||
formatter: function(value, row, index) {
|
||||
return "<a href='javascript:void(0)' onclick='showDetail(" + row.id + ", 2)'>" + value + "</a>";
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'douField',
|
||||
align: 'center',
|
||||
title: '福豆田',
|
||||
formatter: function(value, row, index) {
|
||||
return "<a href='javascript:void(0)' onclick='showDetail(" + row.id + ", 4)'>" + value + "</a>";
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'douSpecial',
|
||||
align: 'center',
|
||||
title: '专项福豆',
|
||||
formatter: function(value, row, index) {
|
||||
return "<a href='javascript:void(0)' onclick='showDetail(" + row.id + ", 3)'>" + value + "</a>";
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'memberType',
|
||||
title: '会员类型',
|
||||
formatter: function(value, row, index) {
|
||||
return value ? "个人用户" : "经销商";
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'isEnable',
|
||||
title: '是否有效',
|
||||
formatter: function(value, row, index) {
|
||||
if(value){
|
||||
return "<span style='color:#00AA00'>有效</span>";
|
||||
}else{
|
||||
return "<span style='color:#AA0000'>失效</span>";
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-warning btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="showTeam(\'' + row.id + '\', \'' + row.memberName + row.mobile + '\')"><i class="fa fa-share-alt"></i>会员架构</a> ');
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="updatePwd(\'' + row.id + '\', \'' + row.memberName + '\')"><i class="fa fa-cog"></i>修改密码</a> ');
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
|
||||
//查看明细
|
||||
function showDetail(memberID, accountType){
|
||||
location.href = prefix + "/accountDetail?memberID=" + memberID + "&accountType=" + accountType;
|
||||
}
|
||||
|
||||
//会员架构
|
||||
function showTeam(memberID, title){
|
||||
$.modal.open(title + " 会员架构", prefix + "/accountTeam?memberID=" + memberID);
|
||||
}
|
||||
|
||||
//修改密码
|
||||
function updatePwd(memberID, memberName){
|
||||
$.post(prefix + "/showPassword", {
|
||||
memberID:memberID
|
||||
}, function(response){
|
||||
if(response.code == 0){
|
||||
showPwd(response.data.pwd)
|
||||
}
|
||||
});
|
||||
|
||||
let showPwd = function(oldPwd){
|
||||
$.modal.confirm("<div id='anch'>请输入新的密码 " + memberName + "<br/><input class='form-control' id='newPwd' value='" + oldPwd + "' maxlength='30'></div>", function() {
|
||||
let pwd = $("#newPwd").val();
|
||||
if(pwd.length == 0){
|
||||
$.modal.msgError("请输入新密码");
|
||||
return false;
|
||||
}
|
||||
$.operate.post(prefix + "/editPassword", {
|
||||
memberID:memberID,
|
||||
password:pwd
|
||||
}, function(response){
|
||||
if(response.code == 0){
|
||||
$.modal.alertSuccess('操作成功!')
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#anch").parent().css("padding", "10px 20px").children(".layui-layer-ico").hide();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增订单')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-order-add">
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "business/order"
|
||||
$("#form-order-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-order-add').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('修改订单')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-order-edit" th:object="${bizOrder}">
|
||||
<input name="id" th:field="*{id}" type="hidden">
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "business/order";
|
||||
$("#form-order-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-order-edit').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,206 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('订单列表')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
<label>订单搜索:</label>
|
||||
<input type="text" name="memberName" placeholder="请输入会员姓名或手机号"/>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="business:order:export"><i class="fa fa-download"></i> 导出</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!--
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="business:order:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="business:order:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="business:order:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="business:order:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>-->
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<style>
|
||||
.fixed-table-toolbar{height: 0;overflow: hidden}
|
||||
</style>
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('business:order:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('business:order:remove')}]];
|
||||
var prefix = ctx + "business/order";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "订单",
|
||||
toolbar: false,
|
||||
columns: [
|
||||
{
|
||||
field: 'id',
|
||||
title: '订单ID',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'orderSn',
|
||||
title: '订单编码'
|
||||
},
|
||||
{
|
||||
field: 'memberName',
|
||||
title: '会员姓名'
|
||||
},
|
||||
{
|
||||
field: 'mobile',
|
||||
title: '手机号码'
|
||||
},
|
||||
{
|
||||
field: 'productName',
|
||||
title: '商品名称'
|
||||
},
|
||||
{
|
||||
field: 'productAmount',
|
||||
title: '商品单价'
|
||||
},
|
||||
{
|
||||
field: 'productCount',
|
||||
title: '数量'
|
||||
},
|
||||
{
|
||||
field: 'orderAmount',
|
||||
title: '订单总额'
|
||||
},
|
||||
{
|
||||
field: 'addressName',
|
||||
title: '收货人姓名'
|
||||
},
|
||||
{
|
||||
field: 'addressMobile',
|
||||
title: '收货人电话'
|
||||
},
|
||||
{
|
||||
title: '收货区域',
|
||||
formatter: function(value, row, index) {
|
||||
return row.addressProvince + row.addressCity + row.addressArea;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'addressDetail',
|
||||
title: '详细地址'
|
||||
},
|
||||
{
|
||||
field: 'orderStatus',
|
||||
title: '订单状态',
|
||||
formatter: function(value, row, index) {
|
||||
switch (value){
|
||||
case 0: return "<span style='color:#5c5c5c'>待支付</span>";
|
||||
case 1: return "<span style='color:#db8301'>已支付</span>";
|
||||
case 2: return "<span style='color:#ad3636'>已取消</span>";
|
||||
case 3: return "<span style='color:#a5a544'>待收货</span>";
|
||||
case 4: return "<span style='color:#04c404'>已完成</span>";
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '下单时间'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
if(row.orderStatus == 1){
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="deliver(\'' + row.id + '\')"><i class="fa fa-truck"></i>发货</a> ');
|
||||
}
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="updateRemark(\'' + row.id + '\', \'' + row.remark + '\')"><i class="fa fa-book"></i>修改备注</a> ');
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="updateAddress(\'' + row.id + '\', \'' + row.addressDetail + '\')"><i class="fa fa fa-map-marker"></i>收货地址</a> ');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
|
||||
//发货
|
||||
function deliver(orderID){
|
||||
$.modal.confirm("此操作设置该订单为已发货吗, 是否继续?", function() {
|
||||
$.operate.post(prefix + "/deliver", {
|
||||
orderID:orderID
|
||||
}, function(response){
|
||||
if(response.code == 0){
|
||||
$.modal.alertSuccess('操作成功!')
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//修改备注
|
||||
function updateRemark(orderID, oldRemark){
|
||||
$.modal.confirm("<div id='anch'>请输入新的备注信息<br/><input class='form-control' id='newRemark' value='" + oldRemark + "' maxlength='30'></div>", function() {
|
||||
let remark = $("#newRemark").val();
|
||||
if(remark.length == 0){
|
||||
$.modal.msgError("请输入备注信息");
|
||||
return false;
|
||||
}
|
||||
$.operate.post(prefix + "/updateAddressOrRemark", {
|
||||
orderID:orderID,
|
||||
content:remark,
|
||||
type:1
|
||||
}, function(response){
|
||||
if(response.code == 0){
|
||||
$.modal.alertSuccess('操作成功!')
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#anch").parent().css("padding", "10px 20px").children(".layui-layer-ico").hide();
|
||||
}
|
||||
|
||||
//修改备注
|
||||
function updateAddress(orderID, oldAddress){
|
||||
$.modal.confirm("<div id='anch'>请输入新的收货地址<br/><input class='form-control' id='newAddress' value='" + oldAddress + "' maxlength='20'></div>", function() {
|
||||
let address = $("#newAddress").val();
|
||||
if(address.length == 0){
|
||||
$.modal.msgError("请输入收货地址");
|
||||
return false;
|
||||
}
|
||||
$.operate.post(prefix + "/updateAddressOrRemark", {
|
||||
orderID:orderID,
|
||||
content:address,
|
||||
type:0
|
||||
}, function(response){
|
||||
if(response.code == 0){
|
||||
$.modal.alertSuccess('操作成功!')
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#anch").parent().css("padding", "10px 20px").children(".layui-layer-ico").hide();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,185 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增产品')" />
|
||||
<th:block th:include="include :: bootstrap-fileinput-css"/>
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<form class="form-horizontal m" id="form-product-add">
|
||||
<div class="tabs-container">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">1产品基础信息</a>
|
||||
</li>
|
||||
<li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">2产品相关图片</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div id="tab-1" class="tab-pane active">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产品名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="productName" class="form-control" type="text" required maxlength="20">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产品分类:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="productTypeId" class="form-control m-b" required>
|
||||
<option th:each="ptype:${productTypeList}" th:value="*{ptype.productTypeId}" th:text="*{ptype.productTypeName}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产品类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="productClass" class="form-control m-b" required>
|
||||
<option th:each="dict:${@dict.getType('busi_product_class')}" th:value="*{dict.dictValue}" th:text="*{dict.dictLabel}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产品单价:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="amount" class="form-control" type="text" required digits="true" min="0" max="100000">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产品返现金额:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="cashbackAmount" class="form-control" type="text" required digits="true" min="0" max="100000">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">排序:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="sort" class="form-control" type="text" digits="true" min="0" max="100">
|
||||
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 排序数字越大排列越靠前</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">是否上架:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio-box">
|
||||
<input type="radio" name="onlineStatus" value="1">
|
||||
<label th:for="onlineStatus" th:text="是"></label>
|
||||
</div>
|
||||
<div class="radio-box">
|
||||
<input type="radio" name="onlineStatus" checked value="0">
|
||||
<label th:for="onlineStatus" th:text="否"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产品描述:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="remark" class="form-control" required maxlength="80"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tab-2" class="tab-pane">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产品主图:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" name="mainImage">
|
||||
<div class="file-loading">
|
||||
<input class="form-control file-upload" id="mainImage" name="file" type="file">
|
||||
</div>
|
||||
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 只能上传png jpg gif图片且大小不能超过200KB</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产品详情图(最多20张):</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="file-loading">
|
||||
<input class="form-control file-upload" id="detailImages" multiple name="file" type="file">
|
||||
</div>
|
||||
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 只能上传png jpg gif图片且大小不能超过200KB</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产品轮播图(最多5张):</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="file-loading">
|
||||
<input class="form-control file-upload" id="loopImages" multiple name="file" type="file">
|
||||
</div>
|
||||
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 只能上传png jpg gif图片且大小不能超过200KB</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<style>
|
||||
.file-drop-zone-title{padding:45px 10px}
|
||||
.file-thumbnail-footer{height:30px !important;}
|
||||
.file-footer-caption{margin-bottom:0 !important;}
|
||||
.kv-file-content{width: 150px !important;height: 100px !important;}
|
||||
</style>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: bootstrap-fileinput-js"/>
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "business/product"
|
||||
$("#form-product-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
var detailImagesArr = [];
|
||||
var loopImagesArr = [];
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
let saveData = $('#form-product-add').serialize();
|
||||
if(detailImagesArr.length > 0){
|
||||
detailImagesArr.forEach((url)=>saveData += "&detailImages=" + url);
|
||||
}
|
||||
if(loopImagesArr.length > 0){
|
||||
loopImagesArr.forEach((url)=>saveData += "&loopImages=" + url);
|
||||
}
|
||||
$.operate.save(prefix + "/add", saveData);
|
||||
}
|
||||
}
|
||||
|
||||
$("#mainImage").fileinput({
|
||||
uploadUrl: '/common/upload',
|
||||
maxFileCount: 1,
|
||||
maxFileSize: 200,
|
||||
allowedFileTypes: ['image'],
|
||||
allowedFileExtensions: ['jpg','png','gif','jpeg'],
|
||||
autoReplace: true
|
||||
}).on('fileuploaded', function (event, data, previewId, index) {
|
||||
$("input[name='" + event.currentTarget.id + "']").val(data.response.url)
|
||||
}).on('fileremoved', function (event, id, index) {
|
||||
$("input[name='" + event.currentTarget.id + "']").val('')
|
||||
});
|
||||
|
||||
$("#detailImages").fileinput({
|
||||
uploadUrl: '/common/upload',
|
||||
maxFileCount: 20,
|
||||
maxFilesNum : 20,
|
||||
maxFileSize: 200,
|
||||
allowedFileTypes: ['image'],
|
||||
allowedFileExtensions: ['jpg','png','gif','jpeg']
|
||||
}).on('fileuploaded', function (event, data, previewId, index) {
|
||||
detailImagesArr.push(data.response.url);
|
||||
}).on('fileremoved', function (event, id, index) {
|
||||
detailImagesArr.splice(detailImagesArr.indexOf(data.response.url), 1);
|
||||
});
|
||||
|
||||
$("#loopImages").fileinput({
|
||||
uploadUrl: '/common/upload',
|
||||
maxFileCount: 5,
|
||||
maxFilesNum : 5,
|
||||
maxFileSize: 200,
|
||||
allowedFileTypes: ['image'],
|
||||
allowedFileExtensions: ['jpg','png','gif','jpeg']
|
||||
}).on('fileuploaded', function (event, data, previewId, index) {
|
||||
loopImagesArr.push(data.response.url);
|
||||
}).on('fileremoved', function (event, id, index) {
|
||||
loopImagesArr.splice(loopImagesArr.indexOf(data.response.url), 1);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,196 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('修改产品')" />
|
||||
<th:block th:include="include :: bootstrap-fileinput-css"/>
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<form class="form-horizontal m" id="form-product-edit" >
|
||||
<input name="id" th:field="*{bizProduct.id}" type="hidden">
|
||||
<input id="hiddenDetail" th:value="*{bizProduct.detailImages}" type="hidden">
|
||||
<input id="hiddenLoop" th:value="*{bizProduct.loopImages}" type="hidden">
|
||||
<div class="tabs-container">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">1产品基础信息</a>
|
||||
</li>
|
||||
<li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">2产品相关图片</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div id="tab-1" class="tab-pane active">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产品名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="productName" th:field="*{bizProduct.productName}" class="form-control" type="text" required maxlength="20">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产品分类:</label>
|
||||
<div class="col-sm-8">
|
||||
<select th:field="*{bizProduct.productTypeId}" name="productTypeId" class="form-control m-b" required>
|
||||
<option th:each="ptype:${productTypeList}" th:value="*{ptype.id}" th:text="*{ptype.productTypeName}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产品类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<select th:field="*{bizProduct.productClass}" name="productClass" class="form-control m-b" required>
|
||||
<option th:each="dict:${@dict.getType('busi_product_class')}" th:value="*{dict.dictValue}" th:text="*{dict.dictLabel}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产品单价:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="amount" th:field="*{bizProduct.amount}" class="form-control" type="text" required digits="true" min="0" max="100000">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产品返现金额:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="cashbackAmount" th:field="*{bizProduct.cashbackAmount}" class="form-control" type="text" required digits="true" min="0" max="100000">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">排序:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="sort" th:field="*{bizProduct.sort}" class="form-control" type="text" digits="true" min="0" max="100">
|
||||
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 排序数字越大排列越靠前</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">是否上架:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio-box">
|
||||
<input type="radio" name="onlineStatus" th:checked="*{bizProduct.onlineStatus==1}" value="1">
|
||||
<label th:for="onlineStatus" th:text="是"></label>
|
||||
</div>
|
||||
<div class="radio-box">
|
||||
<input type="radio" name="onlineStatus" th:checked="*{bizProduct.onlineStatus==0}" value="0">
|
||||
<label th:for="onlineStatus" th:text="否"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产品描述:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="remark" th:field="*{bizProduct.remark}" class="form-control" required maxlength="80"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tab-2" class="tab-pane">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产品主图:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" name="mainImage" th:value="*{bizProduct.mainImage}">
|
||||
<div class="file-loading">
|
||||
<input class="form-control file-upload" id="mainImage" name="file" type="file">
|
||||
</div>
|
||||
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 只能上传png jpg gif图片且大小不能超过200KB</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产品详情图(最多20张):</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="file-loading">
|
||||
<input class="form-control file-upload" id="detailImages" multiple name="file" type="file">
|
||||
</div>
|
||||
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 只能上传png jpg gif图片且大小不能超过200KB</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产品轮播图(最多5张):</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="file-loading">
|
||||
<input class="form-control file-upload" id="loopImages" multiple name="file" type="file">
|
||||
</div>
|
||||
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 只能上传png jpg gif图片且大小不能超过200KB</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<style>
|
||||
.file-drop-zone-title{padding:45px 10px}
|
||||
.file-thumbnail-footer{height:30px !important;}
|
||||
.file-footer-caption{margin-bottom:0 !important;}
|
||||
.kv-file-content{width: 150px !important;height: 100px !important;}
|
||||
</style>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: bootstrap-fileinput-js"/>
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "business/product";
|
||||
$("#form-product-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
var detailStr = $("#hiddenDetail").val().replace(/[\[\]]/g, "");
|
||||
var loopStr = $("#hiddenLoop").val().replace(/[\[\]]/g, "");
|
||||
var detailImagesArr = detailStr.length ? detailStr.split(",") : [];
|
||||
var loopImagesArr = loopStr.length ? loopStr.split(",") : [];
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
let saveData = $('#form-product-edit').serialize();
|
||||
if(detailImagesArr.length > 0){
|
||||
detailImagesArr.forEach((url)=>saveData += "&detailImages=" + url);
|
||||
}
|
||||
if(loopImagesArr.length > 0){
|
||||
loopImagesArr.forEach((url)=>saveData += "&loopImages=" + url);
|
||||
}
|
||||
$.operate.save(prefix + "/edit", saveData);
|
||||
}
|
||||
}
|
||||
|
||||
$("#mainImage").fileinput({
|
||||
uploadUrl: '/common/upload',
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: [$("input[name=mainImage]").val()],
|
||||
maxFileCount: 1,
|
||||
maxFileSize: 200,
|
||||
allowedFileTypes: ['image'],
|
||||
allowedFileExtensions: ['jpg','png','gif','jpeg'],
|
||||
autoReplace: true
|
||||
}).on('fileuploaded', function (event, data, previewId, index) {
|
||||
$("input[name='" + event.currentTarget.id + "']").val(data.response.url)
|
||||
}).on('fileremoved', function (event, id, index) {
|
||||
$("input[name='" + event.currentTarget.id + "']").val('')
|
||||
});
|
||||
|
||||
$("#detailImages").fileinput({
|
||||
uploadUrl: '/common/upload',
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: detailImagesArr,
|
||||
maxFileCount: 20,
|
||||
maxFilesNum : 20,
|
||||
maxFileSize: 200,
|
||||
allowedFileTypes: ['image'],
|
||||
allowedFileExtensions: ['jpg','png','gif','jpeg']
|
||||
}).on('fileuploaded', function (event, data, previewId, index) {
|
||||
detailImagesArr.push(data.response.url);
|
||||
}).on('fileremoved', function (event, id, index) {
|
||||
detailImagesArr.splice(detailImagesArr.indexOf(data.response.url), 1);
|
||||
});
|
||||
|
||||
$("#loopImages").fileinput({
|
||||
uploadUrl: '/common/upload',
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: loopImagesArr,
|
||||
maxFileCount: 5,
|
||||
maxFilesNum : 5,
|
||||
maxFileSize: 200,
|
||||
allowedFileTypes: ['image'],
|
||||
allowedFileExtensions: ['jpg','png','gif','jpeg']
|
||||
}).on('fileuploaded', function (event, data, previewId, index) {
|
||||
loopImagesArr.push(data.response.url);
|
||||
}).on('fileremoved', function (event, id, index) {
|
||||
loopImagesArr.splice(loopImagesArr.indexOf(data.response.url), 1);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,161 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('产品列表')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
<label>产品名称:</label>
|
||||
<input type="text" name="productName"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>产品类型:</label>
|
||||
<select name="productClass">
|
||||
<option value="">所有</option>
|
||||
<option class="classOption" th:each="dict:${@dict.getType('busi_product_class')}" th:value="*{dict.dictValue}" th:text="*{dict.dictLabel}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label>产品分类:</label>
|
||||
<select name="productTypeId">
|
||||
<option value="">所有</option>
|
||||
<option class="typeOption" th:each="ptype:${productTypeList}" th:value="*{ptype.id}" th:text="*{ptype.productTypeName}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="business:product:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="business:product:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="business:product:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="business:product:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('business:product:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('business:product:remove')}]];
|
||||
var prefix = ctx + "business/product";
|
||||
//取产品分类和类型数据
|
||||
var typeDict = {};
|
||||
$(".typeOption").each(function(){typeDict[$(this).val()] = $(this).text()});
|
||||
var classDict = {};
|
||||
$(".classOption").each(function(){classDict[$(this).val()] = $(this).text()});
|
||||
|
||||
//上架或下架
|
||||
function productStatusEdit(productID, status){
|
||||
$.modal.confirm("确认要将该产品" + (status ? "下" : "上") + "架吗?", function() {
|
||||
$.operate.post(prefix + "/status", {
|
||||
productID:productID
|
||||
}, function(response){
|
||||
if(response.code == 0){
|
||||
$.modal.alertSuccess('操作成功!')
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "产品",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'id',
|
||||
title: '产品ID',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'productCode',
|
||||
title: '产品编码'
|
||||
},
|
||||
{
|
||||
field: 'productName',
|
||||
title: '产品名称'
|
||||
},
|
||||
{
|
||||
field: 'productTypeId',
|
||||
title: '产品分类',
|
||||
formatter: function(value, row, index) {
|
||||
return typeDict[value];
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'productClass',
|
||||
title: '产品类型',
|
||||
formatter: function(value, row, index) {
|
||||
return classDict[value];
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'amount',
|
||||
title: '产品单价'
|
||||
},
|
||||
{
|
||||
field: 'sort',
|
||||
title: '排序'
|
||||
},
|
||||
{
|
||||
field: 'onlineStatus',
|
||||
title: '产品状态',
|
||||
formatter: function(value, row, index) {
|
||||
return "<span style='color:" + (value ? "#00FF00" :"#999999") + "'>" + ((value ? "上架中" :"已下架")) + "</span>";
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'onlineTime',
|
||||
title: '上架时间'
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
title: '产品描述'
|
||||
},
|
||||
{
|
||||
field: 'onlineStatus',
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-' + (value ? 'warning' : 'primary') + ' btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="productStatusEdit(\'' + row.id + '\', ' + value + ')"><i class="fa fa-' + (value ? 'level-down' : 'level-up') + '"></i>' + (value ? '下架' : '上架') + '</a> ');
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增产品分类')" />
|
||||
<th:block th:include="include :: bootstrap-fileinput-css"/>
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-productType-add">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产品分类名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="productTypeName" class="form-control" type="text" required maxlength="20">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">附件地址:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" name="imageUrl">
|
||||
<div class="file-loading">
|
||||
<input class="form-control file-upload" id="imageUrl" name="file" type="file">
|
||||
</div>
|
||||
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 只能上传png jpg gif图片且大小不能超过200KB</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">排序:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="sort" class="form-control" type="text" required digits="true" min="0" max="100">
|
||||
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 排序数字越大排列越靠前</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">是否禁用:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio-box">
|
||||
<input type="radio" name="isEnable" value="1">
|
||||
<label th:for="isEnable" th:text="是"></label>
|
||||
</div>
|
||||
<div class="radio-box">
|
||||
<input type="radio" name="isEnable" checked value="0">
|
||||
<label th:for="isEnable" th:text="否"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: bootstrap-fileinput-js"/>
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "business/productType"
|
||||
$("#form-productType-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-productType-add').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
$(".file-upload").fileinput({
|
||||
uploadUrl: '/common/upload',
|
||||
maxFileCount: 1,
|
||||
maxFileSize: 200,
|
||||
allowedFileTypes: ['image'],
|
||||
allowedFileExtensions: ['jpg','png','gif','jpeg'],
|
||||
autoReplace: true
|
||||
}).on('fileuploaded', function (event, data, previewId, index) {
|
||||
$("input[name='" + event.currentTarget.id + "']").val(data.response.url)
|
||||
}).on('fileremoved', function (event, id, index) {
|
||||
$("input[name='" + event.currentTarget.id + "']").val('')
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('修改产品分类')" />
|
||||
<th:block th:include="include :: bootstrap-fileinput-css"/>
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-productType-edit" th:object="${bizProductType}">
|
||||
<input name="productTypeId" th:field="*{productTypeId}" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产品分类名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="productTypeName" th:field="*{productTypeName}" class="form-control" type="text" required maxlength="20">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">附件地址:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" name="imageUrl" th:field="*{imageUrl}">
|
||||
<div class="file-loading">
|
||||
<input class="form-control file-upload" id="imageUrl" name="file" type="file">
|
||||
</div>
|
||||
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 只能上传png jpg gif图片且大小不能超过200KB</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">排序:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="sort" th:field="*{sort}" class="form-control" type="text" required digits="true" min="0" max="100">
|
||||
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 排序数字越大排列越靠前</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">是否禁用:0-否,1-是:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio-box">
|
||||
<input type="radio" name="isEnable" th:checked="*{isEnable==1}" value="1">
|
||||
<label th:for="isEnable" th:text="是"></label>
|
||||
</div>
|
||||
<div class="radio-box">
|
||||
<input type="radio" name="isEnable" th:checked="*{isEnable==0}" value="0">
|
||||
<label th:for="isEnable" th:text="否"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: bootstrap-fileinput-js"/>
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "business/productType";
|
||||
$("#form-productType-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-productType-edit').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
$(".file-upload").each(function (i) {
|
||||
var val = $("input[name='" + this.id + "']").val()
|
||||
$(this).fileinput({
|
||||
'uploadUrl': '/common/upload',
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: [val],
|
||||
maxFileCount: 1,
|
||||
maxFileSize: 200,
|
||||
allowedFileTypes: ['image'],
|
||||
allowedFileExtensions: ['jpg','png','gif','jpeg'],
|
||||
autoReplace: true
|
||||
}).on('fileuploaded', function (event, data, previewId, index) {
|
||||
$("input[name='" + event.currentTarget.id + "']").val(data.response.url)
|
||||
}).on('fileremoved', function (event, id, index) {
|
||||
$("input[name='" + event.currentTarget.id + "']").val('')
|
||||
})
|
||||
$(this).fileinput('_initFileActions');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('产品分类列表')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
<label>名称:</label>
|
||||
<input type="text" name="productTypeName"/>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="business:productType:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="business:productType:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="business:productType:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="business:productType:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('business:productType:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('business:productType:remove')}]];
|
||||
var prefix = ctx + "business/productType";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "产品分类",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'productTypeId',
|
||||
title: '产品分类ID',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'productTypeCode',
|
||||
title: '产品分类编码'
|
||||
},
|
||||
{
|
||||
field: 'productTypeName',
|
||||
title: '产品分类名称'
|
||||
},
|
||||
{
|
||||
field: 'sort',
|
||||
title: '排序'
|
||||
},
|
||||
{
|
||||
field: 'isEnable',
|
||||
title: '是否禁用',
|
||||
formatter: function(value, row, index) {
|
||||
return "<span style='color:" + (value == 1 ? "#FF0000" :"#00FF00") + "'>" + ((value == 1 ? "禁用" :"启用")) + "</span>";
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'createBy',
|
||||
title: '创建者'
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.productTypeId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.productTypeId + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('团队奖励明细列表')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse" style="height: 0;display: none">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<input name="memberId" type="hidden" th:value="*{memberID}"/>
|
||||
<input name="rewardType" type="hidden" th:value="*{rewardType}"/>
|
||||
<input name="rewardDate" type="hidden" th:value="*{rewardDate}"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!--<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="business:reward:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="business:reward:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="business:reward:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="business:reward:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>-->
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<style>
|
||||
.fixed-table-toolbar{height: 0;overflow: hidden}
|
||||
</style>
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "business/reward";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
modalName: "团队奖励明细",
|
||||
columns: [
|
||||
{
|
||||
field: 'id',
|
||||
title: '团队奖励ID',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'rewardMemberName',
|
||||
title: '团队用户',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
field: 'rewardProductCount',
|
||||
title: '盒数',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
field: 'rewardAmount',
|
||||
title: '福豆数量',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
field: 'rewardDate',
|
||||
title: '结算日期',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间',
|
||||
align: 'center'
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -101,6 +101,11 @@
|
|||
<artifactId>javax.servlet-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt</artifactId>
|
||||
<version>0.7.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.ruoyi.common.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* 前端接口鉴权
|
||||
* @author bei.wu
|
||||
*/
|
||||
@Target({ElementType.METHOD, ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface AjaxLogin
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ package com.ruoyi.common.utils;
|
|||
import java.lang.management.ManagementFactory;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
|
||||
|
|
@ -22,7 +23,9 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
|||
public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
|
||||
|
||||
public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
|
||||
public static String YYYY_MM_DD_HH_MM_SS_SSS = "yyyyMMddHHmmssSSS";
|
||||
|
||||
private static String[] parsePatterns = {
|
||||
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
|
||||
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
|
||||
|
|
@ -48,11 +51,42 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
|||
return dateTimeNow(YYYY_MM_DD);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前日期偏差日期, 默认格式为yyyy-MM-dd
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public static String getDate(int diff, String ... dateStr)
|
||||
{
|
||||
Calendar now = Calendar.getInstance();
|
||||
if (dateStr.length > 0) {
|
||||
try {
|
||||
now.setTime(parseDate(dateStr[0], YYYY_MM_DD));
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
now.add(Calendar.DAY_OF_MONTH, diff);
|
||||
return dateTime(now.getTime());
|
||||
}
|
||||
|
||||
public static final String getTime()
|
||||
{
|
||||
return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
|
||||
}
|
||||
|
||||
public static final String getMilliTime()
|
||||
{
|
||||
return dateTimeNow(YYYY_MM_DD_HH_MM_SS_SSS) + getRandomNumber(6);
|
||||
}
|
||||
|
||||
//随机N位数字
|
||||
public static final String getRandomNumber(int size)
|
||||
{
|
||||
String rand = String.valueOf(Math.random());
|
||||
return rand.substring(2, 2 + size);
|
||||
}
|
||||
|
||||
public static final String dateTimeNow()
|
||||
{
|
||||
return dateTimeNow(YYYYMMDDHHMMSS);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,81 @@
|
|||
package com.ruoyi.common.utils;
|
||||
|
||||
import io.jsonwebtoken.Claims;
|
||||
import io.jsonwebtoken.JwtBuilder;
|
||||
import io.jsonwebtoken.Jwts;
|
||||
import io.jsonwebtoken.SignatureAlgorithm;
|
||||
import io.jsonwebtoken.impl.crypto.MacProvider;
|
||||
|
||||
import java.security.Key;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* jwt-token 加、解密工具类 Created by wubei on 16/12/11.
|
||||
*/
|
||||
public class JWTUtil {
|
||||
static final Key KEY = MacProvider.generateKey();
|
||||
|
||||
public static final String AUTHORIZATION = "Authorization";
|
||||
|
||||
public static String createJWT(String subject) {
|
||||
return JWTUtil.createJWT(subject, null);
|
||||
}
|
||||
|
||||
public static String createJWT(String subject, Long ttlMillis) {
|
||||
long nowMillis = System.currentTimeMillis();
|
||||
Date now = new Date(nowMillis);
|
||||
|
||||
JwtBuilder builder =
|
||||
Jwts.builder().setIssuedAt(now).setSubject(subject).signWith(SignatureAlgorithm.HS256, AUTHORIZATION);
|
||||
if (ttlMillis != null) {
|
||||
long expMillis = nowMillis + ttlMillis;
|
||||
Date exp = new Date(expMillis);
|
||||
builder.setExpiration(exp);
|
||||
}
|
||||
return builder.compact();
|
||||
}
|
||||
|
||||
public static Claims parseJWT(String compactJws) {
|
||||
Jwts.parser().isSigned(compactJws);
|
||||
Claims claims = Jwts.parser().setSigningKey(AUTHORIZATION).parseClaimsJws(compactJws).getBody();
|
||||
return claims;
|
||||
}
|
||||
|
||||
/*public static SysUserBean getSysUser(HttpServletRequest request, RedisTemplate redisTemplate,
|
||||
boolean flag) {
|
||||
String token = request.getHeader(AUTHORIZATION);
|
||||
|
||||
// 取值attr里面予值
|
||||
if (StringUtils.isBlank(token)) {
|
||||
Object tToken = request.getAttribute(AUTHORIZATION);
|
||||
if (tToken != null) {
|
||||
token = tToken.toString();
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(token)) {
|
||||
if (flag) {
|
||||
throw new AuthorizationException();
|
||||
} else {
|
||||
return new SysUserBean();
|
||||
}
|
||||
}
|
||||
try {
|
||||
Claims claims = parseJWT(token);
|
||||
String hasKey = claims.getSubject();
|
||||
if (redisTemplate.hasKey(hasKey)) {
|
||||
String conpanyUserStr = (String)redisTemplate.opsForValue().get(hasKey);
|
||||
SysUserBean sysUseBean = JSONObject.parseObject(conpanyUserStr, SysUserBean.class);
|
||||
if (token.equals(sysUseBean.getToken())) {
|
||||
return sysUseBean;
|
||||
} else {
|
||||
throw new AuthorizationException();
|
||||
}
|
||||
} else {
|
||||
throw new AuthorizationException();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new AuthorizationException();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
package com.ruoyi.framework.config;
|
||||
|
||||
import com.ruoyi.framework.interceptor.AjaxAuthenticationInterceptor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
import org.springframework.web.servlet.config.annotation.*;
|
||||
import com.ruoyi.common.config.Global;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.framework.interceptor.RepeatSubmitInterceptor;
|
||||
|
|
@ -27,6 +25,8 @@ public class ResourcesConfig implements WebMvcConfigurer
|
|||
|
||||
@Autowired
|
||||
private RepeatSubmitInterceptor repeatSubmitInterceptor;
|
||||
@Autowired
|
||||
private AjaxAuthenticationInterceptor ajaxAuthenticationInterceptor;
|
||||
|
||||
/**
|
||||
* 默认首页的设置,当输入域名是可以自动跳转到默认指定的网页
|
||||
|
|
@ -55,5 +55,16 @@ public class ResourcesConfig implements WebMvcConfigurer
|
|||
public void addInterceptors(InterceptorRegistry registry)
|
||||
{
|
||||
registry.addInterceptor(repeatSubmitInterceptor).addPathPatterns("/**");
|
||||
registry.addInterceptor(ajaxAuthenticationInterceptor).addPathPatterns("/ajax/**");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry.addMapping("/ajax/**")
|
||||
.allowedOrigins("*")
|
||||
.allowedMethods("POST", "GET", "PUT", "OPTIONS", "DELETE")
|
||||
.allowCredentials(true)
|
||||
.allowedHeaders("*")
|
||||
.maxAge(3600);
|
||||
}
|
||||
}
|
||||
|
|
@ -275,6 +275,7 @@ public class ShiroConfig
|
|||
filterChainDefinitionMap.put("/docs/**", "anon");
|
||||
filterChainDefinitionMap.put("/fonts/**", "anon");
|
||||
filterChainDefinitionMap.put("/img/**", "anon");
|
||||
// 前端所有接口放行
|
||||
filterChainDefinitionMap.put("/ajax/**", "anon");
|
||||
filterChainDefinitionMap.put("/js/**", "anon");
|
||||
filterChainDefinitionMap.put("/ruoyi/**", "anon");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,55 @@
|
|||
package com.ruoyi.framework.interceptor;
|
||||
|
||||
import com.ruoyi.common.annotation.AjaxLogin;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.json.JSON;
|
||||
import com.ruoyi.common.utils.JWTUtil;
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.jsonwebtoken.Claims;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.method.HandlerMethod;
|
||||
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/**
|
||||
* /ajax/**
|
||||
* 所有接口身份认证拦截器
|
||||
* @author bei.wu
|
||||
*/
|
||||
@Component
|
||||
public class AjaxAuthenticationInterceptor extends HandlerInterceptorAdapter {
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
|
||||
if (handler instanceof HandlerMethod) {
|
||||
HandlerMethod handlerMethod = (HandlerMethod) handler;
|
||||
AjaxLogin classAnnotation = ((HandlerMethod) handler).getMethod().getDeclaringClass().getAnnotation(AjaxLogin.class);
|
||||
AjaxLogin annotation = handlerMethod.getMethod().getAnnotation(AjaxLogin.class);
|
||||
if (ObjectUtils.anyNotNull(classAnnotation, annotation)) {
|
||||
String token = request.getHeader("Authorization");
|
||||
if (StringUtils.isBlank(token)) {
|
||||
AjaxResult ajaxResult = AjaxResult.error("请登录后操作");
|
||||
ServletUtils.renderString(response, JSON.marshal(ajaxResult));
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
Claims claims = JWTUtil.parseJWT(token);
|
||||
request.setAttribute("member", claims.getSubject());
|
||||
} catch (Exception e) {
|
||||
AjaxResult ajaxResult = AjaxResult.error("没有权限");
|
||||
ServletUtils.renderString(response, JSON.marshal(ajaxResult));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return super.preHandle(request, response, handler);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
# y
|
||||
|
||||
> y
|
||||
|
||||
## Build Setup
|
||||
|
||||
``` bash
|
||||
# install dependencies
|
||||
npm install
|
||||
|
||||
# serve with hot reload at localhost:8080
|
||||
npm run dev
|
||||
|
||||
# build for production with minification
|
||||
npm run build
|
||||
|
||||
# build for production and view the bundle analyzer report
|
||||
npm run build --report
|
||||
```
|
||||
|
||||
For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
'use strict'
|
||||
require('./check-versions')()
|
||||
|
||||
process.env.NODE_ENV = 'production'
|
||||
|
||||
const ora = require('ora')
|
||||
const rm = require('rimraf')
|
||||
const path = require('path')
|
||||
const chalk = require('chalk')
|
||||
const webpack = require('webpack')
|
||||
const config = require('../config')
|
||||
const webpackConfig = require('./webpack.prod.conf')
|
||||
|
||||
const spinner = ora('building for production...')
|
||||
spinner.start()
|
||||
|
||||
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
|
||||
if (err) throw err
|
||||
webpack(webpackConfig, (err, stats) => {
|
||||
spinner.stop()
|
||||
if (err) throw err
|
||||
process.stdout.write(stats.toString({
|
||||
colors: true,
|
||||
modules: false,
|
||||
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
|
||||
chunks: false,
|
||||
chunkModules: false
|
||||
}) + '\n\n')
|
||||
|
||||
if (stats.hasErrors()) {
|
||||
console.log(chalk.red(' Build failed with errors.\n'))
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
console.log(chalk.cyan(' Build complete.\n'))
|
||||
console.log(chalk.yellow(
|
||||
' Tip: built files are meant to be served over an HTTP server.\n' +
|
||||
' Opening index.html over file:// won\'t work.\n'
|
||||
))
|
||||
})
|
||||
})
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
'use strict'
|
||||
const chalk = require('chalk')
|
||||
const semver = require('semver')
|
||||
const packageConfig = require('../package.json')
|
||||
const shell = require('shelljs')
|
||||
|
||||
function exec (cmd) {
|
||||
return require('child_process').execSync(cmd).toString().trim()
|
||||
}
|
||||
|
||||
const versionRequirements = [
|
||||
{
|
||||
name: 'node',
|
||||
currentVersion: semver.clean(process.version),
|
||||
versionRequirement: packageConfig.engines.node
|
||||
}
|
||||
]
|
||||
|
||||
if (shell.which('npm')) {
|
||||
versionRequirements.push({
|
||||
name: 'npm',
|
||||
currentVersion: exec('npm --version'),
|
||||
versionRequirement: packageConfig.engines.npm
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = function () {
|
||||
const warnings = []
|
||||
|
||||
for (let i = 0; i < versionRequirements.length; i++) {
|
||||
const mod = versionRequirements[i]
|
||||
|
||||
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
|
||||
warnings.push(mod.name + ': ' +
|
||||
chalk.red(mod.currentVersion) + ' should be ' +
|
||||
chalk.green(mod.versionRequirement)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (warnings.length) {
|
||||
console.log('')
|
||||
console.log(chalk.yellow('To use this template, you must update following to modules:'))
|
||||
console.log()
|
||||
|
||||
for (let i = 0; i < warnings.length; i++) {
|
||||
const warning = warnings[i]
|
||||
console.log(' ' + warning)
|
||||
}
|
||||
|
||||
console.log()
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue