Ver Fonte

订单列表

liangpeile há 1 ano atrás
pai
commit
7a58c73214

+ 3 - 0
crmeb-common/src/main/java/com/zbkj/common/model/order/MerchantOrder.java

@@ -145,5 +145,8 @@ public class MerchantOrder implements Serializable {
     @ApiModelProperty(value = "更新时间")
     private Date updateTime;
 
+    @ApiModelProperty(value = "企业ID")
+    private String procureUnit;
+
 
 }

+ 3 - 0
crmeb-common/src/main/java/com/zbkj/common/model/order/Order.java

@@ -156,5 +156,8 @@ public class Order implements Serializable {
     @ApiModelProperty(value = "企业ID")
     private Integer enterpriseId;
 
+    @ApiModelProperty(value = "企业ID")
+    private String procureUnit;
+
 
 }

+ 5 - 0
crmeb-common/src/main/java/com/zbkj/common/model/order/OrderDetail.java

@@ -152,4 +152,9 @@ public class OrderDetail implements Serializable {
     @ApiModelProperty(value = "商户名称")
     @TableField(exist = false)
     private String merName;
+
+    @ApiModelProperty(value = "企业ID")
+    private String procureUnit;
+
+
 }

+ 3 - 0
crmeb-common/src/main/java/com/zbkj/common/response/MerchantOrderPageResponse.java

@@ -70,6 +70,9 @@ public class MerchantOrderPageResponse implements Serializable {
     @ApiModelProperty(value = "企业名称")
     private String qyName;
 
+    @ApiModelProperty(value = "企业Id")
+    private Integer qyId;
+
     @ApiModelProperty(value = "下单账号")
     private String account;
 

+ 3 - 0
crmeb-common/src/main/java/com/zbkj/common/response/OrderAdminDetailResponse.java

@@ -147,6 +147,9 @@ public class OrderAdminDetailResponse implements Serializable {
     @ApiModelProperty(value = "用户是否注销")
     private Boolean isLogoff;
 
+    @ApiModelProperty(value = "采购单位")
+    private String compName;
+
     @ApiModelProperty(value = "核销员名称")
     private String clerkName;
 

+ 3 - 0
crmeb-common/src/main/java/com/zbkj/common/response/PlatformOrderAdminDetailResponse.java

@@ -172,4 +172,7 @@ public class PlatformOrderAdminDetailResponse implements Serializable {
 
     @ApiModelProperty(value = "商户是否自营:0-非自营,1-自营")
     private Boolean merIsSelf;
+
+    @ApiModelProperty(value = "采购单位")
+    private String compName;
 }

+ 35 - 0
crmeb-front/src/main/java/com/zbkj/front/service/impl/FrontOrderServiceImpl.java

@@ -386,6 +386,38 @@ public class FrontOrderServiceImpl implements FrontOrderService {
         }
         order.setType(orderInfoVo.getType());// 默认普通订单
 
+//        采购单位
+        Integer isEnterpriseUser = user.getIsEnterpriseUser();
+        if (null!=isEnterpriseUser){
+            if (2==isEnterpriseUser){
+                LambdaQueryWrapper<UserEnterprise> enterpriseLambdaQueryWrapper = new LambdaQueryWrapper<>();
+                enterpriseLambdaQueryWrapper.eq(UserEnterprise::getIsDelete,0);
+                enterpriseLambdaQueryWrapper.eq(UserEnterprise::getUserId,user.getId());
+                UserEnterprise userEnterprise = userEnterpriseService.getOne(enterpriseLambdaQueryWrapper);
+                if (null!=userEnterprise){
+                    order.setProcureUnit(userEnterprise.getEnterpriseName());
+                }
+
+            }else if (3==isEnterpriseUser){
+                LambdaQueryWrapper<UserBypassAccount> bypassAccountLambdaQueryWrapper = new LambdaQueryWrapper<>();
+                bypassAccountLambdaQueryWrapper.eq(UserBypassAccount::getIsDelete,0);
+                bypassAccountLambdaQueryWrapper.eq(UserBypassAccount::getUserId,user.getId());
+                UserBypassAccount userBypassAccount = userBypassAccountService.getOne(bypassAccountLambdaQueryWrapper);
+                if (null!=userBypassAccount){
+                    Integer enterpriseId = userBypassAccount.getEnterpriseId();
+                    UserEnterprise userEnterprise = userEnterpriseService.getById(enterpriseId);
+                    order.setProcureUnit(userEnterprise.getEnterpriseName());
+                }else {
+                    order.setProcureUnit("");
+                }
+
+            }else {
+                order.setProcureUnit("");
+            }
+        }else {
+            order.setProcureUnit("");
+        }
+
         //企业子账户只能看自己企业的订单
         if (2==user.getIsEnterpriseUser()||3==user.getIsEnterpriseUser()){
             LambdaQueryWrapper<UserBypassAccount> queryWrapper = new LambdaQueryWrapper<>();
@@ -416,6 +448,8 @@ public class FrontOrderServiceImpl implements FrontOrderService {
             merchantOrder.setOrderNo(order.getOrderNo());
             merchantOrder.setMerId(merchantOrderVo.getMerId());
             merchantOrder.setUid(user.getId());
+            merchantOrder.setProcureUnit(order.getProcureUnit());
+
             for (OrderMerchantRequest om : orderMerchantRequestList) {
                 if (om.getMerId().equals(merchantOrderVo.getMerId())) {
                     if (StrUtil.isNotBlank(om.getRemark())) {
@@ -475,6 +509,7 @@ public class FrontOrderServiceImpl implements FrontOrderService {
                 orderDetail.setUseIntegral(detailVo.getUseIntegral());
                 orderDetail.setIntegralPrice(detailVo.getIntegralPrice());
                 orderDetail.setPayPrice(BigDecimal.ZERO);
+                orderDetail.setProcureUnit(order.getProcureUnit());
                 BigDecimal detailPayPrice = orderDetail.getPrice().multiply(new BigDecimal(orderDetail.getPayNum().toString())).add(orderDetail.getFreightFee()).subtract(orderDetail.getCouponPrice()).subtract(orderDetail.getIntegralPrice());
                 if (detailPayPrice.compareTo(BigDecimal.ZERO) >= 0) {
                     orderDetail.setPayPrice(detailPayPrice);

+ 6 - 2
crmeb-service/src/main/java/com/zbkj/service/service/impl/OrderServiceImpl.java

@@ -333,7 +333,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements Or
         LambdaQueryWrapper<Order> lqw = Wrappers.lambdaQuery();
         lqw.select(Order::getOrderNo, Order::getUid, Order::getPayPrice, Order::getPayType, Order::getPaid, Order::getStatus, Order::getRefundStatus,
                 Order::getIsUserDel, Order::getCancelStatus, Order::getType, Order::getCreateTime, Order::getLevel,
-                Order::getIsRemit, Order::getAccount, Order::getQyName);
+                Order::getIsRemit, Order::getAccount, Order::getQyName,Order::getProcureUnit,Order::getQyId);
         lqw.eq(Order::getMerId, systemAdmin.getMerId());
         //这个方法查询不是属于积分支付的订单  不是
 //        lqw.ne(Order::getIsIntegral, 1).or().isNull(Order::getIsIntegral);
@@ -353,7 +353,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements Or
             lqw.like(Order::getOrderNo, URLUtil.decode(request.getOrderNo()));
         }
         if (StrUtil.isNotBlank(request.getQyName())) {
-            lqw.like(Order::getQyName, request.getQyName());
+            lqw.like(Order::getProcureUnit, request.getQyName());
         }
         if (ObjectUtil.isNotNull(request.getType())) {
             lqw.eq(Order::getType, request.getType());
@@ -382,6 +382,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements Or
             pageResponse.setNickName(userMap.get(e.getUid()).getNickname());
             pageResponse.setIsLogoff(userMap.get(e.getUid()).getIsLogoff());
             pageResponse.setIsRemit(e.getIsRemit());
+            pageResponse.setQyName(e.getProcureUnit());
+            pageResponse.setQyId(e.getQyId());
 //            if (e.getIsLineOfCredit()!=null){
 //                if (e.getIsLineOfCredit()==1){
             //换个判断
@@ -510,6 +512,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements Or
             return dataResponse;
         }).collect(Collectors.toList());
         orderAdminDetailResponse.setOrderDetailList(orderInfoList);
+        orderAdminDetailResponse.setCompName(order.getProcureUnit());
 
         // 用户信息
         User user = userService.getById(order.getUid());
@@ -738,6 +741,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements Or
             return dataResponse;
         }).collect(Collectors.toList());
         response.setOrderDetailList(orderInfoList);
+        response.setCompName(order.getProcureUnit());
 
         // 用户信息
         User user = userService.getById(order.getUid());