修改诺干问题
This commit is contained in:
parent
e490a0a206
commit
d935b6c700
|
@ -1,151 +1,151 @@
|
|||
//package com.cj.jiaqingjiayi.controller;
|
||||
//
|
||||
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
//import com.cj.jiaqingjiayi.common.BaseResponse;
|
||||
//import com.cj.jiaqingjiayi.common.ErrorCode;
|
||||
//import com.cj.jiaqingjiayi.common.ResultUtils;
|
||||
//import com.cj.jiaqingjiayi.exception.BusinessException;
|
||||
//import com.cj.jiaqingjiayi.exception.ThrowUtils;
|
||||
//import com.cj.jiaqingjiayi.model.domain.Business;
|
||||
//import com.cj.jiaqingjiayi.model.domain.Manicurist;
|
||||
//import com.cj.jiaqingjiayi.model.domain.Manicuristsign;
|
||||
//import com.cj.jiaqingjiayi.model.request.manicuristSign.ManicuristSignAddRequest;
|
||||
//import com.cj.jiaqingjiayi.model.vo.ManicuristsignVO;
|
||||
//import com.cj.jiaqingjiayi.service.BusinessService;
|
||||
//import com.cj.jiaqingjiayi.service.ManicuristService;
|
||||
//import com.cj.jiaqingjiayi.service.ManicuristsignService;
|
||||
//import com.cj.jiaqingjiayi.service.UserService;
|
||||
//import com.cj.jiaqingjiayi.utils.BeanCopyUtils;
|
||||
//import io.swagger.annotations.Api;
|
||||
//import io.swagger.annotations.ApiOperation;
|
||||
//import org.springframework.beans.BeanUtils;
|
||||
//import org.springframework.transaction.annotation.Transactional;
|
||||
//import org.springframework.web.bind.annotation.*;
|
||||
//
|
||||
//import javax.annotation.Resource;
|
||||
//import java.util.List;
|
||||
//
|
||||
//@Api(tags = "美甲师签约接口")
|
||||
//@RestController
|
||||
//@RequestMapping("/manicuristSign")
|
||||
//public class ManicuristSignController {
|
||||
//
|
||||
// @Resource
|
||||
// private ManicuristsignService manicuristsignService;
|
||||
//
|
||||
// @Resource
|
||||
// private ManicuristService manicuristService;
|
||||
//
|
||||
// @Resource
|
||||
// private BusinessService businessService;
|
||||
//
|
||||
// /**
|
||||
// * 添加签约
|
||||
// */
|
||||
// @ApiOperation(value = "添加美甲师签约")
|
||||
// @PostMapping("/add")
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public BaseResponse<Long> addManicuristSign(@RequestBody ManicuristSignAddRequest addRequest){
|
||||
//
|
||||
// ThrowUtils.throwIf(addRequest == null, ErrorCode.PARAMS_ERROR);
|
||||
//
|
||||
// Manicuristsign manicuristsign = new Manicuristsign();
|
||||
//
|
||||
// BeanUtils.copyProperties(addRequest, manicuristsign);
|
||||
//
|
||||
// boolean save = manicuristsignService.save(manicuristsign);
|
||||
//
|
||||
// if (!save) {
|
||||
// throw new BusinessException(ErrorCode.SYSTEM_ERROR, "添加失败");
|
||||
// }
|
||||
// return ResultUtils.success(manicuristsign.getId(), "添加成功");
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 通过签约
|
||||
// */
|
||||
// @ApiOperation(value = "同意美甲师签约")
|
||||
// @GetMapping("/success")
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public BaseResponse<Boolean> succManicuristSign(@RequestParam Long signId){
|
||||
//
|
||||
// ThrowUtils.throwIf(signId < 0 , ErrorCode.PARAMS_ERROR);
|
||||
// //拿到签约数据
|
||||
// Manicuristsign manicuristsign = manicuristsignService.getById(signId);
|
||||
// //拿到签约的美甲师数据
|
||||
// Manicurist manicurist = manicuristService.getById(manicuristsign.getManicuristId());
|
||||
// ThrowUtils.throwIf(manicurist == null, ErrorCode.SYSTEM_ERROR);
|
||||
// Manicurist manicuristNew = new Manicurist();
|
||||
//
|
||||
// QueryWrapper<Business> queryWrapper = new QueryWrapper<>();
|
||||
// queryWrapper.eq("businessName", manicuristsign.getBusinessName());
|
||||
// Business business = businessService.getOne(queryWrapper);
|
||||
// manicurist.setBusinessId(business.getId());
|
||||
// //更新美甲师所属的美甲店铺
|
||||
// BeanUtils.copyProperties(manicurist, manicuristNew);
|
||||
// manicuristsign.setAuditStatus(1);
|
||||
//
|
||||
// boolean flag = manicuristService.updateById(manicuristNew);
|
||||
// ThrowUtils.throwIf(!flag , ErrorCode.OPERATION_ERROR);
|
||||
//
|
||||
// boolean updateById = manicuristsignService.updateById(manicuristsign);
|
||||
// ThrowUtils.throwIf(!updateById, ErrorCode.SYSTEM_ERROR);
|
||||
//
|
||||
// return ResultUtils.success(true, "审核通过");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 不同意美甲师签约
|
||||
// */
|
||||
// @ApiOperation(value = "不同意美甲师签约")
|
||||
// @GetMapping("/refuse")
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public BaseResponse<Boolean> refuseManicuristSign(@RequestParam Long signId){
|
||||
//
|
||||
// ThrowUtils.throwIf(signId < 0 , ErrorCode.PARAMS_ERROR);
|
||||
// //拿到签约数据
|
||||
// Manicuristsign manicuristsign = manicuristsignService.getById(signId);
|
||||
//
|
||||
// manicuristsign.setAuditStatus(2);
|
||||
//
|
||||
// boolean updateById = manicuristsignService.updateById(manicuristsign);
|
||||
// ThrowUtils.throwIf(!updateById, ErrorCode.SYSTEM_ERROR);
|
||||
//
|
||||
// return ResultUtils.success(true, "审核不通过");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据id删除签约
|
||||
// */
|
||||
// @ApiOperation(value = "根据id删除签约")
|
||||
// @GetMapping("/delete")
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public BaseResponse<Boolean> deleteManicuristSign(@RequestParam Long signId){
|
||||
//
|
||||
// ThrowUtils.throwIf(signId < 0 , ErrorCode.PARAMS_ERROR);
|
||||
//
|
||||
// boolean b = manicuristsignService.removeById(signId);
|
||||
// ThrowUtils.throwIf(!b, ErrorCode.SYSTEM_ERROR);
|
||||
//
|
||||
// return ResultUtils.success(true, "删除成功");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 查询当前店铺签约列表
|
||||
// */
|
||||
// @ApiOperation(value = "查询签约列表")
|
||||
// @GetMapping("/select")
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public BaseResponse<List<ManicuristsignVO>> selectManicuristSign(@RequestParam String businessName){
|
||||
//
|
||||
// ThrowUtils.throwIf(businessName == null , ErrorCode.PARAMS_ERROR);
|
||||
//
|
||||
// QueryWrapper<Manicuristsign> queryWrapper = new QueryWrapper<>();
|
||||
// queryWrapper.eq("businessName", businessName);
|
||||
//
|
||||
// List<Manicuristsign> manicuristsignList = manicuristsignService.list(queryWrapper);
|
||||
// List<ManicuristsignVO> manicuristsignVOList = manicuristsignService.getManicuristsignVO(manicuristsignList);
|
||||
// return ResultUtils.success(manicuristsignVOList);
|
||||
// }
|
||||
//}
|
||||
package com.cj.jiaqingjiayi.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.cj.jiaqingjiayi.common.BaseResponse;
|
||||
import com.cj.jiaqingjiayi.common.ErrorCode;
|
||||
import com.cj.jiaqingjiayi.common.ResultUtils;
|
||||
import com.cj.jiaqingjiayi.exception.BusinessException;
|
||||
import com.cj.jiaqingjiayi.exception.ThrowUtils;
|
||||
import com.cj.jiaqingjiayi.model.domain.Business;
|
||||
import com.cj.jiaqingjiayi.model.domain.Manicurist;
|
||||
import com.cj.jiaqingjiayi.model.domain.Manicuristsign;
|
||||
import com.cj.jiaqingjiayi.model.request.manicuristSign.ManicuristSignAddRequest;
|
||||
import com.cj.jiaqingjiayi.model.vo.ManicuristsignVO;
|
||||
import com.cj.jiaqingjiayi.service.BusinessService;
|
||||
import com.cj.jiaqingjiayi.service.ManicuristService;
|
||||
import com.cj.jiaqingjiayi.service.ManicuristsignService;
|
||||
import com.cj.jiaqingjiayi.service.UserService;
|
||||
import com.cj.jiaqingjiayi.utils.BeanCopyUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "美甲师签约接口")
|
||||
@RestController
|
||||
@RequestMapping("/manicuristSign")
|
||||
public class ManicuristSignController {
|
||||
|
||||
@Resource
|
||||
private ManicuristsignService manicuristsignService;
|
||||
|
||||
@Resource
|
||||
private ManicuristService manicuristService;
|
||||
|
||||
@Resource
|
||||
private BusinessService businessService;
|
||||
|
||||
/**
|
||||
* 添加签约
|
||||
*/
|
||||
@ApiOperation(value = "添加美甲师签约")
|
||||
@PostMapping("/add")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public BaseResponse<Long> addManicuristSign(@RequestBody ManicuristSignAddRequest addRequest){
|
||||
|
||||
ThrowUtils.throwIf(addRequest == null, ErrorCode.PARAMS_ERROR);
|
||||
|
||||
Manicuristsign manicuristsign = new Manicuristsign();
|
||||
|
||||
BeanUtils.copyProperties(addRequest, manicuristsign);
|
||||
|
||||
boolean save = manicuristsignService.save(manicuristsign);
|
||||
|
||||
if (!save) {
|
||||
throw new BusinessException(ErrorCode.SYSTEM_ERROR, "添加失败");
|
||||
}
|
||||
return ResultUtils.success(manicuristsign.getId(), "添加成功");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过签约
|
||||
*/
|
||||
@ApiOperation(value = "同意美甲师签约")
|
||||
@GetMapping("/success")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public BaseResponse<Boolean> succManicuristSign(@RequestParam Long signId){
|
||||
|
||||
ThrowUtils.throwIf(signId < 0 , ErrorCode.PARAMS_ERROR);
|
||||
//拿到签约数据
|
||||
Manicuristsign manicuristsign = manicuristsignService.getById(signId);
|
||||
//拿到签约的美甲师数据
|
||||
Manicurist manicurist = manicuristService.getById(manicuristsign.getManicuristId());
|
||||
ThrowUtils.throwIf(manicurist == null, ErrorCode.SYSTEM_ERROR);
|
||||
Manicurist manicuristNew = new Manicurist();
|
||||
|
||||
QueryWrapper<Business> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("businessName", manicuristsign.getBusinessName());
|
||||
Business business = businessService.getOne(queryWrapper);
|
||||
manicurist.setBusinessId(business.getId());
|
||||
//更新美甲师所属的美甲店铺
|
||||
BeanUtils.copyProperties(manicurist, manicuristNew);
|
||||
manicuristsign.setAuditStatus(1);
|
||||
|
||||
boolean flag = manicuristService.updateById(manicuristNew);
|
||||
ThrowUtils.throwIf(!flag , ErrorCode.OPERATION_ERROR);
|
||||
|
||||
boolean updateById = manicuristsignService.updateById(manicuristsign);
|
||||
ThrowUtils.throwIf(!updateById, ErrorCode.SYSTEM_ERROR);
|
||||
|
||||
return ResultUtils.success(true, "审核通过");
|
||||
}
|
||||
|
||||
/**
|
||||
* 不同意美甲师签约
|
||||
*/
|
||||
@ApiOperation(value = "不同意美甲师签约")
|
||||
@GetMapping("/refuse")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public BaseResponse<Boolean> refuseManicuristSign(@RequestParam Long signId){
|
||||
|
||||
ThrowUtils.throwIf(signId < 0 , ErrorCode.PARAMS_ERROR);
|
||||
//拿到签约数据
|
||||
Manicuristsign manicuristsign = manicuristsignService.getById(signId);
|
||||
|
||||
manicuristsign.setAuditStatus(2);
|
||||
|
||||
boolean updateById = manicuristsignService.updateById(manicuristsign);
|
||||
ThrowUtils.throwIf(!updateById, ErrorCode.SYSTEM_ERROR);
|
||||
|
||||
return ResultUtils.success(true, "审核不通过");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除签约
|
||||
*/
|
||||
@ApiOperation(value = "根据id删除签约")
|
||||
@GetMapping("/delete")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public BaseResponse<Boolean> deleteManicuristSign(@RequestParam Long signId){
|
||||
|
||||
ThrowUtils.throwIf(signId < 0 , ErrorCode.PARAMS_ERROR);
|
||||
|
||||
boolean b = manicuristsignService.removeById(signId);
|
||||
ThrowUtils.throwIf(!b, ErrorCode.SYSTEM_ERROR);
|
||||
|
||||
return ResultUtils.success(true, "删除成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前店铺签约列表
|
||||
*/
|
||||
@ApiOperation(value = "查询签约列表")
|
||||
@GetMapping("/select")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public BaseResponse<List<ManicuristsignVO>> selectManicuristSign(@RequestParam String businessName){
|
||||
|
||||
ThrowUtils.throwIf(businessName == null , ErrorCode.PARAMS_ERROR);
|
||||
|
||||
QueryWrapper<Manicuristsign> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("businessName", businessName);
|
||||
|
||||
List<Manicuristsign> manicuristsignList = manicuristsignService.list(queryWrapper);
|
||||
List<ManicuristsignVO> manicuristsignVOList = manicuristsignService.getManicuristsignVO(manicuristsignList);
|
||||
return ResultUtils.success(manicuristsignVOList);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -138,12 +138,12 @@ public class OrdersController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 分页获取订单列表(管理员)
|
||||
* 分页获取订单列表
|
||||
*/
|
||||
@PostMapping("/list/page")
|
||||
@ApiOperation(value = "分页获取订单列表(管理员)")
|
||||
@ApiOperation(value = "分页获取订单列表")
|
||||
public BaseResponse<Page<Orders>> listOrdersByPage(@RequestBody OrderQueryRequest orderQueryRequest, HttpServletRequest request) {
|
||||
userService.isAdmin(request);
|
||||
// userService.isAdmin(request);
|
||||
long current = orderQueryRequest.getCurrent();
|
||||
long size = orderQueryRequest.getPageSize();
|
||||
Page<Orders> ordersPage = ordersService.page(new Page<>(current, size),
|
||||
|
|
|
@ -116,14 +116,14 @@ public class UserController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 分页获取用户列表(仅管理员)
|
||||
* 分页获取用户列表
|
||||
* @return 用户列表
|
||||
*/
|
||||
@ApiOperation(value = "分页查询用户")
|
||||
@PostMapping("/list/page")
|
||||
public BaseResponse<Page<User>> listUserByPage(@RequestBody UserSearchRequest userSearchRequest, HttpServletRequest request) {
|
||||
//判断是否为管理员
|
||||
userService.isAdmin(request);
|
||||
// userService.isAdmin(request);
|
||||
long current = userSearchRequest.getCurrent();
|
||||
long size = userSearchRequest.getPageSize();
|
||||
Page<User> userPage = userService.page(new Page<>(current, size),
|
||||
|
|
|
@ -62,7 +62,7 @@ public class AlipayServiceImpl implements AliPayService {
|
|||
String subject = orderDetailsList.stream()
|
||||
.map(OrderItems::getAttributeNames)
|
||||
.collect(Collectors.joining(", "));
|
||||
//给支付宝的订单号设置成取餐码
|
||||
//给支付宝的订单号设置
|
||||
order.setOrderNumber(outTradeNo);
|
||||
boolean update = ordersService.updateById(order);
|
||||
ThrowUtils.throwIf(!update, ErrorCode.OPERATION_ERROR, "修改订单状态失败");
|
||||
|
@ -71,8 +71,8 @@ public class AlipayServiceImpl implements AliPayService {
|
|||
model.setTotalAmount(String.valueOf(amount));
|
||||
model.setSubject(subject);
|
||||
model.setProductCode("JSAPI_PAY");
|
||||
model.setSellerId("2088721034640726");
|
||||
model.setBuyerId("2088722034659383");
|
||||
model.setSellerId("2088721037774480");
|
||||
model.setBuyerId("2088722037764824");
|
||||
model.setOpAppId("2021004144652242");
|
||||
|
||||
///回调地址
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -9,6 +9,7 @@
|
|||
<result property="orderNumber" column="orderNumber" jdbcType="VARCHAR"/>
|
||||
<result property="userId" column="userId" jdbcType="BIGINT"/>
|
||||
<result property="businessId" column="businessId" jdbcType="BIGINT"/>
|
||||
<result property="manicuristId" column="manicuristId" jdbcType="BIGINT"/>
|
||||
<result property="userName" column="userName" jdbcType="VARCHAR"/>
|
||||
<result property="phone" column="phone" jdbcType="VARCHAR"/>
|
||||
<result property="payMethod" column="payMethod" jdbcType="TINYINT"/>
|
||||
|
@ -27,6 +28,7 @@
|
|||
businessId,userName,phone,
|
||||
appointmentId,totalPrice,paymentStatus,
|
||||
claimStatus,notes,createTime,
|
||||
updateTime,isDelete,payMethod
|
||||
updateTime,isDelete,payMethod,
|
||||
manicuristId
|
||||
</sql>
|
||||
</mapper>
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user