Parcourir la source

Merge branch 'feature/relation_type_item' into feature/push_invoice

lzm il y a 3 ans
Parent
commit
c9f5dcea51

+ 39 - 31
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java

@@ -47,6 +47,8 @@ import com.pj.project.tb_declare.TbDeclare;
 import com.pj.project.tb_declare.TbDeclareService;
 import com.pj.project.tb_driver.TbDriver;
 import com.pj.project.tb_driver.TbDriverService;
+import com.pj.project.tb_fee_details.TbFeeDetails;
+import com.pj.project.tb_fee_details.TbFeeDetailsService;
 import com.pj.project.tb_goods.TbGoods;
 import com.pj.project.tb_goods.TbGoodsService;
 import com.pj.project.tb_item.TbItem;
@@ -139,7 +141,8 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
 
     @Resource
     private RelationBusinessCarService relationBusinessCarService;
-
+    @Resource
+    private TbFeeDetailsService tbFeeDetailsService;
 
     private final List<String> CAR_LIST = StrUtil.splitTrim("浙,粤,京,津,冀,晋,蒙,辽,黑,沪,吉,苏,皖,赣,鲁,豫,鄂,湘,桂,琼,渝,川,贵,云,藏, 陕, 甘, 青, 宁", ",");
 
@@ -373,6 +376,11 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                         item.setPickCustomerId(customerId).setPick(1)
                                 .setPickCustomerName(tbCostomer.getName()).setPickTime(now)
                                 .setConfirm(1).setConfirmTime(now);
+                        TbFeeDetails feeDetails = tbFeeDetailsService.getByBusinessItemId(item.getId() + "");
+                        if (feeDetails != null) {
+                            feeDetails.setPickCustomerName(item.getPickCustomerName());
+                            tbFeeDetailsService.updateById(feeDetails);
+                        }
                         tbBusinessItemService.updateById(item);
                         List<String> customerMessageType = StrUtil.splitTrim(tbCostomer.getMessageType(), ",");
                         if (customerMessageType.contains(messageType)) {
@@ -720,20 +728,20 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                     .setItemTypeId(typeId).setItemTypeName(tbItemType.getName())
                     .setUnit(db.getUnit()).setTotal(itemTotalPrice).setCreateTime(now);
             //合作伙伴创建记录接单操作人by lzm
-            String businessType = item.getBusinessType();
-            if (!StrUtil.equals(businessType, TbCostomer.CustomerEnum.BUSINESS_TYPE.getType())) {
-                String currCustomerId = StpUserUtil.getCustomerId();
-                TbCostomer currCostomer = tbCostomerService.getById(currCustomerId);
-                List<String> customerType = new ArrayList<>();
-                if (currCostomer != null) {
-                    customerType = StrUtil.splitTrim(currCostomer.getType(), ",");
-                }
-                if (customerType.contains(businessType)) {
-                    SpAdmin currAdmin = StpUserUtil.getAdmin();
-                    String adminName = StrUtil.isNotEmpty(currAdmin.getNickname()) ? currAdmin.getNickname():currAdmin.getName();
-                    item.setPickBy(adminName).setPickByAdminId(currAdmin.getId()+"");
-                }
-            }
+//            String businessType = item.getBusinessType();
+//            if (!StrUtil.equals(businessType, TbCostomer.CustomerEnum.BUSINESS_TYPE.getType())) {
+//                String currCustomerId = StpUserUtil.getCustomerId();
+//                TbCostomer currCostomer = tbCostomerService.getById(currCustomerId);
+//                List<String> customerType = new ArrayList<>();
+//                if (currCostomer != null) {
+//                    customerType = StrUtil.splitTrim(currCostomer.getType(), ",");
+//                }
+//                if (customerType.contains(businessType)) {
+//                    SpAdmin currAdmin = StpUserUtil.getAdmin();
+//                    String adminName = StrUtil.isNotEmpty(currAdmin.getNickname()) ? currAdmin.getNickname():currAdmin.getName();
+//                    item.setPickBy(adminName).setPickByAdminId(currAdmin.getId()+"");
+//                }
+//            }
             //
             price = price.add(itemTotalPrice);
             itemList.add(item);
@@ -857,22 +865,22 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                         .setItemTypeId(tbItem.getTypeId()).setItemTypeName(tbItemType.getName())
                         .setUnit(db.getUnit()).setTotal(itemTotalPrice).setCreateTime(now);
                 //by lzm
-                String businessType = item.getBusinessType();
-                if (!StrUtil.equals(businessType, TbCostomer.CustomerEnum.BUSINESS_TYPE.getType())) {
-                    String currCustomerId = StpUserUtil.getCustomerId();
-                    TbCostomer currCostomer = tbCostomerService.getById(currCustomerId);
-                    List<String> customerType = new ArrayList<>();
-                    if (currCostomer != null) {
-                        customerType = StrUtil.splitTrim(currCostomer.getType(), ",");
-                    }
-                    if (customerType.contains(businessType)) {
-                        SpAdmin currAdmin = StpUserUtil.getAdmin();
-                        String adminName = StrUtil.isNotEmpty(currAdmin.getNickname()) ? currAdmin.getNickname():currAdmin.getName();
-                        item.setPickBy(adminName).setPickByAdminId(currAdmin.getId()+"");
-                    }else {
-                        item.setPickBy("").setPickByAdminId("");
-                    }
-                }
+//                String businessType = item.getBusinessType();
+//                if (!StrUtil.equals(businessType, TbCostomer.CustomerEnum.BUSINESS_TYPE.getType())) {
+//                    String currCustomerId = StpUserUtil.getCustomerId();
+//                    TbCostomer currCostomer = tbCostomerService.getById(currCustomerId);
+//                    List<String> customerType = new ArrayList<>();
+//                    if (currCostomer != null) {
+//                        customerType = StrUtil.splitTrim(currCostomer.getType(), ",");
+//                    }
+//                    if (customerType.contains(businessType)) {
+//                        SpAdmin currAdmin = StpUserUtil.getAdmin();
+//                        String adminName = StrUtil.isNotEmpty(currAdmin.getNickname()) ? currAdmin.getNickname():currAdmin.getName();
+//                        item.setPickBy(adminName).setPickByAdminId(currAdmin.getId()+"");
+//                    }else {
+//                        item.setPickBy("").setPickByAdminId("");
+//                    }
+//                }
                 //
                 price = price.add(itemTotalPrice);
                 itemList.add(item);