更新Note

1. 修复购物车,订单和退单后后置任务正确执行
	2. 修复佣金记录金额和详情
	3. 修复管理端 移动应用界面下订单管理数据统计不准确的问题
	4. 修复短信API升级-后台使用一号通
	5. 修复用户管理相关问题
	6. 修复核销点核销后核销地址不准确
	7. 修复资源同步云服务的问题
新增功能
	1. 秒杀
		a. 秒杀时段配置
		b. 秒杀商品维护
	2. 财务管理
		a. 申请提现
		b. 财务记录
			i. 充值记录
			ii. 资金监控
		c. 佣金记录
	3. 普通商品显示该商品正在参加的活动信息[秒杀]
This commit is contained in:
stivepeim
2020-11-05 16:21:06 +08:00
parent 912cf6403e
commit 6827148d7a
574 changed files with 45105 additions and 4899 deletions

View File

@@ -0,0 +1,49 @@
package com.utils;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* ArrayUtil
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB赋能开发者助力企业发展 ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
*/
public class ArrayUtil {
/**
* List去重不打乱原来顺序泛型list对象
* 对象重写hashCode和equals
* @param <T>
* @param list
* @return
*/
public static <T> List<T> distinctBySetOrder(List<T> list){
Set<T> set = new HashSet<T>();
List<T> newList = new ArrayList<T>();
for(T t: list){
if(set.add(t)){
newList.add(t);
}
}
return newList;
}
/**
* List去重可能打乱原来顺序泛型list对象
* 对象重写hashCode和equals
* @param list
* @return
*/
public static <T> List<T> distinctBySet(List<T> list){
return new ArrayList<T>(new HashSet<T>(list));
}
}

View File

@@ -15,17 +15,22 @@ import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.security.Key;
import java.security.Security;
import java.text.NumberFormat;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @author stivepeim
* @title: CrmebUtil
* @projectName crmeb
* @Description: 工具类
* @since 2020/4/1414:37
* Crmeb工具类
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB赋能开发者助力企业发展 ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
*/
public class CrmebUtil {
@@ -201,7 +206,7 @@ public class CrmebUtil {
List<String> strings = stringToArrayStrRegex(str, ",");
List<Integer> ids = new ArrayList<>();
for (String string : strings) {
ids.add(Integer.parseInt(string));
ids.add(Integer.parseInt(string.trim()));
}
return ids;
}
@@ -762,4 +767,36 @@ public class CrmebUtil {
return list;
}
/**
* 百分比计算
* @param detailTotalNumber 销售量
* @param totalNumber 限量库存
* @return 百分比
*/
public static String percentInstance(Integer detailTotalNumber, Integer totalNumber) {
Double bfTotalNumber = Double.valueOf(detailTotalNumber);
Double zcTotalNumber = Double.valueOf(totalNumber);
double percent = bfTotalNumber/zcTotalNumber;
//获取格式化对象
NumberFormat nt = NumberFormat.getPercentInstance();
//设置百分数精确度2即保留两位小数
nt.setMinimumFractionDigits(2);
return nt.format(percent);
}
/**
* 百分比计算
* @param detailTotalNumber 销售量
* @param totalNumber 限量库存
* @return 百分比
*/
public static int percentInstanceIntVal(Integer detailTotalNumber, Integer totalNumber) {
Double bfTotalNumber = Double.valueOf(detailTotalNumber);
Double zcTotalNumber = Double.valueOf(totalNumber);
double percent = bfTotalNumber/zcTotalNumber;
double pec = percent * 100;
return (int)pec;
}
}

View File

@@ -14,10 +14,17 @@ import java.util.Calendar;
import java.util.Date;
import java.util.List;
/** excel操作类
* @author Mr.zhang
* @Description 日期时间类
* @since 2020-04-17
/**
* Date工具类
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB赋能开发者助力企业发展 ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
**/
public final class DateUtil {
@@ -298,7 +305,12 @@ public final class DateUtil {
}
}
/**
* 计算两个时间之间的天数差
* @param beforeDay 开始时间
* @param afterDay 结束时间
* @return 相差天数
*/
public static long getTwoDateDays(Date beforeDay, Date afterDay) {
SimpleDateFormat sm = new SimpleDateFormat(Constants.DATE_FORMAT_NUM);
long days = -1;
@@ -484,6 +496,11 @@ public final class DateUtil {
}
startTime = list.get(0);
endTime = list.get(1);
if (startTime.equals(endTime)) {
startTime = DateUtil.appointedDayStrToFormatStr(startTime, Constants.DATE_FORMAT_DATE, Constants.DATE_FORMAT_START);
endTime = DateUtil.appointedDayStrToFormatStr(endTime, Constants.DATE_FORMAT_DATE, Constants.DATE_FORMAT_END);
}
break;
}
}
@@ -542,4 +559,26 @@ public final class DateUtil {
return Integer.parseInt(String.valueOf(between_days));
}
/**
* 获取指定日期指定格式字符串
*
* @param dateStr
* @param DATE_FORMAT
* @return
* @throws ParseException
*/
public static String appointedDayStrToFormatStr(String dateStr, String STR_DATE_FORMAT, String DATE_FORMAT) {
Date date = DateUtil.strToDate(dateStr, STR_DATE_FORMAT);
return DateUtil.dateToStr(date, DATE_FORMAT);
}
/**
* 获取当前时间小时
* @return 当前时间小时 默认24小时
*/
public static int getCurrentHour(){
int hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
return hour;
}
}

View File

@@ -31,8 +31,15 @@ import java.util.stream.Collectors;
import java.util.stream.Stream;
/** excel操作类
* @author Mr.zhang
* @since 2020-04-17
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB赋能开发者助力企业发展 ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
**/
public class ExcelUtil {
private final static Logger log = LoggerFactory.getLogger(ExcelUtil.class);
@@ -351,4 +358,4 @@ public class ExcelUtil {
e.printStackTrace();
}
}
}
}

View File

@@ -15,6 +15,18 @@ import java.net.URL;
import java.net.URLConnection;
import java.util.List;
/**
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB赋能开发者助力企业发展 ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
* 图片工具类
*/
@Data
@Component
public class ImageMergeUtil {
@@ -137,4 +149,4 @@ public class ImageMergeUtil {
return null;
}
}
}

View File

@@ -7,8 +7,16 @@ import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
/**
* 汉字转换为拼音
* @author Red
* 汉字拼音转换类
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB赋能开发者助力企业发展 ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
*/
public class PinYinUtil {
/**

View File

@@ -18,9 +18,16 @@ import java.io.IOException;
import java.util.HashMap;
/**
* @description:
* @author: Administrator
* @date: 2019-03-18 10:40
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB赋能开发者助力企业发展 ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
* 二维码工具
*/
@Component
public class QRCodeUtil {
@@ -59,4 +66,4 @@ public class QRCodeUtil {
}
return null;
}
}
}

View File

@@ -10,9 +10,16 @@ import java.util.Set;
import java.util.concurrent.TimeUnit;
/**
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB赋能开发者助力企业发展 ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
* redis工具类
* @author Mr.Zhang
* @since 2020-04-13
*/
@Component

View File

@@ -11,6 +11,18 @@ import java.util.HashMap;
import java.util.List;
import java.util.Objects;
/**
* Request工具类
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB赋能开发者助力企业发展 ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
*/
public class RequestUtil extends HttpServlet{
public static HttpServletRequest getRequest() {
if(RequestContextHolder.getRequestAttributes() != null){

View File

@@ -1,5 +1,6 @@
package com.utils;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.*;
@@ -10,14 +11,22 @@ import org.springframework.web.client.RestTemplate;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB赋能开发者助力企业发展 ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
* httpClient 工具类
* @author Mr.Zhang
* @since 2020-04-13
*/
@Component
@@ -314,4 +323,25 @@ public class RestTemplateUtil {
public byte[] getBuffer(String url) {
return restTemplate.getForEntity(url, byte[].class).getBody();
}
/**
* post——from-urlencoded格式请求
*/
public String postFromUrlencoded(String url, MultiValueMap<String, Object> params, Map<String, String> header) {
HttpHeaders headers = new HttpHeaders();
headers.add("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36");
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
if (CollUtil.isNotEmpty(header)) {
for (Map.Entry<String, String> entry : header.entrySet()) {
headers.add(entry.getKey(), entry.getValue());
}
}
HttpEntity<MultiValueMap<String, Object>> requestEntity =
new HttpEntity<>(params, headers);
String body = restTemplate.postForEntity( url, requestEntity, String.class).getBody();
return body;
}
}

View File

@@ -5,6 +5,18 @@ import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
* Spring 工具类
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB赋能开发者助力企业发展 ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
*/
@Component
public class SpringUtil implements ApplicationContextAware {
private static ApplicationContext applicationContext;

View File

@@ -1,9 +1,16 @@
package com.utils;
/**
* Created on 2019/9/7.
*
* @author MaXiaolong
* ThreadLocalUtil
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB赋能开发者助力企业发展 ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
*/
import java.util.*;

View File

@@ -15,10 +15,16 @@ import java.util.List;
/**
* 上传工具类
* @author Mr.Zhang
* @since 2020-05-08
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB赋能开发者助力企业发展 ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
*/
public class UploadUtil {
private static UploadUtil uploadUtil = new UploadUtil();

View File

@@ -4,7 +4,6 @@ package com.utils;
import com.alibaba.fastjson.JSONObject;
import com.exception.CrmebException;
import org.apache.http.HttpEntity;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
@@ -13,7 +12,6 @@ import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -21,7 +19,15 @@ import java.io.InputStream;
/**
* http通用工具类
*
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB赋能开发者助力企业发展 ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
*/
public class UploadWeChatMediaUtil {
/**

View File

@@ -5,6 +5,15 @@ import java.util.Map;
/**
* url 工具类
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB赋能开发者助力企业发展 ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
*/
public class UrlUtil {
public static class UrlEntity {

View File

@@ -14,8 +14,15 @@ import java.util.Random;
/**
* 验证码生成工具类
* @author Mr.Zhang
* @since 2020-04-16
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB赋能开发者助力企业发展 ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
*/
@Component
public class ValidateCodeUtil {
@@ -36,7 +43,7 @@ public class ValidateCodeUtil {
private ValidateCodeUtil() {
super();
}
/**
* 获取随机字符
* @author Mr.Zhang
@@ -197,4 +204,4 @@ public class ValidateCodeUtil {
}
}
}
}

View File

@@ -8,11 +8,18 @@ import org.apache.commons.lang3.StringUtils;
import java.util.*;
import java.util.regex.Pattern;
/** 表单验证类
* @author Mr.zhang
* @Description 表单验证类
* @since 2020-05-11
**/
/**
* 表单验证类
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB赋能开发者助力企业发展 ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
*/
public class ValidateFormUtil {
/**
* 检测类型

View File

@@ -18,6 +18,18 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* XML 工具类
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB赋能开发者助力企业发展 ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
*/
public class XmlUtil {
public static Map<String,String> xmlToMap(HttpServletRequest request)
{

View File

@@ -8,8 +8,15 @@ import javax.validation.constraints.NotBlank;
/**
* 图片合成详情
* @author Mr.Zhang
* @since 2020-04-18
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB赋能开发者助力企业发展 ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
*/
@Data
public class ImageMergeUtilVo {

View File

@@ -3,11 +3,16 @@ package com.utils.vo;
import lombok.Data;
/**
* @author stivepeim
* @title: dateLimitVoUtil
* @projectName crmeb
* @Description: 工具类
* @since 2020/4/1414:37
* 时间Vo类
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB赋能开发者助力企业发展 ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
*/
@Data
public class dateLimitUtilVo {