Ver código fonte

咨询客户详情开发

anderx 1 ano atrás
pai
commit
01ad2b343e

+ 1 - 1
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -2234,7 +2234,7 @@
         desc
     </select>
     <select id="selectOrderByuid" resultType="java.util.Map">
-        select order_no orderNo,contract_no contractNo
+        select order_no orderNo,contract_no contractNo,total_amount totalAmount
         from t_order_new  where delete_sign in (0,2) and  buyer_id = #{uid}
         order by create_time desc
     </select>

+ 20 - 3
src/main/java/com/goafanti/order/service/impl/OrderPlusServiceImpl.java

@@ -12,6 +12,7 @@ import com.goafanti.order.service.OrderPlusService;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -38,20 +39,33 @@ public class OrderPlusServiceImpl extends BaseMybatisDao<TOrderNewMapper> implem
     public Object techUserDetails(String uid) {
         List<Map<String, Object>> maps = tOrderNewMapper.selectOrderByuid(uid);
         for (Map<String, Object> map : maps) {
-            String contractNo = (String) map.getOrDefault("contractNo",String.class);
-            System.out.println("contractNo = " + contractNo);
-            String orderNo = (String) map.getOrDefault("orderNo", String.class);
+            String contractNo = (String) map.get("contractNo");
+            BigDecimal totalAmount = (BigDecimal) map.get("totalAmount");
+            String orderNo = (String) map.get("orderNo");
             List<TOrderTaskBo> tOrderTaskBos = tOrderTaskMapper.selectOrderTaskAll(orderNo, null);
             String serviceLife = null;
             List<String> list=new ArrayList<>();
             int  yearSum=0;
+            int isHY=0;
             List<String> taskList=new ArrayList<>();
+            String lvl=null;
+            if (totalAmount.compareTo(new BigDecimal("3"))<0){
+                lvl="A";
+            }else if (totalAmount.compareTo(new BigDecimal("8"))<1){
+                lvl="AA";
+            }else if (totalAmount.compareTo(new BigDecimal("8"))>0){
+                lvl="AAA";
+            }
+
             List<TOrderTaskBo> collect = tOrderTaskBos.stream().filter(e -> e.getSplitStatus() == 1).collect(Collectors.toList());
             for (TOrderTaskBo e : collect) {
                 if (e.getYearSum()>yearSum){
                     yearSum=e.getYearSum();
                     serviceLife=e.getServiceLife();
                 }
+                if(e.getcSort()!=null&&e.getcSort()==6){
+                    isHY=1;
+                }
             }
             if (serviceLife!=null){
                 list = JSON.parseArray(serviceLife, String.class);
@@ -65,7 +79,10 @@ public class OrderPlusServiceImpl extends BaseMybatisDao<TOrderNewMapper> implem
                     taskList.add(s);
                 }
             }
+            System.out.println("contractNo = " + contractNo);
             System.out.println(taskList);
+            System.out.println("会员="+isHY);
+            System.out.println("会员等级="+lvl);
         }
         return null;
     }