he2802 1 жил өмнө
parent
commit
ab70715222

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/mapper/TopOldOrderMapper.java

@@ -96,7 +96,7 @@ public interface TopOldOrderMapper extends BaseMapper<TopOldOrder> {
 
     TopOrderStatisticsDetailTotalVo getDetailStatisticsTotal(TopDetailStatisticsTotal total);
 
-    Long getOrderTenant(Long customerId);
+    String getOrderTenant(String customerId);
 
     List<TopOrderCustomerVo> getCustomerList();
 

+ 6 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/impl/TopOldOrderServiceImpl.java

@@ -2906,10 +2906,10 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
         detailVos.forEach(item -> {
             //订单客户机构ID
             if (item.getOrderType() == 1){
-                Long tenantId = baseMapper.getOrderTenant(item.getCustomerId());
-                item.setTenantId(tenantId.toString());
+                String tenantId = baseMapper.getOrderTenant(item.getCustomerId());
+                item.setTenantId(tenantId);
             }else {
-                item.setTenantId(item.getCustomerId().toString());
+                item.setTenantId(item.getCustomerId());
             }
             if (item.getMoney().compareTo(BigDecimal.ZERO) == 0){
                 return;
@@ -3261,6 +3261,9 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
                     break;
             }
         }
+        if (StringUtils.isNotBlank(bo.getBusinessName())){
+            bo.setBusinessName(Arrays.stream(bo.getBusinessName().split("-")).collect(Collectors.joining()));
+        }
         TopDetailStatisticsTotal total = new TopDetailStatisticsTotal();
         total.setStartTime(bo.getStartTime());
         total.setEndTime(bo.getEndTime());

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/order/bo/TopDetailStatisticsTotal.java

@@ -18,7 +18,7 @@ public class TopDetailStatisticsTotal implements Serializable {
     @ApiModelProperty("结束时间")
     private Long endTime;
 
-    private Long customerId;
+    private String customerId;
 
     private String customerName;
 

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/order/bo/TopOrderStatisticsBo.java

@@ -29,7 +29,7 @@ public class TopOrderStatisticsBo implements Serializable {
     @ApiModelProperty("结束时间")
     private Long endTime;
 
-    private Long customerId;
+    private String customerId;
 
     private String customerName;
 

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/order/vo/TopOrderStatisticsDetailVo.java

@@ -14,7 +14,7 @@ import java.math.BigDecimal;
 public class TopOrderStatisticsDetailVo implements Serializable {
 
     @ApiModelProperty("客户ID")
-    private Long customerId;
+    private String customerId;
 
     @ApiModelProperty("机构ID")
     private String tenantId;

+ 7 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/settle/service/impl/ITopInstSettleServiceImpl.java

@@ -118,7 +118,7 @@ public class ITopInstSettleServiceImpl extends ServiceImpl<TopInstSettleMapper,
         if (CollectionUtils.isEmpty(businessNames)){
             throw new CustomException("订单不存在业务层,请检查!");
         }
-        String eduName = getBusinessFullName(bo.getEducationTypeId(),bo.getProjectId(),bo.getBusinessId());
+        String eduName = getOldBusinessFullName(bo.getBusinessId());
         if (businessNames.stream().noneMatch(x -> x.contains(eduName))){
             throw new CustomException("订单业务层次不匹配,请检查!");
         }
@@ -272,7 +272,7 @@ public class ITopInstSettleServiceImpl extends ServiceImpl<TopInstSettleMapper,
             tpBusinessName = baseMapper.geTopCostBusinessName(tpItem.getId());
         }else {
             //模板业务层次全称
-            tpBusinessName = getBusinessFullName(paramBo.getEducationTypeId(),paramBo.getProjectId(),paramBo.getBusinessId());
+            tpBusinessName = getOldBusinessFullName(paramBo.getBusinessId());
         }
 
         for (SettleOrderImportBo bo : orderImportBo) {
@@ -1191,4 +1191,9 @@ public class ITopInstSettleServiceImpl extends ServiceImpl<TopInstSettleMapper,
         TopCourseBusiness business = topCourseBusinessService.getById(businessId);
         return educationType.getEducationName()+business.getBusinessName()+projectType.getProjectName();
     }
+
+    private String getOldBusinessFullName(Long businessId){
+        TopCourseBusiness business = topCourseBusinessService.getById(businessId);
+        return business.getOldBusinessName();
+    }
 }

+ 7 - 7
zhongzheng-system/src/main/resources/mapper/modules/top/TopOldOrderMapper.xml

@@ -712,7 +712,7 @@
                     LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
                     LEFT JOIN course_business cb ON g.business_id = cb.id
                     WHERE o.order_sn = og.order_sn
-                    AND INSTR(CONCAT(cet.education_name,cpt.project_name,cb.business_name),#{businessName}) ) > 0
+                    AND INSTR(CONCAT(cet.education_name,cb.business_name,cpt.project_name),#{businessName}) ) > 0
                 </if>
                 <if test="tenantId != null and tenantId != ''">
                     AND o.tenant_id = #{tenantId}
@@ -844,7 +844,7 @@
             LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
             LEFT JOIN course_business cb ON g.business_id = cb.id
             WHERE o.order_sn = og.order_sn
-            AND INSTR(CONCAT(cet.education_name,cpt.project_name,cb.business_name),#{businessName}) ) > 0
+            AND INSTR(CONCAT(cet.education_name,cb.business_name,cpt.project_name),#{businessName}) ) > 0
         </if>
         <if test="tenantId != null and tenantId != ''">
             AND o.tenant_id = #{tenantId}
@@ -959,7 +959,7 @@
             LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
             LEFT JOIN course_business cb ON g.business_id = cb.id
             WHERE o.order_sn = og.order_sn
-            AND INSTR(CONCAT(cet.education_name,cpt.project_name,cb.business_name),#{businessName}) ) > 0
+            AND INSTR(CONCAT(cet.education_name,cb.business_name,cpt.project_name),#{businessName}) ) > 0
         </if>
         <if test="tenantId != null and tenantId != ''">
             AND o.tenant_id = #{tenantId}
@@ -1025,7 +1025,7 @@
             LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
             LEFT JOIN course_business cb ON g.business_id = cb.id
             WHERE o.order_sn = og.order_sn
-            AND INSTR(CONCAT(cet.education_name,cpt.project_name,cb.business_name),#{businessName}) ) > 0
+            AND INSTR(CONCAT(cet.education_name,cb.business_name,cpt.project_name),#{businessName}) ) > 0
         </if>
         <if test="tenantId != null and tenantId != ''">
             AND o.tenant_id = #{tenantId}
@@ -1184,7 +1184,7 @@
                 LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
                 LEFT JOIN course_business cb ON g.business_id = cb.id
                 WHERE o.order_sn = og.order_sn
-                AND INSTR(CONCAT(cet.education_name,cpt.project_name,cb.business_name),#{businessName}) ) > 0
+                AND INSTR(CONCAT(cet.education_name,cb.business_name,cpt.project_name),#{businessName}) ) > 0
             </if>
             <if test="tenantId != null and tenantId != ''">
                 AND o.tenant_id = #{tenantId}
@@ -1289,7 +1289,7 @@
 
 
     <select id="getSingleTenantStatistics" parameterType="com.zhongzheng.modules.top.order.bo.TopOrderStatisticsBo"
-            resultType="BigDecimal">
+            resultType="java.math.BigDecimal">
         SELECT
         (IFNULL(SUM( vo.order_received - vo.order_refunded ),0)+(
         SELECT
@@ -2091,7 +2091,7 @@
         SUM( allu.money ) DESC
     </select>
 
-    <select id="getOrderTenant" parameterType="java.lang.Long" resultType="java.lang.Long">
+    <select id="getOrderTenant" parameterType="java.lang.String" resultType="java.lang.String">
         SELECT tenant_id FROM top_old_order WHERE old_customer_id = #{customerId} LIMIT 1
     </select>