|
@@ -377,62 +377,63 @@ public class FrontOrderServiceImpl implements FrontOrderService {
|
|
order.setIsRemit(2);
|
|
order.setIsRemit(2);
|
|
order.setCancelStatus(OrderConstants.ORDER_CANCEL_STATUS_NORMAL);
|
|
order.setCancelStatus(OrderConstants.ORDER_CANCEL_STATUS_NORMAL);
|
|
order.setLevel(OrderConstants.ORDER_LEVEL_PLATFORM);
|
|
order.setLevel(OrderConstants.ORDER_LEVEL_PLATFORM);
|
|
- if (2==user.getIsEnterpriseUser()){
|
|
|
|
|
|
+
|
|
|
|
+ if (2 == user.getIsEnterpriseUser()) {
|
|
order.setIsEnterpriseUser(2);
|
|
order.setIsEnterpriseUser(2);
|
|
- }else if(3==user.getIsEnterpriseUser()){
|
|
|
|
|
|
+ } else if (3 == user.getIsEnterpriseUser()) {
|
|
order.setIsEnterpriseUser(3);
|
|
order.setIsEnterpriseUser(3);
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
order.setIsEnterpriseUser(1);
|
|
order.setIsEnterpriseUser(1);
|
|
}
|
|
}
|
|
order.setType(orderInfoVo.getType());// 默认普通订单
|
|
order.setType(orderInfoVo.getType());// 默认普通订单
|
|
|
|
|
|
// 采购单位
|
|
// 采购单位
|
|
Integer isEnterpriseUser = user.getIsEnterpriseUser();
|
|
Integer isEnterpriseUser = user.getIsEnterpriseUser();
|
|
- if (null!=isEnterpriseUser){
|
|
|
|
- if (2==isEnterpriseUser){
|
|
|
|
|
|
+ if (null != isEnterpriseUser) {
|
|
|
|
+ if (2 == isEnterpriseUser) {
|
|
LambdaQueryWrapper<UserEnterprise> enterpriseLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<UserEnterprise> enterpriseLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
- enterpriseLambdaQueryWrapper.eq(UserEnterprise::getIsDelete,0);
|
|
|
|
- enterpriseLambdaQueryWrapper.eq(UserEnterprise::getUserId,user.getId());
|
|
|
|
|
|
+ enterpriseLambdaQueryWrapper.eq(UserEnterprise::getIsDelete, 0);
|
|
|
|
+ enterpriseLambdaQueryWrapper.eq(UserEnterprise::getUserId, user.getId());
|
|
UserEnterprise userEnterprise = userEnterpriseService.getOne(enterpriseLambdaQueryWrapper);
|
|
UserEnterprise userEnterprise = userEnterpriseService.getOne(enterpriseLambdaQueryWrapper);
|
|
- if (null!=userEnterprise){
|
|
|
|
|
|
+ if (null != userEnterprise) {
|
|
order.setProcureUnit(userEnterprise.getEnterpriseName());
|
|
order.setProcureUnit(userEnterprise.getEnterpriseName());
|
|
}
|
|
}
|
|
|
|
|
|
- }else if (3==isEnterpriseUser){
|
|
|
|
|
|
+ } else if (3 == isEnterpriseUser) {
|
|
LambdaQueryWrapper<UserBypassAccount> bypassAccountLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<UserBypassAccount> bypassAccountLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
- bypassAccountLambdaQueryWrapper.eq(UserBypassAccount::getIsDelete,0);
|
|
|
|
- bypassAccountLambdaQueryWrapper.eq(UserBypassAccount::getUserId,user.getId());
|
|
|
|
|
|
+ bypassAccountLambdaQueryWrapper.eq(UserBypassAccount::getIsDelete, 0);
|
|
|
|
+ bypassAccountLambdaQueryWrapper.eq(UserBypassAccount::getUserId, user.getId());
|
|
UserBypassAccount userBypassAccount = userBypassAccountService.getOne(bypassAccountLambdaQueryWrapper);
|
|
UserBypassAccount userBypassAccount = userBypassAccountService.getOne(bypassAccountLambdaQueryWrapper);
|
|
- if (null!=userBypassAccount){
|
|
|
|
|
|
+ if (null != userBypassAccount) {
|
|
Integer enterpriseId = userBypassAccount.getEnterpriseId();
|
|
Integer enterpriseId = userBypassAccount.getEnterpriseId();
|
|
UserEnterprise userEnterprise = userEnterpriseService.getById(enterpriseId);
|
|
UserEnterprise userEnterprise = userEnterpriseService.getById(enterpriseId);
|
|
order.setProcureUnit(userEnterprise.getEnterpriseName());
|
|
order.setProcureUnit(userEnterprise.getEnterpriseName());
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
order.setProcureUnit("");
|
|
order.setProcureUnit("");
|
|
}
|
|
}
|
|
|
|
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
order.setProcureUnit("");
|
|
order.setProcureUnit("");
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
order.setProcureUnit("");
|
|
order.setProcureUnit("");
|
|
}
|
|
}
|
|
|
|
|
|
//企业子账户只能看自己企业的订单
|
|
//企业子账户只能看自己企业的订单
|
|
- if (2==user.getIsEnterpriseUser()||3==user.getIsEnterpriseUser()){
|
|
|
|
|
|
+ if (2 == user.getIsEnterpriseUser() || 3 == user.getIsEnterpriseUser()) {
|
|
LambdaQueryWrapper<UserBypassAccount> queryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<UserBypassAccount> queryWrapper = new LambdaQueryWrapper<>();
|
|
- queryWrapper.eq(UserBypassAccount::getUserId,user.getId());
|
|
|
|
- queryWrapper.eq(UserBypassAccount::getIsDelete,0);
|
|
|
|
|
|
+ queryWrapper.eq(UserBypassAccount::getUserId, user.getId());
|
|
|
|
+ queryWrapper.eq(UserBypassAccount::getIsDelete, 0);
|
|
List<UserBypassAccount> list = userBypassAccountService.list();
|
|
List<UserBypassAccount> list = userBypassAccountService.list();
|
|
- if (null!=list&&list.size()>0){
|
|
|
|
|
|
+ if (null != list && list.size() > 0) {
|
|
Integer enterpriseId = list.get(0).getEnterpriseId();
|
|
Integer enterpriseId = list.get(0).getEnterpriseId();
|
|
order.setEnterpriseId(enterpriseId);
|
|
order.setEnterpriseId(enterpriseId);
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
LambdaQueryWrapper<UserEnterprise> userEnterpriseLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<UserEnterprise> userEnterpriseLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
- userEnterpriseLambdaQueryWrapper.eq(UserEnterprise::getUserId,user.getId());
|
|
|
|
- userEnterpriseLambdaQueryWrapper.eq(UserEnterprise::getIsDelete,0);
|
|
|
|
|
|
+ userEnterpriseLambdaQueryWrapper.eq(UserEnterprise::getUserId, user.getId());
|
|
|
|
+ userEnterpriseLambdaQueryWrapper.eq(UserEnterprise::getIsDelete, 0);
|
|
List<UserEnterprise> list1 = userEnterpriseService.list();
|
|
List<UserEnterprise> list1 = userEnterpriseService.list();
|
|
- if (null!=list&&list.size()>0){
|
|
|
|
|
|
+ if (null != list && list.size() > 0) {
|
|
Integer enterpriseId = list1.get(0).getId();
|
|
Integer enterpriseId = list1.get(0).getId();
|
|
order.setEnterpriseId(enterpriseId);
|
|
order.setEnterpriseId(enterpriseId);
|
|
}
|
|
}
|