浏览代码

Merge branch 'feature/0721-tenant' of http://git.dayaedu.com/yonge/cooleshow into feature/0721-tenant

liujc 1 年之前
父节点
当前提交
a709176250
共有 14 个文件被更改,包括 487 次插入89 次删除
  1. 2 1
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/SysGoodsPriceController.java
  2. 1 1
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/TenantAlbumController.java
  3. 105 0
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/TenantEntryRecordController.java
  4. 1 54
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/TenantInfoController.java
  5. 11 2
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/mapper/TenantApplyRecordMapper.java
  6. 15 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/TenantApplyRecordService.java
  7. 158 10
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TenantApplyRecordServiceImpl.java
  8. 4 4
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/SysGoodsPriceWrapper.java
  9. 5 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/TenantAlbumWrapper.java
  10. 99 7
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/TenantApplyRecordWrapper.java
  11. 1 1
      cooleshow-user/user-biz/src/main/resources/config/mybatis/SysGoodsPriceMapper.xml
  12. 1 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/TenantAlbumMapper.xml
  13. 83 4
      cooleshow-user/user-biz/src/main/resources/config/mybatis/TenantApplyRecordMapper.xml
  14. 1 4
      cooleshow-user/user-biz/src/main/resources/config/mybatis/TenantInfoMapper.xml

+ 2 - 1
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/SysGoodsPriceController.java

@@ -1,6 +1,7 @@
 package com.yonge.cooleshow.admin.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
 import com.yonge.cooleshow.biz.dal.entity.SysGoodsPrice;
 import com.yonge.cooleshow.biz.dal.service.SysGoodsPriceService;
 import com.yonge.cooleshow.biz.dal.wrapper.SysGoodsPriceWrapper;
@@ -38,7 +39,7 @@ public class SysGoodsPriceController extends BaseController {
     @ApiOperation(value = "查询分页", notes = "sysGoodsPrice")
     @PreAuthorize("@pcs.hasPermissions('sysGoodsPrice/page')")
     public HttpResponseResult<PageInfo<SysGoodsPrice>> page(@RequestBody SysGoodsPriceWrapper.SysGoodsPriceQuery query) {
-        IPage<SysGoodsPrice> pages = sysGoodsPriceService.selectPage(PageUtil.getPage(query), query);
+        IPage<SysGoodsPrice> pages = sysGoodsPriceService.selectPage(QueryInfo.getPage(query), query);
         return HttpResponseResult.succeed(PageUtil.pageInfo(pages));
     }
 

+ 1 - 1
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/TenantAlbumController.java

@@ -139,7 +139,7 @@ public class TenantAlbumController {
 
     @PostMapping("/update")
     @ApiOperation(value = "修改专辑", notes = "修改专辑")
-    @PreAuthorize("@pcs.hasPermissions('tenantAlbum/save')")
+    @PreAuthorize("@pcs.hasPermissions('tenantAlbum/update')")
     public HttpResponseResult<Boolean> update(@Validated @RequestBody TenantAlbumVo.TenantAlbum album) {
         TenantAlbum tenantAlbum = JSON.parseObject(album.jsonString(), TenantAlbum.class);
         List<TenantAlbumVo.MusicSheetData> musicSheetData = album.getMusicSheetData();

+ 105 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/TenantEntryRecordController.java

@@ -0,0 +1,105 @@
+package com.yonge.cooleshow.admin.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.biz.dal.entity.TenantInfo;
+import com.yonge.cooleshow.biz.dal.service.TenantApplyRecordService;
+import com.yonge.cooleshow.biz.dal.service.TenantEntryRecordService;
+import com.yonge.cooleshow.biz.dal.service.TenantInfoService;
+import com.yonge.cooleshow.biz.dal.wrapper.TenantApplyRecordWrapper;
+import com.yonge.cooleshow.biz.dal.wrapper.TenantInfoWrapper;
+import com.yonge.cooleshow.common.controller.BaseController;
+import com.yonge.cooleshow.common.entity.HttpResponseResult;
+import com.yonge.toolset.base.exception.BizException;
+import com.yonge.toolset.base.page.PageInfo;
+import com.yonge.toolset.mybatis.support.PageUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.poi.ss.formula.functions.T;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Author:haonan
+ * @Date:2023/8/1 19:02
+ * @Filename:TenantEntryRecordController
+ */
+@RestController
+@RequestMapping("/tenantApply")
+@Api(value = "机构审核", tags = "机构审核")
+public class TenantEntryRecordController extends BaseController {
+
+    @Autowired
+    TenantApplyRecordService tenantApplyRecordService;
+
+    @Autowired
+    SysUserFeignService sysUserFeignService;
+
+    @Autowired
+    TenantInfoService tenantInfoService;
+
+    /**
+     * 机构入驻审核分页查询
+     */
+    @PostMapping("/applyPage")
+    @ApiOperation(value = "机构申请查询", notes = "机构申请查询")
+    @PreAuthorize("@pcs.hasPermissions('tenantApply/applyPage')")
+    public HttpResponseResult<PageInfo<TenantApplyRecordWrapper.TenantApplyRecord>> applyPage(@RequestBody TenantApplyRecordWrapper.TenantApplyRecordQuery query) {
+
+        IPage<TenantApplyRecordWrapper.TenantApplyRecord> pages = tenantApplyRecordService.selectPage(QueryInfo.getPage(query), query);
+        return succeed(PageUtil.pageInfo(pages));
+    }
+
+
+    /**
+     * 机构入驻审核历史记录查询
+     */
+
+    @PostMapping("/historyPage")
+    @ApiOperation(value = "机构审核历史记录", notes = "机构审核历史记录")
+    @PreAuthorize("@pcs.hasPermissions('tenantApply/historyPage')")
+    public HttpResponseResult<PageInfo<TenantApplyRecordWrapper.TenantApply>> historyPage(@RequestBody TenantApplyRecordWrapper.TenantApplyRecordQuery query) {
+
+       IPage<TenantApplyRecordWrapper.TenantApply> pages = tenantApplyRecordService.historyPage(QueryInfo.getPage(query), query);
+        return succeed(PageUtil.pageInfo(pages));
+    }
+
+
+    /**
+     * 机构入驻审核本次提交查询
+     */
+    @PostMapping("/queryNow")
+    @ApiOperation(value = "机构审核本次提交", notes = "机构审核本次提交")
+    @PreAuthorize("@pcs.hasPermissions('tenantApply/queryNow')")
+    public HttpResponseResult<TenantApplyRecordWrapper.TenantApplyRecord> queryNow(@RequestBody TenantApplyRecordWrapper.TenantApplyRecordQuery query) {
+
+        TenantApplyRecordWrapper.TenantApplyRecord tenantApplyRecord = tenantApplyRecordService.queryNow(query);
+        return succeed(tenantApplyRecord);
+    }
+
+    /**
+     * 机构入驻审核功能
+     */
+    @PostMapping("/entry")
+    @ApiOperation(value = "机构审核功能", notes = "机构审核功能")
+    @PreAuthorize("@pcs.hasPermissions('tenantApply/entry')")
+    public HttpResponseResult<Boolean> entry(@RequestBody TenantApplyRecordWrapper.TenantEntry entry) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        TenantInfo tenantInfo = tenantInfoService.lambdaQuery().eq(TenantInfo::getUserId, sysUser.getId())
+                .last("limit 1").one();
+        if (tenantInfo == null) {
+            throw new BizException("非法请求");
+        }
+        Long verifyUserId = sysUser.getId();
+
+        return succeed(tenantApplyRecordService.entry(entry,verifyUserId));
+    }
+
+
+}

+ 1 - 54
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/TenantInfoController.java

@@ -2,6 +2,7 @@ package com.yonge.cooleshow.admin.controller;
 
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
 import com.yonge.cooleshow.admin.io.request.TenantInfoVo;
 import com.yonge.cooleshow.biz.dal.entity.TenantInfo;
 import com.yonge.cooleshow.biz.dal.service.TenantInfoService;
@@ -79,58 +80,4 @@ public class TenantInfoController extends BaseController {
     }
 
 
-    /**
-     * 机构入驻审核分页查询
-     */
-    @PostMapping("/applyPage")
-    @ApiOperation(value = "机构申请查询", notes = "机构申请查询")
-    //@PreAuthorize("@pcs.hasPermissions('tenantInfo/applyPage')")
-    public HttpResponseResult<PageInfo<TenantInfoWrapper.TenantInfo>> applyPage(@RequestBody TenantInfoWrapper.TenantInfoQuery query) {
-
-//        IPage<TenantInfoWrapper.TenantInfo> pages = tenantInfoService.applyPage(PageUtil.getPage(query), query);
-//        return succeed(PageUtil.pageInfo(pages));
-        return null;
-    }
-
-
-    /**
-     * 机构入驻审核历史记录查询
-     */
-
-    @PostMapping("/historyPage")
-    @ApiOperation(value = "机构审核历史记录", notes = "机构审核历史记录")
-    //@PreAuthorize("@pcs.hasPermissions('tenantInfo/historyPage')")
-    public HttpResponseResult<PageInfo<TenantInfoWrapper.TenantInfo>> historyPage(@RequestBody TenantInfoWrapper.TenantInfoQuery query) {
-
-//        IPage<TenantInfoWrapper.TenantInfo> pages = tenantInfoService.historyPage(PageUtil.getPage(query), query);
-//        return succeed(PageUtil.pageInfo(pages));
-        return null;
-    }
-
-
-    /**
-     * 机构入驻审核本次提交查询
-     */
-    @PostMapping("/queryNow")
-    @ApiOperation(value = "机构审核本次提交", notes = "机构审核本次提交")
-    //@PreAuthorize("@pcs.hasPermissions('tenantInfo/now')")
-    public HttpResponseResult<TenantInfoWrapper.TenantInfo> queryNow(@RequestBody TenantInfoWrapper.TenantInfoQuery query) {
-
-        TenantInfoWrapper.TenantInfo tenantInfo = tenantInfoService.queryNow(query);
-        return succeed(tenantInfo);
-    }
-
-    /**
-     * 机构入驻审核功能
-     */
-    @PostMapping("/entry")
-    @ApiOperation(value = "机构审核功能", notes = "机构审核功能")
-    //@PreAuthorize("@pcs.hasPermissions('tenantInfo/now')")
-    public HttpResponseResult<Boolean> entry(@RequestBody TenantInfoWrapper.TenantInfoQuery query) {
-
-
-        return succeed(tenantInfoService.entry(query));
-    }
-
-
 }

+ 11 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/mapper/TenantApplyRecordMapper.java

@@ -4,6 +4,7 @@ import java.util.List;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.biz.dal.wrapper.TenantInfoWrapper;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 import com.yonge.cooleshow.biz.dal.entity.TenantApplyRecord;
@@ -22,6 +23,14 @@ public interface TenantApplyRecordMapper extends BaseMapper<TenantApplyRecord> {
 	 * @param param TenantApplyRecordWrapper.TenantApplyRecordQuery
 	 * @return List<TenantApplyRecordWrapper.TenantApplyRecord>
 	 */
-	List<TenantApplyRecord> selectPage(@Param("page") IPage<TenantApplyRecord> page, @Param("param") TenantApplyRecordWrapper.TenantApplyRecordQuery param);
-	
+	List<TenantApplyRecordWrapper.TenantApplyRecord> selectPage(@Param("page") IPage<TenantApplyRecordWrapper.TenantApplyRecord> page, @Param("param") TenantApplyRecordWrapper.TenantApplyRecordQuery param);
+
+
+	List<TenantApplyRecordWrapper.TenantApply> selectHistoryPage(@Param("page") IPage<TenantApplyRecordWrapper.TenantApply> page, @Param("id") long id);
+
+	TenantApplyRecordWrapper.TenantApplyRecord queryNow(@Param("param") TenantApplyRecordWrapper.TenantApplyRecordQuery query);
+
+	Boolean updateStatusById(@Param("id") Long id);
+
+	Boolean updateUnpassStatusById(@Param("id") Long id);
 }

+ 15 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/TenantApplyRecordService.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.yonge.cooleshow.biz.dal.wrapper.TenantApplyRecordWrapper;
 import com.yonge.cooleshow.biz.dal.entity.TenantApplyRecord;
+import com.yonge.cooleshow.biz.dal.wrapper.TenantInfoWrapper;
 
 /**
  * 机构入驻申请记录
@@ -24,7 +25,7 @@ public interface TenantApplyRecordService extends IService<TenantApplyRecord>  {
      * @param query TenantApplyRecordWrapper.TenantApplyRecordQuery
      * @return IPage<TenantApplyRecord>
      */
-    IPage<TenantApplyRecord> selectPage(IPage<TenantApplyRecord> page, TenantApplyRecordWrapper.TenantApplyRecordQuery query);
+    IPage<TenantApplyRecordWrapper.TenantApplyRecord> selectPage(IPage<TenantApplyRecordWrapper.TenantApplyRecord> page, TenantApplyRecordWrapper.TenantApplyRecordQuery query);
 	
     /**
      * 添加
@@ -45,4 +46,17 @@ public interface TenantApplyRecordService extends IService<TenantApplyRecord>  {
      *
      */
     void apply(TenantApplyRecordWrapper.TenantApply tenantApply);
+
+
+
+    /**
+     * 机构入驻审核历史记录查询
+     * @param query
+     * @return
+     */
+    IPage<TenantApplyRecordWrapper.TenantApply> historyPage(IPage<TenantApplyRecordWrapper.TenantApply> page, TenantApplyRecordWrapper.TenantApplyRecordQuery query);
+
+    TenantApplyRecordWrapper.TenantApplyRecord queryNow(TenantApplyRecordWrapper.TenantApplyRecordQuery query);
+
+    Boolean entry(TenantApplyRecordWrapper.TenantEntry entry,Long verifyUserId);
 }

+ 158 - 10
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TenantApplyRecordServiceImpl.java

@@ -4,22 +4,24 @@ import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.microsvc.toolkit.common.webportal.exception.BizException;
-import com.yonge.cooleshow.biz.dal.entity.TenantStaff;
+import com.yonge.cooleshow.biz.dal.dto.activity.ActivityTeacherQuery;
+import com.yonge.cooleshow.biz.dal.entity.*;
 import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
-import com.yonge.cooleshow.biz.dal.service.SmsCodeService;
-import com.yonge.cooleshow.biz.dal.service.TenantInfoService;
-import com.yonge.cooleshow.biz.dal.service.TenantStaffService;
+import com.yonge.cooleshow.biz.dal.mapper.TenantEntryRecordMapper;
+import com.yonge.cooleshow.biz.dal.service.*;
+import com.yonge.cooleshow.biz.dal.wrapper.TenantInfoWrapper;
+import org.apache.commons.collections.CollectionUtils;
+import org.checkerframework.checker.units.qual.A;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.beans.BeanUtils;
 import lombok.extern.slf4j.Slf4j;
-import com.yonge.cooleshow.biz.dal.entity.TenantApplyRecord;
 import com.yonge.cooleshow.biz.dal.wrapper.TenantApplyRecordWrapper;
 import com.yonge.cooleshow.biz.dal.mapper.TenantApplyRecordMapper;
-import com.yonge.cooleshow.biz.dal.service.TenantApplyRecordService;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.Date;
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * 机构入驻申请记录
@@ -36,6 +38,18 @@ public class TenantApplyRecordServiceImpl extends ServiceImpl<TenantApplyRecordM
     @Autowired
     private SmsCodeService smsCodeService;
 
+    @Autowired
+    private SysAreaService sysAreaService;
+
+    @Autowired
+    TenantApplyRecordMapper tenantApplyRecordMapper;
+
+    @Autowired
+    TenantEntryRecordMapper tenantEntryRecordMapper;
+
+    @Autowired
+    TenantInfoService tenantInfoService;
+
     /**
      * 查询详情
      * @param id 详情ID
@@ -54,9 +68,10 @@ public class TenantApplyRecordServiceImpl extends ServiceImpl<TenantApplyRecordM
      * @return IPage<TenantApplyRecord>
      */
     @Override
-    public IPage<TenantApplyRecord> selectPage(IPage<TenantApplyRecord> page, TenantApplyRecordWrapper.TenantApplyRecordQuery query) {
-        
-        return page.setRecords(baseMapper.selectPage(page, query));
+    public IPage<TenantApplyRecordWrapper.TenantApplyRecord> selectPage(IPage<TenantApplyRecordWrapper.TenantApplyRecord> page, TenantApplyRecordWrapper.TenantApplyRecordQuery query) {
+        List<TenantApplyRecordWrapper.TenantApplyRecord> records = baseMapper.selectPage(page, query);
+        List<TenantApplyRecordWrapper.TenantApplyRecord> infos = queryArea(records);
+        return page.setRecords(infos);
     }
 
     /**
@@ -127,4 +142,137 @@ public class TenantApplyRecordServiceImpl extends ServiceImpl<TenantApplyRecordM
 
 
     }
+
+    @Override
+    public IPage<TenantApplyRecordWrapper.TenantApply> historyPage(IPage<TenantApplyRecordWrapper.TenantApply> page, TenantApplyRecordWrapper.TenantApplyRecordQuery query) {
+        long id = query.getId();
+        //分页查询
+       List<TenantApplyRecordWrapper.TenantApply> tenantInfos = baseMapper.selectHistoryPage(page, id);
+       //查询对应省市区
+        List<Integer> areaCodeList = tenantInfos.stream().map(next -> {
+            Set<Integer> codes = new HashSet<>();
+            codes.add(next.getCityCode());
+            codes.add(next.getProvinceCode());
+            codes.add(next.getRegionCode());
+            return codes;
+        }).flatMap(Collection::stream).filter(Objects::nonNull).distinct().collect(Collectors.toList());
+
+        Map<Integer, String> codeNameMap = new HashMap<>();
+
+        if (!CollectionUtils.isEmpty(areaCodeList)) {
+            List<SysArea> sysAreaList = sysAreaService.queryByCodes(areaCodeList);
+            codeNameMap = sysAreaList.stream().collect(Collectors.toMap(SysArea::getCode,
+                    SysArea::getName));
+        }
+
+        for (TenantApplyRecordWrapper.TenantApply next : tenantInfos) {
+            next.setProvinceName(codeNameMap.getOrDefault(next.getProvinceCode(), ""));
+            next.setCityName(codeNameMap.getOrDefault(next.getCityCode(), ""));
+            next.setRegionName(codeNameMap.getOrDefault(next.getRegionCode(), ""));
+        }
+
+        return page.setRecords(tenantInfos);
+    }
+
+    @Override
+    public TenantApplyRecordWrapper.TenantApplyRecord queryNow(TenantApplyRecordWrapper.TenantApplyRecordQuery query) {
+        //查询本次提交记录
+        TenantApplyRecordWrapper.TenantApplyRecord info = baseMapper.queryNow(query);
+        Set<Integer> codes = new HashSet<>();
+        codes.add(info.getCityCode());
+        codes.add(info.getProvinceCode());
+        codes.add(info.getRegionCode());
+
+        //将地区码转化为对应的地名
+        List<Integer> areaCodeList = new ArrayList<>();
+        areaCodeList.addAll(codes);
+
+        Map<Integer, String> codeNameMap = new HashMap<>();
+
+        if (!CollectionUtils.isEmpty(areaCodeList)) {
+            List<SysArea> sysAreaList = sysAreaService.queryByCodes(areaCodeList);
+            codeNameMap = sysAreaList.stream().collect(Collectors.toMap(SysArea::getCode,
+                    SysArea::getName));
+        }
+
+        info.setProvinceName(codeNameMap.get(info.getProvinceCode()));
+        info.setCityName(codeNameMap.get(info.getCityCode()));
+        info.setRegionName(codeNameMap.get(info.getRegionCode()));
+        return info;
+    }
+
+
+    @Override
+    public Boolean entry(TenantApplyRecordWrapper.TenantEntry entry,Long verifyUserId) {
+        Boolean ifPass = entry.getIfPass();
+        Long id = entry.getId();
+        TenantApplyRecord applyRecord = tenantApplyRecordMapper.selectById(id);
+        TenantEntryRecord entryRecord = new TenantEntryRecord();
+
+        entryRecord.setTenantApplyRecordId(applyRecord.getId());
+        entryRecord.setName(applyRecord.getName());
+        entryRecord.setLogo(applyRecord.getLogo());
+        entryRecord.setProvinceCode(applyRecord.getProvinceCode());
+        entryRecord.setCityCode(applyRecord.getCityCode());
+        entryRecord.setRegionCode(applyRecord.getRegionCode());
+        entryRecord.setUsername(applyRecord.getUsername());
+        entryRecord.setPhone(applyRecord.getPhone());
+        entryRecord.setVerifyUserId(verifyUserId);
+        entryRecord.setReason(entry.getReason());
+        if (ifPass == true){
+            entryRecord.setStatus("PASS");
+            //更改当前记录的审核状态
+            tenantApplyRecordMapper.updateStatusById(id);
+
+            //机构账户新增逻辑
+            TenantInfo tenantInfo = new TenantInfo();
+            tenantInfo.setLogo(applyRecord.getLogo());
+            tenantInfo.setName(applyRecord.getName());
+            tenantInfo.setProvinceCode(applyRecord.getProvinceCode());
+            tenantInfo.setCityCode(applyRecord.getCityCode());
+            tenantInfo.setRegionCode(applyRecord.getRegionCode());
+            tenantInfo.setUsername(applyRecord.getUsername());
+            tenantInfo.setPhone(applyRecord.getPhone());
+            tenantInfo.setEnableFlag(true);
+            tenantInfoService.add(tenantInfo);
+        } else {
+            entryRecord.setStatus("UNPASS");
+            tenantApplyRecordMapper.updateUnpassStatusById(id);
+        }
+        tenantEntryRecordMapper.insert(entryRecord);
+        return true;
+    }
+
+
+    /**
+     * 匹配地区码与省市区
+     *
+     * @param tenantInfos
+     * @return
+     */
+    private List<TenantApplyRecordWrapper.TenantApplyRecord> queryArea(List<TenantApplyRecordWrapper.TenantApplyRecord> tenantInfos) {
+        List<Integer> areaCodeList = tenantInfos.stream().map(next -> {
+            Set<Integer> codes = new HashSet<>();
+            codes.add(next.getCityCode());
+            codes.add(next.getProvinceCode());
+            codes.add(next.getRegionCode());
+            return codes;
+        }).flatMap(Collection::stream).filter(Objects::nonNull).distinct().collect(Collectors.toList());
+
+        Map<Integer, String> codeNameMap = new HashMap<>();
+
+        if (!CollectionUtils.isEmpty(areaCodeList)) {
+            List<SysArea> sysAreaList = sysAreaService.queryByCodes(areaCodeList);
+            codeNameMap = sysAreaList.stream().collect(Collectors.toMap(SysArea::getCode,
+                    SysArea::getName));
+        }
+
+        for (TenantApplyRecordWrapper.TenantApplyRecord next : tenantInfos) {
+            next.setProvinceName(codeNameMap.getOrDefault(next.getProvinceCode(), ""));
+            next.setCityName(codeNameMap.getOrDefault(next.getCityCode(), ""));
+            next.setRegionName(codeNameMap.getOrDefault(next.getRegionCode(), ""));
+        }
+
+        return tenantInfos;
+    }
 }

+ 4 - 4
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/SysGoodsPriceWrapper.java

@@ -3,7 +3,7 @@ package com.yonge.cooleshow.biz.dal.wrapper;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
-import com.yonge.toolset.base.page.QueryInfo;
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -29,13 +29,13 @@ public class SysGoodsPriceWrapper {
     @NoArgsConstructor
     @AllArgsConstructor
     @ApiModel(" SysGoodsPriceQuery-商品价格设置")
-    public static class SysGoodsPriceQuery extends QueryInfo {
+    public static class SysGoodsPriceQuery implements QueryInfo {
     
     	@ApiModelProperty("当前页")
-        private int page;
+        private Integer page;
         
         @ApiModelProperty("分页行数")
-        private int rows;
+        private Integer rows;
         
         @ApiModelProperty("关键字匹配")
 		private String keyword;

+ 5 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/TenantAlbumWrapper.java

@@ -103,6 +103,11 @@ public class TenantAlbumWrapper {
         @ApiModelProperty("原价")
         private BigDecimal costPrice;
 
+        @ApiModelProperty("机构利润")
+        private BigDecimal tenantProfits;
+
+
+
         @ApiModelProperty("购买周期")
         private Integer purchaseCycle;
 

+ 99 - 7
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/TenantApplyRecordWrapper.java

@@ -3,10 +3,12 @@ package com.yonge.cooleshow.biz.dal.wrapper;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import java.util.Optional;
 
+import io.swagger.models.auth.In;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
@@ -28,6 +30,8 @@ public class TenantApplyRecordWrapper {
     @AllArgsConstructor
     @ApiModel(" TenantApplyRecordQuery-机构入驻申请记录")
     public static class TenantApplyRecordQuery implements QueryInfo {
+        @ApiModelProperty("id")
+        private Integer Id;
     
     	@ApiModelProperty("当前页")
         private Integer page;
@@ -37,6 +41,15 @@ public class TenantApplyRecordWrapper {
         
         @ApiModelProperty("关键字匹配")
 		private String keyword;
+
+        @ApiModelProperty("省份编码")
+        private Integer provinceCode;
+
+        @ApiModelProperty("城市编码")
+        private Integer cityCode;
+
+        @ApiModelProperty("地区街道编码")
+        private Integer regionCode;
         
         public String getKeyword() {
             return Optional.ofNullable(keyword).filter(StringUtils::isNotBlank).orElse(null);
@@ -49,11 +62,51 @@ public class TenantApplyRecordWrapper {
         public static TenantApplyRecordQuery from(String json) {
             return JSON.parseObject(json, TenantApplyRecordQuery.class);
         }
-    }  
+    }
 
+    @Data
+    @Builder
+    @NoArgsConstructor
+    @AllArgsConstructor
 	@ApiModel(" TenantApplyRecord-机构入驻申请记录")
     public static class TenantApplyRecord {
-        
+        @ApiModelProperty("名称")
+        private String name;
+
+        @ApiModelProperty("logo")
+        private String logo;
+
+        @ApiModelProperty("省份编码")
+        private Integer provinceCode;
+
+        @ApiModelProperty("城市编码")
+        private Integer cityCode;
+
+        @ApiModelProperty("地区/街道")
+        private Integer regionCode;
+
+        @ApiModelProperty("联系人")
+        private String username;
+
+        @ApiModelProperty("手机号")
+        @NotNull(message = "手机号不能为空")
+        private String phone;
+
+        @ApiModelProperty("省份名称")
+        private String provinceName;
+
+        @ApiModelProperty("城市名称")
+        private String cityName;
+
+        @ApiModelProperty("地区街道名称")
+        private String regionName;
+
+        @ApiModelProperty("审核状态 DOING、审核中 PASS、通过 UNPASS、不通过")
+        private AuthStatusEnum status;
+
+        @ApiModelProperty("审核理由")
+        private String reason;
+
         public String jsonString() {
             return JSON.toJSONString(this);
         }
@@ -63,12 +116,16 @@ public class TenantApplyRecordWrapper {
         }
 	}
 
-
     @Data
-    @ApiModel(" TenantApply-机构入驻申请")
+    @Builder
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @ApiModel(" TenantApply-机构历史审核记录")
     public static class TenantApply {
 
 
+        @ApiModelProperty("机构申请记录id")
+        private Integer tenantApplyRecordId;
 
         @ApiModelProperty("名称")
         private String name;
@@ -76,9 +133,6 @@ public class TenantApplyRecordWrapper {
         @ApiModelProperty("logo")
         private String logo;
 
-        @ApiModelProperty("简介")
-        private String briefIntroduction;
-
         @ApiModelProperty("省份编码")
         private Integer provinceCode;
 
@@ -95,6 +149,24 @@ public class TenantApplyRecordWrapper {
         @NotNull(message = "手机号不能为空")
         private String phone;
 
+        @ApiModelProperty("审核状态 DOING、审核中 PASS、通过 UNPASS、不通过")
+        private AuthStatusEnum status;
+
+        @ApiModelProperty("认证人Id")
+        private Integer verifyUserId;
+
+        @ApiModelProperty("审核理由")
+        private String reason;
+
+        @ApiModelProperty("省份名称")
+        private String provinceName;
+
+        @ApiModelProperty("城市名称")
+        private String cityName;
+
+        @ApiModelProperty("地区街道名称")
+        private String regionName;
+
         @ApiModelProperty("验证码")
         @NotNull(message = "验证码不能为空")
         private String code;
@@ -107,4 +179,24 @@ public class TenantApplyRecordWrapper {
             return JSON.parseObject(json, TenantApplyRecord.class);
         }
     }
+
+
+    @Data
+    @Builder
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @ApiModel("机构审核")
+    public static class TenantEntry {
+        @ApiModelProperty("审核理由")
+        private String reason;
+
+        @ApiModelProperty("是否通过")
+        private Boolean IfPass;
+
+        @ApiModelProperty("id")
+        private Long id;
+    }
+
+
+
 }

+ 1 - 1
cooleshow-user/user-biz/src/main/resources/config/mybatis/SysGoodsPriceMapper.xml

@@ -10,7 +10,7 @@
         , t.goods_type_ AS goodsType
         , t.sale_price_ AS salePrice
         , t.original_price_ AS originalPrice
-        , t.describe_ AS describe
+        , t.describe_ AS `describe`
         , t.duration_ AS duration
         , t.goods_img_ AS goodsImg
         , t.update_by_ AS updateBy

+ 1 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/TenantAlbumMapper.xml

@@ -22,6 +22,7 @@
     <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumWrapper$TenantAlbum">
         SELECT
         <include refid="baseColumns"/>
+        , (t.sale_price_ - t.original_price_) AS tenantProfits
         , i.name_ AS tenantName
         FROM tenant_album t
         LEFT JOIN tenant_album_ref r on t.id_ = r.tenant_album_id_

+ 83 - 4
cooleshow-user/user-biz/src/main/resources/config/mybatis/TenantApplyRecordMapper.xml

@@ -20,12 +20,91 @@
         , t.reason_ AS reason
         , t.update_time_ AS updateTime
         , t.create_time_ AS createTime
-        </sql> 
-    
-    <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.entity.TenantApplyRecord">
+        </sql>
+    <update id="updateStatusById">
+        update  tenant_apply_record
+        set status_ = 'PASS'
+        where  id_ =#{id}
+    </update>
+    <update id="updateUnpassStatusById">
+        update  tenant_apply_record
+        set status_ = 'UNPASS'
+        where  id_ =#{id}
+    </update>
+
+    <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.wrapper.TenantApplyRecordWrapper$TenantApplyRecord">
 		SELECT         
         	<include refid="baseColumns" />
 		FROM tenant_apply_record t
+        <where>
+            <if test="param.keyword != null and param.keyword  != ''">
+                and (
+                t.name_ like concat('%',#{param.keyword},'%')
+                or t.username_ like concat('%',#{param.keyword},'%')
+                or t.phone_ like concat('%',#{param.keyword},'%')
+                )
+            </if>
+            <if test="param.provinceCode != null">
+                and t.province_code_ = #{param.provinceCode}
+            </if>
+            <if test="param.cityCode != null">
+                and t.city_code_ = #{param.cityCode}
+            </if>
+            <if test="param.regionCode != null">
+                and t.region_code_ = #{param.regionCode}
+            </if>
+        </where>
+
 	</select>
-    
+    <select id="selectHistoryPage"
+            resultType="com.yonge.cooleshow.biz.dal.wrapper.TenantApplyRecordWrapper$TenantApply">
+        select
+        id_ AS id,
+        tenant_apply_record_id_ AS tenantApplyRecordId,
+        name_ AS name,
+        logo_ as logo,
+        province_code_ AS provinceCode,
+        city_code_ AS cityCode,
+        region_code_ AS regionCode,
+        username_ AS username,
+        phone_ AS phone,
+        status_ AS status,
+        verify_user_id_ AS verifyUserId,
+        reason_ AS reason,
+        update_time_ AS updateTime,
+        create_time_ AS createTime
+        FROM
+        tenant_entry_record
+        WHERE
+        1=1
+        <if test="id != null">
+            and tenant_apply_record_id_ = #{id}
+        </if>
+
+    </select>
+    <select id="queryNow"
+            resultType="com.yonge.cooleshow.biz.dal.wrapper.TenantApplyRecordWrapper$TenantApplyRecord">
+        select
+        name_ AS name,
+        logo_ as logo,
+        province_code_ AS provinceCode,
+        city_code_ AS cityCode,
+        region_code_ AS regionCode,
+        username_ AS username,
+        phone_ AS phone,
+        status_ AS status,
+        verify_user_id_ AS verifyUserId,
+        reason_ AS reason,
+        update_time_ AS updateTime,
+        create_time_ AS createTime
+        from
+        tenant_apply_record
+        where
+        1=1
+        <if test="param.id != null">
+            and
+            id_ = #{param.id}
+        </if>
+    </select>
+
 </mapper>

+ 1 - 4
cooleshow-user/user-biz/src/main/resources/config/mybatis/TenantInfoMapper.xml

@@ -190,10 +190,7 @@
         username_ AS username,
         phone_ AS phone,
         status_ AS status,
-        verify_user_id_ AS verifyUserId,
-        reason_ AS reason,
-        update_time_ AS updateTime,
-        create_time_ AS createTime
+        reason_ AS reason
         from
         tenant_apply_record
         where