Commit c9e3649d by Wangmin

bugfix

parent 3d47a0b7
...@@ -253,6 +253,8 @@ public class CompanyServiceImpl implements ICompanyService { ...@@ -253,6 +253,8 @@ public class CompanyServiceImpl implements ICompanyService {
wrapper.set(Company::getBalance, balance) wrapper.set(Company::getBalance, balance)
.set(Company::getFreezeBalance, freeze) .set(Company::getFreezeBalance, freeze)
.eq(Company::getId, company.getId()); .eq(Company::getId, company.getId());
return baseMapper.update(null, wrapper) > 0; // 目前不满足资质,拒绝提现操作
throw new UnsupportedOperationException("资质不足,无法提现");
// return baseMapper.update(null, wrapper) > 0;
} }
} }
...@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil; ...@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.pz.common.core.domain.R;
import com.pz.common.core.domain.entity.SysUser; import com.pz.common.core.domain.entity.SysUser;
import com.pz.common.core.page.TableDataInfo; import com.pz.common.core.page.TableDataInfo;
import com.pz.common.core.domain.PageQuery; import com.pz.common.core.domain.PageQuery;
...@@ -13,6 +14,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; ...@@ -13,6 +14,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.pz.common.enums.UserType; import com.pz.common.enums.UserType;
import com.pz.common.exception.ServiceException; import com.pz.common.exception.ServiceException;
import com.pz.common.utils.StringUtils; import com.pz.common.utils.StringUtils;
import com.pz.common.utils.redis.RedisUtils;
import com.pz.merchant.domain.Company; import com.pz.merchant.domain.Company;
import com.pz.merchant.domain.bo.EmployeesListBo; import com.pz.merchant.domain.bo.EmployeesListBo;
import com.pz.merchant.domain.bo.OrderBo; import com.pz.merchant.domain.bo.OrderBo;
...@@ -101,6 +103,7 @@ public class EmployeesServiceImpl implements IEmployeesService { ...@@ -101,6 +103,7 @@ public class EmployeesServiceImpl implements IEmployeesService {
public TableDataInfo<EmployeesListVo> employeesList(EmployeesListBo bo, PageQuery pageQuery) { public TableDataInfo<EmployeesListVo> employeesList(EmployeesListBo bo, PageQuery pageQuery) {
QueryWrapper<Employees> wrapper = Wrappers.query(); QueryWrapper<Employees> wrapper = Wrappers.query();
wrapper.like(StringUtils.isNotEmpty(bo.getEmployeeName()), "employees.name", bo.getEmployeeName()) wrapper.like(StringUtils.isNotEmpty(bo.getEmployeeName()), "employees.name", bo.getEmployeeName())
.eq(bo.getCompanyId() != null, "employees.company_id", bo.getCompanyId())
.eq(bo.getEmployeeType() != null, "employees.now_type", bo.getEmployeeType()); .eq(bo.getEmployeeType() != null, "employees.now_type", bo.getEmployeeType());
IPage<EmployeesListVo> result = baseMapper.selectEmployeesList(pageQuery.build(), wrapper); IPage<EmployeesListVo> result = baseMapper.selectEmployeesList(pageQuery.build(), wrapper);
return TableDataInfo.build(result); return TableDataInfo.build(result);
...@@ -148,7 +151,7 @@ public class EmployeesServiceImpl implements IEmployeesService { ...@@ -148,7 +151,7 @@ public class EmployeesServiceImpl implements IEmployeesService {
*/ */
SysUser sysUser = new SysUser(); SysUser sysUser = new SysUser();
sysUser.setUserId(bo.getUid().longValue()); sysUser.setUserId(bo.getUid().longValue());
//sysUser.setPhonenumber(bo.getPhone()); // sysUser.setPhonenumber(bo.getPhone());
if (bo.getIdentity() == 2) { if (bo.getIdentity() == 2) {
Employees add = BeanUtil.toBean(bo, Employees.class); Employees add = BeanUtil.toBean(bo, Employees.class);
add.setNowType(1); add.setNowType(1);
...@@ -283,21 +286,26 @@ public class EmployeesServiceImpl implements IEmployeesService { ...@@ -283,21 +286,26 @@ public class EmployeesServiceImpl implements IEmployeesService {
*/ */
@Override @Override
public boolean disableOrRecover(Integer emId) { public boolean disableOrRecover(Integer emId) {
EmployeesVo employeesVo = baseMapper.selectVoById(emId); Employees employees = baseMapper.selectById(emId);
Objects.requireNonNull(employeesVo, "查无此人"); Objects.requireNonNull(employees, "查无此人");
Integer status = employeesVo.getStatus(); Integer status = employees.getStatus();
if (status == 0) { if (status == 0) {
throw new ServiceException("该用户待审核通过,暂无法修改状态"); throw new ServiceException("该用户待审核通过,暂无法修改状态");
} }
Integer modifyStatus = status == 1 ? 2 : 1; int modifyStatus = status == 1 ? 2 : 1;
employeesVo.setStatus(modifyStatus); // 若切换状态为1(正常),则需清除账户的取消订单次数
return baseMapper.updateById(BeanUtil.toBean(employeesVo, Employees.class)) > 0; if (modifyStatus == 1) {
RedisUtils.delCacheMapValue(ISonOrderService.ORDER_CANCEL_CACHE_PREFIX, String.valueOf(emId));
employees.setKillOrder(0);
}
employees.setStatus(modifyStatus);
return baseMapper.updateById(employees) > 0;
} }
@Override @Override
public EmployeesVo queryByUserId(Long userId) { public EmployeesVo queryByUserId(Long userId) {
EmployeesVo employeesVo = baseMapper.selectVoOne(Wrappers.<Employees>lambdaQuery().eq(Employees::getUid, userId)); EmployeesVo employeesVo = baseMapper.selectVoOne(Wrappers.<Employees>lambdaQuery().eq(Employees::getUid, userId));
//获取所属商户 // 获取所属商户
Optional.ofNullable(companyMapper.selectVoById(employeesVo.getCompanyId())) Optional.ofNullable(companyMapper.selectVoById(employeesVo.getCompanyId()))
.ifPresent(companyVo -> employeesVo.setCompanyName(companyVo.getName())); .ifPresent(companyVo -> employeesVo.setCompanyName(companyVo.getName()));
...@@ -319,7 +327,8 @@ public class EmployeesServiceImpl implements IEmployeesService { ...@@ -319,7 +327,8 @@ public class EmployeesServiceImpl implements IEmployeesService {
wrapper.set(Employees::getBalance, balance) wrapper.set(Employees::getBalance, balance)
.set(Employees::getFreezeBalance, freeze) .set(Employees::getFreezeBalance, freeze)
.eq(Employees::getId, employees.getId()); .eq(Employees::getId, employees.getId());
return baseMapper.update(null, wrapper) > 0; throw new UnsupportedOperationException("资质不足,无法提现");
// return baseMapper.update(null, wrapper) > 0;
} }
/** /**
......
package com.pz.system.domain.vo; package com.pz.system.domain.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
...@@ -60,6 +59,11 @@ public class AccompanyDemandVo { ...@@ -60,6 +59,11 @@ public class AccompanyDemandVo {
private String description; private String description;
/** /**
* 主订单状态
*/
private Integer orderStatus;
/**
* 服务状态,0:已发布,1:已接单,2:已完成,3:退款中 ,4:已退款,6:进行中 * 服务状态,0:已发布,1:已接单,2:已完成,3:退款中 ,4:已退款,6:进行中
*/ */
private Integer sonOrderStatus; private Integer sonOrderStatus;
......
...@@ -202,8 +202,8 @@ public class DbghOrderServiceImpl implements IDbghOrderService, ISonOrderService ...@@ -202,8 +202,8 @@ public class DbghOrderServiceImpl implements IDbghOrderService, ISonOrderService
// 若设置了就诊时间,在取消订单时需要检查是否在18小时之前 // 若设置了就诊时间,在取消订单时需要检查是否在18小时之前
// 取消次数 // 取消次数
Integer cancel = RedisUtils.<Integer>getCacheMapValue(ISonOrderService.ORDER_CANCEL_CACHE_PREFIX, String.valueOf(emId)); Integer cancel = RedisUtils.<Integer>getCacheMapValue(ISonOrderService.ORDER_CANCEL_CACHE_PREFIX, String.valueOf(emId));
if (dbghOrder.getOverTime() != null) { if (dbghOrder.getVisitTime() != null) {
LocalDateTime visitTime = LocalDateTime.ofInstant(dbghOrder.getOverTime().toInstant(), ZoneId.systemDefault()); LocalDateTime visitTime = LocalDateTime.ofInstant(dbghOrder.getVisitTime().toInstant(), ZoneId.systemDefault());
LocalDateTime currentDate = LocalDateTime.ofInstant(new Date().toInstant(), ZoneId.systemDefault()); LocalDateTime currentDate = LocalDateTime.ofInstant(new Date().toInstant(), ZoneId.systemDefault());
// 若缓存为空,则查询数据表 // 若缓存为空,则查询数据表
if (cancel == null) { if (cancel == null) {
......
...@@ -272,6 +272,7 @@ public class DbmyOrderServiceImpl implements IDbmyOrderService, ISonOrderService ...@@ -272,6 +272,7 @@ public class DbmyOrderServiceImpl implements IDbmyOrderService, ISonOrderService
Objects.requireNonNull(totalOrder, "主订单不存在"); Objects.requireNonNull(totalOrder, "主订单不存在");
if (totalOrder.getStatus() != 1 || totalOrder.getEmId() == 0) { // 用户已付款 if (totalOrder.getStatus() != 1 || totalOrder.getEmId() == 0) { // 用户已付款
throw new ServiceException("主订单不符合开始服务要求"); throw new ServiceException("主订单不符合开始服务要求");
} }
DbmyOrder suborder = baseMapper.selectOne(Wrappers.<DbmyOrder>lambdaQuery().eq(DbmyOrder::getOrderId, totalOrder.getId())); DbmyOrder suborder = baseMapper.selectOne(Wrappers.<DbmyOrder>lambdaQuery().eq(DbmyOrder::getOrderId, totalOrder.getId()));
Objects.requireNonNull(suborder, "子订单不存在"); Objects.requireNonNull(suborder, "子订单不存在");
......
...@@ -229,13 +229,13 @@ public class DbwzOrderServiceImpl implements IDbwzOrderService, ISonOrderService ...@@ -229,13 +229,13 @@ public class DbwzOrderServiceImpl implements IDbwzOrderService, ISonOrderService
if (employeesMapper.update(null, if (employeesMapper.update(null,
Wrappers.<Employees>lambdaUpdate() Wrappers.<Employees>lambdaUpdate()
.set(Employees::getStatus, 2) .set(Employees::getStatus, 2)
.set(Employees::getKillOrder, cancel) // .set(Employees::getKillOrder, cancel)
.eq(Employees::getId, emId)) < 0) { .eq(Employees::getId, emId)) < 0) {
throw new ServiceException("用户冻结失败"); throw new ServiceException("用户冻结失败");
} }
} }
if (cancel != null) { if (cancel != null) {
RedisUtils.setCacheMapValue(ISonOrderService.ORDER_CANCEL_CACHE_PREFIX, String.valueOf(emId), cancel); // RedisUtils.setCacheMapValue(ISonOrderService.ORDER_CANCEL_CACHE_PREFIX, String.valueOf(emId), cancel);
} }
return true; return true;
} }
......
...@@ -263,7 +263,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService { ...@@ -263,7 +263,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
totalOrderVo.setStoreGoodsVo(storeGoods); totalOrderVo.setStoreGoodsVo(storeGoods);
UserAddressVo userAddressVo = userAddressMapper.selectVoById(storeOrder.getAddressId()); UserAddressVo userAddressVo = userAddressMapper.selectVoById(storeOrder.getAddressId());
totalOrderVo.setUserAddressVo(userAddressVo); totalOrderVo.setUserAddressVo(userAddressVo);
if(StringUtils.isNotEmpty(storeOrder.getLogisticsCode())){ if (StringUtils.isNotEmpty(storeOrder.getLogisticsCode())) {
TotalOrderBo totalOrderBo = new TotalOrderBo(); TotalOrderBo totalOrderBo = new TotalOrderBo();
totalOrderBo.setId(totalOrderVo.getId()); totalOrderBo.setId(totalOrderVo.getId());
totalOrderBo.setPhone(userAddressVo.getPhone()); totalOrderBo.setPhone(userAddressVo.getPhone());
...@@ -789,9 +789,9 @@ public class TotalOrderServiceImpl implements ITotalOrderService { ...@@ -789,9 +789,9 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
// 筛选未分配订单 // 筛选未分配订单
wrapper.eq("total_order.em_id", emId) // 未分配陪诊员订单 wrapper.eq("total_order.em_id", emId) // 未分配陪诊员订单
.eq("total_order.status", 2) // 订单已完成 .eq("total_order.status", 2) // 订单已完成
.ne("total_order.is_satisfaction", 0)
.between("total_order.business_id", 1, 5) .between("total_order.business_id", 1, 5)
.orderByDesc("total_order.id"); .orderByDesc("total_order.id");
;
IPage<AccompanyDemandVo> result = baseMapper.selectUndistributedTotalOrder(page.build(), wrapper); IPage<AccompanyDemandVo> result = baseMapper.selectUndistributedTotalOrder(page.build(), wrapper);
// 装载子订单信息 // 装载子订单信息
result.getRecords().forEach(order -> { result.getRecords().forEach(order -> {
......
...@@ -47,12 +47,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -47,12 +47,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectAllOrder" resultType="com.pz.merchant.domain.vo.FinanceOrderInfoVo"> <select id="selectAllOrder" resultType="com.pz.merchant.domain.vo.FinanceOrderInfoVo">
select total_order.id as orderId, select total_order.id as orderId,
total_order.status as orderStatus, total_order.status as orderStatus,
business.name as project, business.name as businessName,
services.name as project,
employees.name as emName, employees.name as emName,
services.cover, services.cover,
CONVERT((1 - services.fenmo / 100), decimal(10, 2)) * CONVERT((1 - services.fenmo / 100), decimal(10, 2)) *
CONVERT(services.price, decimal(10, 2)) as commission, CONVERT(services.price, decimal(10, 2)) as commission,
services.bid services.bid as businessId
from total_order from total_order
left join business on total_order.business_id = business.id left join business on total_order.business_id = business.id
left join employees on employees.id = total_order.em_id left join employees on employees.id = total_order.em_id
......
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
total_order.remark as description, total_order.remark as description,
total_order.evaluation_content, total_order.evaluation_content,
total_order.is_satisfaction as evaluation_flag, total_order.is_satisfaction as evaluation_flag,
total_order.uid as uid total_order.uid as uid,
total_order.status as orderStatus
from total_order from total_order
left join services on total_order.service_id = services.id left join services on total_order.service_id = services.id
left join business on total_order.business_id = business.id left join business on total_order.business_id = business.id
......
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