# Conflicts:
#	src/main/java/com/sqx/modules/artificer/service/impl/OrdersServiceImpl.java
This commit is contained in:
yangjun 2024-06-20 21:45:02 +08:00
commit 767c6f1fda
20 changed files with 1954 additions and 883 deletions

View File

@ -144,7 +144,7 @@ public class Artificer implements Serializable {
* 技师类型 比例 * 技师类型 比例
*/ */
@TableField(exist = false) @TableField(exist = false)
private Integer technicianTypeRate; private BigDecimal technicianTypeRate;
/** /**
* 是否是明星技师 1是 2否 * 是否是明星技师 1是 2否

View File

@ -102,7 +102,7 @@ public class Orders implements Serializable {
private Integer payWay; private Integer payWay;
/** /**
* 状态 1待支付 2待服务 3待评论 4已取消 5已完成 6进行中 7技师出发 8技师到达 * 状态 1待支付 2待服务 3待评论 4已取消 5已完成 6进行中 7技师出发 8技师到达 9用户已支付技师待接单 10待补单
*/ */
private Integer status; private Integer status;
@ -202,7 +202,7 @@ public class Orders implements Serializable {
/** /**
* 优惠券id * 优惠券id
*/ */
private Long couponId; private String couponId;
/** /**
* 优惠券金额 * 优惠券金额
@ -278,7 +278,7 @@ public class Orders implements Serializable {
private Integer warning; private Integer warning;
/** /**
* 是否是储蓄金支付 1是 * 是否是储蓄金支付 1是 -- 暂无用
*/ */
private Integer userArtificerMoney; private Integer userArtificerMoney;
/** /**
@ -371,6 +371,12 @@ public class Orders implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private String shopPhone; private String shopPhone;
/**
* 会员优惠比例
*/
@TableField(exist = false)
private BigDecimal vipRate;
@TableField(exist = false) @TableField(exist = false)
private String userRecharge; private String userRecharge;

View File

@ -110,7 +110,7 @@ public class MassagePackage implements Serializable {
/** /**
* 服务分类ID * 服务分类ID
*/ */
private Integer classifyId; private Long classifyId;
/** /**
* 类型名称 * 类型名称

View File

@ -100,7 +100,7 @@ public class UserPackage implements Serializable {
/** /**
* 服务分类ID * 服务分类ID
*/ */
private Integer classifyId; private Long classifyId;
/** /**
* 服务分类名称 * 服务分类名称

View File

@ -44,7 +44,7 @@ public class UserPackageDetail implements Serializable {
private Long massageTypeId; private Long massageTypeId;
/** /**
* 状态 1上 2下 * 状态是否使用0未使用1已使用
*/ */
private Integer status; private Integer status;

View File

@ -127,7 +127,7 @@ public class UserPackageOrderServiceImpl extends ServiceImpl<UserPackageOrderDao
BigDecimal canCouponMoney = BigDecimal.ZERO;//当可用代金券时的金额 BigDecimal canCouponMoney = BigDecimal.ZERO;//当可用代金券时的金额
BigDecimal canVipMoney = BigDecimal.ZERO;//当可用vip时的金额 BigDecimal canVipMoney = BigDecimal.ZERO;//当可用vip时的金额
BigDecimal totalMoney = BigDecimal.ZERO;//总金额 BigDecimal totalMoney = BigDecimal.ZERO;//总金额
List<Integer> classifyIdArr = Lists.newArrayList(); List<Long> classifyIdArr = Lists.newArrayList();
List<UserPackageOrdersMapping> ordersPackageList = userPackageOrder.getOrdersPackageList(); List<UserPackageOrdersMapping> ordersPackageList = userPackageOrder.getOrdersPackageList();
for (UserPackageOrdersMapping ordersPackage : ordersPackageList) { for (UserPackageOrdersMapping ordersPackage : ordersPackageList) {
MassagePackage massagePackage = massagePackageService.getById(ordersPackage.getPackageId()); MassagePackage massagePackage = massagePackageService.getById(ordersPackage.getPackageId());
@ -139,7 +139,7 @@ public class UserPackageOrderServiceImpl extends ServiceImpl<UserPackageOrderDao
canVipMoney = canVipMoney.add(sum); canVipMoney = canVipMoney.add(sum);
} }
totalMoney = totalMoney.add(sum); totalMoney = totalMoney.add(sum);
Integer classifyId = massagePackage.getClassifyId(); Long classifyId = massagePackage.getClassifyId();
classifyIdArr.add(classifyId); classifyIdArr.add(classifyId);
} }

View File

@ -11,11 +11,11 @@ public enum CommonEnum {
NONE(null,null,null,null), NONE(null,null,null,null),
/**距离服务开始n个小时以上免费取消*/ /**距离服务开始n个小时以上免费取消*/
V3_ORDER_FORM_CANCEL_NOT_START_01(436, "v3_order_form", "距离服务开始n个小时以上免费取消", "4"), V3_ORDER_FORM_CANCEL_NOT_START_01(436, "v3_order_form", "距离服务开始n分钟以上免费取消", "240"),
/**距离服务开始前取消n-n个小时内收取n元*/ /**距离服务开始前取消n-n个小时内收取n元*/
V3_ORDER_FORM_CANCEL_NOT_START_02(437, "v3_order_form", "距离服务开始前取消n-n个小时内收取n元", "1.5,4,10"), V3_ORDER_FORM_CANCEL_NOT_START_02(437, "v3_order_form", "距离服务开始前取消n-n分钟内收取n元", "90,240,10"),
/**距离服务开始前取消少于n个小时内收取n元*/ /**距离服务开始前取消少于n个小时内收取n元*/
V3_ORDER_FORM_CANCEL_NOT_START_03(438, "v3_order_form", "距离服务开始前取消少于n个小时内收取n元", "1.5,30"), V3_ORDER_FORM_CANCEL_NOT_START_03(438, "v3_order_form", "距离服务开始前取消少于n分钟内收取n元", "90,30"),
/**服务开始n分钟内取消订单扣项目费用n%车费全扣n%*/ /**服务开始n分钟内取消订单扣项目费用n%车费全扣n%*/
V3_ORDER_FORM_CANCEL_START_01(439, "v3_order_form", "服务开始n分钟内取消订单扣项目费用n%车费全扣n%", "15,50,100"), V3_ORDER_FORM_CANCEL_START_01(439, "v3_order_form", "服务开始n分钟内取消订单扣项目费用n%车费全扣n%", "15,50,100"),

View File

@ -31,7 +31,6 @@ import java.util.Map;
@Service @Service
public class CommonInfoServiceImpl extends ServiceImpl<CommonInfoDao, CommonInfo> implements CommonInfoService { public class CommonInfoServiceImpl extends ServiceImpl<CommonInfoDao, CommonInfo> implements CommonInfoService {
private final CommonInfoDao commonInfoDao; private final CommonInfoDao commonInfoDao;
private final UserRechargeDao userRechargeDao; private final UserRechargeDao userRechargeDao;
private final ArtificerPartitioningDetailsMapper artificerPartitioningDetailsMapper; private final ArtificerPartitioningDetailsMapper artificerPartitioningDetailsMapper;
@ -142,54 +141,52 @@ public class CommonInfoServiceImpl extends ServiceImpl<CommonInfoDao, CommonInfo
@Override @Override
public CommonInfo isCheckChangeOrder(Date businessTime, Date nowTime) { public CommonInfo isCheckChangeOrder(Date businessTime, Date nowTime) {
long bnDiffDay = DateUtil.between(businessTime, nowTime, DateUnit.DAY, false); long bnDiffDay = DateUtil.between(nowTime, businessTime, DateUnit.MINUTE, false);
Map<Integer, CommonInfo> configMap = getMapByCondition(CommonEnum.GroupConditionEnum.V3_ORDER_FORM.getValue()); Map<Integer, CommonInfo> configMap = getMapByCondition(CommonEnum.GroupConditionEnum.V3_ORDER_FORM.getValue());
CommonInfo defCommonInfo = new CommonInfo(); CommonInfo defCommonInfo = new CommonInfo();
if(bnDiffDay >= 0) { if(bnDiffDay > 0) {
//正数 开始前 //正数 开始前
//距离服务开始n个小时以上免费取消 - 4 //距离服务开始n分钟以上免费取消 240
CommonInfo v3OrderFormCancelNotStart01 = configMap.getOrDefault(CommonEnum.V3_ORDER_FORM_CANCEL_NOT_START_01.getKey(), defCommonInfo); CommonInfo v3OrderFormCancelNotStart01 = configMap.getOrDefault(CommonEnum.V3_ORDER_FORM_CANCEL_NOT_START_01.getKey(), defCommonInfo);
Double v3OrderFormCancelNotStart01D = CommonConfigUtil.getDoubleValue(v3OrderFormCancelNotStart01.getValue()); Long v3OrderFormCancelNotStart01D = CommonConfigUtil.getLongValue(v3OrderFormCancelNotStart01.getValue());
if(v3OrderFormCancelNotStart01D == null) v3OrderFormCancelNotStart01D = -1D; if(v3OrderFormCancelNotStart01D == null) v3OrderFormCancelNotStart01D = 240L;
//距离服务开始前取消n-n个小时内收取n元 - 1.5,4,10 //距离服务开始前取消n-n分钟内收取n元 90,240,10
CommonInfo v3OrderFormCancelNotStart02 = configMap.getOrDefault(CommonEnum.V3_ORDER_FORM_CANCEL_NOT_START_02.getKey(), defCommonInfo); CommonInfo v3OrderFormCancelNotStart02 = configMap.getOrDefault(CommonEnum.V3_ORDER_FORM_CANCEL_NOT_START_02.getKey(), defCommonInfo);
String[] v3OrderFormCancelNotStart02A = CommonConfigUtil.getArrayValue(v3OrderFormCancelNotStart01.getValue()); String[] v3OrderFormCancelNotStart02A = CommonConfigUtil.getArrayValue(v3OrderFormCancelNotStart02.getValue());
if(v3OrderFormCancelNotStart02A == null) v3OrderFormCancelNotStart02A = new String[]{ "-1","4","10" }; if(v3OrderFormCancelNotStart02A == null) v3OrderFormCancelNotStart02A = new String[]{ "90","240","10" };
double v3OrderFormCancelNotStart02D = Double.parseDouble(v3OrderFormCancelNotStart02A[0]); Long v3OrderFormCancelNotStart02D = CommonConfigUtil.getLongValue(v3OrderFormCancelNotStart02A[0]);
//距离服务开始前取消少于n个小时内收取n元 -1.5,30 //距离服务开始前取消少于n分钟内收取n元 90,30
CommonInfo v3OrderFormCancelNotStart03 = configMap.getOrDefault(CommonEnum.V3_ORDER_FORM_CANCEL_NOT_START_03.getKey(), defCommonInfo); CommonInfo v3OrderFormCancelNotStart03 = configMap.getOrDefault(CommonEnum.V3_ORDER_FORM_CANCEL_NOT_START_03.getKey(), defCommonInfo);
String[] v3OrderFormCancelNotStart03A = CommonConfigUtil.getArrayValue(v3OrderFormCancelNotStart01.getValue()); String[] v3OrderFormCancelNotStart03A = CommonConfigUtil.getArrayValue(v3OrderFormCancelNotStart03.getValue());
if(v3OrderFormCancelNotStart03A == null) v3OrderFormCancelNotStart03A = new String[]{ "-1","30" }; if(v3OrderFormCancelNotStart03A == null) v3OrderFormCancelNotStart03A = new String[]{ "90","30" };
double v3OrderFormCancelNotStart03D = Double.parseDouble(v3OrderFormCancelNotStart03A[0]); Long v3OrderFormCancelNotStart03D = CommonConfigUtil.getLongValue(v3OrderFormCancelNotStart03A[0]);
if(bnDiffDay > v3OrderFormCancelNotStart01D && v3OrderFormCancelNotStart01D != -1){ if(bnDiffDay >= v3OrderFormCancelNotStart01D){
//外面的 //外面的
return v3OrderFormCancelNotStart01; return v3OrderFormCancelNotStart01;
} else if(bnDiffDay <= v3OrderFormCancelNotStart01D && bnDiffDay >= v3OrderFormCancelNotStart02D && v3OrderFormCancelNotStart02D != -1){ } else if(bnDiffDay >= v3OrderFormCancelNotStart02D && bnDiffDay < v3OrderFormCancelNotStart01D ){
return v3OrderFormCancelNotStart02; return v3OrderFormCancelNotStart02;
} else if(bnDiffDay < v3OrderFormCancelNotStart02D && bnDiffDay >= v3OrderFormCancelNotStart03D && v3OrderFormCancelNotStart03D != -1){ } else if(bnDiffDay < v3OrderFormCancelNotStart03D){
return v3OrderFormCancelNotStart03;
} else if(v3OrderFormCancelNotStart03D > bnDiffDay){
return v3OrderFormCancelNotStart03; return v3OrderFormCancelNotStart03;
} }
} else { } else {
//负数开始后 //负数开始后
long bnDiffMinute = DateUtil.between(businessTime, nowTime, DateUnit.MINUTE, false); long bnDiffMinute = DateUtil.between(businessTime, nowTime, DateUnit.MINUTE, false);
//服务开始n分钟内取消订单扣项目费用n%车费全扣n% - 15,50,100 //服务开始n分钟内取消订单扣项目费用n%车费全扣n% 15,50,100
CommonInfo v3OrderFormCancelStart01 = configMap.getOrDefault(CommonEnum.V3_ORDER_FORM_CANCEL_START_01.getKey(), defCommonInfo); CommonInfo v3OrderFormCancelStart01 = configMap.getOrDefault(CommonEnum.V3_ORDER_FORM_CANCEL_START_01.getKey(), defCommonInfo);
String[] v3OrderFormCancelStart01A = CommonConfigUtil.getArrayValue(v3OrderFormCancelStart01.getValue()); String[] v3OrderFormCancelStart01A = CommonConfigUtil.getArrayValue(v3OrderFormCancelStart01.getValue());
if(v3OrderFormCancelStart01A == null) v3OrderFormCancelStart01A = new String[]{ "-1","0","0" }; if(v3OrderFormCancelStart01A == null) v3OrderFormCancelStart01A = new String[]{ "15","50","100" };
double v3OrderFormCancelStart01I = Double.parseDouble(v3OrderFormCancelStart01A[0]); Long v3OrderFormCancelStart01I = CommonConfigUtil.getLongValue(v3OrderFormCancelStart01A[0]);
//服务开始n分钟后不可以取消订单 - 15 //服务开始n分钟后不可以取消订单 15
CommonInfo v3OrderFormCancelStart02 = configMap.getOrDefault(CommonEnum.V3_ORDER_FORM_CANCEL_START_02.getKey(), defCommonInfo); CommonInfo v3OrderFormCancelStart02 = configMap.getOrDefault(CommonEnum.V3_ORDER_FORM_CANCEL_START_02.getKey(), defCommonInfo);
Double v3OrderFormCancelStart02I = CommonConfigUtil.getDoubleValue(v3OrderFormCancelStart02.getValue()); Long v3OrderFormCancelStart02I = CommonConfigUtil.getLongValue(v3OrderFormCancelStart02.getValue());
if(v3OrderFormCancelStart02I == null) v3OrderFormCancelStart02I = -1D; if(v3OrderFormCancelStart02I == null) v3OrderFormCancelStart02I = 15L;
if(bnDiffMinute <= v3OrderFormCancelStart01I) { if(bnDiffMinute <= v3OrderFormCancelStart01I) {
return v3OrderFormCancelStart01; return v3OrderFormCancelStart01;
} else if(bnDiffMinute >= v3OrderFormCancelStart02I){ } else if(bnDiffMinute > v3OrderFormCancelStart02I){
return v3OrderFormCancelStart02; return v3OrderFormCancelStart02;
} }
} }
@ -223,6 +220,4 @@ public class CommonInfoServiceImpl extends ServiceImpl<CommonInfoDao, CommonInfo
} }
} }
} }

View File

@ -44,7 +44,7 @@ public class Coupon implements Serializable {
private Integer couType; private Integer couType;
@ApiModelProperty("分类ID0为通用非0为具体分类ID") @ApiModelProperty("分类ID0为通用非0为具体分类ID")
private Integer classifyId; private Long classifyId;
public Coupon() {} public Coupon() {}
} }

View File

@ -60,7 +60,10 @@ public class CouponUser implements Serializable {
private Long couponIssueId; private Long couponIssueId;
@ApiModelProperty("分类ID0为通用非0为具体分类ID") @ApiModelProperty("分类ID0为通用非0为具体分类ID")
private Integer classifyId; private Long classifyId;
@TableField(exist = false)
private String classifyName;
@TableField(exist = false) @TableField(exist = false)
private String nickName; private String nickName;

View File

@ -40,5 +40,6 @@ public interface MessageService extends IService<MessageInfo> {
Result selectArtificerScoreList(Integer page,Integer limit,String artificerName,String phone,Long userId); Result selectArtificerScoreList(Integer page,Integer limit,String artificerName,String phone,Long userId);
void sendNoticeByCall(Long userId);
} }

View File

@ -236,4 +236,17 @@ public class MessageServiceImpl extends
return Result.success().put("data",new PageUtils(baseMapper.selectArtificerScoreList(new Page<>(page,limit),artificerName,phone,userId))); return Result.success().put("data",new PageUtils(baseMapper.selectArtificerScoreList(new Page<>(page,limit),artificerName,phone,userId)));
} }
@Override
public void sendNoticeByCall(Long userId){
//技师电话通知业务
UserEntity byId = userService.getById(userId);
//accountId
String accountId = commonInfoService.findOne(428).getValue();
//token
String token = commonInfoService.findOne(429).getValue();
//templateId
String templateId = commonInfoService.findOne(430).getValue();
AppNotifyUtil.AppNotify(byId.getPhone(),accountId,token,templateId);
}
} }

View File

@ -179,51 +179,46 @@ public class AliPayController {
payDetailsDao.updateState(payDetails.getId(), 1, sdf.format(new Date()), tradeNo); payDetailsDao.updateState(payDetails.getId(), 1, sdf.format(new Date()), tradeNo);
if (payDetails.getType() == 1) { if (payDetails.getType() == 1) {
Orders orders = ordersService.selectOrdersByOrderNo(payDetails.getOrderId()); Orders orders = ordersService.selectOrdersByOrderNo(payDetails.getOrderId());
orders.setStatus(2); orders.setStatus(9);//用户已支付技师待接单
orders.setPayWay(6); orders.setPayWay(6);
orders.setPayTime(sdf.format(new Date())); orders.setPayTime(sdf.format(new Date()));
BigDecimal pingMoney=orders.getPayMoney(); BigDecimal pingMoney=orders.getPayMoney();
UserEntity user = userService.selectUserById(orders.getUserId()); // 分佣在订单完成后进行计算 2024-06-20 by caolei
// UserEntity user = userService.selectUserById(orders.getUserId());
UserEntity oneUser = userService.queryByInvitationCode(user.getInviterCode()); // UserEntity oneUser = userService.queryByInvitationCode(user.getInviterCode());
BigDecimal oneUserMoney=BigDecimal.ZERO; BigDecimal oneUserMoney=BigDecimal.ZERO;
if(oneUser!=null && oneUser.getIsAgency()!=null && oneUser.getIsAgency()==1){ // if(oneUser!=null && oneUser.getIsAgency()!=null && oneUser.getIsAgency()==1){
orders.setOneUserId(oneUser.getUserId()); // orders.setOneUserId(oneUser.getUserId());
orders.setOneUserName(oneUser.getUserName()); // orders.setOneUserName(oneUser.getUserName());
oneUserMoney=pingMoney.multiply(oneUser.getUserRate()); // oneUserMoney=pingMoney.multiply(oneUser.getUserRate());
// }
}
Artificer artificer = artificerService.getById(orders.getArtificerId()); Artificer artificer = artificerService.getById(orders.getArtificerId());
// UserEntity artificerUser = userService.selectUserById(artificer.getUserId());
UserEntity artificerUser = userService.selectUserById(artificer.getUserId()); // UserEntity oneArtificerUser = userService.queryByInvitationCode(artificerUser.getInviterCode());
UserEntity oneArtificerUser = userService.queryByInvitationCode(artificerUser.getInviterCode());
BigDecimal oneArtificerMoney=BigDecimal.ZERO; BigDecimal oneArtificerMoney=BigDecimal.ZERO;
if(oneArtificerUser!=null && oneArtificerUser.getIsAgency()!=null && oneArtificerUser.getIsAgency()==1){ // if(oneArtificerUser!=null && oneArtificerUser.getIsAgency()!=null && oneArtificerUser.getIsAgency()==1){
orders.setOneArtificerUserId(oneArtificerUser.getUserId()); // orders.setOneArtificerUserId(oneArtificerUser.getUserId());
orders.setOneArtificerUserName(oneArtificerUser.getUserName()); // orders.setOneArtificerUserName(oneArtificerUser.getUserName());
oneArtificerMoney=pingMoney.multiply(oneArtificerUser.getShopRate()); // oneArtificerMoney=pingMoney.multiply(oneArtificerUser.getShopRate());
//
} // }
BigDecimal shopMoney=BigDecimal.ZERO; BigDecimal shopMoney=BigDecimal.ZERO;
if(artificerUser.getConsortiaId()!=null){ // if(artificerUser.getConsortiaId()!=null){
Consortia consortia = consortiaService.getById(artificerUser.getConsortiaId()); // Consortia consortia = consortiaService.getById(artificerUser.getConsortiaId());
if(consortia!=null && consortia.getUserId()!=null){ // if(consortia!=null && consortia.getUserId()!=null){
UserEntity consortiaUser = userService.getById(consortia.getUserId()); // UserEntity consortiaUser = userService.getById(consortia.getUserId());
if(consortiaUser!=null){ // if(consortiaUser!=null){
shopMoney = pingMoney.multiply(consortia.getRate()); // shopMoney = pingMoney.multiply(consortia.getRate());
orders.setConsortiaId(consortia.getConsortiaId()); // orders.setConsortiaId(consortia.getConsortiaId());
orders.setShopUserId(consortiaUser.getUserId()); // orders.setShopUserId(consortiaUser.getUserId());
orders.setShopUserName(consortiaUser.getUserName()); // orders.setShopUserName(consortiaUser.getUserName());
//
} // }
} // }
} // }
pingMoney=pingMoney.subtract(orders.getArtificerMoney()); pingMoney=pingMoney.subtract(orders.getArtificerMoney());
pingMoney=pingMoney.subtract(oneUserMoney); pingMoney=pingMoney.subtract(oneUserMoney);
pingMoney=pingMoney.subtract(oneArtificerMoney); pingMoney=pingMoney.subtract(oneArtificerMoney);
@ -279,8 +274,6 @@ public class AliPayController {
} }
} }
Orders orders1 = ordersDao.selectById(orders.getParentId()); Orders orders1 = ordersDao.selectById(orders.getParentId());
if(orders1.getAddNum()==null){ if(orders1.getAddNum()==null){
orders1.setAddNum(1); orders1.setAddNum(1);
@ -304,24 +297,25 @@ public class AliPayController {
orders1.setSumArtificerMoney(orders1.getSumArtificerMoney().add(orders.getArtificerMoney())); orders1.setSumArtificerMoney(orders1.getSumArtificerMoney().add(orders.getArtificerMoney()));
pingMoney=orders1.getSumMoney(); pingMoney=orders1.getSumMoney();
// 分佣在订单完成后进行计算 2024-06-20 by caolei
oneUserMoney=BigDecimal.ZERO; oneUserMoney=BigDecimal.ZERO;
if(oneUser!=null && oneUser.getIsAgency()!=null && oneUser.getIsAgency()==1){ // if(oneUser!=null && oneUser.getIsAgency()!=null && oneUser.getIsAgency()==1){
oneUserMoney=pingMoney.multiply(oneUser.getUserRate()); // oneUserMoney=pingMoney.multiply(oneUser.getUserRate());
} // }
oneArtificerMoney=BigDecimal.ZERO; oneArtificerMoney=BigDecimal.ZERO;
if(oneArtificerUser!=null && oneArtificerUser.getIsAgency()!=null && oneArtificerUser.getIsAgency()==1){ // if(oneArtificerUser!=null && oneArtificerUser.getIsAgency()!=null && oneArtificerUser.getIsAgency()==1){
oneArtificerMoney=pingMoney.multiply(oneArtificerUser.getShopRate()); // oneArtificerMoney=pingMoney.multiply(oneArtificerUser.getShopRate());
} // }
shopMoney=BigDecimal.ZERO; shopMoney=BigDecimal.ZERO;
if(artificerUser.getConsortiaId()!=null){ // if(artificerUser.getConsortiaId()!=null){
Consortia consortia = consortiaService.getById(artificerUser.getConsortiaId()); // Consortia consortia = consortiaService.getById(artificerUser.getConsortiaId());
if(consortia!=null && consortia.getUserId()!=null){ // if(consortia!=null && consortia.getUserId()!=null){
UserEntity consortiaUser = userService.getById(consortia.getUserId()); // UserEntity consortiaUser = userService.getById(consortia.getUserId());
if(consortiaUser!=null){ // if(consortiaUser!=null){
shopMoney=pingMoney.multiply(consortia.getRate()); // shopMoney=pingMoney.multiply(consortia.getRate());
} // }
} // }
} // }
pingMoney=pingMoney.subtract(orders1.getSumArtificerMoney()); pingMoney=pingMoney.subtract(orders1.getSumArtificerMoney());
pingMoney=pingMoney.subtract(oneUserMoney); pingMoney=pingMoney.subtract(oneUserMoney);
pingMoney=pingMoney.subtract(oneArtificerMoney); pingMoney=pingMoney.subtract(oneArtificerMoney);
@ -353,6 +347,8 @@ public class AliPayController {
messageInfo.setUserId("0"); messageInfo.setUserId("0");
messageInfo.setIsSee("0"); messageInfo.setIsSee("0");
messageService.saveBody(messageInfo); messageService.saveBody(messageInfo);
//电话通知 add 2024-06-20 by caolei
messageService.sendNoticeByCall(artificer.getUserId());
} }
ordersService.sendMsg(orders); ordersService.sendMsg(orders);
@ -758,9 +754,6 @@ public class AliPayController {
} }
} }
} }
} }
//通知页面地址 //通知页面地址
@ -775,7 +768,11 @@ public class AliPayController {
payDetails.setCreateTime(sdf.format(new Date())); payDetails.setCreateTime(sdf.format(new Date()));
payDetails.setOrderId(orders.getOrdersNo()); payDetails.setOrderId(orders.getOrdersNo());
payDetails.setUserId(orders.getUserId()); payDetails.setUserId(orders.getUserId());
if(orders.getUserPackageDetailId() !=null ){
payDetails.setMoney(orders.getTaxiMoney().doubleValue());
}else{
payDetails.setMoney(orders.getPayMoney().doubleValue()); payDetails.setMoney(orders.getPayMoney().doubleValue());
}
payDetails.setClassify(6); payDetails.setClassify(6);
payDetails.setType(1); payDetails.setType(1);
payDetailsDao.insert(payDetails); payDetailsDao.insert(payDetails);
@ -784,11 +781,19 @@ public class AliPayController {
payDetailsDao.updateById(payDetails1); payDetailsDao.updateById(payDetails1);
} }
if (type == 1) { if (type == 1) {
if(orders.getUserPackageDetailId() !=null ){
return payApp(name, orders.getOrdersNo(), orders.getTaxiMoney().doubleValue());
}else{
return payApp(name, orders.getOrdersNo(), orders.getPayMoney().doubleValue()); return payApp(name, orders.getOrdersNo(), orders.getPayMoney().doubleValue());
}
} else {
if(orders.getUserPackageDetailId() !=null ){
return payApp(name, orders.getOrdersNo(), orders.getTaxiMoney().doubleValue());
}else{ }else{
return payH5(name, orders.getOrdersNo(), orders.getPayMoney().doubleValue(), returnUrl); return payH5(name, orders.getOrdersNo(), orders.getPayMoney().doubleValue(), returnUrl);
} }
} }
}
@Login @Login
@ApiOperation("支付宝支付订单") @ApiOperation("支付宝支付订单")

View File

@ -224,8 +224,6 @@ public class WxServiceImpl implements WxService {
} }
} }
} }
} }
PayDetails payDetails1 = payDetailsDao.selectByOrderId(orders.getOrdersNo()); PayDetails payDetails1 = payDetailsDao.selectByOrderId(orders.getOrdersNo());
if(payDetails1==null){ if(payDetails1==null){
@ -234,7 +232,11 @@ public class WxServiceImpl implements WxService {
payDetails.setCreateTime(sdf.format(new Date())); payDetails.setCreateTime(sdf.format(new Date()));
payDetails.setOrderId(orders.getOrdersNo()); payDetails.setOrderId(orders.getOrdersNo());
payDetails.setUserId(orders.getUserId()); payDetails.setUserId(orders.getUserId());
if(orders.getUserPackageDetailId() !=null ){
payDetails.setMoney(orders.getTaxiMoney().doubleValue());
}else{
payDetails.setMoney(orders.getPayMoney().doubleValue()); payDetails.setMoney(orders.getPayMoney().doubleValue());
}
payDetails.setClassify(classify); payDetails.setClassify(classify);
payDetails.setType(1); payDetails.setType(1);
payDetailsDao.insert(payDetails); payDetailsDao.insert(payDetails);
@ -242,8 +244,12 @@ public class WxServiceImpl implements WxService {
payDetails1.setClassify(classify); payDetails1.setClassify(classify);
payDetailsDao.updateById(payDetails1); payDetailsDao.updateById(payDetails1);
} }
if(orders.getUserPackageDetailId() !=null ){
return pay(orders.getTaxiMoney().doubleValue(), classify, orders.getUserId(), orders.getOrdersNo(),request);
}else{
return pay(orders.getPayMoney().doubleValue(), classify, orders.getUserId(), orders.getOrdersNo(),request); return pay(orders.getPayMoney().doubleValue(), classify, orders.getUserId(), orders.getOrdersNo(),request);
} }
}
@Override @Override
public Result payPackageOrder(Long id, Integer classify,HttpServletRequest request) throws Exception { public Result payPackageOrder(Long id, Integer classify,HttpServletRequest request) throws Exception {
@ -654,51 +660,46 @@ public class WxServiceImpl implements WxService {
payDetailsDao.updateState(payDetails.getId(), 1, sdf.format(new Date()), ""); payDetailsDao.updateState(payDetails.getId(), 1, sdf.format(new Date()), "");
if(payDetails.getType()==1){ if(payDetails.getType()==1){
Orders orders = ordersService.selectOrdersByOrderNo(payDetails.getOrderId()); Orders orders = ordersService.selectOrdersByOrderNo(payDetails.getOrderId());
orders.setStatus(2); orders.setStatus(9);//用户已支付技师待接单
orders.setPayWay(payDetails.getClassify()); orders.setPayWay(payDetails.getClassify());
orders.setPayTime(sdf.format(new Date())); orders.setPayTime(sdf.format(new Date()));
BigDecimal pingMoney=orders.getPayMoney(); BigDecimal pingMoney=orders.getPayMoney();
UserEntity user = userService.selectUserById(orders.getUserId()); // 分佣在订单完成后进行计算 2024-06-20 by caolei
// UserEntity user = userService.selectUserById(orders.getUserId());
UserEntity oneUser = userService.queryByInvitationCode(user.getInviterCode()); // UserEntity oneUser = userService.queryByInvitationCode(user.getInviterCode());
BigDecimal oneUserMoney=BigDecimal.ZERO; BigDecimal oneUserMoney=BigDecimal.ZERO;
if(oneUser!=null && oneUser.getIsAgency()!=null && oneUser.getIsAgency()==1){ // if(oneUser!=null && oneUser.getIsAgency()!=null && oneUser.getIsAgency()==1){
orders.setOneUserId(oneUser.getUserId()); // orders.setOneUserId(oneUser.getUserId());
orders.setOneUserName(oneUser.getUserName()); // orders.setOneUserName(oneUser.getUserName());
oneUserMoney=pingMoney.multiply(oneUser.getUserRate()); // oneUserMoney=pingMoney.multiply(oneUser.getUserRate());
//
} // }
Artificer artificer = artificerService.getById(orders.getArtificerId()); Artificer artificer = artificerService.getById(orders.getArtificerId());
// UserEntity artificerUser = userService.selectUserById(artificer.getUserId());
UserEntity artificerUser = userService.selectUserById(artificer.getUserId()); // UserEntity oneArtificerUser = userService.queryByInvitationCode(artificerUser.getInviterCode());
UserEntity oneArtificerUser = userService.queryByInvitationCode(artificerUser.getInviterCode());
BigDecimal oneArtificerMoney=BigDecimal.ZERO; BigDecimal oneArtificerMoney=BigDecimal.ZERO;
if(oneArtificerUser!=null && oneArtificerUser.getIsAgency()!=null && oneArtificerUser.getIsAgency()==1){ // if(oneArtificerUser!=null && oneArtificerUser.getIsAgency()!=null && oneArtificerUser.getIsAgency()==1){
orders.setOneArtificerUserId(oneArtificerUser.getUserId()); // orders.setOneArtificerUserId(oneArtificerUser.getUserId());
orders.setOneArtificerUserName(oneArtificerUser.getUserName()); // orders.setOneArtificerUserName(oneArtificerUser.getUserName());
oneArtificerMoney=pingMoney.multiply(oneArtificerUser.getShopRate()); // oneArtificerMoney=pingMoney.multiply(oneArtificerUser.getShopRate());
//
} // }
BigDecimal shopMoney=BigDecimal.ZERO; BigDecimal shopMoney=BigDecimal.ZERO;
if(artificerUser.getConsortiaId()!=null){ // if(artificerUser.getConsortiaId()!=null){
Consortia consortia = consortiaService.getById(artificerUser.getConsortiaId()); // Consortia consortia = consortiaService.getById(artificerUser.getConsortiaId());
if(consortia!=null && consortia.getUserId()!=null){ // if(consortia!=null && consortia.getUserId()!=null){
UserEntity consortiaUser = userService.getById(consortia.getUserId()); // UserEntity consortiaUser = userService.getById(consortia.getUserId());
if(consortiaUser!=null){ // if(consortiaUser!=null){
shopMoney = pingMoney.multiply(consortia.getRate()); // shopMoney = pingMoney.multiply(consortia.getRate());
orders.setConsortiaId(consortia.getConsortiaId()); // orders.setConsortiaId(consortia.getConsortiaId());
orders.setShopUserId(consortiaUser.getUserId()); // orders.setShopUserId(consortiaUser.getUserId());
orders.setShopUserName(consortiaUser.getUserName()); // orders.setShopUserName(consortiaUser.getUserName());
//
} // }
} // }
} // }
pingMoney=pingMoney.subtract(orders.getArtificerMoney()); pingMoney=pingMoney.subtract(orders.getArtificerMoney());
pingMoney=pingMoney.subtract(oneUserMoney); pingMoney=pingMoney.subtract(oneUserMoney);
pingMoney=pingMoney.subtract(oneArtificerMoney); pingMoney=pingMoney.subtract(oneArtificerMoney);
@ -748,8 +749,6 @@ public class WxServiceImpl implements WxService {
} }
} }
Orders orders1 = ordersDao.selectById(orders.getParentId()); Orders orders1 = ordersDao.selectById(orders.getParentId());
if(orders1.getAddNum()==null){ if(orders1.getAddNum()==null){
orders1.setAddNum(1); orders1.setAddNum(1);
@ -773,24 +772,25 @@ public class WxServiceImpl implements WxService {
orders1.setSumArtificerMoney(orders1.getSumArtificerMoney().add(orders.getArtificerMoney())); orders1.setSumArtificerMoney(orders1.getSumArtificerMoney().add(orders.getArtificerMoney()));
pingMoney=orders1.getSumMoney(); pingMoney=orders1.getSumMoney();
// 分佣在订单完成后进行计算 2024-06-20 by caolei
oneUserMoney=BigDecimal.ZERO; oneUserMoney=BigDecimal.ZERO;
if(oneUser!=null && oneUser.getIsAgency()!=null && oneUser.getIsAgency()==1){ // if(oneUser!=null && oneUser.getIsAgency()!=null && oneUser.getIsAgency()==1){
oneUserMoney=pingMoney.multiply(oneUser.getUserRate()); // oneUserMoney=pingMoney.multiply(oneUser.getUserRate());
} // }
oneArtificerMoney=BigDecimal.ZERO; oneArtificerMoney=BigDecimal.ZERO;
if(oneArtificerUser!=null && oneArtificerUser.getIsAgency()!=null && oneArtificerUser.getIsAgency()==1){ // if(oneArtificerUser!=null && oneArtificerUser.getIsAgency()!=null && oneArtificerUser.getIsAgency()==1){
oneArtificerMoney=pingMoney.multiply(oneArtificerUser.getShopRate()); // oneArtificerMoney=pingMoney.multiply(oneArtificerUser.getShopRate());
} // }
shopMoney=BigDecimal.ZERO; shopMoney=BigDecimal.ZERO;
if(artificerUser.getConsortiaId()!=null){ // if(artificerUser.getConsortiaId()!=null){
Consortia consortia = consortiaService.getById(artificerUser.getConsortiaId()); // Consortia consortia = consortiaService.getById(artificerUser.getConsortiaId());
if(consortia!=null && consortia.getUserId()!=null){ // if(consortia!=null && consortia.getUserId()!=null){
UserEntity consortiaUser = userService.getById(consortia.getUserId()); // UserEntity consortiaUser = userService.getById(consortia.getUserId());
if(consortiaUser!=null){ // if(consortiaUser!=null){
shopMoney=pingMoney.multiply(consortia.getRate()); // shopMoney=pingMoney.multiply(consortia.getRate());
} // }
} // }
} // }
pingMoney=pingMoney.subtract(orders1.getSumArtificerMoney()); pingMoney=pingMoney.subtract(orders1.getSumArtificerMoney());
pingMoney=pingMoney.subtract(oneUserMoney); pingMoney=pingMoney.subtract(oneUserMoney);
pingMoney=pingMoney.subtract(oneArtificerMoney); pingMoney=pingMoney.subtract(oneArtificerMoney);
@ -814,7 +814,6 @@ public class WxServiceImpl implements WxService {
orders1.setEndTime(endTime); orders1.setEndTime(endTime);
} }
ordersDao.updateById(orders1); ordersDao.updateById(orders1);
}else{ }else{
@ -824,6 +823,8 @@ public class WxServiceImpl implements WxService {
messageInfo.setUserId("0"); messageInfo.setUserId("0");
messageInfo.setIsSee("0"); messageInfo.setIsSee("0");
messageService.saveBody(messageInfo); messageService.saveBody(messageInfo);
//电话通知 add 2024-06-20 by caolei
messageService.sendNoticeByCall(artificer.getUserId());
} }
ordersService.sendMsg(orders); ordersService.sendMsg(orders);

View File

@ -136,7 +136,7 @@ public class TravelConfServiceImpl extends ServiceImpl<TravelConfDao, TravelConf
}else{ }else{
//双方混合判断 //双方混合判断
//前台无法创建 23:00:00-12:00:00的数据直接甩出错误或者忽略 //前台无法创建 23:00:00-12:00:00的数据直接甩出错误或者忽略
throw new SqxException("请清空夜间时间配置配置,请联系管理员!"); throw new SqxException("请清空夜间时间配置,请联系管理员!");
} }
return getConfByAccordingCondition(pricingType, travelType, seasonsType, timeIntervalType); return getConfByAccordingCondition(pricingType, travelType, seasonsType, timeIntervalType);
} }
@ -200,6 +200,7 @@ public class TravelConfServiceImpl extends ServiceImpl<TravelConfDao, TravelConf
@Override @Override
public TravelPriceVo calcTravelPrice(Integer _travelType, BigDecimal freeKilometers, String longitude, String latitude, String toLongitude, String toLatitude){ public TravelPriceVo calcTravelPrice(Integer _travelType, BigDecimal freeKilometers, String longitude, String latitude, String toLongitude, String toLatitude){
TravelPriceVo vo = new TravelPriceVo(); TravelPriceVo vo = new TravelPriceVo();
vo.setFreeKilometers(NumberUtil.decimalFormat("0.00",freeKilometers));
Date now = DateTime.now(); Date now = DateTime.now();
//按条件取配置 //按条件取配置

View File

@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
/** /**
* @ClassName TravelPriceVo * @ClassName TravelPriceVo
* @Description TODO * @Description TODO
@ -18,17 +20,21 @@ public class TravelPriceVo {
/**出行价格(元)*/ /**出行价格(元)*/
@ApiModelProperty("出行价格(元)") @ApiModelProperty("出行价格(元)")
String travelPrice; private String travelPrice;
/**出行距离(米)*/ /**出行距离(米)*/
@ApiModelProperty("出行距离(米)") @ApiModelProperty("出行距离(米)")
Integer distances; private Integer distances;
/**出行距离(公里/千米)*/ /**出行距离(公里/千米)*/
@ApiModelProperty("出行距离(公里)") @ApiModelProperty("出行距离(公里)")
String kilometerNum; private String kilometerNum;
/**技师免费公里数*/
@ApiModelProperty("技师免费公里数")
private String freeKilometers;
/**出行配置具体参数*/ /**出行配置具体参数*/
@ApiModelProperty("出行配置具体参数") @ApiModelProperty("出行配置具体参数")
TravelConf conf; private TravelConf conf;
} }

View File

@ -10,7 +10,7 @@
ifnull((select avg(c.score) from taking_commnt c where c.artificer_id=a.artificer_id ),0.00) as ordersScore, ifnull((select avg(c.score) from taking_commnt c where c.artificer_id=a.artificer_id ),0.00) as ordersScore,
(select count(*) from taking_commnt c where c.artificer_id=a.artificer_id ) as commentCount, (select count(*) from taking_commnt c where c.artificer_id=a.artificer_id ) as commentCount,
(st_distance (point (a.longitude, a.latitude),point(#{longitude},#{latitude}) ) *111195) as distance, (st_distance (point (a.longitude, a.latitude),point(#{longitude},#{latitude}) ) *111195) as distance,
v.vip_name as technicianTypeName, (CASE WHEN DATEDIFF(CURDATE(), a.create_time) &lt;=7 THEN 1 ELSE 2 END) AS isNewer v.vip_name as technicianTypeName,v.rate as technicianTypeRate ,(CASE WHEN DATEDIFF(CURDATE(), a.create_time) &lt;=7 THEN 1 ELSE 2 END) AS isNewer
from artificer a from artificer a
left join tb_user u on a.user_id=u.user_id left join tb_user u on a.user_id=u.user_id
left join sys_dict s on s.id=a.classify_id left join sys_dict s on s.id=a.classify_id
@ -83,7 +83,7 @@
(select count(*) from collect_artificer o where o.artificer_id = a.artificer_id and o.user_id = #{userId} and classify = 1) as myCollectCount, (select count(*) from collect_artificer o where o.artificer_id = a.artificer_id and o.user_id = #{userId} and classify = 1) as myCollectCount,
ifnull((select avg(c.score) from taking_commnt c where c.artificer_id = a.artificer_id), 0.00) as ordersScore, ifnull((select avg(c.score) from taking_commnt c where c.artificer_id = a.artificer_id), 0.00) as ordersScore,
(st_distance(point(a.longitude, a.latitude), point(#{longitude}, #{latitude})) * 111195) as distance, (st_distance(point(a.longitude, a.latitude), point(#{longitude}, #{latitude})) * 111195) as distance,
v.vip_name as technicianTypeName,(CASE WHEN DATEDIFF(CURDATE(), a.create_time) &lt;=7 THEN 1 ELSE 2 END) AS isNewer v.vip_name as technicianTypeName,v.rate as technicianTypeRate ,(CASE WHEN DATEDIFF(CURDATE(), a.create_time) &lt;=7 THEN 1 ELSE 2 END) AS isNewer
from artificer a from artificer a
left join tb_user u on a.user_id = u.user_id left join tb_user u on a.user_id = u.user_id
left join sys_dict s on s.id=a.classify_id left join sys_dict s on s.id=a.classify_id

View File

@ -54,7 +54,7 @@
</delete> </delete>
<select id="findPackageAndMassagePage" resultType="com.sqx.modules.bl.massage.entity.MassagePackage"> <select id="findPackageAndMassagePage" resultType="com.sqx.modules.bl.massage.entity.MassagePackage">
select a.id,title,a.type,b.value as type_name,old_price,price,package_img,content,content_img,add_num,sales,labels,'套餐' as flag select a.id,title,a.type,b.value as type_name,old_price,price,package_img,content,content_img,add_num,sales,labels,'套餐' as flag,is_can_coupon,is_can_vip
from bl_massage_package a from bl_massage_package a
left join sys_dict b on a.type = b.id left join sys_dict b on a.type = b.id
where a.status = 1 where a.status = 1
@ -62,7 +62,7 @@
and (a.city like concat('%',#{params.city},'%') or a.city='不限') and (a.city like concat('%',#{params.city},'%') or a.city='不限')
</if> </if>
union all union all
select massage_type_id as id,title,classify_id as type,b.value as type_name,old_price,price,massage_img,jianjie,content_img,add_num,sales,labels,'项目' as flag select massage_type_id as id,title,classify_id as type,b.value as type_name,old_price,price,massage_img,jianjie,content_img,add_num,sales,labels,'项目' as flag,1 as is_can_coupon,1 as is_can_vip
from massage_type a from massage_type a
left join sys_dict b on a.classify_id = b.id left join sys_dict b on a.classify_id = b.id
where a.status = 1 where a.status = 1

View File

@ -26,9 +26,10 @@
</update> </update>
<select id="selectCouponByUserId" resultType="com.sqx.modules.coupon.entity.CouponUser"> <select id="selectCouponByUserId" resultType="com.sqx.modules.coupon.entity.CouponUser">
select tcu.*, tu.user_name as nickName, tu.avatar as avatar, tu.phone as phone select tcu.*, tu.user_name as nickName, tu.avatar as avatar, tu.phone as phone,d.value as classifyName
from coupon_user tcu from coupon_user tcu
left join tb_user tu on tcu.user_id = tu.user_id left join tb_user tu on tcu.user_id = tu.user_id
left join sys_dict d on tcu.classify_id = d.id
where 1 = 1 where 1 = 1
<if test="userId!=null"> <if test="userId!=null">
and tcu.user_id = #{userId} and tcu.user_id = #{userId}