|
@@ -1,44 +1,34 @@
|
|
|
package com.ym.mec.web.controller;
|
|
|
|
|
|
-import com.ym.mec.biz.dal.dao.StudentPaymentRouteOrderDao;
|
|
|
-import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
|
|
|
-import com.ym.mec.biz.service.OrganizationService;
|
|
|
-import io.swagger.annotations.Api;
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
-
|
|
|
-import java.math.BigDecimal;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
-
|
|
|
-import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
-import com.ym.mec.auth.api.entity.SysUser;
|
|
|
-import com.ym.mec.biz.dal.dao.EmployeeDao;
|
|
|
import com.ym.mec.biz.dal.dao.SellOrderDao;
|
|
|
import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
|
|
|
+import com.ym.mec.biz.dal.dao.StudentPaymentRouteOrderDao;
|
|
|
import com.ym.mec.biz.dal.dto.BasicUserDto;
|
|
|
import com.ym.mec.biz.dal.dto.OutOrderInfoDto;
|
|
|
import com.ym.mec.biz.dal.dto.StudentPaymentRouteOrderDto;
|
|
|
-import com.ym.mec.biz.dal.entity.Employee;
|
|
|
import com.ym.mec.biz.dal.entity.SellOrder;
|
|
|
+import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
|
|
|
import com.ym.mec.biz.dal.entity.StudentPaymentRouteOrder;
|
|
|
import com.ym.mec.biz.dal.enums.AuditStatusEnum;
|
|
|
import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
|
|
|
import com.ym.mec.biz.dal.page.StudentPaymentRouteOrderQueryInfo;
|
|
|
+import com.ym.mec.biz.service.OrganizationService;
|
|
|
import com.ym.mec.biz.service.StudentPaymentRouteOrderService;
|
|
|
+import com.ym.mec.biz.service.SysUserService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
import com.ym.mec.common.page.PageInfo;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
@RequestMapping("routeOrder")
|
|
|
@Api(tags = "分润订单服务")
|
|
@@ -48,7 +38,7 @@ public class StudentPaymentRouteOrderController extends BaseController {
|
|
|
@Autowired
|
|
|
private StudentPaymentRouteOrderService studentPaymentRouteOrderService;
|
|
|
@Autowired
|
|
|
- private SysUserFeignService sysUserFeignService;
|
|
|
+ private SysUserService sysUserService;
|
|
|
@Autowired
|
|
|
private OrganizationService organizationService;
|
|
|
@Autowired
|
|
@@ -98,15 +88,15 @@ public class StudentPaymentRouteOrderController extends BaseController {
|
|
|
@PostMapping("/add")
|
|
|
@PreAuthorize("@pcs.hasPermissions('routeOrder/add')")
|
|
|
public HttpResponseResult<StudentPaymentRouteOrder> add(@RequestBody StudentPaymentRouteOrder studentPaymentRouteOrder) {
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ Integer userId = sysUserService.getUserId();
|
|
|
if (studentPaymentRouteOrder.getServiceAmount() == null) {
|
|
|
studentPaymentRouteOrder.setServiceAmount(BigDecimal.ZERO);
|
|
|
}
|
|
|
if (studentPaymentRouteOrder.getSaleAmount() == null) {
|
|
|
studentPaymentRouteOrder.setSaleAmount(BigDecimal.ZERO);
|
|
|
}
|
|
|
- studentPaymentRouteOrder.setCreateBy(sysUser.getId());
|
|
|
- studentPaymentRouteOrder.setUpdateBy(sysUser.getId());
|
|
|
+ studentPaymentRouteOrder.setCreateBy(userId);
|
|
|
+ studentPaymentRouteOrder.setUpdateBy(userId);
|
|
|
if(studentPaymentRouteOrder.getPayTime().after(new Date())){
|
|
|
failed("交易日期不能大于当前时间");
|
|
|
}
|
|
@@ -119,8 +109,7 @@ public class StudentPaymentRouteOrderController extends BaseController {
|
|
|
@PostMapping("/auditOutOrder")
|
|
|
@PreAuthorize("@pcs.hasPermissions('routeOrder/auditOutOrder')")
|
|
|
public HttpResponseResult<String> auditOutOrder(Long studentPaymentRouteOrderId, AuditStatusEnum auditStatus, String memo) {
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- studentPaymentRouteOrderService.auditOutOrder(studentPaymentRouteOrderId, auditStatus, memo, sysUser.getId());
|
|
|
+ studentPaymentRouteOrderService.auditOutOrder(studentPaymentRouteOrderId, auditStatus, memo,sysUserService.getUserId());
|
|
|
return succeed();
|
|
|
}
|
|
|
|
|
@@ -136,14 +125,13 @@ public class StudentPaymentRouteOrderController extends BaseController {
|
|
|
if(originOrder.getAuditStatus() != AuditStatusEnum.REJECT ){
|
|
|
return failed("只有“拒绝”状态才能修改订单");
|
|
|
}
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
if (studentPaymentRouteOrder.getServiceAmount() == null) {
|
|
|
studentPaymentRouteOrder.setServiceAmount(BigDecimal.ZERO);
|
|
|
}
|
|
|
if (studentPaymentRouteOrder.getSaleAmount() == null) {
|
|
|
studentPaymentRouteOrder.setSaleAmount(BigDecimal.ZERO);
|
|
|
}
|
|
|
- studentPaymentRouteOrder.setUpdateBy(sysUser.getId());
|
|
|
+ studentPaymentRouteOrder.setUpdateBy(sysUserService.getUserId());
|
|
|
if(studentPaymentRouteOrder.getSchoolId() == null){
|
|
|
studentPaymentRouteOrder.setSchoolId(999999999);
|
|
|
}
|