Commit 94d3e043 by huluobin

bug fix

parent b4a92c1e
...@@ -119,8 +119,20 @@ public interface ScheduleManageService extends IService<ScheduleManage> { ...@@ -119,8 +119,20 @@ public interface ScheduleManageService extends IService<ScheduleManage> {
List<Map<String, Object>> queryReservableTime(String startDate, Integer lengthTime, Integer departmentId, Integer orderId, Boolean needRemoveOldServe); List<Map<String, Object>> queryReservableTime(String startDate, Integer lengthTime, Integer departmentId, Integer orderId, Boolean needRemoveOldServe);
/**
* 查询预约聚合
*
* @param id
* @return
*/
ScheduleManage queryScheduleManage(Integer id); ScheduleManage queryScheduleManage(Integer id);
/**
* 分页查询预约
*
* @param qry
* @return
*/
IPage<ScheduleManage> queryPageScheduleManage(ScheduleManagePageQuery qry); IPage<ScheduleManage> queryPageScheduleManage(ScheduleManagePageQuery qry);
/** /**
......
...@@ -315,6 +315,10 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order ...@@ -315,6 +315,10 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order
if (ListUtil.isNotEmpty(list)) { if (ListUtil.isNotEmpty(list)) {
orderManage.setScheduleManage(list.stream().findAny().orElse(null)); orderManage.setScheduleManage(list.stream().findAny().orElse(null));
} }
orderManage.getListOrderServer().forEach(orderServe -> {
orderServe.setActualServeDuration((int) (orderServe.getEndTime().getTime() -
orderServe.getStartTime().getTime()) / 1000 / 60);
});
}); });
return orderManagePage; return orderManagePage;
...@@ -599,10 +603,7 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order ...@@ -599,10 +603,7 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order
orderServeMapper.updateById(orderServe); orderServeMapper.updateById(orderServe);
}); });
//如果全部项评论了 orderManage.setStatus(OrderManage.STATUS_FINISHED);
if (orderServeList.stream().noneMatch(orderServe -> orderServe.getCommentStatus().equals(OrderServe.COMMENT_STATUS_NO))) {
orderManage.setStatus(OrderManage.STATUS_FINISHED);
}
//订单已完成 //订单已完成
orderManageMapper.updateById(orderManage); orderManageMapper.updateById(orderManage);
return orderServeList; return orderServeList;
...@@ -864,6 +865,11 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order ...@@ -864,6 +865,11 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order
.map(storeTechnicianMapper::selectById) .map(storeTechnicianMapper::selectById)
.collect(Collectors.toList())); .collect(Collectors.toList()));
}); });
orderManage.getListOrderServer().forEach(orderServe -> {
orderServe.setActualServeDuration((int) (orderServe.getEndTime().getTime() -
orderServe.getStartTime().getTime()) / 1000 / 60);
});
return orderManage; return orderManage;
} }
} }
......
package com.gogirl.application.order.serve.impl; package com.gogirl.application.order.serve.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult;
import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult; import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult;
import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest; import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest;
import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.exception.WxPayException;
...@@ -9,12 +8,9 @@ import com.gogirl.application.market.MarketService; ...@@ -9,12 +8,9 @@ import com.gogirl.application.market.MarketService;
import com.gogirl.application.order.serve.OrderManageService; import com.gogirl.application.order.serve.OrderManageService;
import com.gogirl.application.order.serve.PayService; import com.gogirl.application.order.serve.PayService;
import com.gogirl.application.user.customer.CustomerBalanceService; import com.gogirl.application.user.customer.CustomerBalanceService;
import com.gogirl.domain.market.discount.DiscountConfig;
import com.gogirl.domain.order.serve.MultiPaymentType; import com.gogirl.domain.order.serve.MultiPaymentType;
import com.gogirl.domain.order.serve.OrderManage; import com.gogirl.domain.order.serve.OrderManage;
import com.gogirl.domain.user.customer.Customer;
import com.gogirl.domain.user.customer.CustomerBalance; import com.gogirl.domain.user.customer.CustomerBalance;
import com.gogirl.domain.user.customer.CustomerBalanceRecord;
import com.gogirl.infrastructure.common.exception.RRException; import com.gogirl.infrastructure.common.exception.RRException;
import com.gogirl.infrastructure.common.util.JsonUtilByFsJson; import com.gogirl.infrastructure.common.util.JsonUtilByFsJson;
import com.gogirl.infrastructure.common.util.RandomUtil; import com.gogirl.infrastructure.common.util.RandomUtil;
...@@ -38,7 +34,6 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -38,7 +34,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -157,7 +152,7 @@ public class PayServiceImpl implements PayService { ...@@ -157,7 +152,7 @@ public class PayServiceImpl implements PayService {
OrderManage orderManageDTO = orderManageService.queryOrder(qry.getOrderId()); OrderManage orderManageDTO = orderManageService.queryOrder(qry.getOrderId());
CustomerBalance customerBalance = customerBalanceMapper.selectByCustomerId(qry.getCustomerId()); CustomerBalance customerBalance = customerBalanceMapper.selectOne(new LambdaQueryWrapper<CustomerBalance>().eq(CustomerBalance::getCustomerId, orderManageDTO.getOrderUser()));
if (orderManageDTO.getTotalPaymentAmount().multiply(new BigDecimal(100)).intValue() < customerBalance.getBalance()) { if (orderManageDTO.getTotalPaymentAmount().multiply(new BigDecimal(100)).intValue() < customerBalance.getBalance()) {
throw new RRException("请使用余额支付"); throw new RRException("请使用余额支付");
...@@ -194,7 +189,7 @@ public class PayServiceImpl implements PayService { ...@@ -194,7 +189,7 @@ public class PayServiceImpl implements PayService {
public void balancePosPay(Integer currentCustomerId, Integer orderId) { public void balancePosPay(Integer currentCustomerId, Integer orderId) {
OrderManage orderManage = orderManageService.getById(orderId); OrderManage orderManage = orderManageService.getById(orderId);
CustomerBalance customerBalance = customerBalanceMapper.selectByCustomerId(currentCustomerId); CustomerBalance customerBalance = customerBalanceMapper.selectOne(new LambdaQueryWrapper<CustomerBalance>().eq(CustomerBalance::getCustomerId, currentCustomerId));
if (orderManage.getTotalPaymentAmount().multiply(new BigDecimal(100)).intValue() < customerBalance.getBalance()) { if (orderManage.getTotalPaymentAmount().multiply(new BigDecimal(100)).intValue() < customerBalance.getBalance()) {
throw new RRException("请使用余额支付"); throw new RRException("请使用余额支付");
......
...@@ -594,6 +594,7 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper, ...@@ -594,6 +594,7 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
ScheduleServe param = scheduleServeMapper.selectById(scheduleServeId); ScheduleServe param = scheduleServeMapper.selectById(scheduleServeId);
param.setActualEndTime(new Date()); param.setActualEndTime(new Date());
//所有需要更新的服务
List<ScheduleServe> updateList = scheduleServeMapper.selectList(new LambdaQueryWrapper<ScheduleServe>() List<ScheduleServe> updateList = scheduleServeMapper.selectList(new LambdaQueryWrapper<ScheduleServe>()
.eq(ScheduleServe::getSchId, param.getSchId()) .eq(ScheduleServe::getSchId, param.getSchId())
.eq(ScheduleServe::getServeId, param.getServeId())); .eq(ScheduleServe::getServeId, param.getServeId()));
...@@ -1087,7 +1088,9 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper, ...@@ -1087,7 +1088,9 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
scheduleServeCmd.setTechnicianName(storeTechnician.getName()); scheduleServeCmd.setTechnicianName(storeTechnician.getName());
scheduleServeCmd.setServeType(baseType.getName()); scheduleServeCmd.setServeType(baseType.getName());
String technicianNames = storeTechnicianMapper.selectBatchIds(Lists.newArrayList(scheduleServeCmd.getTechnicianIds().split(","))).stream().map(StoreTechnician::getName).collect(Collectors.joining(",")); String technicianNames = storeTechnicianMapper.selectBatchIds(
Lists.newArrayList(scheduleServeCmd.getTechnicianIds().split(","))).stream().map(StoreTechnician::getName)
.collect(Collectors.joining(","));
scheduleServeCmd.setTechnicianNames(technicianNames); scheduleServeCmd.setTechnicianNames(technicianNames);
//设置价格为服务价格 //设置价格为服务价格
...@@ -1458,6 +1461,12 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper, ...@@ -1458,6 +1461,12 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
set.addAll(scheduleServeList); set.addAll(scheduleServeList);
} }
scheduleManage.setListScheduleServer(set); scheduleManage.setListScheduleServer(set);
scheduleManage.getListScheduleServer().forEach(scheduleServe -> {
if (scheduleServe.getActualEndTime() != null && scheduleServe.getActualStartTime() != null) {
scheduleServe.setActualServeDuration((int) (scheduleServe.getActualEndTime().getTime()
- scheduleServe.getActualStartTime().getTime()) / 1000 / 60);
}
});
return scheduleManage; return scheduleManage;
} }
...@@ -1503,6 +1512,12 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper, ...@@ -1503,6 +1512,12 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
set.addAll(scheduleServeMap.get(scheduleManage.getId())); set.addAll(scheduleServeMap.get(scheduleManage.getId()));
} }
scheduleManage.setListScheduleServer(set); scheduleManage.setListScheduleServer(set);
scheduleManage.getListScheduleServer().forEach(scheduleServe -> {
if (scheduleServe.getActualEndTime() != null && scheduleServe.getActualStartTime() != null) {
scheduleServe.setActualServeDuration((int) (scheduleServe.getActualEndTime().getTime()
- scheduleServe.getActualStartTime().getTime()) / 1000 / 60);
}
});
}); });
return page; return page;
} }
......
package com.gogirl.application.user.customer.impl; package com.gogirl.application.user.customer.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gogirl.application.user.customer.CustomerBalanceService; import com.gogirl.application.user.customer.CustomerBalanceService;
import com.gogirl.domain.user.customer.CustomerBalance; import com.gogirl.domain.user.customer.CustomerBalance;
...@@ -30,7 +31,8 @@ public class CustomerBalanceServiceImpl extends ServiceImpl<CustomerBalanceMappe ...@@ -30,7 +31,8 @@ public class CustomerBalanceServiceImpl extends ServiceImpl<CustomerBalanceMappe
@Override @Override
public CustomerBalance getCustomerBalance(int customerId) { public CustomerBalance getCustomerBalance(int customerId) {
CustomerBalance customerBalance = customerBalanceMapper.selectByCustomerId(customerId); CustomerBalance customerBalance = customerBalanceMapper.selectOne(new LambdaQueryWrapper<CustomerBalance>()
.eq(CustomerBalance::getCustomerId, customerId));
if (customerBalance == null) { if (customerBalance == null) {
customerBalance = CustomerBalance.getInstance(customerId); customerBalance = CustomerBalance.getInstance(customerId);
...@@ -57,7 +59,8 @@ public class CustomerBalanceServiceImpl extends ServiceImpl<CustomerBalanceMappe ...@@ -57,7 +59,8 @@ public class CustomerBalanceServiceImpl extends ServiceImpl<CustomerBalanceMappe
@Override @Override
public void consumer(ConsumerCommand cmd) { public void consumer(ConsumerCommand cmd) {
CustomerBalance customerBalance = customerBalanceMapper.selectByCustomerId(cmd.getCustomerId()); CustomerBalance customerBalance = customerBalanceMapper.selectOne(new LambdaQueryWrapper<CustomerBalance>()
.eq(CustomerBalance::getCustomerId, cmd.getCustomerId()));
if (customerBalance == null) { if (customerBalance == null) {
customerBalance = CustomerBalance.getInstance(cmd.getCustomerId()); customerBalance = CustomerBalance.getInstance(cmd.getCustomerId());
...@@ -90,5 +93,6 @@ public class CustomerBalanceServiceImpl extends ServiceImpl<CustomerBalanceMappe ...@@ -90,5 +93,6 @@ public class CustomerBalanceServiceImpl extends ServiceImpl<CustomerBalanceMappe
customerBalanceRecordMapper.insert(record); customerBalanceRecordMapper.insert(record);
customerBalance.setBalance(customerBalance.getBalance() - cmd.getAmount()); customerBalance.setBalance(customerBalance.getBalance() - cmd.getAmount());
customerBalance.setTotalExpenditure(customerBalance.getTotalExpenditure() + cmd.getAmount()); customerBalance.setTotalExpenditure(customerBalance.getTotalExpenditure() + cmd.getAmount());
customerBalanceMapper.updateById(customerBalance);
} }
} }
...@@ -181,4 +181,7 @@ public class OrderServe implements Serializable { ...@@ -181,4 +181,7 @@ public class OrderServe implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private Integer lengthTime; private Integer lengthTime;
@TableField(exist = false)
private Integer actualServeDuration;
} }
...@@ -177,4 +177,7 @@ public class ScheduleServe implements Serializable { ...@@ -177,4 +177,7 @@ public class ScheduleServe implements Serializable {
@ApiModelProperty("实际结束时间") @ApiModelProperty("实际结束时间")
private Date actualEndTime; private Date actualEndTime;
@TableField(exist = false)
private Integer actualServeDuration;
} }
...@@ -26,8 +26,6 @@ public class Career { ...@@ -26,8 +26,6 @@ public class Career {
private String technicianName; private String technicianName;
private Integer score;
@ApiModelProperty("加入gogirl时间") @ApiModelProperty("加入gogirl时间")
private Date joinDate; private Date joinDate;
......
...@@ -7,6 +7,4 @@ import com.gogirl.domain.user.customer.CustomerBalance; ...@@ -7,6 +7,4 @@ import com.gogirl.domain.user.customer.CustomerBalance;
public interface CustomerBalanceMapper extends BaseMapper<CustomerBalance> { public interface CustomerBalanceMapper extends BaseMapper<CustomerBalance> {
CustomerBalance selectByCustomerId(Integer customerId);
} }
...@@ -295,7 +295,8 @@ public class PayController { ...@@ -295,7 +295,8 @@ public class PayController {
//折扣信息 //折扣信息
DiscountConfig discountConfig = discountConfigService.selectByCharge((int) (amount * 100)); DiscountConfig discountConfig = discountConfigService.selectByCharge((int) (amount * 100));
//会员卡 //会员卡
CustomerBalance customerBalance = customerBalanceMapper.selectByCustomerId(customer.getId()); CustomerBalance customerBalance = customerBalanceMapper.selectOne(new LambdaQueryWrapper<CustomerBalance>()
.eq(CustomerBalance::getCustomerId, customer.getId()));
//充值类型 //充值类型
Integer type = customerBalance == null ? 2 : 1; Integer type = customerBalance == null ? 2 : 1;
......
...@@ -117,4 +117,7 @@ public class ScheduleServeDTO implements Serializable { ...@@ -117,4 +117,7 @@ public class ScheduleServeDTO implements Serializable {
private Integer leisureDiscountConfigId; private Integer leisureDiscountConfigId;
private List<PurchaseSkuDTO> purchaseSkuDTOList; private List<PurchaseSkuDTO> purchaseSkuDTOList;
private Integer actualServeDuration;
} }
...@@ -107,4 +107,5 @@ public class OrderServeDTO { ...@@ -107,4 +107,5 @@ public class OrderServeDTO {
private List<StoreTechnicianDTO> storeTechnicianDTOList; private List<StoreTechnicianDTO> storeTechnicianDTOList;
private Integer actualServeDuration;
} }
...@@ -24,7 +24,7 @@ spring: ...@@ -24,7 +24,7 @@ spring:
name: gogirl-wxapp-member-backend name: gogirl-wxapp-member-backend
#数据配置 #数据配置
datasource: datasource:
url: jdbc:mysql://10.0.0.9:3306/gogirl_pre?useUnicode=true&characterEncoding=utf-8&useSSL=false&&zeroDateTimeBehavior=convertToNull url: jdbc:mysql://gz-cdb-c0sq6eax.sql.tencentcdb.com:60779/gogirl_pre?useUnicode=true&characterEncoding=utf-8&useSSL=false&&zeroDateTimeBehavior=convertToNull
username: root username: root
password: "#7kfnymAM$Y9-Ntf" password: "#7kfnymAM$Y9-Ntf"
driver-class-name: com.mysql.jdbc.Driver driver-class-name: com.mysql.jdbc.Driver
......
spring: spring:
profiles: profiles:
active: prod active: pre
servlet: servlet:
#文件上传最大容量 #文件上传最大容量
multipart: multipart:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment