Commit 94d3e043 by huluobin

bug fix

parent b4a92c1e
......@@ -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);
/**
* 查询预约聚合
*
* @param id
* @return
*/
ScheduleManage queryScheduleManage(Integer id);
/**
* 分页查询预约
*
* @param qry
* @return
*/
IPage<ScheduleManage> queryPageScheduleManage(ScheduleManagePageQuery qry);
/**
......
......@@ -315,6 +315,10 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order
if (ListUtil.isNotEmpty(list)) {
orderManage.setScheduleManage(list.stream().findAny().orElse(null));
}
orderManage.getListOrderServer().forEach(orderServe -> {
orderServe.setActualServeDuration((int) (orderServe.getEndTime().getTime() -
orderServe.getStartTime().getTime()) / 1000 / 60);
});
});
return orderManagePage;
......@@ -599,10 +603,7 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order
orderServeMapper.updateById(orderServe);
});
//如果全部项评论了
if (orderServeList.stream().noneMatch(orderServe -> orderServe.getCommentStatus().equals(OrderServe.COMMENT_STATUS_NO))) {
orderManage.setStatus(OrderManage.STATUS_FINISHED);
}
orderManage.setStatus(OrderManage.STATUS_FINISHED);
//订单已完成
orderManageMapper.updateById(orderManage);
return orderServeList;
......@@ -864,6 +865,11 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order
.map(storeTechnicianMapper::selectById)
.collect(Collectors.toList()));
});
orderManage.getListOrderServer().forEach(orderServe -> {
orderServe.setActualServeDuration((int) (orderServe.getEndTime().getTime() -
orderServe.getStartTime().getTime()) / 1000 / 60);
});
return orderManage;
}
}
......
package com.gogirl.application.order.serve.impl;
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.request.WxPayUnifiedOrderRequest;
import com.github.binarywang.wxpay.exception.WxPayException;
......@@ -9,12 +8,9 @@ import com.gogirl.application.market.MarketService;
import com.gogirl.application.order.serve.OrderManageService;
import com.gogirl.application.order.serve.PayService;
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.OrderManage;
import com.gogirl.domain.user.customer.Customer;
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.util.JsonUtilByFsJson;
import com.gogirl.infrastructure.common.util.RandomUtil;
......@@ -38,7 +34,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
......@@ -157,7 +152,7 @@ public class PayServiceImpl implements PayService {
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()) {
throw new RRException("请使用余额支付");
......@@ -194,7 +189,7 @@ public class PayServiceImpl implements PayService {
public void balancePosPay(Integer currentCustomerId, Integer 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()) {
throw new RRException("请使用余额支付");
......
......@@ -594,6 +594,7 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
ScheduleServe param = scheduleServeMapper.selectById(scheduleServeId);
param.setActualEndTime(new Date());
//所有需要更新的服务
List<ScheduleServe> updateList = scheduleServeMapper.selectList(new LambdaQueryWrapper<ScheduleServe>()
.eq(ScheduleServe::getSchId, param.getSchId())
.eq(ScheduleServe::getServeId, param.getServeId()));
......@@ -1087,7 +1088,9 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
scheduleServeCmd.setTechnicianName(storeTechnician.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);
//设置价格为服务价格
......@@ -1458,6 +1461,12 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
set.addAll(scheduleServeList);
}
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;
}
......@@ -1503,6 +1512,12 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
set.addAll(scheduleServeMap.get(scheduleManage.getId()));
}
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;
}
......
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.gogirl.application.user.customer.CustomerBalanceService;
import com.gogirl.domain.user.customer.CustomerBalance;
......@@ -30,7 +31,8 @@ public class CustomerBalanceServiceImpl extends ServiceImpl<CustomerBalanceMappe
@Override
public CustomerBalance getCustomerBalance(int customerId) {
CustomerBalance customerBalance = customerBalanceMapper.selectByCustomerId(customerId);
CustomerBalance customerBalance = customerBalanceMapper.selectOne(new LambdaQueryWrapper<CustomerBalance>()
.eq(CustomerBalance::getCustomerId, customerId));
if (customerBalance == null) {
customerBalance = CustomerBalance.getInstance(customerId);
......@@ -57,7 +59,8 @@ public class CustomerBalanceServiceImpl extends ServiceImpl<CustomerBalanceMappe
@Override
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) {
customerBalance = CustomerBalance.getInstance(cmd.getCustomerId());
......@@ -90,5 +93,6 @@ public class CustomerBalanceServiceImpl extends ServiceImpl<CustomerBalanceMappe
customerBalanceRecordMapper.insert(record);
customerBalance.setBalance(customerBalance.getBalance() - cmd.getAmount());
customerBalance.setTotalExpenditure(customerBalance.getTotalExpenditure() + cmd.getAmount());
customerBalanceMapper.updateById(customerBalance);
}
}
......@@ -181,4 +181,7 @@ public class OrderServe implements Serializable {
@TableField(exist = false)
private Integer lengthTime;
@TableField(exist = false)
private Integer actualServeDuration;
}
......@@ -177,4 +177,7 @@ public class ScheduleServe implements Serializable {
@ApiModelProperty("实际结束时间")
private Date actualEndTime;
@TableField(exist = false)
private Integer actualServeDuration;
}
......@@ -26,8 +26,6 @@ public class Career {
private String technicianName;
private Integer score;
@ApiModelProperty("加入gogirl时间")
private Date joinDate;
......
......@@ -7,6 +7,4 @@ import com.gogirl.domain.user.customer.CustomerBalance;
public interface CustomerBalanceMapper extends BaseMapper<CustomerBalance> {
CustomerBalance selectByCustomerId(Integer customerId);
}
......@@ -295,7 +295,8 @@ public class PayController {
//折扣信息
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;
......
......@@ -117,4 +117,7 @@ public class ScheduleServeDTO implements Serializable {
private Integer leisureDiscountConfigId;
private List<PurchaseSkuDTO> purchaseSkuDTOList;
private Integer actualServeDuration;
}
......@@ -107,4 +107,5 @@ public class OrderServeDTO {
private List<StoreTechnicianDTO> storeTechnicianDTOList;
private Integer actualServeDuration;
}
......@@ -24,7 +24,7 @@ spring:
name: gogirl-wxapp-member-backend
#数据配置
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
password: "#7kfnymAM$Y9-Ntf"
driver-class-name: com.mysql.jdbc.Driver
......
spring:
profiles:
active: prod
active: pre
servlet:
#文件上传最大容量
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