gongdecai 1 year ago
parent
commit
8a7f7dce6f

+ 26 - 1
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/gubi/impl/GubiPriceHisServiceImpl.java

@@ -2,9 +2,16 @@ package com.iotechn.unimall.admin.api.gubi.impl;
 
 import java.util.List;
 
+import com.iotechn.unimall.data.domain.gubi.GubiTypeInfo;
+import com.iotechn.unimall.data.domain.gubi.GubiTypeSecond;
+import com.iotechn.unimall.data.domain.gubi.GubiTypeThree;
+import com.iotechn.unimall.data.mapper.gubi.GubiTypeInfoMapper;
+import com.iotechn.unimall.data.mapper.gubi.GubiTypeSecondMapper;
+import com.iotechn.unimall.data.mapper.gubi.GubiTypeThreeMapper;
 import org.apache.ibatis.session.RowBounds;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
 
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
@@ -30,7 +37,12 @@ import org.springframework.transaction.annotation.Transactional;
 public class GubiPriceHisServiceImpl implements IGubiPriceHisService {
     @Autowired
     private GubiPriceHisMapper gubiPriceHisMapper;
-
+    @Autowired
+    private GubiTypeInfoMapper gubiTypeInfoMapper;
+    @Autowired
+    private GubiTypeSecondMapper gubiTypeSecondMapper;
+    @Autowired
+    private GubiTypeThreeMapper gubiTypeThreeMapper;
     @Override
     public Boolean add(GubiPriceHis gubiPriceHis, Long adminId) throws ServiceException {
         Date now = new Date();
@@ -75,6 +87,19 @@ public class GubiPriceHisServiceImpl implements IGubiPriceHisService {
         }
         wrapper.eq("delete_flag", 0);
         List<GubiPriceHis> list = gubiPriceHisMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+        if(!CollectionUtils.isEmpty(list)){
+            for(int i=0;i<list.size();i++){
+                List<GubiTypeThree> gubiTypeThrees =  gubiTypeThreeMapper.selectList(new EntityWrapper<GubiTypeThree>()
+                        .eq("id",list.get(i).getOrderId()));
+                List<GubiTypeSecond> gubiTypeSeconds =  gubiTypeSecondMapper.selectList(new EntityWrapper<GubiTypeSecond>()
+                        .eq("id",gubiTypeThrees.get(0).getSecondId()));
+                List<GubiTypeInfo> gubiTypeInfos = gubiTypeInfoMapper.selectList(new EntityWrapper<GubiTypeInfo>()
+                        .eq("id",gubiTypeSeconds.get(0).getTypeId()));
+                list.get(i).setStrFlag(gubiTypeInfos.get(0).getTypeName()+"/"+gubiTypeSeconds.get(0).getSecondName()+"/"+gubiTypeThrees.get(0).getTypeId());
+                list.get(i).setIdstr(gubiTypeInfos.get(0).getId()+"/"+gubiTypeSeconds.get(0).getId()+"/"+gubiTypeThrees.get(0).getId());
+
+            }
+        }
         Integer count = gubiPriceHisMapper.selectCount(wrapper);
         return new Page<GubiPriceHis>(list, page, limit, count);
     }

+ 2 - 2
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/gubi/impl/GubiTransactionServiceImpl.java

@@ -43,7 +43,6 @@ public class GubiTransactionServiceImpl implements IGubiTransactionService {
     private GubiTypeSecondMapper gubiTypeSecondMapper;
     @Autowired
     private GubiTypeThreeMapper gubiTypeThreeMapper;
-    @Autowired
     @Override
     public Boolean add(GubiTransaction gubiTransaction, Long adminId) throws ServiceException {
         Date now = new Date();
@@ -105,7 +104,8 @@ public class GubiTransactionServiceImpl implements IGubiTransactionService {
               .eq("id",gubiTypeThrees.get(0).getSecondId()));
               List<GubiTypeInfo> gubiTypeInfos = gubiTypeInfoMapper.selectList(new EntityWrapper<GubiTypeInfo>()
               .eq("id",gubiTypeSeconds.get(0).getTypeId()));
-              list.get(i).setStrFlag(gubiTypeInfos.get(0).getTypeName()+"/"+gubiTypeSeconds.get(0).getSecondName()+"/"+gubiTypeThrees.get(0).getProduct());
+              list.get(i).setStrFlag(gubiTypeInfos.get(0).getTypeName()+"/"+gubiTypeSeconds.get(0).getSecondName()+"/"+gubiTypeThrees.get(0).getTypeId());
+              list.get(i).setIdstr(gubiTypeInfos.get(0).getId()+"/"+gubiTypeSeconds.get(0).getId()+"/"+gubiTypeThrees.get(0).getId());
 
             }
         }

+ 24 - 15
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/gubi/impl/GubiTypeInfoServiceImpl.java

@@ -54,7 +54,6 @@ public class GubiTypeInfoServiceImpl implements IGubiTypeInfoService {
         cacheComponent.delPrefixKey(Const.ADMIN_CONTRACTINFO);
         cacheComponent.delPrefixKey(Const.ADMIN_BI_INFO);
     }
-
     @Override
     public Boolean add(GubiTypeInfo gubiTypeInfo, Long adminId) throws ServiceException {
         Date now = new Date();
@@ -95,6 +94,7 @@ public class GubiTypeInfoServiceImpl implements IGubiTypeInfoService {
             wrapper.eq("admin_id", adminId);
         }
         wrapper.eq("delete_flag", 0);
+        wrapper.orderBy("postion");
         List<GubiTypeInfo> list = gubiTypeInfoMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
         Integer count = gubiTypeInfoMapper.selectCount(wrapper);
         return new Page<GubiTypeInfo>(list, page, limit, count);
@@ -104,29 +104,38 @@ public class GubiTypeInfoServiceImpl implements IGubiTypeInfoService {
         List<GubiTypeInfo> list = gubiTypeInfoMapper.selectList(new EntityWrapper<GubiTypeInfo>()
                 .eq("delete_flag", "0")
                 .orderBy("postion"));
+        if (!CollectionUtils.isEmpty(list)) {
+            for (int i = 0; i < list.size(); i++) {
+                List<GubiTypeSecond> gubiTypeSeconds = gubiTypeSecondMapper.selectList(new EntityWrapper<GubiTypeSecond>()
+                        .eq("type_id", list.get(i).getId())
+                        .eq("delete_flag", "0")
+                        .orderBy("postion"));
+                if (!CollectionUtils.isEmpty(gubiTypeSeconds)) {
+                    for (int k = 0; k < gubiTypeSeconds.size(); k++) {
+                        List<GubiTypeThree> gubiTypeThrees = gubiTypeThreeMapper.selectList(new EntityWrapper<GubiTypeThree>()
+                                .eq("second_id", gubiTypeSeconds.get(k).getId())
+                                .eq("delete_flag", "0")
+                                .orderBy("postion"));
+                        gubiTypeSeconds.get(k).setChildren(gubiTypeThrees);
+                    }
+                }
+                list.get(i).setChildren(gubiTypeSeconds);
+            }
 
+        }
         return list;
     }
 
+    @Override
     public List<GubiTypeSecond> gubiTypeSeconds(String typeId) throws ServiceException {
-        List<GubiTypeSecond> gubiTypeSeconds = gubiTypeSecondMapper.selectList(new EntityWrapper<GubiTypeSecond>()
-                .eq("type_id", typeId)
-                .eq("delete_flag", "0")
-                .orderBy("postion"));
-        return gubiTypeSeconds;
+        return null;
     }
 
-
-
-    public List<GubiTypeThree> listThreeInfo(String secondId) {
-        List<GubiTypeThree> gubiTypeThrees = gubiTypeThreeMapper.selectList(new EntityWrapper<GubiTypeThree>()
-                .eq("second_id", secondId)
-                .eq("delete_flag", "0")
-                .orderBy("postion"));
-        return gubiTypeThrees;
+    @Override
+    public List<GubiTypeThree> listThreeInfo(String secondId) throws ServiceException {
+        return null;
     }
 
-
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Boolean delete(String id) {

+ 1 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/gubi/impl/GubiTypeSecondServiceImpl.java

@@ -77,6 +77,7 @@ public class GubiTypeSecondServiceImpl implements IGubiTypeSecondService {
             wrapper.eq("admin_id", adminId);
         }
         wrapper.eq("delete_flag", 0);
+        wrapper.orderBy("postion");
         List<GubiTypeSecond> list = gubiTypeSecondMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
         Integer count = gubiTypeSecondMapper.selectCount(wrapper);
         return new Page<GubiTypeSecond>(list, page, limit, count);

+ 1 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/gubi/impl/GubiTypeThreeServiceImpl.java

@@ -107,6 +107,7 @@ public class GubiTypeThreeServiceImpl implements IGubiTypeThreeService {
             wrapper.eq("admin_id", adminId);
         }
         wrapper.eq("delete_flag", 0);
+        wrapper.orderBy("postion");
         List<GubiTypeThree> list = gubiTypeThreeMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
         Integer count = gubiTypeThreeMapper.selectCount(wrapper);
         return new Page<GubiTypeThree>(list, page, limit, count);

+ 10 - 1
unimall-data/src/main/java/com/iotechn/unimall/data/domain/gubi/GubiPriceHis.java

@@ -78,7 +78,16 @@ public class GubiPriceHis extends SuperDO {
     @TableField("admin_id")
     private Long adminId;
 
-
+    /**
+     *
+     */
+    @TableField(exist = false)
+    private String strFlag;
+    /**
+     *
+     */
+    @TableField(exist = false)
+    private String idstr;
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 6 - 1
unimall-data/src/main/java/com/iotechn/unimall/data/domain/gubi/GubiTransaction.java

@@ -36,7 +36,7 @@ public class GubiTransaction extends SuperDO {
      */
     @Excel(name = "")
     @TableField("company_id")
-    private Long companyId;
+    private String companyId;
 
     /**
      * 分值id
@@ -126,6 +126,11 @@ public class GubiTransaction extends SuperDO {
      */
     @TableField(exist = false)
     private String strFlag;
+    /**
+     *
+     */
+    @TableField(exist = false)
+    private String idstr;
 
 
     @Override