feat(企业微信): 添加根据corpid查询企业基本信息功能

- 新增QyAuthCorpBasicInfoDTO用于返回企业基本信息
- 在AuthCorpInfoApplicationService中添加getCorpBasicInfoByCorpid方法
- 在QyAuthCorpInfoController中新增/basicInfo接口
- 优化ShopController中日期工具类的导入方式
This commit is contained in:
dzq 2025-12-01 10:48:27 +08:00
parent ca7a4b53ab
commit bd8412d1c8
4 changed files with 63 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import com.agileboot.domain.qywx.authCorpInfo.AuthCorpInfoApplicationService;
import com.agileboot.domain.qywx.authCorpInfo.command.AddAuthCorpInfoCommand; import com.agileboot.domain.qywx.authCorpInfo.command.AddAuthCorpInfoCommand;
import com.agileboot.domain.qywx.authCorpInfo.command.UpdateAuthCorpInfoCommand; import com.agileboot.domain.qywx.authCorpInfo.command.UpdateAuthCorpInfoCommand;
import com.agileboot.domain.qywx.authCorpInfo.db.QyAuthCorpInfoEntity; import com.agileboot.domain.qywx.authCorpInfo.db.QyAuthCorpInfoEntity;
import com.agileboot.domain.qywx.authCorpInfo.dto.QyAuthCorpBasicInfoDTO;
import com.agileboot.domain.qywx.authCorpInfo.dto.QyAuthCorpInfoDTO; import com.agileboot.domain.qywx.authCorpInfo.dto.QyAuthCorpInfoDTO;
import com.agileboot.domain.qywx.authCorpInfo.query.SearchQyAuthCorpInfoQuery; import com.agileboot.domain.qywx.authCorpInfo.query.SearchQyAuthCorpInfoQuery;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
@ -24,6 +25,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
@ -65,4 +67,11 @@ public class QyAuthCorpInfoController extends BaseController {
authCorpInfoApplicationService.deleteAuthCorpInfo(new BulkOperationCommand<>(ids)); authCorpInfoApplicationService.deleteAuthCorpInfo(new BulkOperationCommand<>(ids));
return ResponseDTO.ok(); return ResponseDTO.ok();
} }
@Operation(summary = "根据corpid查询企业基本信息")
@GetMapping("/basicInfo")
public ResponseDTO<QyAuthCorpBasicInfoDTO> getBasicInfoByCorpid(@RequestParam @NotNull String corpid) {
QyAuthCorpBasicInfoDTO basicInfo = authCorpInfoApplicationService.getCorpBasicInfoByCorpid(corpid);
return ResponseDTO.ok(basicInfo);
}
} }

View File

@ -22,6 +22,8 @@ import com.agileboot.domain.shop.shop.db.ShopEntity;
import com.agileboot.domain.shop.shop.dto.ShopDTO; import com.agileboot.domain.shop.shop.dto.ShopDTO;
import com.agileboot.domain.shop.shop.dto.StatsDTO; import com.agileboot.domain.shop.shop.dto.StatsDTO;
import com.agileboot.domain.shop.shop.query.SearchShopQuery; import com.agileboot.domain.shop.shop.query.SearchShopQuery;
import cn.hutool.core.date.DateUtil;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -91,7 +93,7 @@ public class ShopController extends BaseController {
// 格式化每个订单商品的创建时间HH:mm:ss格式 // 格式化每个订单商品的创建时间HH:mm:ss格式
todayLatestOrderGoodsDTOS.forEach(dto -> { todayLatestOrderGoodsDTOS.forEach(dto -> {
if (dto.getCreateTime() != null) { if (dto.getCreateTime() != null) {
dto.setCreateTimeStr(cn.hutool.core.date.DateUtil.format(dto.getCreateTime(), "HH:mm:ss")); dto.setCreateTimeStr(DateUtil.format(dto.getCreateTime(), "HH:mm:ss"));
} }
}); });
// 设置今日最新订单商品列表到统计DTO // 设置今日最新订单商品列表到统计DTO

View File

@ -6,6 +6,7 @@ import com.agileboot.domain.qywx.authCorpInfo.command.AddAuthCorpInfoCommand;
import com.agileboot.domain.qywx.authCorpInfo.command.UpdateAuthCorpInfoCommand; import com.agileboot.domain.qywx.authCorpInfo.command.UpdateAuthCorpInfoCommand;
import com.agileboot.domain.qywx.authCorpInfo.db.QyAuthCorpInfoEntity; import com.agileboot.domain.qywx.authCorpInfo.db.QyAuthCorpInfoEntity;
import com.agileboot.domain.qywx.authCorpInfo.db.QyAuthCorpInfoService; import com.agileboot.domain.qywx.authCorpInfo.db.QyAuthCorpInfoService;
import com.agileboot.domain.qywx.authCorpInfo.dto.QyAuthCorpBasicInfoDTO;
import com.agileboot.domain.qywx.authCorpInfo.dto.QyAuthCorpInfoDTO; import com.agileboot.domain.qywx.authCorpInfo.dto.QyAuthCorpInfoDTO;
import com.agileboot.domain.qywx.authCorpInfo.model.AuthCorpInfoModel; import com.agileboot.domain.qywx.authCorpInfo.model.AuthCorpInfoModel;
import com.agileboot.domain.qywx.authCorpInfo.model.AuthCorpInfoModelFactory; import com.agileboot.domain.qywx.authCorpInfo.model.AuthCorpInfoModelFactory;
@ -62,4 +63,17 @@ public class AuthCorpInfoApplicationService {
public QyAuthCorpInfoEntity selectByCorpid(String corpid) { public QyAuthCorpInfoEntity selectByCorpid(String corpid) {
return authCorpInfoService.selectByCorpid(corpid); return authCorpInfoService.selectByCorpid(corpid);
} }
/**
* 根据corpid查询企业基本信息
* @param corpid 企业微信ID
* @return 企业基本信息DTO
*/
public QyAuthCorpBasicInfoDTO getCorpBasicInfoByCorpid(String corpid) {
QyAuthCorpInfoEntity entity = authCorpInfoService.selectByCorpid(corpid);
if (entity == null) {
return null;
}
return new QyAuthCorpBasicInfoDTO(entity);
}
} }

View File

@ -0,0 +1,37 @@
package com.agileboot.domain.qywx.authCorpInfo.dto;
import org.springframework.beans.BeanUtils;
import com.agileboot.domain.qywx.authCorpInfo.db.QyAuthCorpInfoEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 企业授权基本信息DTO
* 用于根据corpid查询企业基本信息
*/
@Data
@Schema(description = "企业授权基本信息")
public class QyAuthCorpBasicInfoDTO {
public QyAuthCorpBasicInfoDTO(QyAuthCorpInfoEntity entity) {
if (entity != null) {
BeanUtils.copyProperties(entity, this);
}
}
@Schema(description = "授权方企业方形头像")
private String corpSquareLogoUrl;
@Schema(description = "授权方企业名称")
private String corpName;
@Schema(description = "授权方企业全称")
private String corpFullName;
@Schema(description = "企业所属行业")
private String corpIndustry;
@Schema(description = "企业所属子行业")
private String corpSubIndustry;
}