Commit d8659897 by 邹磊浩

修改代码

parent 0165295b
......@@ -31,7 +31,7 @@ import javax.validation.constraints.NotNull;
@RestController
@RequestMapping("app/accompany")
@SaIgnore
public class EmployeesAccompanyController extends BaseController {
public class AccompanyEmployeesAccompanyController extends BaseController {
private final ITotalOrderService totalOrderService;
......
package com.pz.accompany;
import com.pz.common.core.controller.BaseController;
import com.pz.common.core.domain.PageQuery;
import com.pz.common.core.domain.R;
import com.pz.common.core.page.TableDataInfo;
import com.pz.common.core.validate.EditGroup;
import com.pz.merchant.domain.bo.EmployeesBo;
import com.pz.merchant.domain.bo.EmployeesListBo;
import com.pz.merchant.domain.bo.OrderBo;
import com.pz.merchant.domain.bo.SetEmployeeWorkingHourBo;
import com.pz.merchant.domain.vo.EmployeesListVo;
import com.pz.merchant.domain.vo.EmployeesVo;
import com.pz.merchant.domain.vo.OrderInfoVO;
import com.pz.merchant.domain.vo.TodayOrderListVo;
import com.pz.merchant.service.IEmployeesService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotNull;
/**
* 陪诊员信息
*
* @author WangMin
* @date 2023-09-11
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/accompany/employees")
public class AccompanyEmployeesController extends BaseController {
private final IEmployeesService employeesService;
/**
* 修改陪诊员个人信息
*
* @param bo
* @return
*/
@PutMapping("/updateEmployees")
public R<Boolean> updateEmployees(EmployeesBo bo) {
return R.ok(employeesService.updateByBo(bo));
}
/**
* 陪诊员个人信息
*/
@GetMapping("/getEmployeesInfo")
public R<EmployeesVo> getEmployeesInfo() {
return R.ok(employeesService.queryByUserId(getUserId()));
}
}
......@@ -4,6 +4,8 @@ import com.pz.common.core.controller.BaseController;
import com.pz.common.core.domain.PageQuery;
import com.pz.common.core.domain.R;
import com.pz.common.core.page.TableDataInfo;
import com.pz.common.utils.StringUtils;
import com.pz.merchant.domain.bo.EmployeesBo;
import com.pz.merchant.domain.vo.EmployeesVo;
import com.pz.merchant.service.IEmployeesService;
import com.pz.system.domain.bo.IncomeBo;
......@@ -12,9 +14,14 @@ import com.pz.system.service.IIncomeService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.sql.rowset.serial.SerialException;
import java.math.BigDecimal;
import java.util.Optional;
/**
* 陪诊员-财务收益
*
......@@ -25,7 +32,7 @@ import org.springframework.web.bind.annotation.RestController;
@RequiredArgsConstructor
@RestController
@RequestMapping("/accompany/employees")
public class EmployeesIncomeController extends BaseController {
public class AccompanyEmployeesIncomeController extends BaseController {
private final IEmployeesService iEmployeesService;
......@@ -51,4 +58,25 @@ public class EmployeesIncomeController extends BaseController {
}
/**
* 陪诊员提现
*
* @param bo
* @return
*/
@PutMapping("/withdrawEmployees")
public R<Boolean> withdrawEmployees(IncomeBo bo) {
Optional.ofNullable(iEmployeesService.queryByUserId(getUserId()))
.ifPresent(employeesVo -> {
//判断提现金额是否大于余额
if (bo.getAmount().compareTo(StringUtils.isNotBlank(employeesVo.getBalance()) ? new BigDecimal(employeesVo.getBalance()) : new BigDecimal("0.00")) > 0) {
try {
throw new SerialException("余额不足以本次提现");
} catch (SerialException e) {
throw new RuntimeException(e);
}
}
});
return R.ok(true);
}
}
......@@ -22,109 +22,91 @@ public class EmployeesBo extends BaseEntity {
/**
*
*/
@NotNull(message = "不能为空", groups = { EditGroup.class })
private Integer id;
/**
* 陪诊员
*/
@NotBlank(message = "陪诊员 不能为空", groups = { AddGroup.class, EditGroup.class })
private String name;
/**
* 职业开始年份
*/
@NotBlank(message = "职业开始年份不能为空", groups = { AddGroup.class, EditGroup.class })
private String startYear;
/**
* 用户
*/
@NotNull(message = "用户不能为空", groups = { AddGroup.class, EditGroup.class })
private Integer uid;
/**
* 工作时段
*/
@NotBlank(message = "工作时段不能为空", groups = { AddGroup.class, EditGroup.class })
private String workingHours;
/**
* 状态
*/
@NotNull(message = "状态不能为空", groups = { AddGroup.class, EditGroup.class })
private Integer status;
/**
* 所属商户
*/
@NotNull(message = "所属商户不能为空", groups = { AddGroup.class, EditGroup.class })
private Integer companyId;
/**
* 身份证正面照
*/
@NotBlank(message = "身份证正面照不能为空", groups = { AddGroup.class, EditGroup.class })
private String cardFront;
/**
* 身份证反面照
*/
@NotBlank(message = "身份证反面照不能为空", groups = { AddGroup.class, EditGroup.class })
private String cardReverse;
/**
* 健康证
*/
@NotBlank(message = "健康证不能为空", groups = { AddGroup.class, EditGroup.class })
private String healthCertificate;
/**
* 经度
*/
@NotBlank(message = "经度不能为空", groups = { AddGroup.class, EditGroup.class })
private String lng;
/**
* 纬度
*/
@NotBlank(message = "纬度不能为空", groups = { AddGroup.class, EditGroup.class })
private String lat;
/**
* 城市
*/
@NotNull(message = "城市不能为空", groups = { AddGroup.class, EditGroup.class })
private Long cityId;
/**
* 当前身份
*/
@NotNull(message = "当前身份不能为空", groups = { AddGroup.class, EditGroup.class })
private Integer nowType;
/**
* 总收益
*/
@NotBlank(message = "总收益不能为空", groups = { AddGroup.class, EditGroup.class })
private String totalRevenue;
/**
* 当前余额
*/
@NotBlank(message = "当前余额不能为空", groups = { AddGroup.class, EditGroup.class })
private String balance;
/**
* 冻结余额
*/
@NotNull(message = "冻结余额不能为空", groups = { AddGroup.class, EditGroup.class })
private Long freezeBalance;
/**
* 取消订单次数
*/
@NotNull(message = "取消订单次数不能为空", groups = { AddGroup.class, EditGroup.class })
private Integer killOrder;
/**
......
......@@ -130,4 +130,6 @@ public class EmployeesVo {
* 工作年限
*/
private Integer wrokYear;
private String phone;
}
......@@ -248,7 +248,7 @@ public class EmployeesServiceImpl implements IEmployeesService {
.orderByDesc(TotalOrder::getId));
for (TotalOrderVo order : totalOrder) {
BusinessVo businessVo = businessMapper.selectVoOne(new LambdaQueryWrapper<Business>().eq(Business::getId, order.getBusinessId()));
if(null != businessVo){
if (null != businessVo) {
order.setProject(businessVo.getName());
}
}
......@@ -294,6 +294,11 @@ public class EmployeesServiceImpl implements IEmployeesService {
@Override
public EmployeesVo queryByUserId(Long userId) {
EmployeesVo employeesVo = baseMapper.selectVoOne(Wrappers.<Employees>lambdaQuery().eq(Employees::getUid, userId));
//获取所属商户
Optional.ofNullable(companyMapper.selectVoById(employeesVo.getCompanyId()))
.ifPresent(companyVo -> employeesVo.setCompanyName(companyVo.getName()));
return baseMapper.selectVoOne(Wrappers.<Employees>lambdaQuery().eq(Employees::getUid, userId));
}
......
......@@ -5,6 +5,8 @@ import com.pz.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 陪诊员/商户提现对象 income
......@@ -43,7 +45,7 @@ public class Income extends BaseEntity {
/**
* 提现金额
*/
private Long amount;
private BigDecimal amount;
/**
* 提现状态 0-待审核,1-成功提现,2-拒绝提现
*/
......
......@@ -4,6 +4,7 @@ import com.pz.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.*;
import java.math.BigDecimal;
/**
......@@ -45,7 +46,7 @@ public class IncomeBo extends BaseEntity {
/**
* 提现金额
*/
private Long amount;
private BigDecimal amount;
/**
* 提现状态 0-待审核,1-成功提现,2-拒绝提现
......
......@@ -4,8 +4,11 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.pz.common.annotation.ExcelDictFormat;
import com.pz.common.convert.ExcelDictConvert;
import com.pz.common.core.domain.BaseEntity;
import lombok.Data;
import java.math.BigDecimal;
/**
* 陪诊员/商户提现视图对象 income
......@@ -15,7 +18,7 @@ import lombok.Data;
*/
@Data
@ExcelIgnoreUnannotated
public class IncomeVo {
public class IncomeVo extends BaseEntity {
private static final long serialVersionUID = 1L;
......@@ -53,7 +56,7 @@ public class IncomeVo {
* 提现金额
*/
@ExcelProperty(value = "提现金额")
private Long amount;
private BigDecimal amount;
/**
* 提现状态 0-待审核,1-成功提现,2-拒绝提现
......
......@@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.pz.common.enums.CommonOrderStatus;
import com.pz.common.enums.DBMYOrderStatus;
import com.pz.common.enums.ShopOrderStatus;
import com.pz.common.enums.TotalOrderStatus;
import com.pz.common.exception.ServiceException;
import com.pz.merchant.domain.vo.SonOrderVo;
import com.pz.merchant.service.ISonOrderService;
......
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