Jelajahi Sumber

修改商品字段不显示的问题

yaoyq 2 tahun lalu
induk
melakukan
55d56907b9

+ 28 - 0
imcs-bt-be/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/place/PlaceController.java

@@ -1,15 +1,26 @@
 package com.github.zuihou.business.controller.place;
 
+import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.zuihou.base.request.PageParams;
+import com.github.zuihou.business.company.entity.Company;
+import com.github.zuihou.business.order.dto.OrderPageDTO;
+import com.github.zuihou.business.order.entity.Order;
 import com.github.zuihou.business.place.entity.Place;
 import com.github.zuihou.business.place.dto.PlaceSaveDTO;
 import com.github.zuihou.business.place.dto.PlaceUpdateDTO;
 import com.github.zuihou.business.place.dto.PlacePageDTO;
 import com.github.zuihou.business.place.service.PlaceService;
+
+import java.lang.reflect.Array;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
 import com.github.zuihou.base.controller.SuperController;
 import com.github.zuihou.base.R;
+import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
+import com.github.zuihou.database.mybatis.conditions.query.QueryWrap;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
@@ -35,6 +46,23 @@ import com.github.zuihou.security.annotation.PreAuth;
 @PreAuth(replace = "place:")
 public class PlaceController extends SuperController<PlaceService, Long, Place, PlacePageDTO, PlaceSaveDTO, PlaceUpdateDTO> {
 
+    @Override
+    public void query(PageParams<PlacePageDTO> params, IPage<Place> page, Long defSize) {
+        PlacePageDTO data = params.getModel();
+        Place model = BeanUtil.toBean(data, Place.class);
+        QueryWrap<Place> wrapper = this.handlerWrapper(null, params);
+        LbqWrapper<Place> lbqWrapper = wrapper.lambda();
+        lbqWrapper.like(Place::getPlcName,model.getPlcName());
+        lbqWrapper.eq(Place::getPlcPid,model.getPlcPid());
+        lbqWrapper.eq(Place::getPlcAid,model.getPlcAid());
+        lbqWrapper.eq(Place::getPlcCid,model.getPlcCid());
+        baseService.page(page, wrapper);
+        List<Place>placeList =  page.getRecords();
+        for(Place place:placeList){
+            String []arr = {place.getPlcPid(),place.getPlcCid(),place.getPlcAid()};
+            place.setSelectedOptions(arr) ;
+        }
+    }
     /**
      * Excel导入后的操作
      *

+ 4 - 0
imcs-bt-be/imcs-business-entity/src/main/java/com/github/zuihou/business/place/entity/Place.java

@@ -203,6 +203,10 @@ public class Place extends Entity<Long> {
     @Excel(name = "场地维度")
     private String plcLat;
 
+    @ApiModelProperty(value = "省市区")
+    @TableField(exist = false)
+    private String [] selectedOptions;
+
 
     @Builder
     public Place(Long id, LocalDateTime createTime, Long createUser, LocalDateTime updateTime, Long updateUser,