提交 6ea140cb 作者: 张小凤

Coupon(add)

上级 dcabd811
......@@ -18,10 +18,46 @@
</properties>
<dependencies>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-base</artifactId>
<version>4.1.0</version>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-web</artifactId>
<version>4.1.0</version>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-annotation</artifactId>
<version>4.1.0</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.15</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel-core</artifactId>
<version>3.1.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel-core</artifactId>
<version>3.1.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
......
package com.mmc.oms.common;
import com.alibaba.fastjson.JSONArray;
import com.mmc.oms.jwt.JwtConstant;
import com.mmc.oms.jwt.JwtUtil;
import com.mmc.oms.model.dto.BaseAccountDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.*;
import java.util.concurrent.TimeUnit;
/**
* @Author small
* @Date 2023/5/24 15:59
* @Version 1.0
*/
@Component
public class AuthHandler {
@Autowired
private StringRedisTemplate stringRedisTemplate;
/**
* 获取当前用户
*
* @param request
* @return
*/
// public CurrentUserDTO getCurrentUser(HttpServletRequest request) {
// // 登录未做好-统一通过此方法获取当前用户信息
// Integer id = Integer.parseInt(request.getHeader(JwtConstant.USERIDKEY).toString());
// Integer roleId = Integer.parseInt(request.getHeader(JwtConstant.ROLEIDKEY).toString());
// return CurrentUserDTO.builder().id(id).roleId(roleId).build();
// }
/**
* 获取当前登录账号信息
*/
public BaseAccountDTO getCurrentAccount(String token) {
// 获取登录的基本信息
String json = stringRedisTemplate.opsForValue().get(token);
if (StringUtils.isEmpty(json)) {
throw new BizException(ResultEnum.LOGIN_ACCOUNT_STATUS_ERROR);
}
BaseAccountDTO account = JsonUtil.parseJsonToObj(json, BaseAccountDTO.class);
// 如果是PC管理端-获取部门缓存信息
if (JwtConstant.SXTB_ACCOUNT_TOKEN.equals(account.getTokenPort())) {
account.getCompanyInfo().setCompanys(this.getCompanys(account.getCompanyInfo().getId()));
}
return account;
}
public String addLoginCache(Integer userId, Integer roleId, String tokenType, BaseAccountDTO loginInfo) {
Map<String, Object> map = new HashMap<String, Object>();
map.put(JwtConstant.USERIDKEY, userId);
map.put(JwtConstant.ROLEIDKEY, roleId);
map.put(JwtConstant.TOKEN_TYPE, tokenType);
String token = JwtUtil.createJwt(map);
loginInfo.setTokenPort(tokenType);
// 缓存登录token-jwt
stringRedisTemplate.opsForValue().set(
RedisConstant.createLoginTokenKey(tokenType, roleId.toString(), userId.toString()), token,
JwtConstant.EXPIRATION, TimeUnit.MILLISECONDS);
// 平台PC管理端登录保存-单位的id及无限下级id集合
if (JwtConstant.SXTB_ACCOUNT_TOKEN.equals(tokenType)) {
if (loginInfo.getCompanyInfo() != null && !CollectionUtils.isEmpty(loginInfo.getCompanyInfo().getCompanys())) {
List<Integer> companys = loginInfo.getCompanyInfo().getCompanys();
this.refreshCompanys(companys, loginInfo.getCompanyInfo().getId());
// 置为null--省内存
loginInfo.getCompanyInfo().setCompanys(null);
}
}
// 缓存登录对象
stringRedisTemplate.opsForValue().set(token, JsonUtil.parseObjToJson(loginInfo), JwtConstant.EXPIRATION,
TimeUnit.MILLISECONDS);
return token;
}
/**
* 更新单位缓存
*
* @param companys
* @param companyId
*/
public void refreshCompanys(List<Integer> companys, Integer companyId) {
String key = RedisConstant.getCompanyChildKey(companyId);
stringRedisTemplate.opsForValue().set(
key, JsonUtil.parseObjToJson(companys),
JwtConstant.EXPIRATION, TimeUnit.MILLISECONDS);
}
public List<Integer> getCompanys(Integer companyId) {
String key = RedisConstant.getCompanyChildKey(companyId);
if (stringRedisTemplate.hasKey(key)) {
String json = stringRedisTemplate.opsForValue().get(key);
if(!StringUtils.isEmpty(json)) {
List<Integer> list = JSONArray.parseArray(json, Integer.class);
return list;
}
}
return new ArrayList<Integer>();
}
public void updateLoginCache(String token, BaseAccountDTO loginInfo) {
stringRedisTemplate.opsForValue().set(token, JsonUtil.parseObjToJson(loginInfo), JwtConstant.EXPIRATION,
TimeUnit.MILLISECONDS);
}
/**
* 检验缓存token是否存在
*
* @param token
* @return
*/
public boolean hasToken(String token) {
return stringRedisTemplate.hasKey(token);
}
/**
* 检验token是否进了失效名单 && 检验token是否为最新token
*
* @param token
* @return
*/
public boolean isDisableToken(String token) {
List<String> disableTokens = stringRedisTemplate.opsForList().range(RedisConstant.DISABLE_TOKEN_LIST, 0, -1);// 需要强制失效的token
return (!CollectionUtils.isEmpty(disableTokens) && disableTokens.contains(token));
}
/**
* 检测是否为最新的token
*
* @param userId
* @param roleId
* @param tokenType
*/
public boolean isLatestToken(String userId, String roleId, String tokenType, String token) {
String key = RedisConstant.createLoginTokenKey(tokenType, roleId, userId);
return (token.equals(stringRedisTemplate.opsForValue().get(key)));
}
public String getUserToken(Integer userAccountId, Integer roleId, String tokenType) {
String token = stringRedisTemplate.opsForValue()
.get(RedisConstant.createLoginTokenKey(tokenType, roleId.toString(), userAccountId.toString()));// 查询他的token
return token;
}
public void disableOneToken(Integer userAccountId, Integer roleId, String tokenType) {
String token = this.getUserToken(userAccountId, roleId, tokenType);// 查询他的token
if (!StringUtils.isEmpty(token)) {
stringRedisTemplate.opsForList().leftPush(RedisConstant.DISABLE_TOKEN_LIST, token);// 加入token失效列表
}
String cacheLoginKey = RedisConstant.createLoginCacheKey(tokenType, userAccountId);
stringRedisTemplate.delete(cacheLoginKey);// 删除登录信息
}
public void disableListToken(List<Integer> userAccountIds, Integer roleId, String tokenType) {
Set<String> tokenKeyList = stringRedisTemplate
.keys(RedisConstant.tokenPreFix(tokenType, roleId.toString()) + "*");// 模糊查询所有key
if (!CollectionUtils.isEmpty(tokenKeyList)) {
List<String> tokenList = stringRedisTemplate.opsForValue().multiGet(tokenKeyList);
stringRedisTemplate.opsForList().leftPushAll(RedisConstant.DISABLE_TOKEN_LIST, tokenList);
}
userAccountIds.forEach(id -> {
String cacheLoginKey = RedisConstant.createLoginCacheKey(tokenType, id);
stringRedisTemplate.delete(cacheLoginKey);
});
}
}
package com.mmc.oms.common;
/**
* @Author small
* @Date 2023/5/24 13:36
* @Version 1.0
*/
public interface BaseErrorInfoInterface {
/**
* 错误码
*
* @return
*/
String getResultCode();
/**
* 错误描述
*
* @return
*/
String getResultMsg();
}
package com.mmc.oms.common;
import static com.mmc.oms.common.ResultEnum.CUSTOM_ERROR;
/**
* @Author small
* @Date 2023/5/24 16:00
* @Version 1.0
*/
public class BizException extends RuntimeException {
private static final long serialVersionUID = 1L;
/**
* 错误码
*/
protected String errorCode;
/**
* 错误信息
*/
protected String errorMsg;
public BizException() {
super();
}
public BizException(BaseErrorInfoInterface errorInfoInterface) {
super(errorInfoInterface.getResultCode());
this.errorCode = errorInfoInterface.getResultCode();
this.errorMsg = errorInfoInterface.getResultMsg();
}
public BizException(BaseErrorInfoInterface errorInfoInterface, Throwable cause) {
super(errorInfoInterface.getResultCode(), cause);
this.errorCode = errorInfoInterface.getResultCode();
this.errorMsg = errorInfoInterface.getResultMsg();
}
public BizException(ResultEnum enums) {
super(enums.getResultCode());
this.errorCode = enums.getResultCode();
this.errorMsg = enums.getResultMsg();
}
public BizException(String errorMsg) {
super(errorMsg);
this.errorCode = CUSTOM_ERROR.resultCode;
this.errorMsg = errorMsg;
}
public BizException(String errorCode, String errorMsg) {
super(errorCode);
this.errorCode = errorCode;
this.errorMsg = errorMsg;
}
public BizException(String errorCode, String errorMsg, Throwable cause) {
super(errorCode, cause);
this.errorCode = errorCode;
this.errorMsg = errorMsg;
}
public String getErrorCode() {
return errorCode;
}
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
@Override
public String getMessage() {
return errorMsg;
}
@Override
public Throwable fillInStackTrace() {
return this;
}
}
package com.mmc.oms.common;
import java.util.Random;
/**
* @Author small
* @Date 2023/5/24 16:02
* @Version 1.0
*/
public class CodeUtil {
private static Random random = new Random();
// 数据生成有位数字或字母的随机数
public static String randomCode(int num) {
// 0-61 9 9+26=35 35+26 =61 65-90 97-122
StringBuffer sb = new StringBuffer();
for (int i = 0; i < num; i++) {
int y = random.nextInt(62);
if (y <= 9) {
// 数值
sb.append(y);
} else {
if (y <= 35) {
// 大写字母
y += 55;
} else {
// 小写字母
y += 61;
}
sb.append((char) y);
}
}
return sb.toString();
}
/**
* 生成随机数字
*
* @param length[生成随机数的长度]
* @return
*/
public static String getRandomNum(int length) {
StringBuffer sb = new StringBuffer();
Random random = new Random();
for (int i = 0; i < length; i++) {
sb.append(String.valueOf(random.nextInt(10)));
}
return sb.toString();
}
/**
* 生成用户uid
*
* @return
*/
public static String createUserUID() {
return "UID" + CodeUtil.getRandomNum(7);
}
/**
* 生成-现金流水账目no
*/
public static String createPayCashNO() {
StringBuffer sb = new StringBuffer();
sb.append("T");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmm"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 生成-信用流水账目no
*/
public static String createPayCreditNo() {
StringBuffer sb = new StringBuffer();
sb.append("T");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmm"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 生成-飞手工资流水账目no
*/
public static String createPayWagNo() {
StringBuffer sb = new StringBuffer();
sb.append("T");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmm"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 生成订单no
*/
public static String createOrderTaskNO() {
StringBuffer sb = new StringBuffer();
sb.append("D");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmm"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 生成-信用返利账目no
*/
public static String createPayRebateNo() {
StringBuffer sb = new StringBuffer();
sb.append("T");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmm"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 生成行业no
*/
public static String createIndustryNO() {
StringBuffer sb = new StringBuffer();
sb.append("HY");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmm"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 生成服务no
*/
public static String createInspectionNO() {
StringBuffer sb = new StringBuffer();
sb.append("FW");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmm"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 生成服务no
*/
public static String createRoleNo() {
StringBuffer sb = new StringBuffer();
sb.append("JS");
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 生成商品编号
*
* @return
*/
public static String createWareID() {
return "ID" + CodeUtil.getRandomNum(10);
}
/**
* 生成云仓订单编号
*/
public static String createRepoOrderNo() {
StringBuffer sb = new StringBuffer();
sb.append("R");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmm"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 云仓现金流水
*/
public static String createRepoCashNo() {
StringBuffer sb = new StringBuffer();
sb.append("J");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmm"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 生成商品编号
*
* @return
*/
public static String createDeviceCode() {
return "DC" + CodeUtil.getRandomNum(6);
}
/**
* 云仓现金流水
*/
public static String createOrderRefund() {
StringBuffer sb = new StringBuffer();
sb.append("RD");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmm"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 返祖订单号
*/
public static String createShareOrderNo() {
StringBuffer sb = new StringBuffer();
sb.append("GX");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmm"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 型号编号
*/
public static String createDeviceModelNo() {
return "DM" + CodeUtil.getRandomNum(8);
}
/**
* 仓库编号
*/
public static String createRepoNo() {
return "RN" + CodeUtil.getRandomNum(8);
}
public static String uavOrderCode(Long id) {
StringBuffer sb = new StringBuffer();
sb.append("UD");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmmss"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 活动编号
*/
public static String generateActivityNo() {
return "AC" + CodeUtil.getRandomNum(5);
}
}
package com.mmc.oms.common;
/**
* @Author small
* @Date 2023/5/24 14:03
* @Version 1.0
*/
public class CouponConstants {
/**
* --------优惠券常量------------
*/
/** 优惠券类型—打折券 */
public static final Integer COUPON_TYPE_DISCOUNT = 1;
/** 优惠券类型—减免券 */
public static final Integer COUPON_TYPE_REDUCED = 2;
/** 优惠券类型—无门槛 */
public static final Integer COUPON_TYPE_NO_THRESHOLD = 3;
/** 优惠券使用类型—vip */
public static final Integer COUPON_USR_TYPE_VIP = 1;
/** 优惠券使用类型—品牌券 */
public static final Integer COUPON_USR_TYPE_BRAND = 2;
/** 优惠券有效期时间方式-固定时间 */
public static final Integer COUPON_USE_TIME_FIXED = 0;
/** 优惠券有效期时间方式-领取当日起 */
public static final Integer COUPON_USE_TIME_THE_DAY = 1;
/** 优惠券有效期时间方式-领取次日起 */
public static final Integer COUPON_USE_TIME_NEXT_DAY = 2;
/** 优惠券发放方式—手动领取 */
public static final Integer COUPON_ISSUE_TYPE_RECEIVE = 1;
/** 优惠券发放方式—系统发放 */
public static final Integer COUPON_ISSUE_TYPE_INITIATIVE =2;
/** 优惠券发放方式—批量导入用户 */
public static final Integer COUPON_ISSUE_TYPE_IMPORT = 3;
/** 优惠券使用类型—活动裂变券 */
public static final Integer COUPON_USR_TYPE_ACTIVITY = 4;
/** 用户标签-新人 */
public static final Integer USER_LABEL_NEW_PEOPLE = 1;
/** 用户标签-实名认证 */
public static final Integer USER_LABEL_REAL_NAME_AUTHENTICATION = 2;
/** 用户标签-企业认证 */
public static final Integer USER_LABEL_ENTERPRISE_CERTIFICATION = 3;
/**
* --------用户优惠券常量----------------
*/
/** 用户优惠券获取方式—用户领取 */
public static final String STORE_COUPON_USER_TYPE_GET = "receive";
/** 用户优惠券获取方式—后台发放 */
public static final String STORE_COUPON_USER_TYPE_SEND = "send";
/** 用户优惠券获取方式—赠送 */
public static final String STORE_COUPON_USER_TYPE_PRESENTED = "presented";
/** 用户优惠券获取方式—获赠 */
public static final String STORE_COUPON_USER_TYPE_ACQUIRE = "acquire";
/** 用户优惠券获取方式—兑换 */
public static final String STORE_COUPON_USER_TYPE_EXCHANGE = "exchange";
/** 用户优惠券获取方式—活动领取 */
public static final String STORE_COUPON_USER_TYPE_ACTIVITY = "activity";
/** 用户优惠券状态—未使用 */
public static final Integer STORE_COUPON_USER_STATUS_USABLE = 0;
/** 用户优惠券状态—已使用 */
public static final Integer STORE_COUPON_USER_STATUS_USED = 1;
/** 用户优惠券状态—已失效 */
public static final Integer STORE_COUPON_USER_STATUS_LAPSED = 2;
/** 用户优惠券状态—已转赠 */
public static final Integer STORE_COUPON_USER_STATUS_PRESENTED = 3;
/** 用户优惠券状态—使用中 */
public static final Integer STORE_COUPON_USER_STATUS_IN_USE = 4;
}
package com.mmc.oms.common;
/**
* @Author small
* @Date 2023/5/24 16:11
* @Version 1.0
*/
public interface CouponType {
//打折券
public static final Integer DISCOUNT_COUPONS=1;
//减免卷
public static final Integer REDUCTION_ROLLS=2;
//无门槛
public static final Integer NO_THRESHOLD=3;
}
package com.mmc.oms.common;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small
* @Date 2023/5/24 15:23
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@ExcelTarget("couponUserExcel")
public class CouponUserExcel implements Serializable {
private static final long serialVersionUID=1L;
@Excel(name = "优惠券id", orderNum = "1", width = 25)
private Integer couponId;
@Excel(name = "领取人id", orderNum = "2", width = 25)
private Integer uid;
@Excel(name = "领取人手机号码", orderNum = "3", width = 25)
private String userPhone;
@Excel(name = "优惠券名称", orderNum = "4", width = 25)
private String couponName;
@Excel(name = "获取方式", orderNum = "5", width = 25)
private String gainType;
@Excel(name = "状态", orderNum = "6", width = 25)
private String status;
@Excel(name = "领取时间", orderNum = "7", width = 25, databaseFormat = "yyyyMMddHHmmss", format = "yyyy-MM-dd hh:mm:ss", isImportField = "true_st", timezone = "Asia/Shanghai")
private Date createTime;
@Excel(name = "使用时间", orderNum = "8", width = 25, databaseFormat = "yyyyMMddHHmmss", format = "yyyy-MM-dd hh:mm:ss", isImportField = "true_st", timezone = "Asia/Shanghai")
private Date useTime;
@Excel(name = "订单编码", orderNum = "9", width = 25)
private String orderNo;
}
package com.mmc.oms.common;
/**
* @Author small
* @Date 2023/5/24 15:26
* @Version 1.0
*/
public interface Create {
}
package com.mmc.oms.common;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import java.util.ArrayList;
import java.util.List;
/**
* @Author small
* @Date 2023/5/24 15:37
* @Version 1.0
*/
public final class EasyExcelListener<T> implements ReadListener<T> {
/**
* 缓存的数据
*/
private List<T> cachedDataList = new ArrayList<>();
@Override
@SuppressWarnings("unchecked")
public void invoke(Object object, AnalysisContext analysisContext) {
T map = (T) object;
cachedDataList.add(map);
}
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
}
public List<T> getCachedDataList() {
return cachedDataList;
}
public void setCachedDataList(List<T> cachedDataList){
this.cachedDataList = cachedDataList;
}
}
package com.mmc.oms.common;
/**
* @Author small
* @Date 2023/5/24 15:07
* @Version 1.0
*/
public enum FlyerAccountType {
YK(0, "游客"), PT(1, "普通用户"), GR(2, "个人飞手"), JG(3, "飞手机构");
FlyerAccountType(Integer code, String status) {
this.code = code;
this.status = status;
}
private Integer code;
private String status;
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}
package com.mmc.oms.common;
/**
* @Author small
* @Date 2023/5/24 14:02
* @Version 1.0
*/
public interface Freeze {
}
package com.mmc.oms.common;
/**
* @Author small
* @Date 2023/5/24 14:00
* @Version 1.0
*/
public interface Insert {
}
package com.mmc.oms.common;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import java.io.*;
import java.util.List;
/**
* @Author small
* @Date 2023/5/24 16:01
* @Version 1.0
*/
public class JsonUtil {
public static void main(String[] args) {
String array = "[1,24,23]";
List<Integer> list = JSONArray.parseArray(array, Integer.class);
System.out.println(list.get(2));
}
/**
* 把Java对象转换成json字符串
*
* @param object 待转化为JSON字符串的Java对象
* @return json 串 or null
*/
public static String parseObjToJson(Object object) {
String string = null;
try {
string = JSONObject.toJSONString(object);
} catch (Exception e) {
// LOGGER.error(e.getMessage());
}
return string;
}
/**
* 将Json字符串信息转换成对应的Java对象
*
* @param json json字符串对象
* @param c 对应的类型
*/
public static <T> T parseJsonToObj(String json, Class<T> c) {
try {
JSONObject jsonObject = JSON.parseObject(json);
return JSON.toJavaObject(jsonObject, c);
} catch (Exception e) {
// LOGGER.error(e.getMessage());
}
return null;
}
/**
* 读取json文件
*
* @param fileName
* @return
*/
public static String readJsonFile(String fileName) {
String jsonStr = "";
try {
File jsonFile = new File(fileName);
FileReader fileReader = new FileReader(jsonFile);
Reader reader = new InputStreamReader(new FileInputStream(jsonFile), "utf-8");
int ch = 0;
StringBuffer sb = new StringBuffer();
while ((ch = reader.read()) != -1) {
sb.append((char) ch);
}
fileReader.close();
reader.close();
jsonStr = sb.toString();
return jsonStr;
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
/**
* 将JSON数据格式化并保存到文件中
*
* @param jsonData 需要输出的json数
* @param filePath 输出的文件地址
* @return
*/
public static boolean createJsonFile(Object jsonData, String filePath) {
String content = JSON.toJSONString(jsonData, SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue,
SerializerFeature.WriteDateUseDateFormat);
// 标记文件生成是否成功
boolean flag = true;
// 生成json格式文件
try {
// 保证创建一个新文件
File file = new File(filePath);
if (!file.getParentFile().exists()) { // 如果父目录不存在,创建父目录
file.getParentFile().mkdirs();
}
if (file.exists()) { // 如果已存在,删除旧文件
file.delete();
}
file.createNewFile();
// 将格式化后的字符串写入文件
Writer write = new OutputStreamWriter(new FileOutputStream(file), "UTF-8");
write.write(content);
write.flush();
write.close();
} catch (Exception e) {
flag = false;
e.printStackTrace();
}
return flag;
}
}
package com.mmc.oms.common;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small
* @Date 2023/5/24 16:14
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MsgData implements Serializable {
private static final long serialVersionUID = 1479503488297727536L;
private String value;
private String color = "#173177";// 字体颜色
}
package com.mmc.oms.common;
/**
* @Author small
* @Date 2023/5/24 14:31
* @Version 1.0
*/
public interface Others {
}
package com.mmc.oms.common;
/**
* @Author small
* @Date 2023/5/24 14:01
* @Version 1.0
*/
public interface Page {
}
package com.mmc.oms.common;
import com.mmc.oms.model.qo.BaseInfoQO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small
* @Date 2023/5/24 15:19
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PageResult<T> implements Serializable {
private static final long serialVersionUID = -2848996493573325801L;
private int pageNo;// 分页起始页
private int pageSize;// 每页记录数
private T list;// 返回的记录集合
private long totalCount;// 总记录条数
private long totalPage;// 总页数
public static PageResult buildPage(int pageNo, int pageSize, int totalCount) {
PageResult page = new PageResult();
page.pageNo = pageNo;
page.pageSize = pageSize;
page.totalCount = totalCount;
page.totalPage = (totalCount % pageSize == 0) ? (totalCount / pageSize) : (totalCount / pageSize + 1);
return page;
}
public static <T> PageResult buildPage(int pageNo, int pageSize, int totalCount, T list) {
PageResult page = PageResult.buildPage(pageNo, pageSize, totalCount);
page.setList(list);
return page;
}
public static PageResult buildPage(BaseInfoQO qo, int totalCount) {
PageResult page = new PageResult();
page.pageNo = qo.getPageNo();
Integer pageSize = qo.getPageSize();
page.pageSize = pageSize;
page.totalCount = totalCount;
page.totalPage = (totalCount % pageSize == 0) ? (totalCount / pageSize) : (totalCount / pageSize + 1);
return page;
}
}
package com.mmc.oms.common;
/**
* @Author small
* @Date 2023/5/24 14:08
* @Version 1.0
*/
public interface Query {
}
package com.mmc.oms.common;
/**
* @Author small
* @Date 2023/5/24 16:03
* @Version 1.0
*/
public class RedisConstant {
/**
* 验证码-key
*/
public final static String VERIFYCODEKEY = "verifyCode";
/**
* 电话号码-key
*/
public final static String PHONENUMKEY = "phoneNum";
/**
* 当天用户量统计-key
*/
public final static String ACTIVE_USER_TOTAL_COUNT_TODAY = "active_user_total_count_today";
/**
* 后台-当天用户量统计-key
*/
public final static String ADMIN_ACTIVE_COUNT_TODAY = "admin_active_count_today";
/**
* 云享飞-当天用户量统计-key
*/
public final static String YXF_ACTIVE_COUNT_TODAY = "yxf_active_count_today";
/**
* 云飞手-当天用户量统计-key
*/
public final static String YFS_ACTIVE_COUNT_TODAY = "yfs_active_count_today";
/**
* 云仓-当天用户量统计-key
*/
public final static String YC_ACTIVE_COUNT_TODAY = "yc_active_count_today";
/**
* 登录信息token前缀
*/
public final static String LOGING_TOKEN_BEFORE = "CLOUD-SHARED-FLIGHT-USERID@";
/**
* token黑名单-key
*
* @param userId
* @return
*/
/**
* 实名认证 redis 的键
*/
public final static String REALNAMEREDISKEY = "realName";
/**
* token失效
*/
public final static String DISABLE_TOKEN = "DISABLE-TOKEN";
/**
* 分片上传的key
*
* @param userId
* @return
*/
public final static String PART_UPLOAD = "UPLOAD_PART_";
/**
* 飞手端-假数据-分页信息-可以
*/
public final static String FLYER_DUMMY_DATA_PAGE = "FLYER_DUMMY_DATA_PAGE";
/**
* token失效列表的key
*/
public final static String DISABLE_TOKEN_LIST = "DISABLE_TOKEN_LIST";
/**
* 无人机城的订单状态
*/
public final static String UAV_MALL_ORDER_STATUS = "UAV_MALL_ORDER_STATUS";
/**
* 无人机城的快递公司编码
*/
public final static String UAV_MALL_EXP_COM = "UAV_MALL_EXP_COM";
/**
* 无人机城的快递状态码
*/
public final static String UAV_MALL_EXP_STATUS = "UAV_MALL_EXP_STATUS";
/**
* 微信access_token
*
* @param userId
* @return
*/
public final static String WX_ACCESS_TOKEN_BEFORE = "WX_ACCESS_TOKEN_";
public final static String REPO_SEND_PAY_MESSAGE = "REPO_ORDER_REMIND_PAY_";
public final static String FLYER_PUBLIC_DEFAULT_NAME = "FLYER_PUBLIC_DEFAULT_NAME";
public final static String EVALUATION = "EVALUATION";
public final static String FLYER_DUMMY_DATA="FLYER_DUMMY_DATA_KEY";
public final static String UAV_DUMMY_DATA="UAV_DUMMY_DATA_KEY";
/**
* tagInfoAllot表的缓存key
*/
public final static String TAGINFOALLOT_QUESTALL = "csf-service-system:tagInfoAllot:questAll";
public static String getDisableTokenKey(String accountId, String roleId, String tokenType) {
StringBuffer key = new StringBuffer();
key.append(RedisConstant.DISABLE_TOKEN);
key.append("_ROLE_");
key.append(roleId);
key.append("_");
key.append(accountId);
return key.toString();
}
/**
* 生成唯一的分片上传key
*
* @param uploadId
* @return
*/
public static String createPartUploadKey(String uploadId) {
StringBuffer key = new StringBuffer();
key.append(uploadId);
return key.toString();
}
/**
* 生成微信api的access_token的key
*/
public static String createWxToken(String wxAppid) {
StringBuffer key = new StringBuffer();
key.append(RedisConstant.WX_ACCESS_TOKEN_BEFORE);
key.append(wxAppid);
return key.toString();
}
/**
* 表单重复提交key
*/
public static String createRepeatKey(String token, String url, String params) {
StringBuffer key = new StringBuffer();
key.append(token);
key.append(url);
key.append(params);
return key.toString();
}
public static String createRepeatKey(String token, String url) {
return RedisConstant.createRepeatKey(token, url, "");
}
/**
* 登录缓存信息
*/
public static String createLoginCacheKey(String tokenType, Integer id) {
StringBuffer key = new StringBuffer();
key.append(tokenType);
key.append("_");
key.append(id);
return key.toString();
}
/**
* 每位账号的的token的key的前缀
*/
public static String tokenPreFix(String tokenType, String roleId) {
StringBuffer key = new StringBuffer();
key.append(tokenType);
key.append("_ROLE_");
key.append(roleId);
key.append("_");
return key.toString();
}
/**
* 每位账号的token保存的key
*/
public static String createLoginTokenKey(String tokenType, String roleId, String accountId) {
StringBuffer key = new StringBuffer();
key.append(RedisConstant.tokenPreFix(tokenType, roleId));
key.append(accountId);
return key.toString();
}
public static String createRepoOrderOver(Integer orderInfoId) {
StringBuffer key = new StringBuffer();
key.append(RedisConstant.REPO_SEND_PAY_MESSAGE);
key.append(orderInfoId);
return key.toString();
}
public static String getLockKey(String userId, String tokenType, String path) {
StringBuffer sb = new StringBuffer();
sb.append(userId);
sb.append("_");
sb.append(tokenType);
sb.append("_");
sb.append(path);
return sb.toString();
}
public static String createInspection(Integer id) {
StringBuffer key = new StringBuffer();
key.append(RedisConstant.EVALUATION);
key.append(id);
return key.toString();
}
public static String accessTokenKey(String clientId, Integer roleId, String grantType) {
StringBuilder key = new StringBuilder();
key.append("OAUTH_");
key.append(clientId);
key.append("_");
key.append(roleId);
key.append("_");
key.append(grantType);
return key.toString();
}
public static String getCompanyChildKey(Integer companyId){
StringBuilder key = new StringBuilder();
key.append("company_cache:");
key.append(companyId);
return key.toString();
}
public static String getXEAccessTokenKey(){
StringBuilder key = new StringBuilder();
key.append("XE_ACCESS_TOKEN");
return key.toString();
}
}
package com.mmc.oms.common;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small
* @Date 2023/5/24 13:36
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiModel(value = "com.mmc.result.ResultBody", description = "请求响应体")
public class ResultBody<T> implements Serializable {
private static final long serialVersionUID = 6341937455634693363L;
/**
* 响应代码
*/
@ApiModelProperty(value = "响应代码")
private String code;
/**
* 响应消息
*/
@ApiModelProperty(value = "响应消息")
private String message;
/**
* 响应结果
*/
@ApiModelProperty(value = "响应结果")
private T result;
public ResultBody(BaseErrorInfoInterface errorInfo) {
this.code = errorInfo.getResultCode();
this.message = errorInfo.getResultMsg();
}
/**
* 成功
*
* @return
*/
public static ResultBody success() {
return success(null);
}
/**
* 成功
*
* @param data
* @return
*/
public static <T> ResultBody success(T data) {
ResultBody rb = new ResultBody();
rb.setCode(ResultEnum.SUCCESS.getResultCode());
rb.setMessage(ResultEnum.SUCCESS.getResultMsg());
rb.setResult(data);
return rb;
}
/**
* 成功
*
* **/
public static ResultBody success1(ResultEnum enums){
ResultBody rb = new ResultBody();
rb.setCode("200");
rb.setMessage(enums.getResultMsg());
rb.setResult(null);
return rb;
}
public void buildSuccess() {
this.setCode(ResultEnum.SUCCESS.getResultCode());
this.setMessage(ResultEnum.SUCCESS.getResultMsg());
}
/**
* 失败
*/
public static ResultBody error(BaseErrorInfoInterface errorInfo) {
ResultBody rb = new ResultBody();
rb.setCode(errorInfo.getResultCode());
rb.setMessage(errorInfo.getResultMsg());
rb.setResult(null);
return rb;
}
/**
* 失败
*/
public static ResultBody error(String code, String message) {
ResultBody rb = new ResultBody();
rb.setCode(code);
rb.setMessage(message);
rb.setResult(null);
return rb;
}
/**
* 失败
*/
public static ResultBody error(ResultEnum enums) {
ResultBody rb = new ResultBody();
rb.setCode(enums.getResultCode());
rb.setMessage(enums.getResultMsg());
rb.setResult(null);
return rb;
}
/**
* 失败
*/
public static ResultBody error(String message) {
ResultBody rb = new ResultBody();
rb.setCode("-1");
rb.setMessage(message);
rb.setResult(null);
return rb;
}
/**
* 失败
*/
public static ResultBody error(ResultEnum enums, Object data) {
ResultBody rb = new ResultBody();
rb.setCode(enums.getResultCode());
rb.setMessage(enums.getResultMsg());
rb.setResult(data);
return rb;
}
public static boolean isSuccess(ResultBody res) {
return res.getCode().equals(ResultEnum.SUCCESS.getResultCode());
}
@Override
public String toString() {
return JSONObject.toJSONString(this);
}
}
package com.mmc.oms.common;
/**
* @Author small
* @Date 2023/5/24 14:08
* @Version 1.0
*/
public interface Update {
}
package com.mmc.oms.common;
/**
* @Author small
* @Date 2023/5/24 16:24
* @Version 1.0
*/
public interface WxMsgDataConfig {
/**
* 用户-信息主页-服务通知-跳转路径
*/
public static final String USER_INFO_PATH = "pages/home/index/index";
/**
* 订单相关-服务通知-跳转路径
*/
public static final String ORDER_PATH = "pages/order/index/index";
/**
*云仓订单发货通知跳转地址
*/
public static final String REPO_SHIP_MESSAGE = "pages/order/index";
/**
* 云仓-首页-跳转路径
*/
public static final String REPO_REBATE_PATH = "pages/home/index";
/**
* 云仓-我的-跳转路径
*/
public static final String REPO_MINE_PATH = "pages/mine/index";
/**
* 云仓-我的-跳转路径
*/
public static final String FLYER_MINE_PATH = "pages/mine/index";
/**
* 企业认证-标题
*/
public static final String ENTPRISE_TITLE = "您的企业信息认证审核结果如下:";
/**
* 渠道申请-服务号-标题
*/
public static final String CHANNEL_FW_TITLE = "您的渠道商申请结果如下:";
/**
* 渠道申请-小程序-标题
*/
public static final String CHANNEL_AT_TITLE = "您的渠道商申请结果如下:";
/**
* 实名认证-标题
*/
public static final String REAL_NAME_TITLE = "实名认证";
/**
* 订单-验收通知说明
*/
public static final String ORDER_FINISH_PAY_REMARK = "验收结算完成";
/**
* 用户端-小程序-首页
*/
public static final String USER_APPLET_PAGE_INDEX = "pages/home/index/index";
/**
* 小程序-提现成功-结果
*/
public static final String REBATE_SUCCESS = "提现成功";
/**
* 小程序-提现失败-结果
*/
public static final String REBATE_FAIL = "提现失败";
/**
* 云仓-提现提示语
*/
public static final String REPO_REBATE_TIPS = "您可以通过云仓小程序查询奖励明细";
/**
* 云飞手-提现提示语
*/
public static final String FLYER_REBATE_TIPS = "您可以通过云飞手小程序查询提现明细";
/**
* 云仓渠道通过页面跳转-小程序
*/
public static final String REPO_CHANNEL_PASS_PATH = "pages/mine/index";
/**
* 无人机城-我的-小程序
*/
public static final String M_ORDER_STATUS_CHANGE_PAGE = "pages/mine/index";
/**
* 无人机城-我的-小程序优惠卷详细页面
*/
public static final String M_ORDER_STATUS_COUPON_DETAILS_PAGE = "page-activity/discount-list/index";
}
package com.mmc.oms.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
/**
* @Author small
* @Date 2023/5/24 16:17
* @Version 1.0
*/
@Component
public class FlyerSystemConstant {
public static String AppletFlyerWxAppid;
public static String AppletFlyerSecret;
public static String WXSubAppId;// 微信公众服务号-appid
public static String WXSubSecret;// 微信公众服务号-密钥
public static String MIMIPROGRAMSTATE;
public static String RABBITMQ_EXCHANGE;
public static String WORK_FLYER_INFO_KEY;
public final static String IS_ADMIN_ROLE = "1";// 为系统管理员类型角色
public FlyerSystemConstant(@Value("${wechat.applet.appid}") String appletFlyerWxAppid,
@Value("${wechat.applet.secret}") String appletFlyerSecret,
@Value("${wechat.sub.appid}") String wXSubAppId, @Value("${wechat.sub.secret}") String wXSubSecret,
@Value("${wechat.applet.miniprogram-state}") String miniprogramState,
@Value("${rabbitmq.exchange}") String rabbitExchange,
@Value("${workFlyerInfoKey}") String workFlyerInfoKey) {
AppletFlyerWxAppid = appletFlyerWxAppid;
AppletFlyerSecret = appletFlyerSecret;
WXSubAppId = wXSubAppId;
WXSubSecret = wXSubSecret;
MIMIPROGRAMSTATE = miniprogramState;
RABBITMQ_EXCHANGE = rabbitExchange;
WORK_FLYER_INFO_KEY = workFlyerInfoKey;
}
}
package com.mmc.oms.controller;
import com.mmc.oms.common.AuthHandler;
import com.mmc.oms.jwt.JwtConstant;
import com.mmc.oms.model.dto.BaseAccountDTO;
import com.mmc.oms.model.dto.CurrentUserDTO;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
/**
* @Author small
* @Date 2023/5/24 15:58
* @Version 1.0
*/
public abstract class BaseController {
@Autowired
private AuthHandler authHandler;
/**
* 获取当前用户
*
* @param request
* @return
*/
public CurrentUserDTO getCurrentUser(HttpServletRequest request) {
// 登录未做好-统一通过此方法获取当前用户信息
Integer id = Integer.parseInt(request.getHeader(JwtConstant.USERIDKEY).toString());
Integer roleId = Integer.parseInt(request.getHeader(JwtConstant.ROLEIDKEY).toString());
return CurrentUserDTO.builder().id(id).roleId(roleId).build();
}
/**
* 获取当前登录账号信息
*/
public BaseAccountDTO getCurrentAccount(HttpServletRequest request) {
String token = request.getHeader(JwtConstant.TOKENKEY);
return authHandler.getCurrentAccount(token);
}
}
package com.mmc.oms.controller;
import com.mmc.oms.common.*;
import com.mmc.oms.model.dto.CouponActivityDTO;
import com.mmc.oms.model.dto.CouponDTO;
import com.mmc.oms.model.dto.CouponUserDTO;
import com.mmc.oms.model.dto.CouponViewDTO;
import com.mmc.oms.model.qo.CouponInfoQO;
import com.mmc.oms.model.qo.CouponUserInfoQO;
import com.mmc.oms.model.qo.ProductCouponQO;
import com.mmc.oms.model.vo.CouponInfoActivityVO;
import com.mmc.oms.model.vo.CouponInfoVO;
import com.mmc.oms.service.CouponBackService;
import io.swagger.annotations.*;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
/**
* @Author small
* @Date 2023/5/24 13:28
* @Version 1.0
*/
@RestController
@RequestMapping("/coupon/back")
@Api(tags = {"优惠券管理后台-相关接口"})
public class CouponBackController {
@Resource
private CouponBackService couponBackService;
@ApiOperation(value = "V1.0.1--新增优惠券")
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = CouponDTO.class)})
@PostMapping("/save")
public ResultBody<CouponDTO> saveCouponInfo(@RequestParam(value = "file",required = false) MultipartFile file
, @RequestBody CouponInfoVO couponInfoVO){
return couponBackService.saveCouponBackInfo(couponInfoVO,file);
}
@ApiOperation(value = "V1.0.1--新增裂变优惠券")
@ApiResponses({ @ApiResponse(code = 200, message = "OK")})
@PostMapping("/saveActivity")
public ResultBody saveActivityCouponInfo(@Validated(Insert.class) @RequestBody CouponInfoActivityVO couponInfoActivityVO){
return couponBackService.saveActivityCouponInfo(couponInfoActivityVO);
}
@ApiOperation(value = "V1.0.1--优惠券列表-分页")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CouponDTO.class)})
@PostMapping("/pageList")
public ResultBody pageCouponList(@Validated(Page.class) @RequestBody CouponInfoQO couponInfoQO) {
return couponBackService.pageCouponList(couponInfoQO);
}
@ApiOperation(value = "V1.0.1--裂变优惠券列表-分页")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CouponActivityDTO.class)})
@PostMapping("/pageActivityList")
public ResultBody pageActivityCouponList(@Validated(Page.class) @RequestBody CouponInfoQO couponInfoQO) {
return couponBackService.pageActivityCouponList(couponInfoQO);
}
@ApiOperation(value = "优惠券-下拉")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CouponActivityDTO.class)})
@GetMapping("/getActivityCouponPullDown")
public ResultBody getActivityCouponPullDown(@ApiParam(value = "活动类型: 1裂变活动 2普通活动", required = true)
@RequestParam(required = true, value = "type") Integer type) {
return couponBackService.getActivityCouponPullDown(type);
}
@ApiOperation(value = "V1.0.1--增发优惠券")
@ApiResponses({@ApiResponse(code = 200, message = "OK")})
@PostMapping("/increase")
public ResultBody increaseCoupon(@Validated(Update.class)
@ApiParam(value = "id", required = true)
@RequestParam(required = true, value = "id") Integer id,
@ApiParam(value = "数量", required = true)
@RequestParam(required = true, value = "count") Integer count){
return couponBackService.increaseCouponCount(id, count);
}
@ApiOperation(value = "V1.0.1--关闭优惠券发放")
@ApiResponses({@ApiResponse(code = 200, message = "OK")})
@PostMapping("/shutDown")
public ResultBody shutDown(@Validated(Update.class)
@ApiParam(value = "id", required = true)
@RequestParam(required = true, value = "id") Integer id){
return couponBackService.shutDown(id);
}
@ApiOperation(value = "V1.0.1--获取优惠券使用数据")
@ApiResponses({@ApiResponse(code = 200, message = "OK",response = CouponViewDTO.class)})
@GetMapping("/getData")
public ResultBody getViewData(@Validated(Query.class)
@ApiParam(value = "id", required = true)
@RequestParam(required = true, value = "id") Integer id){
return couponBackService.couponViewData(id);
}
@ApiOperation(value = "V1.0.1--获取优惠券明细列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CouponUserDTO.class)})
@PostMapping("/getUserCouponList")
public ResultBody getCouponUserList(@Validated(Page.class) @RequestBody CouponUserInfoQO couponUserInfoQO){
return couponBackService.getCouponUserList(couponUserInfoQO);
}
@ApiOperation(value = "V1.0.1--优惠券明细列表-导出")
@ApiResponses({@ApiResponse(code = 200, message = "OK")})
@PostMapping("/downloadCouponUserList")
public void downloadCouponUserList(@Validated(value = {Others.class}) @RequestBody CouponUserInfoQO couponUserInfoQO,
HttpServletResponse response){
try {
couponBackService.downloadCouponUserList(response,couponUserInfoQO);
} catch (IOException e) {
e.printStackTrace();
}
}
@ApiOperation(value = "feign-获取优惠券详情",hidden = true)
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CouponDTO.class)})
@GetMapping("/feignByIds")
public List<CouponDTO> feignByIds(@RequestParam List<Integer> ids){
return couponBackService.feignByIds(ids);
}
@ApiOperation(value = "feign-获取裂变优惠券详情",hidden = true)
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CouponActivityDTO.class)})
@GetMapping("/feignGetActivity")
public CouponActivityDTO feignGetCouponActivityById(@RequestParam Integer id) {
return couponBackService.getCouponActivityById(id);
}
@ApiOperation(value = "feign-获取裂变优惠券详情-批量",hidden = true)
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CouponActivityDTO.class)})
@PostMapping("/feignGetActivityList")
public List<CouponActivityDTO> feignGetCouponActivityByList(@RequestBody List<Integer> id) {
return couponBackService.getCouponActivityList(id);
}
@ApiOperation(value = "feign-优惠券定时修改状态",hidden = true)
@ApiResponses({@ApiResponse(code = 200, message = "OK")})
@GetMapping("/feignExpireCoupon")
public void feignExpireCoupon() {
couponBackService.overdueCouponTask();
}
@ApiOperation(value = "feign-根据用户标签获取对应优惠券",hidden = true)
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CouponDTO.class)})
@GetMapping("/feignGetCouponType")
public List<CouponDTO> feignGetCouponType(@RequestParam Integer type) {
return couponBackService.feignGetCouponType(type);
}
@ApiOperation(value = "V2.3.2——商品优惠券普通活动列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CouponDTO.class)})
@PostMapping("/ordinaryActivities")
public ResultBody ordinaryActivities(@Validated(Page.class) @RequestBody ProductCouponQO productCouponQO) {
return couponBackService.ordinaryActivities(productCouponQO);
}
@ApiOperation(value = "V2.3.2——商品优惠券裂变活动列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CouponDTO.class)})
@PostMapping("/fissionActivity")
public ResultBody fissionActivity(@Validated(Page.class) @RequestBody ProductCouponQO productCouponQO) {
return couponBackService.fissionActivity(productCouponQO);
}
}
package com.mmc.oms.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mmc.oms.entity.CouponDO;
import com.mmc.oms.entity.ProductInformationDo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @Author small
* @Date 2023/5/24 14:44
* @Version 1.0
*/
@Mapper
public interface CouponBackDao extends BaseMapper<CouponDO> {
List<CouponDO> selectCouponList(String date, String priority, Integer pageNo, Integer pageSize);
Integer selectCouponCount(String date, String priority);
ProductInformationDo findProduct(Integer goodsInfoId);
List<CouponDO> ordinaryActivities(Integer brandId);
List<CouponDO> fissionActivity(Integer brandId);
}
package com.mmc.oms.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mmc.oms.entity.CouponUsageDetailsDO;
import com.mmc.oms.entity.CouponUserDO;
import com.mmc.oms.entity.GoodsInfoDO;
import com.mmc.oms.model.dto.CouponUserDTO;
import com.mmc.oms.model.qo.CouponUserInfoQO;
import com.mmc.oms.model.vo.CouponUserVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
/**
* @Author small
* @Date 2023/5/24 15:09
* @Version 1.0
*/
@Mapper
public interface CouponUserDao extends BaseMapper<CouponUserDO> {
List<CouponUserDO> selectCouponUserList(String list, Integer uid, String data);
List<CouponUserDTO> selectCouponUserInfoList(CouponUserInfoQO couponUserInfoQO);
Integer selectCouponUserInfoCount(CouponUserInfoQO couponUserInfoQO);
Integer insertCouponUserOrder(CouponUserVO couponUserVO);
List<Long> getOrderList(Integer id);
void batchRemoveByOIds(@Param("orderIds") Set<Long> orderIds);
List<Integer> merchandise(Integer couponId);
List<GoodsInfoDO> couponMerchandise(List<Integer> merchandise,String productName);
List<CouponUsageDetailsDO> couponUsageDetails(Integer uid);
List<GoodsInfoDO> VipCouponMerchandise(String productName);
}
package com.mmc.oms.entity;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
/**
* @Author small
* @Date 2023/5/24 14:48
* @Version 1.0
*/
@Getter
@Setter
@EqualsAndHashCode
public class ChannelCouponDO implements Serializable {
private static final long serialVersionUID = 1L;
private String uid;
private String userPhone;
}
package com.mmc.oms.entity;
import com.mmc.oms.model.dto.CouponUsageDetailsDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author small
* @Date 2023/5/24 15:17
* @Version 1.0
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "优惠券使用明细", description = "优惠券使用明细")
public class CouponUsageDetailsDO {
private static final long serialVersionUID = 6104334488561632747L;
@ApiModelProperty("id编号")
private Integer id;
@ApiModelProperty("优惠券couponId")
private Integer couponId;
@ApiModelProperty("领劵人id")
private Integer uid;
@ApiModelProperty("开始使用时间")
private Date startTime;
@ApiModelProperty("优惠券名称")
private String couponName;
@ApiModelProperty("状态(0:未使用,1:已使用, 2:已失效,3:已转赠 4:使用中)")
private Integer status;
@ApiModelProperty("核销方式 0单次核销 1多次核销")
private Integer verificationType;
@ApiModelProperty("关联表id")
private Integer couponUserId;
@ApiModelProperty("订单id")
private String orderId;
@ApiModelProperty("订单编码")
private String orderNo;
@ApiModelProperty("剩余余额")
private BigDecimal remainingBalance;
@ApiModelProperty("使用金额")
private BigDecimal useAmount;
@ApiModelProperty("优惠券使用时间")
private Date orderUsageTime;
public CouponUsageDetailsDTO bilIdCouponUsageDetailsDTO() {
return CouponUsageDetailsDTO.builder()
.id(this.id)
.couponId(this.couponId)
.uid(this.uid)
.startTime(this.startTime)
.couponName(this.couponName)
.status(this.status)
.verificationType(this.verificationType)
.couponUserId(this.couponUserId)
.orderId(this.orderId)
.orderNo(this.orderNo)
.remainingBalance(this.remainingBalance)
.useAmount(this.useAmount)
.orderUsageTime(this.orderUsageTime).build();
}
}
package com.mmc.oms.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.mmc.oms.common.CouponConstants;
import com.mmc.oms.model.dto.CouponUserDTO;
import com.mmc.oms.model.dto.CouponUserOrderDTO;
import com.mmc.oms.model.vo.CouponUserExchangeVO;
import com.mmc.oms.model.vo.CouponUserVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import lombok.experimental.Tolerate;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author small
* @Date 2023/5/24 14:54
* @Version 1.0
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("coupon_user")
@ApiModel(value = "CouponUser对象", description = "用户优惠券记录表")
public class CouponUserDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "优惠券id")
private Integer couponId;
@ApiModelProperty(value = "领取人id")
private Integer uid;
@ApiModelProperty(value = "领取人uuid")
private String uuid;
@ApiModelProperty(value = "领取人手机号码")
private String userPhone;
@ApiModelProperty(value = "优惠券名称")
private String couponName;
/**
* @see com.mmc.csf.userpay.constants.CouponConstants
*/
@ApiModelProperty(value = "优惠券类型 1打折券, 2减免券 3无门槛")
private Integer couponType;
/**
* @see com.mmc.csf.userpay.constants.CouponConstants
*/
@ApiModelProperty(value = "优惠券使用类型 1vip券, 2品牌券")
private Integer useType;
@ApiModelProperty(value = "优惠券的面值")
private BigDecimal couponMoney;
@ApiModelProperty(value = "最低消费")
private BigDecimal minPrice;
@ApiModelProperty(value = "优惠券的折扣")
private BigDecimal couponDiscount;
@ApiModelProperty(value = "剩余余额")
private BigDecimal remainingBalance;
/**
* @see com.mmc.csf.userpay.constants.CouponConstants
*/
@ApiModelProperty(value = "获取方式: 用户领取receive, 后台发放send, 赠送presented, 获赠acquire,积分兑换exchange")
private String gainType;
/**
* @see com.mmc.csf.userpay.constants.CouponConstants
*/
@ApiModelProperty(value = "状态(0:未使用,1:已使用, 2:已失效,3:已转赠,4:使用中)")
private Integer status;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "开始使用时间")
private Date startTime;
@ApiModelProperty(value = "过期时间")
private Date endTime;
@ApiModelProperty(value = "使用时间")
private Date useTime;
@ApiModelProperty(value = "所属品牌id")
private String primaryKey;
@ApiModelProperty(value = "兑换比例")
private String conversionRatio;
@ApiModelProperty(value = "转赠人uid")
private String transferorUid;
@ApiModelProperty(value = "获赠人uid")
private String receiveUid;
@ApiModelProperty(value = "转赠时间")
private Date transferorTime;
@ApiModelProperty(value = "是否多次核销 0单次核销 1多次核销")
private Boolean verificationType;
@ApiModelProperty(value = "最多优惠")
private BigDecimal preferentialLimit;
public CouponUserDTO bilIdCouponDTO() {
return CouponUserDTO.builder().id(this.id).couponId(this.couponId).uid(this.uid)
.userPhone(this.userPhone).couponName(this.couponName).couponType(this.couponType).useType(this.useType)
.couponMoney(this.couponMoney).minPrice(this.minPrice).couponDiscount(this.couponDiscount)
.remainingBalance(this.remainingBalance).gainType(this.gainType).status(this.status)
.createTime(this.createTime).updateTime(this.updateTime).startTime(this.startTime)
.endTime(this.endTime).useTime(this.useTime).primaryKey(this.primaryKey)
.conversionRatio(this.conversionRatio).transferorUid(this.transferorUid).receiveUid(this.receiveUid)
.transferorTime(this.transferorTime).verificationType(this.verificationType)
.preferentialLimit(this.preferentialLimit).build();
}
public CouponUserOrderDTO buildCouponUserOrderDTO() {
return CouponUserOrderDTO.builder().id(this.id).couponId(this.couponId).uid(this.uid)
.userPhone(this.userPhone).couponName(this.couponName).couponType(this.couponType).useType(this.useType)
.couponMoney(this.couponMoney).minPrice(this.minPrice).couponDiscount(this.couponDiscount)
.remainingBalance(this.remainingBalance).gainType(this.gainType).status(this.status)
.createTime(this.createTime).startTime(this.startTime).endTime(this.endTime).useTime(this.useTime)
.primaryKey(this.primaryKey).verificationType(this.verificationType)
.preferentialLimit(this.preferentialLimit).validStr("unusable").build();
}
@Tolerate
public CouponUserDO(CouponUserVO couponUserVO) {
this.id = couponUserVO.getId();
this.status = couponUserVO.getStatus();
this.remainingBalance = couponUserVO.getRemainingBalance();
}
@Tolerate
public CouponUserDO(CouponUserExchangeVO couponUserExchangeVO) {
this.uid = couponUserExchangeVO.getUid();
this.uuid = couponUserExchangeVO.getUuid();
this.userPhone = couponUserExchangeVO.getUserPhone();
this.couponName = couponUserExchangeVO.getCouponName();
this.couponMoney = couponUserExchangeVO.getCouponMoney();
this.conversionRatio = couponUserExchangeVO.getConversionRatio();
}
@Tolerate
public CouponUserDO(CouponDO couponDO) {
this.couponId = couponDO.getId();
this.couponName = couponDO.getCouponName();
this.couponType = couponDO.getCouponType();
this.useType = couponDO.getUseType();
this.couponMoney = couponDO.getCouponMoney();
this.minPrice = couponDO.getMinPrice();
this.couponDiscount = couponDO.getCouponDiscount();
this.status = CouponConstants.STORE_COUPON_USER_STATUS_USABLE;
this.primaryKey = couponDO.getPrimaryKey();
this.startTime = couponDO.getUseStartTime();
this.endTime = couponDO.getUseEndTime();
this.verificationType = couponDO.getVerificationType();
this.preferentialLimit = couponDO.getPreferentialLimit();
}
}
package com.mmc.oms.entity;
import com.mmc.oms.model.dto.AppGoodsInfoDTO;
import com.mmc.oms.model.dto.GoodsInfoListDTO;
import com.mmc.oms.model.dto.GoodsRcdDTO;
import com.mmc.oms.model.dto.TypeGoodsInfoDTO;
import com.mmc.oms.model.vo.CategoryParamAndValueVO;
import com.mmc.oms.model.vo.GoodsAddVO;
import com.mmc.oms.model.vo.MallGoodsAddVO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @Author small
* @Date 2023/5/24 15:14
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Accessors(chain = true)
public class GoodsInfoDO implements Serializable {
private static final long serialVersionUID = -1329342381196659417L;
private Integer id;
private Integer pid;
private String goodsNo;
private String goodsName;
private Integer masterTypeId;
private Integer slaveTypeId;
private Integer shelfStatus;
private Integer skuNum;
private Integer deleted;
private Date createTime;
private Date updateTime;
private Integer goodsAttr;
private String ecoLabel;
private Integer goodsCategoryId;
private Integer repoId;
private Integer shareFlyServiceId;
private Integer goodsType;
private Integer sort;
private Integer showCode;
private Integer standardProduct;
private String tag;
/**
* 辅助字段-start
*/
private String videoUrl;
private Integer goodsVideoId;
private String goodsDesc;
// privateGoodsVideoDO goodsVideoDO;
private String mainImg; // 主图
// private GoodsTypeDO goodsMasterType;
// private GoodsTypeDO goodsSlaveType;
private String remark;// 底部备注
private Integer sortTypeId;
private List<CategoryParamAndValueVO> paramAndValue;
// private GoodsConfigExportDO goodsConfigExport;// 功能清单
private Integer buyNum;// 购买数量
private String directoryName;
/**
* 辅助字段-end
*/
public GoodsInfoDO(MallGoodsAddVO mallGoodsAddVO) {
this.id = mallGoodsAddVO.getGoodsInfoVO().getId();
this.goodsName = mallGoodsAddVO.getGoodsInfoVO().getGoodsName();
this.masterTypeId = mallGoodsAddVO.getGoodsInfoVO().getMasterTypeId();
this.slaveTypeId = mallGoodsAddVO.getGoodsInfoVO().getSlaveTypeId();
this.goodsAttr = mallGoodsAddVO.getGoodsInfoVO().getGoodsAttr();
this.ecoLabel = mallGoodsAddVO.getGoodsInfoVO().getGoodsAttr() == 1 ? mallGoodsAddVO.getGoodsInfoVO().getEcoLabel() : null;
this.repoId = mallGoodsAddVO.getGoodsInfoVO().getRepoId() == null ? null : mallGoodsAddVO.getGoodsInfoVO().getRepoId();
this.shareFlyServiceId = mallGoodsAddVO.getGoodsInfoVO().getShareFlyServiceId() == null ? null : mallGoodsAddVO.getGoodsInfoVO().getShareFlyServiceId();
}
// 新版无人机城构造器
public GoodsInfoDO(GoodsAddVO goodsAddVO) {
this.id = goodsAddVO.getId();
this.goodsName = goodsAddVO.getGoodsName();
this.shelfStatus = goodsAddVO.getShelfStatus();
this.masterTypeId = goodsAddVO.getMasterTypeId();
this.slaveTypeId = goodsAddVO.getSlaveTypeId();
this.sortTypeId = goodsAddVO.getSortTypeId();
this.repoId = goodsAddVO.getRepoId();
this.shareFlyServiceId = goodsAddVO.getShareFlyServiceId();
this.tag = goodsAddVO.getTag();
}
public GoodsInfoListDTO buildGoodsInfoListDTO() {
return GoodsInfoListDTO.builder().id(this.id)
.goodsName(this.goodsName)
.status(this.shelfStatus)
.createTime(this.createTime)
.imgUrl(this.mainImg)
.directoryId(this.sortTypeId)
.directoryName(this.directoryName)
.build();
}
public AppGoodsInfoDTO buildAppGoodsInfoDTO() {
return AppGoodsInfoDTO.builder()
.id(this.id)
.goodsName(this.goodsName)
.mainImg(this.mainImg)
.goodsDesc(this.goodsDesc)
.shelfStatus(this.shelfStatus)
.goodsAttr(this.goodsAttr)
.ecoLabel(this.tag)
.showCode(this.showCode)
.sort(this.sort)
.build();
}
public GoodsRcdDTO buildGoodsRcdDTO() {
return GoodsRcdDTO.builder().id(this.id)
.rcdGoodsName(this.goodsName)
.rcdGoodsDescription(this.goodsDesc)
.imgUrl(this.mainImg).build();
}
public TypeGoodsInfoDTO buildTypeGoodsInfoDTO() {
return TypeGoodsInfoDTO.builder().goodsId(this.id)
.goodsImg(this.mainImg).goodsName(this.goodsName)
.showCode(this.showCode).shelfStatus(this.shelfStatus)
.build();
}
}
package com.mmc.oms.entity;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Author small
* @Date 2023/5/24 14:49
* @Version 1.0
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
//@ApiModel(value = "CouponUser对象", description = "用户优惠券记录表")
public class ProductInformationDo {
private Integer goodsInfoId;
private String goodsName;
private String prodSkuSpecName;
private Integer productSkuId;
private String productName;
private Integer brandId;
private String brandName;
}
package com.mmc.oms.jwt;
/**
* @Author small
* @Date 2023/5/24 15:59
* @Version 1.0
*/
public interface JwtConstant {
public final static String BASE64KEY = "sharefly@mmc20220616";
public final static String SUBJECT = "cloud_shared_flight_token";
public final static String ISSUER = "mmc";
public final static long EXPIRATION = 1 * 24 * 60 * 60 * 1000L;
public final static long SXTB_PC_LOGIN_INVALID = 1 * 24 * 60 * 60 * 1000L;
public final static String USERIDKEY = "uid";
public final static String ROLEIDKEY = "roleId";
public final static String TOKENKEY = "token";
public final static String TOKEN_TYPE = "TOKEN_TYPE";
public final static String SXTB_ACCOUNT_TOKEN = "SXTB_ACCOUNT_TOKEN";// 神行太保平台平台token
public final static String CSF_USER_ACCOUNT_TOKEN = "USER_ACCOUNT_TOKEN";// 云享飞-用户-token
public final static String CSF_FLYER_ACCOUNT_TOKEN = "FLYER_ACCOUNT_TOKEN";// 飞手-token
public final static String CSF_REPO_ACCOUNT_TOKEN = "REPO_ACCOUNT_TOKEN";// 飞手-token
public final static String MALL_USER_ACCOUNT_TOKEN = "MALL_USER_ACCOUNT_TOKEN";// 商城-token
public final static String OPEN_API_ACCESS_TOKEN = "OPENAPI_ACCESS_TOKEN";// OAUTH-client-token
public final static String AUTHORIZATION = "Authorization";
public final static String GRANT_TYPE = "grant_type";
public final static String CLIENT_CREDENTIALS = "client_credentials";
public final static long OAUTH_EXPIRATION = 1 * 24 * 60 * 60 * 1000L;
public final static String CLIENT_ID_KEY = "MMC_CLIENT_ID_KEY";
public final static String CLIENT_ROLE_KEY = "MMC_CLIENT_ROLE_KEY";
}
package com.mmc.oms.jwt;
import com.mmc.oms.common.CodeUtil;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.JwtBuilder;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import javax.crypto.spec.SecretKeySpec;
import javax.xml.bind.DatatypeConverter;
import java.security.Key;
import java.util.Date;
import java.util.Map;
/**
* @Author small
* @Date 2023/5/24 16:01
* @Version 1.0
*/
public class JwtUtil {
/**
* 根据map中的信息生成token, tokenId为随机生成码,有效时间为24h
*
* @param claims 封装到token中的map
* @return
*/
public static String createJwt(Map<String, Object> claims) {
return createJwt(claims, JwtConstant.EXPIRATION);
}
public static String createJwt(Map<String, Object> claims, long expiration) {
SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256;
byte[] apiKeySecretBytes = DatatypeConverter.parseBase64Binary(JwtConstant.BASE64KEY);
Key signingKey = new SecretKeySpec(apiKeySecretBytes, signatureAlgorithm.getJcaName());
long nowMillis = System.currentTimeMillis();
long expMillis = nowMillis + expiration;
Date now = new Date(nowMillis);
Date exp = new Date(expMillis);
JwtBuilder builder = Jwts.builder().setClaims(claims).setId(CodeUtil.randomCode(6)).setIssuedAt(now)
.setSubject(JwtConstant.SUBJECT).setIssuer(JwtConstant.ISSUER).signWith(signatureAlgorithm, signingKey)
.setExpiration(exp);
return builder.compact();
}
/**
* 解析前端传来的token,解析成功则返回Claims,解析失败返回null;解析成功后可通过claims获取信息
*
* @param jwt
* @return
*/
public static Claims parseJwt(String jwt) {
Claims claims = Jwts.parser().setSigningKey(DatatypeConverter.parseBase64Binary(JwtConstant.BASE64KEY))
.parseClaimsJws(jwt).getBody();
return claims;
}
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small
* @Date 2023/5/24 15:47
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.mall.dto.AppGoodsInfoDTO", description = "小程序商品信息DTO")
public class AppGoodsInfoDTO implements Serializable {
private static final long serialVersionUID = 6104334488561632747L;
@ApiModelProperty("商品id")
private Integer id;
@ApiModelProperty("商品名称")
private String goodsName;
@ApiModelProperty("商品上架状态")
private Integer shelfStatus;
@ApiModelProperty("商品主图")
private String mainImg;
@ApiModelProperty("商品描述")
private String goodsDesc;
@ApiModelProperty("商品属性")
private Integer goodsAttr;
@ApiModelProperty("生态标签")
private String ecoLabel;
@ApiModelProperty("安全编码")
private String code;
@ApiModelProperty("排序")
private Integer sort;
@ApiModelProperty("安全编码是否显示 0 否 1 是")
private Integer showCode;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small
* @Date 2023/5/24 14:56
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.model.dto.BaseAccountDTO", description = "登录信息DTO")
public class BaseAccountDTO implements Serializable {
private static final long serialVersionUID = -2979712090903806216L;
private Integer id;
private String uid;
private String accountPhone;
private String accountNo;
private String accountName;
private String tokenPort;
@ApiModelProperty(value = "角色ID")
private Integer roleId;
@ApiModelProperty(value = "是否为管理角色:0否 1是")
private Integer admin;// 是否为管理角色
@ApiModelProperty(value = "是否为运营角色:0否 1是")
private Integer operate;
@ApiModelProperty(value = "是否PMC发货专员:0否 1是")
private Integer pmc;
@ApiModelProperty(value = "单位信息")
private CompanyCacheDTO companyInfo;// 单位信息
public BaseAccountDTO(UserAccountDTO user) {
this.id = user.getId();
this.accountNo = user.getAccountNo();
this.accountName = user.getUserName();
this.roleId = user.getRoleInfo() == null ? null : user.getRoleInfo().getId();
this.admin = user.getRoleInfo() == null ? null : user.getRoleInfo().getAdmin();
this.operate = user.getRoleInfo() == null ? null : user.getRoleInfo().getOperate();
this.pmc = user.getRoleInfo() == null ? null : user.getRoleInfo().getPmc();
}
public BaseAccountDTO(RepoAccountDTO account) {
this.id = account.getId();
this.accountName = account.getAccountName();
this.uid = account.getUid();
this.accountPhone = account.getPhoneNum();
}
public BaseAccountDTO(MallUserDTO account) {
this.id = account.getId();
this.accountName = account.getNickName();
this.uid = account.getUid();
this.accountPhone = account.getPhoneNum();
}
public BaseAccountDTO(FlyerAccountDTO account) {
this.id = account.getId();
this.accountName = account.getAccountName();
this.uid = account.getUid();
this.accountPhone = account.getPhoneNum();
}
/**
* 是否为科比特超级管理员单位(是:无单位资源限制 否:只能看当前和下级单位的资源)
* @return
*/
public boolean isManage() {
if(this.getCompanyInfo()==null){
return false;
}
if(this.getCompanyInfo().getManage()==null){
return false;
}
return this.getCompanyInfo().getManage() == 1;
}
/**
* 判断是否已授权
*
* @return
*/
// public boolean authorized() {
// if (StringUtils.isBlank(this.accountName) || StringUtils.isBlank(this.accountPhone)) {
// return false;
// }
// return true;
// }
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @Author small
* @Date 2023/5/24 14:57
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CompanyCacheDTO implements Serializable {
@ApiModelProperty(value = "单位ID")
private Integer id;
@ApiModelProperty(value = "单位名称")
private String company;
@ApiModelProperty(value = "是否为管理单位:0否 1是",hidden = true)
private Integer manage;
@ApiModelProperty(value = "当前单位ID+子级单位ID的集合",hidden = true)
private List<Integer> companys;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @Author small
* @Date 2023/5/24 14:57
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.sharefly.dto.CompanySimpleDTO", description = "单位信息DTO")
public class CompanySimpleDTO implements Serializable {
private static final long serialVersionUID = 2541404541696571857L;
@ApiModelProperty(value = "单位ID")
private Integer id;
@ApiModelProperty(value = "单位名称")
private String company;
@ApiModelProperty(value = "账号类型:0合伙人 1员工")
private Integer userType;
@ApiModelProperty(value = "是否为管理单位:0否 1是",hidden = true)
private Integer manage;
@ApiModelProperty(value = "当前单位ID+子级单位ID的集合",hidden = true)
private List<Integer> companys;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author small
* @Date 2023/5/24 14:05
* @Version 1.0
*/
@Builder
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="CouponActivity对象", description="裂变优惠券")
@AllArgsConstructor
@NoArgsConstructor
public class CouponActivityDTO implements Serializable {
private static final long serialVersionUID=1L;
@ApiModelProperty(value = "优惠券ID")
private Integer id;
@ApiModelProperty(value = "优惠券名称")
private String couponName;
@ApiModelProperty(value = "优惠券面值")
private BigDecimal couponMoney;
@ApiModelProperty(value = "优惠券折扣")
private BigDecimal couponDiscount;
@ApiModelProperty(value = "是否限量, 默认0不限量, 1限量")
private Boolean isLimited;
@ApiModelProperty(value = "每人限制领取张数")
private Integer restrictedAccess;
@ApiModelProperty(value = "发放总数")
private Integer couponTotal;
@ApiModelProperty(value = "剩余数量")
private Integer lastTotal;
@ApiModelProperty(value = "已领取数量")
private Integer amountReceived;
@ApiModelProperty(value = "优惠券类型 1打折卷, 2减免券 3无门槛")
private Integer couponType;
@ApiModelProperty(value = "优惠券使用类型 1vip券, 2品牌券")
private Integer useType;
@ApiModelProperty(value = "最低消费")
private BigDecimal minPrice;
@ApiModelProperty(value = "所属 品牌范围id")
private String primaryKey;
@ApiModelProperty(value = "有效期时间方式:0 固定使用时间, 1领取当日起 2领取次日起")
private Integer isFixedTime;
@ApiModelProperty(value = "有效期时间范围 开始时间")
private Date useStartTime;
@ApiModelProperty(value = "有效期时间范围 结束时间")
private Date useEndTime;
@ApiModelProperty(value = "有效期时间天数")
private Integer couponDay;
@ApiModelProperty(value = "优惠券类型 1 手动领取 2 系统发放 3 批量导入用户 4活动领取")
private Integer getType;
@ApiModelProperty(value = "用户标签")
private Integer userTag;
@ApiModelProperty(value = "是否单次核销 0单次核销 1多次核销")
private Boolean verificationType;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "状态(0:关闭,1:开启)")
private Boolean couponStatus;
@ApiModelProperty(value = "分享者优惠券id")
private Integer parentId;
@ApiModelProperty(value = "分享者分享人数")
private Integer peopleNumber;
@ApiModelProperty(value = "角色 share分享者 beShare被分享者")
private String activityRole;
@ApiModelProperty(value = "被分享者优惠券")
private CouponActivityDTO beSharedCoupon;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author small
* @Date 2023/5/24 13:59
* @Version 1.0
*/
@Builder
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="Coupon对象", description="优惠券表")
@NoArgsConstructor
@AllArgsConstructor
public class CouponDTO implements Serializable {
private static final long serialVersionUID=1L;
@ApiModelProperty(value = "优惠券ID")
private Integer id;
@ApiModelProperty(value = "优惠券名称")
private String couponName;
@ApiModelProperty(value = "优惠券面值")
private BigDecimal couponMoney;
@ApiModelProperty(value = "优惠券折扣")
private BigDecimal couponDiscount;
@ApiModelProperty(value = "是否限量, 默认0不限量, 1限量")
private Boolean isLimited;
@ApiModelProperty(value = "每人限制领取张数")
private Integer restrictedAccess;
@ApiModelProperty(value = "发放总数")
private Integer couponTotal;
@ApiModelProperty(value = "剩余数量")
private Integer lastTotal;
@ApiModelProperty(value = "优惠券类型 1打折卷, 2减免券 3无门槛")
private Integer couponType;
@ApiModelProperty(value = "优惠券使用类型 1vip券, 2品牌券")
private Integer useType;
@ApiModelProperty(value = "最低消费")
private BigDecimal minPrice;
@ApiModelProperty(value = "所属 品牌范围id")
private String primaryKey;
@ApiModelProperty(value = "有效期时间方式:0 固定使用时间, 1领取当日起 2领取次日起")
private Integer isFixedTime;
@ApiModelProperty(value = "有效期时间范围 开始时间")
private Date useStartTime;
@ApiModelProperty(value = "有效期时间范围 结束时间")
private Date useEndTime;
@ApiModelProperty(value = "有效期时间天数")
private Integer couponDay;
@ApiModelProperty(value = "优惠券类型 1 手动领取 2 系统发放 3 批量导入用户 4活动裂变券")
private Integer getType;
@ApiModelProperty(value = "用户标签 1新人 2实名认证 3企业认证")
private Integer userTag;
@ApiModelProperty(value = "状态(0:关闭,1:开启)")
private Boolean couponStatus;
@ApiModelProperty(value = "是否删除 状态(0:否,1:是)")
private Boolean isDel;
@ApiModelProperty(value = "最多优惠")
private BigDecimal preferentialLimit;
@ApiModelProperty(value = "是否多次核销 0单次核销 1多次核销")
private Boolean verificationType;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "批量导入文件url")
private String fileUrl;
@ApiModelProperty(value = "已领取的数量")
private String quantityClaimed ;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author small
* @Date 2023/5/24 14:06
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
//@ApiModel(value="CouponList对象", description="小程序优惠券表")
public class CouponListDTO implements Serializable {
private static final long serialVersionUID=1L;
@ApiModelProperty(value = "优惠券ID")
private Integer id;
@ApiModelProperty(value = "优惠券名称")
private String couponName;
@ApiModelProperty(value = "优惠券面值")
private BigDecimal couponMoney;
@ApiModelProperty(value = "优惠券折扣")
private BigDecimal couponDiscount;
@ApiModelProperty(value = "是否限量, 默认0不限量, 1限量")
private Boolean isLimited;
@ApiModelProperty(value = "每人限制领取张数")
private Integer restrictedAccess;
@ApiModelProperty(value = "剩余数量")
private Integer lastTotal;
@ApiModelProperty(value = "优惠券类型 1打折卷, 2减免券 3无门槛")
private Integer couponType;
@ApiModelProperty(value = "优惠券使用类型 1vip券, 2品牌券")
private Integer useType;
@ApiModelProperty(value = "最低消费")
private BigDecimal minPrice;
@ApiModelProperty(value = "所属 品牌范围id")
private String primaryKey;
@ApiModelProperty(value = "有效期时间方式:0 固定使用时间, 1领取当日起 2领取次日起")
private Integer isFixedTime;
@ApiModelProperty(value = "有效期时间范围 开始时间")
private Date useStartTime;
@ApiModelProperty(value = "有效期时间范围 结束时间")
private Date useEndTime;
@ApiModelProperty(value = "有效期时间天数")
private Integer couponDay;
@ApiModelProperty(value = "优惠券类型 1 手动领取 2 系统发放 3 批量导入用户 4活动领取")
private Integer getType;
@ApiModelProperty(value = "用户标签")
private Integer userTag;
@ApiModelProperty(value = "最多优惠")
private BigDecimal preferentialLimit;
@ApiModelProperty(value = "是否已领取未使用")
private Boolean isUse = false;
@ApiModelProperty(value = "已经领取数量")
private Integer receivedCount = 0;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author small
* @Date 2023/5/24 15:17
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.mall.dto.CouponUsageDetailsDTO", description = "优惠券使用明细DTO")
public class CouponUsageDetailsDTO {
private static final long serialVersionUID = 6104334488561632747L;
@ApiModelProperty("id编号")
private Integer id;
@ApiModelProperty("优惠券id")
private Integer couponId;
@ApiModelProperty("领劵人id")
private Integer uid;
@ApiModelProperty("开始使用时间")
private Date startTime;
@ApiModelProperty("优惠券名称")
private String couponName;
@ApiModelProperty("状态(0:未使用,1:已使用, 2:已失效,3:已转赠 4:使用中)")
private Integer status;
@ApiModelProperty("核销方式 0单次核销 1多次核销")
private Integer verificationType;
@ApiModelProperty("关联表id")
private Integer couponUserId;
@ApiModelProperty("订单id")
private String orderId;
@ApiModelProperty("订单编码")
private String orderNo;
@ApiModelProperty("剩余余额")
private BigDecimal remainingBalance;
@ApiModelProperty("使用金额")
private BigDecimal useAmount;
@ApiModelProperty("优惠券使用时间")
private Date orderUsageTime;
}
package com.mmc.oms.model.dto;
import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @Author small
* @Date 2023/5/24 14:09
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="CouponUser对象", description="用户优惠券DTO表")
@ExcelTarget("couponUserExcel")
public class CouponUserDTO implements Serializable {
private static final long serialVersionUID = 7665462964438044885L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "优惠券id")
private Integer couponId;
@JsonSerialize(using= ToStringSerializer.class)
@ApiModelProperty(value = "订单id")
private Long cid;
@ApiModelProperty(value = "订单编码")
private String orderNo;
@ApiModelProperty(value = "领取人id")
private Integer uid;
@ApiModelProperty(value = "领取人uuid")
private String uuid;
@ApiModelProperty(value = "领取人手机号码")
private String userPhone;
@ApiModelProperty(value = "优惠券名称")
private String couponName;
@ApiModelProperty(value = "优惠券类型 1打折券, 2减免券 3无门槛")
private Integer couponType;
@ApiModelProperty(value = "优惠券使用类型 1vip券, 2品牌券")
private Integer useType;
@ApiModelProperty(value = "优惠券的面值")
private BigDecimal couponMoney;
@ApiModelProperty(value = "最低消费")
private BigDecimal minPrice;
@ApiModelProperty(value = "优惠券的折扣")
private BigDecimal couponDiscount;
@ApiModelProperty(value = "剩余余额")
private BigDecimal remainingBalance;
@ApiModelProperty(value = "获取方式,1 后台发放, 2 用户领取, 3赠送 4获赠")
private String gainType;
@ApiModelProperty(value = "状态(0:未使用,1:已使用, 2:已失效,3:已转赠,4:使用中)")
private Integer status;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "开始使用时间")
private Date startTime;
@ApiModelProperty(value = "过期时间")
private Date endTime;
@ApiModelProperty(value = "使用时间")
private Date useTime;
@ApiModelProperty(value = "所属品牌id")
private String primaryKey;
@ApiModelProperty(value = "兑换比例")
private String conversionRatio;
@ApiModelProperty(value = "转赠人uid")
private String transferorUid;
@ApiModelProperty(value = "获赠人uid")
private String receiveUid;
@ApiModelProperty(value = "转赠时间")
private Date transferorTime;
@ApiModelProperty(value = "是否多次核销 0单次核销 1多次核销")
private Boolean verificationType;
@ApiModelProperty(value = "最多优惠")
private BigDecimal preferentialLimit;
@ApiModelProperty(value = "所属品牌id")
private List<String> brandIds;
@ApiModelProperty(value = "可打折金额")
private BigDecimal discountCouponPrice;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @Author small
* @Date 2023/5/24 14:46
* @Version 1.0
*/
@Builder
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
//@ApiModel(value="CouponUser对象", description="下单可用用户优惠券DTO表")
@NoArgsConstructor
@AllArgsConstructor
public class CouponUserOrderDTO implements Serializable {
private static final long serialVersionUID=1L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "优惠券id")
private Integer couponId;
@ApiModelProperty(value = "订单id")
private Long cid;
@ApiModelProperty(value = "领取人id")
private Integer uid;
@ApiModelProperty(value = "领取人手机号码")
private String userPhone;
@ApiModelProperty(value = "优惠券名称")
private String couponName;
@ApiModelProperty(value = "优惠券类型 1打折券, 2减免券 3无门槛")
private Integer couponType;
@ApiModelProperty(value = "优惠券使用类型 1vip券, 2品牌券")
private Integer useType;
@ApiModelProperty(value = "优惠券的面值")
private BigDecimal couponMoney;
@ApiModelProperty(value = "最低消费")
private BigDecimal minPrice;
@ApiModelProperty(value = "优惠券的折扣")
private BigDecimal couponDiscount;
@ApiModelProperty(value = "剩余余额")
private BigDecimal remainingBalance;
@ApiModelProperty(value = "获取方式,1 后台发放, 2 用户领取, 3赠送 4获赠")
private String gainType;
@ApiModelProperty(value = "状态(0:未使用,1:已使用, 2:已失效,3:已转赠,4:使用中)")
private Integer status;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "开始使用时间")
private Date startTime;
@ApiModelProperty(value = "过期时间")
private Date endTime;
@ApiModelProperty(value = "使用时间")
private Date useTime;
@ApiModelProperty(value = "所属品牌id")
private String primaryKey;
@ApiModelProperty(value = "是否多次核销 0单次核销 1多次核销")
private Boolean verificationType;
@ApiModelProperty(value = "最多优惠")
private BigDecimal preferentialLimit;
@ApiModelProperty(value = "有效状态:usable-可用,unusable-不可用,默认不可用")
private String validStr;
@ApiModelProperty(value = "所属品牌id")
private List<String> brandIds;
@ApiModelProperty(value = "可打折金额")
private BigDecimal discountCouponPrice;
@ApiModelProperty(value = "推荐使用")
private Integer recommend;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @Author small
* @Date 2023/5/24 14:09
* @Version 1.0
*/
@Data
@ApiModel(value="用户优惠券使用数据", description="用户优惠券使用数据DTO")
public class CouponViewDTO implements Serializable {
private static final long serialVersionUID=1L;
@ApiModelProperty(value = "总发行量")
private Integer couponTotal;
@ApiModelProperty(value = "领取量")
private Long receiveQuantity;
@ApiModelProperty(value = "领取率")
private String claimRate;
@ApiModelProperty(value = "使用量")
private Integer usageAmount;
@ApiModelProperty(value = "有效使用量")
private Integer accountPaid;
@ApiModelProperty(value = "有效使用率")
private String availability;
}
package com.mmc.oms.model.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small
* @Date 2023/5/24 15:58
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CurrentUserDTO implements Serializable {
private static final long serialVersionUID = -2302598593780513593L;
private Integer id;
private Integer roleId;
}
package com.mmc.oms.model.dto;
import com.mmc.oms.common.FlyerAccountType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Set;
/**
* @Author small
* @Date 2023/5/24 14:59
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "com.mmc.csf.model.dto.FlyerAccountDTO", description = "飞手端用户DTO")
public class FlyerAccountDTO implements Serializable {
private static final long serialVersionUID = -5663270547201316327L;
@ApiModelProperty(value = "飞手端用户id")
private Integer id;
@ApiModelProperty(value = "飞手端用户uid")
private String uid;
@ApiModelProperty(value = "飞手端用户名称")
private String accountName;
@ApiModelProperty(value = "联系电话")
private String phoneNum;
@ApiModelProperty(value = "飞手端用户类型,(个人飞手,机构)")
private Integer accountType;
@ApiModelProperty(value = "实名认证状态")
private Integer realAuthStatus;
@ApiModelProperty(value = "企业认证状态")
private Integer entAuthStatus;
@ApiModelProperty(value = "工作状态")
private Integer workStatus;
@ApiModelProperty(value = "常驻城市")
private String resAddress;
@ApiModelProperty(value = "openId")
private String openId;
@ApiModelProperty(value = "unionId")
private String unionId;
@ApiModelProperty(value = "昵称")
private String nickName;
@ApiModelProperty(value = "头像url")
private String headerImg;
@ApiModelProperty(value = "经度")
private Double lon;
@ApiModelProperty(value = "纬度")
private Double lat;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "删除状态,0未删除,1删除")
private Integer deleted;
@ApiModelProperty(value = "企业名称")
private String entName;
@ApiModelProperty(value = "生成时间")
private Date createTime;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "有无订单:0无,1有")
private Integer serviceStatus;
@ApiModelProperty(value = "距离订单距离-单位km")
private Double orderDist;
@ApiModelProperty(value = "服务中的订单名称")
private List<String> orderNames;
@ApiModelProperty(value = "飞手认证状态")
private Integer licStatus;
@ApiModelProperty(value = "机构信息")
private FlyerEntInfoDTO entInfo;
@ApiModelProperty(value = "抢单状态-0否-1是")
private Integer applyOrder;
@ApiModelProperty(value = "多端用户,USER_PORT(云享飞)-FLYER_PORT(云飞手)-REPO_PORT(云仓)")
private Set<String> ports;
@ApiModelProperty(value = "推荐人ID")
private Integer rcdFlyerAccountId;
@ApiModelProperty(value = "推荐人昵称")
private String rcdNickName;
@ApiModelProperty(value = "推荐人uid")
private String rcdUid;
@ApiModelProperty(value = "推荐人账号名称")
private String rcdAccountName;
@ApiModelProperty(value = "已推荐用户数")
private Integer rcdUserNumber;
@ApiModelProperty(value = "是否销售")
private Integer sale;
@ApiModelProperty(value = "是否白名单")
private Integer white;
@ApiModelProperty(value = "用户来源:0自然流,1海报,2抖音,3公众号,4社群,5招投标,默认0")
private Integer source;
@ApiModelProperty(value = "订单信息")
private FlyerOrderTaskDTO flyerOrderTask;
@ApiModelProperty(value = "场景认证信息")
private FlyerScenesAuthDTO flyerScenesAuth;
/**
* 是否为飞手机构用户
*
* @return
*/
public boolean checkFlyerEnt() {
return (FlyerAccountType.JG.getCode().toString().equals(this.accountType.toString()));
}
/**
* 是否为飞手个人用户
*
* @return
*/
public boolean checkFlyer() {
return (FlyerAccountType.GR.getCode().toString().equals(this.accountType.toString()));
}
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small
* @Date 2023/5/24 14:59
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.model.dto.FlyerEntInfoDTO", description = "飞手机构DTO")
public class FlyerEntInfoDTO implements Serializable {
private static final long serialVersionUID = -3064900348178903673L;
@ApiModelProperty(value = "机构id")
private Integer id;
@ApiModelProperty(value = "飞手端用户id")
private Integer flyerAccountId;
@ApiModelProperty(value = "机构名称")
private String entName;
@ApiModelProperty(value = "机构认证审批状态")
private Integer entCheckStatus;
@ApiModelProperty(value = "机构法人名称")
private String entLegalPerson;
@ApiModelProperty(value = "社会统一信用码")
private String uscCode;
@ApiModelProperty(value = "营业执照url")
private String unLicImg;
@ApiModelProperty(value = "开户银行")
private String bankName;
@ApiModelProperty(value = "账户名称")
private String accountHolder;
@ApiModelProperty(value = "银行账号")
private String bankAccount;
@ApiModelProperty(value = "法人身份证号")
private String idNumber;
@ApiModelProperty(value = "机构备注")
private String remark;
@ApiModelProperty(value = "生成时间")
private Date createTime;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "飞手总数")
private Integer sumOfFlyer;
@ApiModelProperty(value = "认证飞手数")
private Integer countOfAuthFlyer;
@ApiModelProperty(value = "用户uid")
private String uid;
@ApiModelProperty(value = "用户手机号")
private String phoneNum;
@ApiModelProperty(value = "常驻城市")
private String resAddress;
@ApiModelProperty(value = "昵称")
private String nickName;
}
package com.mmc.oms.model.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small
* @Date 2023/5/24 15:01
* @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class FlyerOrderTaskDTO implements Serializable {
private static final long serialVersionUID = 4288411060058354326L;
private Integer id;
private Integer orderId;
private Integer flyerAccountId;
private Integer orderType;
private Integer virtualTeamId;
private String orderName;
private String orderNo;
public FlyerOrderTaskDTO(OrderTaskDTO d) {
this.orderId = d.getId();
this.orderName = d.getOrderName();
this.orderNo = d.getOrderNo();
}
}
package com.mmc.oms.model.dto;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small
* @Date 2023/5/24 15:06
* @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class FlyerScenesAuthDTO implements Serializable {
private static final long serialVersionUID = 66032902942031710L;
@ApiModelProperty("飞手id")
private Integer id;
@ApiModelProperty(value = "商务礼仪认证")
private Integer protocolAuth;
@ApiModelProperty(value = "电力巡检认证状态,0未认证,1通过,2未通过")
private Integer electricAuth;
@ApiModelProperty(value = "航空测绘认证状态,0未认证,1通过,2未通过", hidden = true)
@JsonIgnore
private Integer aviationAuth;
@ApiModelProperty(value = "应急保障认证状态,0未认证,1通过,2未通过", hidden = true)
@JsonIgnore
private Integer emergencyAuth;
@ApiModelProperty(value = "value = 监察巡检认证状态,0未认证,1通过,2未通过", hidden = true)
@JsonIgnore
private Integer superviseAuth;
@ApiModelProperty(value = "通用认证状态,0未认证,1通过,2未通过")
private Integer universalAuth;
@ApiModelProperty(value = "油气巡检认证状态,0未认证,1通过,2未通过")
private Integer oilGasAuth;
@ApiModelProperty(value = "演示认证状态,0未认证,1通过,2未通过")
private Integer demoAuth;
@ApiModelProperty(value = "航空测绘外业状态,0未认证,1通过,2未通过")
private Integer aviationOutAuth;
@ApiModelProperty(value = "航空测绘内业状态,0未认证,1通过,2未通过")
private Integer aviationInAuth;
@ApiModelProperty(value = "指挥车认证状态,0未认证,1通过,2未通过")
private Integer commandAuth;
@ApiModelProperty(value = "天目将软件认证状态,0未认证,1通过,2未通过")
private Integer tmjAuth;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small
* @Date 2023/5/24 15:46
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.mall.dto.GoodsInfoListDTO", description = "商品列表信息DTO")
public class GoodsInfoListDTO implements Serializable {
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "商品名称")
private String goodsName;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "状态 : 0:下架 1:上架")
private Integer status;
@ApiModelProperty(value = "商品主图")
private String imgUrl;
@ApiModelProperty(value = "一级分类名称")
private String goodsOneLevelTypeName;
@ApiModelProperty(value = "二级分类名称")
private String goodsTwoLevelTypeName;
@ApiModelProperty(value = "目录名字")
private String directoryName;
@ApiModelProperty(value = "目录id")
private Integer directoryId;
@ApiModelProperty(value = "是否有优惠券 0表示没有 有就返回数字")
private Integer isCoupons;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small
* @Date 2023/5/24 15:14
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.mall.dto.GoodsRcdDTO", description = "推荐商品信息DTO")
public class GoodsRcdDTO implements Serializable {
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "推荐商品的id")
private Integer rcdGoodsId;
@ApiModelProperty(value = "推荐商品名称")
private String rcdGoodsName;
@ApiModelProperty(value = "推荐商品图片")
private String imgUrl;
@ApiModelProperty(value = "推荐商品描述")
private String rcdGoodsDescription;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @Author small
* @Date 2023/5/24 14:53
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.mall.dto.MallUserDTO", description = "用户信息DTO")
public class MallUserDTO implements Serializable {
private static final long serialVersionUID = -2968237190830435082L;
@ApiModelProperty("id")
private Integer id;
@ApiModelProperty("uid")
private String uid;
@ApiModelProperty("个人认证名字")
private String userName;
@ApiModelProperty("联系电话")
private String phoneNum;
@ApiModelProperty("小程序openid")
private String openId;
@ApiModelProperty("微信unionid")
private String unionId;
@ApiModelProperty("微信昵称")
private String nickName;
@ApiModelProperty("头像")
private String headerImg;
@ApiModelProperty("经度")
private Double lon;
@ApiModelProperty("纬度")
private Double lat;
@ApiModelProperty("注册端口")
private String ports;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty(value = "用户来源:0自然流,1海报,2抖音,3公众号,4社群,5招投标,默认0")
private Integer source;
@ApiModelProperty("渠道等级状态")
private Integer channelAuthStatus;
@ApiModelProperty("渠道等级标签")
private Integer channelClass;
@ApiModelProperty("渠道等级名称")
private String tagName;
@ApiModelProperty("注册时间")
private Date createTime;
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty(value = "实名认证状态(0未通过,1通过)")
private Integer realAuthStatus;
@ApiModelProperty(value = "企业认证状态(0未通过,1通过)")
private Integer entAuthStatus;
@ApiModelProperty("企业名称")
private String entName;
@ApiModelProperty("法大大电子签章认证状态(0未通过,1通过)")
private Integer entVerifyStatus;
@ApiModelProperty("实名认证时间")
private Date realAuthTime;
@ApiModelProperty("企业认证时间")
private Date entAuthTime;
@ApiModelProperty("电子签章认证时间")
private Date entVerifyTime;
@ApiModelProperty(value = "上级推荐人id")
private Integer upReferralId;
@ApiModelProperty(value = "上级推荐人的uid(name)")
private String upReferralUidAndName;
@ApiModelProperty(value = "推荐伙伴数量")
private Integer lowerReferralCount;
@ApiModelProperty("相关运营id")
private Integer operateId;
@ApiModelProperty("相关运营Name")
private String operateName;
@ApiModelProperty("相关销售id")
private Integer saleId;
@ApiModelProperty("相关销售Name")
private String saleName;
@ApiModelProperty("小程序相关运营id")
private Integer mallOperator;
@ApiModelProperty("小程序相关运营名字")
private String mallOperatorName;
@ApiModelProperty("小程序相关运营uid")
private String mallOperatorUID;
@ApiModelProperty("小程序相关销售id")
private Integer mallSaleManager;
@ApiModelProperty("小程序相关销售uid")
private String mallSaleManagerUID;
@ApiModelProperty("小程序相关销售名字")
private String mallSaleManagerName;
@ApiModelProperty("上级渠道名称")
private String superiorChannelName;
@ApiModelProperty(value = "开户银行")
private String accountBank;
@ApiModelProperty(value = "开户姓名")
private String accountName;
@ApiModelProperty(value = "银行卡号")
private String bankCardNumber;
@ApiModelProperty(value = "支行")
private String branch;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author small
* @Date 2023/5/24 14:46
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.mall.dto.OrderCouponDTO", description = "订单优惠券使用")
public class OrderCouponDTO implements Serializable {
private static final long serialVersionUID = 6681933441428005418L;
@ApiModelProperty("id")
private Integer id;
@ApiModelProperty("订单id")
private Long orderId;
@ApiModelProperty("用户优惠券id")
private Integer couponUserId;
@ApiModelProperty("优惠券类型")
private Integer couponType;
@ApiModelProperty("优惠券使用类型")
private Integer useType;
@ApiModelProperty("优惠券使用金额")
private BigDecimal useAmount;
@ApiModelProperty("使用时间")
private Date createTime;
@ApiModelProperty("优惠券简称")
private String couponName;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @Author small
* @Date 2023/5/24 15:01
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class OrderTaskDTO implements Serializable {
private static final long serialVersionUID = 6732943573766573605L;
@ApiModelProperty(value = "订单id")
private Integer id;
@ApiModelProperty(value = "主任务id")
private Integer parentId;
@ApiModelProperty(value = "用户id")
private Integer userAccountId;
@ApiModelProperty(value = "订单专属运营id")
private Integer userOperateId;
@ApiModelProperty(value = "用户订单uid")
private String uid;
@ApiModelProperty(value = "订单编号")
private String orderNo;//单号
@ApiModelProperty(value = "订单名称")
private String orderName;//名称
@ApiModelProperty(value = "账单金额")
private BigDecimal orderAmt;//账单金额
@ApiModelProperty(value = "订单现金金额")
private BigDecimal orderCashAmt;
@ApiModelProperty(value = "订单信用金额")
private BigDecimal orderCreditAmt;
@ApiModelProperty(value = "任务状态")
private Integer orderStatus;//任务状态
@ApiModelProperty(value = "评价状态")
private Integer evaluateStatus;//评价状态
private String lastMsg1;//消息
private String lastMag2;
@ApiModelProperty(value = "生成时间")
private Date createTime;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "备注")
private String basicInfo;//基本信息
@ApiModelProperty(value = "预计开始时间")
private String startTime;//开始时间
@ApiModelProperty(value = "预计结束时间")
private String endTime;//结束时间
@ApiModelProperty(value = "实际开始时间")
private String acStartTime;// 实际开始时间
@ApiModelProperty(value = "实际结束时间")
private String acEndTime;// 实际结束时间
@ApiModelProperty(value = "订单地址")
private String taskAddress;
private String image;
@ApiModelProperty(value = "服务id")
private Integer inspectionId;
@ApiModelProperty(value = "服务名称")
private String inspectionName;
@ApiModelProperty(value = "运营联系电话")
private String phoneNum;
@ApiModelProperty(value = "专属运营名称")
private String operateName;
@ApiModelProperty(value = "经度")
private BigDecimal lon;
@ApiModelProperty(value = "纬度")
private BigDecimal lat;
@ApiModelProperty(value = "用户名称")
private String userName;
@ApiModelProperty(value = "是否企业")
private Integer entUser;
@ApiModelProperty(value = "企业名称")
private String entName;
@ApiModelProperty(value = "是否实名")
private Integer realAuthStatus;
@ApiModelProperty(value = "昵称")
private String nickName;
@ApiModelProperty(value = "订单关闭原因")
private String shutReason;
@ApiModelProperty(value = "用户联系电话")
private String userPhoneNum;
@ApiModelProperty(value = "飞手Id")
private Integer flyerAccountId;
@ApiModelProperty(value = "平台工作人员设置的备注")
private String pfRemark;
@ApiModelProperty(value = "飞手端-推送-数据-0否-1是")
private Integer dummy;
@ApiModelProperty(value = "飞手UID")
private String flyerUid;
@ApiModelProperty(value = "飞手账号名")
private String flyerAccountName;
@ApiModelProperty(value = "抢单状态:0待接单,1抢单中")
private Integer applyStatus;
@ApiModelProperty(value = "预付款总金额")
private BigDecimal totalFreeze;
@ApiModelProperty(value = "结算总金额")
private BigDecimal totalPay;
@ApiModelProperty(value = "倒计时")
private Long countSconds;
@ApiModelProperty(value = "飞手基本信息")
private FlyerAccountDTO flyerAccount;
@ApiModelProperty(value = "飞手类型")
private Integer flyerType;
@ApiModelProperty(value = "飞手个数")
private Integer flyerNum;
@ApiModelProperty(value = "0:隐藏 1:显示")
private Integer display;
@ApiModelProperty(value = "飞手-结算-信息", hidden = true)
private TaskFlyerCostDTO taskFlyerCost;
@ApiModelProperty(value = "下期飞手入账时间")
private String nextFlyerIncomeDate;
@ApiModelProperty(value = "是否进行过催付款 0:未催 1:已催")
private Integer urge;
@ApiModelProperty(value = "订单类型")
private Integer orderType;
@ApiModelProperty(value = "确认需求备注")
private String cmdRemark;
@ApiModelProperty(value = "飞手可抢单开始时间")
private Date flyerStartTime;
@ApiModelProperty(value = "飞手可抢单结束时间")
private Date flyerEndTime;
@ApiModelProperty(value = "预估金额")
private BigDecimal estimatedAmount;
@ApiModelProperty(value = "申请id")
private Integer orderApplyId;
@ApiModelProperty(value = "用户下单附件预览效果")
private String userPreview;
@ApiModelProperty(value = "平台上传附件预览效果")
private String platformPreview;
@ApiModelProperty(value = "文案描述")
private String copywriting;
@ApiModelProperty(value = "子任务列表")
private List<OrderTaskDTO> children;
@ApiModelProperty(value = "子订单信息")
private List<OrderTaskSonDTO> son;
public void buildOperateUser(UserAccountDTO op) {
this.phoneNum = op.getPhoneNum();
this.operateName = op.getUserName();
this.userOperateId = op.getId();
}
public void buildWxUser(UserAccountDTO wx) {
this.userAccountId = wx.getId();
this.uid = wx.getUid();
this.nickName = wx.getNickName();
this.userName = wx.getUserName();
this.userPhoneNum = wx.getPhoneNum();
}
public FlyerOrderTaskDTO buildFlyerOrderTaskDTO(){
return FlyerOrderTaskDTO.builder().orderId(this.id).orderNo(this.orderNo).orderName(this.orderName).build();
}
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* @Author small
* @Date 2023/5/24 15:01
* @Version 1.0
*/
@Data
//@ApiModel(value="OrderTaskSonDTO", description="云享飞订单-子任务表")
@AllArgsConstructor
@NoArgsConstructor
public class OrderTaskSonDTO implements Serializable {
private static final long serialVersionUID = 1L;
private Integer id;
@ApiModelProperty(value = "0为主任务")
private Integer parentId;
@ApiModelProperty(value = "客户ID")
private Integer userAccountId;
@ApiModelProperty(value = "运营人员ID(负责这个order的运营人员id")
private Integer userOperateId;
@ApiModelProperty(value = "订单编号")
private String orderNo;
@ApiModelProperty(value = "订单名称")
private String orderName;
@ApiModelProperty(value = "订单总金额")
private BigDecimal orderAmt;
@ApiModelProperty(value = "订单金额中的现金金额")
private BigDecimal cashAmt;
@ApiModelProperty(value = "订单金额中的信用金额")
private BigDecimal creditAmt;
@ApiModelProperty(value = "任务飞行地址")
private String taskAddress;
@ApiModelProperty(value = "基本信息")
private String basicInfo;
@ApiModelProperty(value = "服务开始时间")
private LocalDateTime startTime;
@ApiModelProperty(value = "服务结束时间")
private LocalDateTime endTime;
@ApiModelProperty(value = "实际服务开始时间")
private LocalDateTime acStartTime;
@ApiModelProperty(value = "实际服务结束时间")
private LocalDateTime acEndTime;
@ApiModelProperty(value = "0下单初始化(待分配运营)-> 100已分配运营(待需求确认)-> 200已经需求确认(待订单确认)-> 300已订单确认(待预支付)-> 400已预支付(调度中)-> 500飞手已接单(待抵达现场)-> 525飞手已抵达(待开始作业)-> 550已开始作业(作业中)-> 575飞手已完成作业(待平台确认作业完成)-> 600平台已确认作业完成(待验收结算)-> 700验收通过-> 900订单关闭")
private Integer orderStatus;
@ApiModelProperty(value = "评价状态:0未评价 1已评价")
private Integer evaluateStatus;
private LocalDateTime createTime;
private LocalDateTime updateTime;
@ApiModelProperty(value = "服务项ID")
private Integer inspectionId;
@ApiModelProperty(value = "服务名称")
private String inspectionName;
@ApiModelProperty(value = "最近一次操作信息")
private String lastMsg;
@ApiModelProperty(value = "任务地址经度")
private BigDecimal lon;
@ApiModelProperty(value = "任务地址纬度")
private BigDecimal lat;
@ApiModelProperty(value = "订单关闭原因")
private String shutReason;
@ApiModelProperty(value = "是否营销数据(假数据):0:否 1:是")
private Boolean isDummy;
@ApiModelProperty(value = "平台备注")
private String pfRemark;
@ApiModelProperty(value = "飞手类型(0个人飞手 1飞手机构)")
private Integer flyerType;
@ApiModelProperty(value = "任务飞手人数")
private Integer flyerNum;
@ApiModelProperty(value = "0:隐藏 1:显示(隐藏后飞手端不显示,不参与抢单)")
private Integer display;
@ApiModelProperty(value = "飞手评价:0未评价 1已评价")
private Integer flyerEval;
@ApiModelProperty(value = "是否进行过催单 0:未通知 1:已通知")
private Integer isUrge;
@ApiModelProperty(value = "订单类型:0普通订单,1推荐订单,2加急单")
private Integer orderType;
@ApiModelProperty(value = "需求确认备注")
private String cmdRemark;
@ApiModelProperty(value = "飞手抢单开始时间")
private LocalDateTime flyerStartTime;
@ApiModelProperty(value = "飞手抢单结束时间")
private LocalDateTime flyerEndTime;
@ApiModelProperty(value = "推荐机构")
private Integer rcdCompanyId;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Set;
/**
* @Author small
* @Date 2023/5/24 14:58
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.model.dto.RepoAccountDTO", description = "云仓账号信息DTO")
public class RepoAccountDTO implements Serializable {
private static final long serialVersionUID = 1433562781546856233L;
@ApiModelProperty(value = "用户id")
private Integer id;
@ApiModelProperty(value = "用户uid")
private String uid;
@ApiModelProperty(value = "账号名称")
private String accountName;
@ApiModelProperty(value = "账号类型")
private Integer accountType;
@ApiModelProperty(value = "联系电话")
private String phoneNum;
@ApiModelProperty(value = "实名认证状态")
private Integer realAuthStatus;
@ApiModelProperty(value = "企业认证状态")
private Integer entAuthStatus;
@ApiModelProperty(value = "渠道认证状态")
private Integer channelAuthStatus;
@ApiModelProperty(value = "渠道等级")
private Integer channelClass;
@ApiModelProperty(value = "常驻城市")
private String resAddress;
@ApiModelProperty(value = "昵称")
private String nickName;
@ApiModelProperty(value = "头像url")
private String headerImg;
@ApiModelProperty(value = "经度")
private BigDecimal lon;
@ApiModelProperty(value = "纬度")
private BigDecimal lat;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "删除状态,0未删除,1删除")
private Integer deleted;
@ApiModelProperty(value = "企业名称")
private String entName;
@ApiModelProperty(value = "用户名称")
private String userName;
@ApiModelProperty(value = "企业认证时间")
private Date entAuthTime;
@ApiModelProperty(value = "生成时间")
private Date createTime;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "现金余额")
private BigDecimal cashAmt;
private String unionId;
private String openId;
@ApiModelProperty(value = "多端用户,USER_PORT(云享飞)-FLYER_PORT(云飞手)-REPO_PORT(云仓)")
private Set<String> ports;
@ApiModelProperty(value = "用户推荐人数量")
private Integer rcdRepoTeamNum;
@ApiModelProperty(value = "推荐人Uid")
private String rcdUid;
@ApiModelProperty(value = "推荐人账户名称")
private String rcdAccountName;
@ApiModelProperty(value = "推荐人昵称")
private String rcdNickName;
@ApiModelProperty(value = "推荐人id")
private Integer rcdAccountId;
@ApiModelProperty(value = "是否销售")
private Integer sale;
@ApiModelProperty(value = "是否白名单")
private Integer white;
@ApiModelProperty(value = "用户来源:0自然流,1海报,2抖音,3公众号,4社群,5招投标,默认0")
private Integer source;
@ApiModelProperty(value = "推荐单位")
private String company;
@ApiModelProperty(value = "推荐单位ID", hidden = true)
private Integer rcdCompanyId;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small
* @Date 2023/5/24 14:56
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "com.mmc.csf.model.dto.RoleInfoDTO", description = "角色信息DTO")
public class RoleInfoDTO implements Serializable {
private static final long serialVersionUID = -4791023169682602298L;
@ApiModelProperty(value = "角色ID")
private Integer id;
@ApiModelProperty(value = "角色编号")
private String roleNo;
@ApiModelProperty(value = "角色名称")
private String roleName;
@ApiModelProperty(value = "是否为管理角色:0否 1是")
private Integer admin;// 是否为管理角色
@ApiModelProperty(value = "是否为运营角色:0否 1是")
private Integer operate;
@ApiModelProperty(value = "是否为系统角色:0否 1是")
private Integer system;
@ApiModelProperty(value = "是否为PMC发货角色:0否 1是")
private Integer pmc;//PMC发货角色
@ApiModelProperty(value = "是否可用:0否 1是")
private Integer roleStatus;
@ApiModelProperty(value = "备注")
private String remark;
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @Author small
* @Date 2023/5/24 15:02
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.model.dto.TaskFlyerCostDTO", description = "飞手工资DTO")
public class TaskFlyerCostDTO implements Serializable {
private static final long serialVersionUID = 4411028098471010440L;
@ApiModelProperty(value = "飞手工资id")
private Integer id;
@ApiModelProperty(value = "订单id")
private Integer orderTaskId;
@ApiModelProperty(value = "飞手日薪")
private BigDecimal flyerWag;
@ApiModelProperty(value = "飞手每日补贴")
private BigDecimal flyerSudy;
@ApiModelProperty(value = "每月工资结算日")
private Integer payDay;
@ApiModelProperty(value = "租房补贴")
private BigDecimal rentHouseSudy;
@ApiModelProperty(value = "交通补贴")
private BigDecimal trafficSudy;
@ApiModelProperty(value = "支付比例(例如0.95)")
private BigDecimal payPersent;
@ApiModelProperty(value = "设备信息")
private String deviceInfo;
@ApiModelProperty(value = "生成时间")
private Date createTime;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "任务编号")
private String orderNo;
@ApiModelProperty(value = "任务名称")
private String orderName;
@ApiModelProperty(value = "飞手数量")
private Integer flyerNum;
@ApiModelProperty(value = "服务类型")
private String inspectionName;
@ApiModelProperty(value = "飞手类型(0个人飞手 1飞手机构)")
private Integer flyerType;
@ApiModelProperty(value = "任务工资信息列表")
private List<WagTermDetailDTO> details;
@ApiModelProperty(value = "任务开始日")
private Date startTime;
@ApiModelProperty(value = "任务结束日")
private Date endTime;
@ApiModelProperty(value = "高温补贴")
private BigDecimal hotSudy;
@ApiModelProperty(value = "预估金额")
private BigDecimal estimateWag;
@ApiModelProperty(value = "补助标签")
private String sudyTag;
public void defaultValue() {
if (this.flyerWag == null) {
this.flyerWag = BigDecimal.ZERO;
}
if (this.flyerSudy == null) {
this.flyerSudy = BigDecimal.ZERO;
}
if (this.rentHouseSudy == null) {
this.rentHouseSudy = BigDecimal.ZERO;
}
if (this.trafficSudy == null) {
this.trafficSudy = BigDecimal.ZERO;
}
if (this.payPersent == null) {
this.payPersent = BigDecimal.ZERO;
}
if(this.hotSudy == null) {
this.hotSudy = BigDecimal.ZERO;
}
}
}
package com.mmc.oms.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author small
* @Date 2023/5/24 15:20
* @Version 1.0
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
//@ApiModel(value = "com.mmc.csf.mall.dto.TypeGoodsInfoDTO", description = "分类下关联的商品")
public class TypeGoodsInfoDTO implements Serializable {
private static final long serialVersionUID = 7151146563536604554L;
@ApiModelProperty(value = "商品id")
private Integer goodsId;
@ApiModelProperty(value = "商品名称")
private String goodsName;
@ApiModelProperty(value = "商品主图")
private String goodsImg;
@ApiModelProperty(value = "商品上下架状态")
private Integer shelfStatus;
@ApiModelProperty(value = "商品安全编码是否显示:0否 1是")
private Integer showCode;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论