|
@@ -34,7 +34,7 @@ import java.util.Optional;
|
|
public class RepairController extends BaseController {
|
|
public class RepairController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- private SysUserFeignService sysUserFeignService;
|
|
|
|
|
|
+ private SysUserService sysUserService;
|
|
@Autowired
|
|
@Autowired
|
|
private StudentRepairService studentRepairService;
|
|
private StudentRepairService studentRepairService;
|
|
@Autowired
|
|
@Autowired
|
|
@@ -50,11 +50,7 @@ public class RepairController extends BaseController {
|
|
@PostMapping(value = "/addGoodsSellOrder")
|
|
@PostMapping(value = "/addGoodsSellOrder")
|
|
public HttpResponseResult addGoodsSellOrder(@RequestBody StudentGoodsSell studentGoodsSell) throws Exception {
|
|
public HttpResponseResult addGoodsSellOrder(@RequestBody StudentGoodsSell studentGoodsSell) throws Exception {
|
|
if(studentGoodsSell.getUserId() == null){
|
|
if(studentGoodsSell.getUserId() == null){
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
|
- if (sysUser == null) {
|
|
|
|
- throw new BizException("请登录");
|
|
|
|
- }
|
|
|
|
- studentGoodsSell.setUserId(sysUser.getId());
|
|
|
|
|
|
+ studentGoodsSell.setUserId(sysUserService.getUserId());
|
|
}
|
|
}
|
|
if (studentGoodsSell.getIsRepeatPay() == false) {
|
|
if (studentGoodsSell.getIsRepeatPay() == false) {
|
|
List<StudentPaymentOrder> list = studentPaymentOrderService.queryByCondition(GroupType.GOODS_SELL, null, studentGoodsSell.getUserId(), DealStatusEnum.ING,
|
|
List<StudentPaymentOrder> list = studentPaymentOrderService.queryByCondition(GroupType.GOODS_SELL, null, studentGoodsSell.getUserId(), DealStatusEnum.ING,
|
|
@@ -94,11 +90,7 @@ public class RepairController extends BaseController {
|
|
@ApiOperation("获取维修记录")
|
|
@ApiOperation("获取维修记录")
|
|
@GetMapping(value = "/getStudentRepairList")
|
|
@GetMapping(value = "/getStudentRepairList")
|
|
public HttpResponseResult getStudentRepairList(RepairStudentQueryInfo queryInfo) {
|
|
public HttpResponseResult getStudentRepairList(RepairStudentQueryInfo queryInfo) {
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
|
- if (sysUser == null) {
|
|
|
|
- return failed("用户信息获取失败");
|
|
|
|
- }
|
|
|
|
- queryInfo.setStudentId(sysUser.getId());
|
|
|
|
|
|
+ queryInfo.setStudentId(sysUserService.getUserId());
|
|
queryInfo.setPayStatus(2);
|
|
queryInfo.setPayStatus(2);
|
|
return succeed(studentRepairService.queryPage(queryInfo));
|
|
return succeed(studentRepairService.queryPage(queryInfo));
|
|
}
|
|
}
|
|
@@ -107,7 +99,7 @@ public class RepairController extends BaseController {
|
|
@GetMapping(value = "/getRepairInfo")
|
|
@GetMapping(value = "/getRepairInfo")
|
|
public HttpResponseResult getRepairInfo(Integer id,Integer studentId) {
|
|
public HttpResponseResult getRepairInfo(Integer id,Integer studentId) {
|
|
Optional.ofNullable(studentId)
|
|
Optional.ofNullable(studentId)
|
|
- .map(sysUserFeignService::queryUserById)
|
|
|
|
|
|
+ .map(sysUserService::queryUserById)
|
|
.orElseThrow(() -> new BizException("用户信息获取失败"));
|
|
.orElseThrow(() -> new BizException("用户信息获取失败"));
|
|
|
|
|
|
StudentRepair repairInfo = studentRepairService.getRepairInfo(id);
|
|
StudentRepair repairInfo = studentRepairService.getRepairInfo(id);
|
|
@@ -120,31 +112,23 @@ public class RepairController extends BaseController {
|
|
@ApiOperation("支付维修单")
|
|
@ApiOperation("支付维修单")
|
|
@PostMapping(value = "/payRepair")
|
|
@PostMapping(value = "/payRepair")
|
|
public HttpResponseResult payRepair(@RequestBody StudentRepair repairInfo) throws Exception {
|
|
public HttpResponseResult payRepair(@RequestBody StudentRepair repairInfo) throws Exception {
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
|
- if (sysUser == null) {
|
|
|
|
- return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
|
- }
|
|
|
|
|
|
+ sysUserService.getUser();
|
|
return succeed(studentRepairService.payRepair(repairInfo));
|
|
return succeed(studentRepairService.payRepair(repairInfo));
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation("获取维修技师信息")
|
|
@ApiOperation("获取维修技师信息")
|
|
@PostMapping(value = "/getRepairer")
|
|
@PostMapping(value = "/getRepairer")
|
|
public HttpResponseResult getRepairer() {
|
|
public HttpResponseResult getRepairer() {
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
|
- if (sysUser == null) {
|
|
|
|
- return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
|
- }
|
|
|
|
|
|
+ SysUser sysUser = sysUserService.getUser();
|
|
return succeed(studentRepairService.getStudentRepairer(sysUser.getId(),sysUser.getOrganId()));
|
|
return succeed(studentRepairService.getStudentRepairer(sysUser.getId(),sysUser.getOrganId()));
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "分页查询商品(教材、辅件)列表")
|
|
@ApiOperation(value = "分页查询商品(教材、辅件)列表")
|
|
@GetMapping("/queryGoodsPage")
|
|
@GetMapping("/queryGoodsPage")
|
|
public Object queryPage(GoodsQueryInfo queryInfo){
|
|
public Object queryPage(GoodsQueryInfo queryInfo){
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
|
- if(sysUser == null){
|
|
|
|
- throw new BizException("请先登录");
|
|
|
|
- }
|
|
|
|
|
|
+ SysUser sysUser = sysUserService.getUser();
|
|
queryInfo.setStudentShowOrganId(sysUser.getOrganId().toString());
|
|
queryInfo.setStudentShowOrganId(sysUser.getOrganId().toString());
|
|
|
|
+ queryInfo.setTenantId(sysUser.getTenantId());
|
|
return succeed(goodsService.queryPage(queryInfo));
|
|
return succeed(goodsService.queryPage(queryInfo));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -157,11 +141,7 @@ public class RepairController extends BaseController {
|
|
@ApiOperation(value = "分页查询学员商品订单")
|
|
@ApiOperation(value = "分页查询学员商品订单")
|
|
@GetMapping("/queryStudentGoodsOrders")
|
|
@GetMapping("/queryStudentGoodsOrders")
|
|
public Object queryStudentGoodsOrders(GoodsSellQueryInfo queryInfo) {
|
|
public Object queryStudentGoodsOrders(GoodsSellQueryInfo queryInfo) {
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
|
- if (sysUser == null) {
|
|
|
|
- return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
|
- }
|
|
|
|
- queryInfo.setStudentId(sysUser.getId());
|
|
|
|
|
|
+ queryInfo.setStudentId(sysUserService.getUserId());
|
|
return succeed(studentGoodsSellService.queryStudentGoodsOrders(queryInfo));
|
|
return succeed(studentGoodsSellService.queryStudentGoodsOrders(queryInfo));
|
|
}
|
|
}
|
|
|
|
|