Browse Source

Merge branch 'master' of http://git.zthymaoyi.com/gongdc/gubi

achao 1 year ago
parent
commit
a84c3141a9

+ 6 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/gubi/IGubiTypeInfoService.java

@@ -8,6 +8,8 @@ import com.iotechn.unimall.core.annotation.HttpParam;
 import com.iotechn.unimall.core.annotation.HttpParamType;
 import com.iotechn.unimall.core.annotation.param.NotNull;
 import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.gubi.GubiTypeSecond;
+import com.iotechn.unimall.data.domain.gubi.GubiTypeThree;
 import com.iotechn.unimall.data.model.Page;
 
 import java.util.Date;
@@ -45,6 +47,10 @@ public interface IGubiTypeInfoService {
 
     @HttpMethod(description = "列表")
     public List<GubiTypeInfo> listInfo() throws ServiceException;
+    @HttpMethod(description = "列表")
+    public  List<GubiTypeSecond> gubiTypeSeconds(@HttpParam(name = "typeId", type = HttpParamType.COMMON, description = "typeId") String typeId) throws ServiceException;
+    @HttpMethod(description = "列表")
+    public List<GubiTypeThree> listThreeInfo(@HttpParam(name = "secondId", type = HttpParamType.COMMON, description = "secondId") String secondId) throws ServiceException;
 
     @HttpMethod(description = "删除", permission = "admin:gubi:gubiTypeInfo:delete", permissionParentName = "宠物管理", permissionName = "一级分类管理")
     public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "") String id) throws ServiceException;

+ 26 - 1
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/gubi/impl/GubiTransactionServiceImpl.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,13 @@ import org.springframework.transaction.annotation.Transactional;
 public class GubiTransactionServiceImpl implements IGubiTransactionService {
     @Autowired
     private GubiTransactionMapper gubiTransactionMapper;
-
+    @Autowired
+    private GubiTypeInfoMapper gubiTypeInfoMapper;
+    @Autowired
+    private GubiTypeSecondMapper gubiTypeSecondMapper;
+    @Autowired
+    private GubiTypeThreeMapper gubiTypeThreeMapper;
+    @Autowired
     @Override
     public Boolean add(GubiTransaction gubiTransaction, Long adminId) throws ServiceException {
         Date now = new Date();
@@ -84,6 +97,18 @@ public class GubiTransactionServiceImpl implements IGubiTransactionService {
         }
         wrapper.eq("delete_flag", 0);
         List<GubiTransaction> list = gubiTransactionMapper.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).getProduct());
+
+            }
+        }
         Integer count = gubiTransactionMapper.selectCount(wrapper);
         return new Page<GubiTransaction>(list, page, limit, count);
     }

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

@@ -54,6 +54,7 @@ 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();
@@ -100,37 +101,32 @@ public class GubiTypeInfoServiceImpl implements IGubiTypeInfoService {
     }
 
     public List<GubiTypeInfo> listInfo() {
-        List<GubiTypeInfo> listRedis = cacheComponent.getObjList(Const.ADMIN_BI_INFO, GubiTypeInfo.class);
-        if (listRedis != null && listRedis.size() > 0) {
-            return listRedis;
-        }
         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);
-            }
-
-        }
-        cacheComponent.putRaw(Const.ADMIN_BI_INFO , JSONObject.toJSONString(list), 60 * 60);
 
         return list;
     }
 
+    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;
+    }
+
+
+
+    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
     @Transactional(rollbackFor = Exception.class)
     public Boolean delete(String id) {

+ 5 - 0
unimall-data/src/main/java/com/iotechn/unimall/data/domain/gubi/GubiTransaction.java

@@ -121,6 +121,11 @@ public class GubiTransaction extends SuperDO {
     @Excel(name = "")
     @TableField("admin_id")
     private Long adminId;
+    /**
+     *
+     */
+    @TableField(exist = false)
+    private String strFlag;
 
 
     @Override