From bc33f3fe85b96c5297a86f65bdace43374b3c126 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 15 七月 2025 10:15:10 +0800
Subject: [PATCH] 前端
---
server/services/src/main/java/com/doumee/core/utils/azure/AzureBlobUtil.java | 1
server/services/src/main/java/com/doumee/core/utils/huaweiOBS/ObsUtil.java | 41 +++++++++++++
server/services/src/main/java/com/doumee/dao/business/model/IdentityInfo.java | 5 +
server/services/src/main/java/com/doumee/service/business/impl/IdentityInfoServiceImpl.java | 70 +++++++++++++---------
server/services/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java | 6 ++
server/services/src/main/java/com/doumee/dao/business/IdentityInfoMapper.java | 3
server/services/src/main/java/com/doumee/dao/business/model/Member.java | 3 +
7 files changed, 97 insertions(+), 32 deletions(-)
diff --git a/server/services/src/main/java/com/doumee/core/utils/azure/AzureBlobUtil.java b/server/services/src/main/java/com/doumee/core/utils/azure/AzureBlobUtil.java
index 4f1c383..1086452 100644
--- a/server/services/src/main/java/com/doumee/core/utils/azure/AzureBlobUtil.java
+++ b/server/services/src/main/java/com/doumee/core/utils/azure/AzureBlobUtil.java
@@ -41,6 +41,7 @@
}
+
public void initClient( ) {
try {
this.blobServiceClient = new BlobServiceClientBuilder().connectionString(connectionString).buildClient();
diff --git a/server/services/src/main/java/com/doumee/core/utils/huaweiOBS/ObsUtil.java b/server/services/src/main/java/com/doumee/core/utils/huaweiOBS/ObsUtil.java
index 5d24461..c428928 100644
--- a/server/services/src/main/java/com/doumee/core/utils/huaweiOBS/ObsUtil.java
+++ b/server/services/src/main/java/com/doumee/core/utils/huaweiOBS/ObsUtil.java
@@ -3,12 +3,14 @@
import com.azure.storage.blob.BlobContainerClient;
import com.azure.storage.blob.BlobServiceClient;
import com.azure.storage.blob.BlobServiceClientBuilder;
+import com.doumee.core.utils.azure.AzureBlobUtil;
import com.obs.services.BasicObsCredentialsProvider;
import com.obs.services.ObsClient;
import com.obs.services.exception.ObsException;
import com.obs.services.model.*;
import java.io.ByteArrayInputStream;
+import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
@@ -39,6 +41,37 @@
}
private void initClient() {
this.obsClient = new ObsClient(new BasicObsCredentialsProvider(this.accessId, this.accessKey), this.endpoint);
+ }
+ private void uploadLocalFile(File file,String bucket,String key) {
+ try {
+ if(this.obsClient == null){
+ initClient();
+ }
+ // 鏂囦欢涓婁紶
+ // localfile 涓哄緟涓婁紶鐨勬湰鍦版枃浠惰矾寰勶紝闇�瑕佹寚瀹氬埌鍏蜂綋鐨勬枃浠跺悕
+ PutObjectRequest request = new PutObjectRequest();
+ request.setBucketName(bucket);
+ request.setObjectKey(key);
+ request.setFile(file);
+ obsClient.putObject(request);
+ System.out.println("putObject successfully");
+ } catch (ObsException e) {
+ System.out.println("putObject failed");
+ // 璇锋眰澶辫触,鎵撳嵃http鐘舵�佺爜
+ System.out.println("HTTP Code:" + e.getResponseCode());
+ // 璇锋眰澶辫触,鎵撳嵃鏈嶅姟绔敊璇爜
+ System.out.println("Error Code:" + e.getErrorCode());
+ // 璇锋眰澶辫触,鎵撳嵃璇︾粏閿欒淇℃伅
+ System.out.println("Error Message:" + e.getErrorMessage());
+ // 璇锋眰澶辫触,鎵撳嵃璇锋眰id
+ System.out.println("Request ID:" + e.getErrorRequestId());
+ System.out.println("Host ID:" + e.getErrorHostId());
+ e.printStackTrace();
+ } catch (Exception e) {
+ System.out.println("putObject failed");
+ // 鍏朵粬寮傚父淇℃伅鎵撳嵃
+ e.printStackTrace();
+ }
}
@@ -84,7 +117,13 @@
return true;
}
-
+ public static void main(String[] args) {
+ ObsUtil blobUtil = new ObsUtil("HPUAQVBRXX9A9TLZ3RTA","uHC2uoFh42Z2xgQmCBBtG8rNZ4Caf85qQ2DQqZZf","obs.cn-south-1.myhuaweicloud.com");
+ blobUtil.uploadLocalFile(new File("D://static/1.png"),"jinkuai","identity/1.png");
+ blobUtil.uploadLocalFile(new File("D://static/2.png"),"jinkuai","identity/2.png");
+ blobUtil.uploadLocalFile(new File("D://static/3.png"),"jinkuai","identity/3.png");
+ blobUtil.uploadLocalFile(new File("D://static/4.png"),"jinkuai","identity/4.png");
+ }
public static Integer uploadNetFile(ObsClient obsClient,String bucketName,String url, String objectKey) throws IOException {
InputStream is = new URL(url).openStream();
if(is != null){
diff --git a/server/services/src/main/java/com/doumee/dao/business/IdentityInfoMapper.java b/server/services/src/main/java/com/doumee/dao/business/IdentityInfoMapper.java
index 35c6efe..b8b3251 100644
--- a/server/services/src/main/java/com/doumee/dao/business/IdentityInfoMapper.java
+++ b/server/services/src/main/java/com/doumee/dao/business/IdentityInfoMapper.java
@@ -2,11 +2,12 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.doumee.dao.business.model.IdentityInfo;
+import com.github.yulichang.base.MPJBaseMapper;
/**
* @author 姹熻箘韫�
* @date 2025/07/09 12:00
*/
-public interface IdentityInfoMapper extends BaseMapper<IdentityInfo> {
+public interface IdentityInfoMapper extends MPJBaseMapper<IdentityInfo> {
}
diff --git a/server/services/src/main/java/com/doumee/dao/business/model/IdentityInfo.java b/server/services/src/main/java/com/doumee/dao/business/model/IdentityInfo.java
index 2177307..25b70ce 100644
--- a/server/services/src/main/java/com/doumee/dao/business/model/IdentityInfo.java
+++ b/server/services/src/main/java/com/doumee/dao/business/model/IdentityInfo.java
@@ -29,7 +29,7 @@
@ApiModelProperty(value = "鏄惁宸插垹闄� 0鏈垹闄� 1宸插垹闄�", example = "1")
@ExcelColumn(name="鏄惁宸插垹闄� 0鏈垹闄� 1宸插垹闄�")
- private Byte deleted;
+ private Integer deleted;
@ApiModelProperty(value = "鍒涘缓浜虹紪鐮�", example = "1")
@ExcelColumn(name="鍒涘缓浜虹紪鐮�")
@@ -121,6 +121,9 @@
@ApiModelProperty(value = "鍥剧墖鍓嶇紑")
@TableField(exist = false)
private String prefix;
+ @ApiModelProperty(value = "瀹℃牳浜哄鍚�")
+ @TableField(exist = false)
+ private String editorName;
@ApiModelProperty(value = "鍥剧墖闆嗗悎")
@TableField(exist = false)
private List<String> imgList;
diff --git a/server/services/src/main/java/com/doumee/dao/business/model/Member.java b/server/services/src/main/java/com/doumee/dao/business/model/Member.java
index e9311ab..a32a200 100644
--- a/server/services/src/main/java/com/doumee/dao/business/model/Member.java
+++ b/server/services/src/main/java/com/doumee/dao/business/model/Member.java
@@ -170,5 +170,8 @@
@ApiModelProperty(value = "鍙樻煡璇㈢粨鏉熸椂闂�", example = "1")
@TableField(exist = false)
private Date endTime;
+ @ApiModelProperty(value = "褰撳墠浣跨敤韬唤:0=鍙戝崟鏂�;1=鎺ュ崟鏂�;", example = "1")
+ @TableField(exist = false)
+ private Integer type;
}
diff --git a/server/services/src/main/java/com/doumee/service/business/impl/IdentityInfoServiceImpl.java b/server/services/src/main/java/com/doumee/service/business/impl/IdentityInfoServiceImpl.java
index d1b698e..f127c72 100644
--- a/server/services/src/main/java/com/doumee/service/business/impl/IdentityInfoServiceImpl.java
+++ b/server/services/src/main/java/com/doumee/service/business/impl/IdentityInfoServiceImpl.java
@@ -13,11 +13,13 @@
import com.doumee.dao.business.MemberMapper;
import com.doumee.dao.business.model.IdentityInfo;
import com.doumee.dao.business.model.Member;
+import com.doumee.dao.system.model.SystemUser;
import com.doumee.service.business.IdentityInfoService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -230,25 +232,32 @@
}
private void addMemberModelByType(Integer id,Integer type, List<IdentityInfo> list,String path) {
- LambdaQueryWrapper<IdentityInfo> wrapper = new LambdaQueryWrapper<IdentityInfo>()
+ MPJLambdaWrapper<IdentityInfo> wrapper = new MPJLambdaWrapper<IdentityInfo>()
+ .selectAll(IdentityInfo.class).selectAs(SystemUser::getUsername,IdentityInfo::getEditorName)
+ .leftJoin(SystemUser.class,SystemUser::getId,IdentityInfo::getUpdateUser)
.orderByDesc(IdentityInfo::getCreateTime )//鍙栨渶鏂颁竴鏉�
.eq(IdentityInfo::getMemberId,id)
.eq(IdentityInfo::getType,type)
.eq(IdentityInfo::getDeleted,Constants.ZERO)
.last("limit 1");
- IdentityInfo model = identityInfoMapper.selectOne(wrapper);
+ IdentityInfo model = identityInfoMapper.selectJoinOne(IdentityInfo.class,wrapper);
if(model !=null){
+ model.setImgList(new ArrayList<>());
if(StringUtils.isNotBlank(model.getImg1())){
model.setImg1(path+model.getImg1());
+ model.getImgList().add(model.getImg1());
}
if(StringUtils.isNotBlank(model.getImg2())){
- model.setImg1(path+model.getImg2());
+ model.setImg2(path+model.getImg2());
+ model.getImgList().add(model.getImg2());
}
if(StringUtils.isNotBlank(model.getImg3())) {
- model.setImg1(path + model.getImg3());
+ model.setImg3(path + model.getImg3());
+ model.getImgList().add(model.getImg3());
}
if(StringUtils.isNotBlank(model.getImg4())){
- model.setImg1(path+model.getImg4());
+ model.setImg4(path+model.getImg4());
+ model.getImgList().add(model.getImg4());
}
list.add(model);
}
@@ -257,67 +266,70 @@
@Override
public PageData<IdentityInfo> findPage(PageWrap<IdentityInfo> pageWrap) {
IPage<IdentityInfo> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
- QueryWrapper<IdentityInfo> queryWrapper = new QueryWrapper<>();
+ MPJLambdaWrapper<IdentityInfo> queryWrapper = new MPJLambdaWrapper<>();
Utils.MP.blankToNull(pageWrap.getModel());
+ pageWrap.getModel().setDeleted(Constants.ZERO);
+ queryWrapper.selectAll(IdentityInfo.class).selectAs(SystemUser::getUsername,IdentityInfo::getEditorName)
+ .leftJoin(SystemUser.class,SystemUser::getId,IdentityInfo::getUpdateUser);
if (pageWrap.getModel().getId() != null) {
- queryWrapper.lambda().eq(IdentityInfo::getId, pageWrap.getModel().getId());
+ queryWrapper.eq(IdentityInfo::getId, pageWrap.getModel().getId());
}
if (pageWrap.getModel().getDeleted() != null) {
- queryWrapper.lambda().eq(IdentityInfo::getDeleted, pageWrap.getModel().getDeleted());
+ queryWrapper.eq(IdentityInfo::getDeleted, pageWrap.getModel().getDeleted());
}
if (pageWrap.getModel().getCreateUser() != null) {
- queryWrapper.lambda().eq(IdentityInfo::getCreateUser, pageWrap.getModel().getCreateUser());
+ queryWrapper.eq(IdentityInfo::getCreateUser, pageWrap.getModel().getCreateUser());
}
if (pageWrap.getModel().getCreateTime() != null) {
- queryWrapper.lambda().ge(IdentityInfo::getCreateTime, Utils.Date.getStart(pageWrap.getModel().getCreateTime()));
- queryWrapper.lambda().le(IdentityInfo::getCreateTime, Utils.Date.getEnd(pageWrap.getModel().getCreateTime()));
+ queryWrapper.ge(IdentityInfo::getCreateTime, Utils.Date.getStart(pageWrap.getModel().getCreateTime()));
+ queryWrapper.le(IdentityInfo::getCreateTime, Utils.Date.getEnd(pageWrap.getModel().getCreateTime()));
}
if (pageWrap.getModel().getUpdateUser() != null) {
- queryWrapper.lambda().eq(IdentityInfo::getUpdateUser, pageWrap.getModel().getUpdateUser());
+ queryWrapper.eq(IdentityInfo::getUpdateUser, pageWrap.getModel().getUpdateUser());
}
if (pageWrap.getModel().getUpdateTime() != null) {
- queryWrapper.lambda().ge(IdentityInfo::getUpdateTime, Utils.Date.getStart(pageWrap.getModel().getUpdateTime()));
- queryWrapper.lambda().le(IdentityInfo::getUpdateTime, Utils.Date.getEnd(pageWrap.getModel().getUpdateTime()));
+ queryWrapper.ge(IdentityInfo::getUpdateTime, Utils.Date.getStart(pageWrap.getModel().getUpdateTime()));
+ queryWrapper.le(IdentityInfo::getUpdateTime, Utils.Date.getEnd(pageWrap.getModel().getUpdateTime()));
}
if (pageWrap.getModel().getRemark() != null) {
- queryWrapper.lambda().eq(IdentityInfo::getRemark, pageWrap.getModel().getRemark());
+ queryWrapper.eq(IdentityInfo::getRemark, pageWrap.getModel().getRemark());
}
if (pageWrap.getModel().getType() != null) {
- queryWrapper.lambda().eq(IdentityInfo::getType, pageWrap.getModel().getType());
+ queryWrapper.eq(IdentityInfo::getType, pageWrap.getModel().getType());
}
if (pageWrap.getModel().getMemberId() != null) {
- queryWrapper.lambda().eq(IdentityInfo::getMemberId, pageWrap.getModel().getMemberId());
+ queryWrapper.eq(IdentityInfo::getMemberId, pageWrap.getModel().getMemberId());
}
if (pageWrap.getModel().getAuthType() != null) {
- queryWrapper.lambda().eq(IdentityInfo::getAuthType, pageWrap.getModel().getAuthType());
+ queryWrapper.eq(IdentityInfo::getAuthType, pageWrap.getModel().getAuthType());
}
if (pageWrap.getModel().getLinkName() != null) {
- queryWrapper.lambda().eq(IdentityInfo::getLinkName, pageWrap.getModel().getLinkName());
+ queryWrapper.eq(IdentityInfo::getLinkName, pageWrap.getModel().getLinkName());
}
if (pageWrap.getModel().getTelephone() != null) {
- queryWrapper.lambda().eq(IdentityInfo::getTelephone, pageWrap.getModel().getTelephone());
+ queryWrapper.eq(IdentityInfo::getTelephone, pageWrap.getModel().getTelephone());
}
if (pageWrap.getModel().getLocation() != null) {
- queryWrapper.lambda().eq(IdentityInfo::getLocation, pageWrap.getModel().getLocation());
+ queryWrapper.eq(IdentityInfo::getLocation, pageWrap.getModel().getLocation());
}
if (pageWrap.getModel().getCompanyName() != null) {
- queryWrapper.lambda().eq(IdentityInfo::getCompanyName, pageWrap.getModel().getCompanyName());
+ queryWrapper.eq(IdentityInfo::getCompanyName, pageWrap.getModel().getCompanyName());
}
if (pageWrap.getModel().getLat() != null) {
- queryWrapper.lambda().eq(IdentityInfo::getLat, pageWrap.getModel().getLat());
+ queryWrapper.eq(IdentityInfo::getLat, pageWrap.getModel().getLat());
}
if (pageWrap.getModel().getLgt() != null) {
- queryWrapper.lambda().eq(IdentityInfo::getLgt, pageWrap.getModel().getLgt());
+ queryWrapper.eq(IdentityInfo::getLgt, pageWrap.getModel().getLgt());
}
if (pageWrap.getModel().getAuditStatus() != null) {
- queryWrapper.lambda().eq(IdentityInfo::getAuditStatus, pageWrap.getModel().getAuditStatus());
+ queryWrapper.eq(IdentityInfo::getAuditStatus, pageWrap.getModel().getAuditStatus());
}
if (pageWrap.getModel().getAuditTime() != null) {
- queryWrapper.lambda().ge(IdentityInfo::getAuditTime, Utils.Date.getStart(pageWrap.getModel().getAuditTime()));
- queryWrapper.lambda().le(IdentityInfo::getAuditTime, Utils.Date.getEnd(pageWrap.getModel().getAuditTime()));
+ queryWrapper.ge(IdentityInfo::getAuditTime, Utils.Date.getStart(pageWrap.getModel().getAuditTime()));
+ queryWrapper.le(IdentityInfo::getAuditTime, Utils.Date.getEnd(pageWrap.getModel().getAuditTime()));
}
if (pageWrap.getModel().getAuditRemark() != null) {
- queryWrapper.lambda().eq(IdentityInfo::getAuditRemark, pageWrap.getModel().getAuditRemark());
+ queryWrapper.eq(IdentityInfo::getAuditRemark, pageWrap.getModel().getAuditRemark());
}
for(PageWrap.SortData sortData: pageWrap.getSorts()) {
if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) {
@@ -326,7 +338,7 @@
queryWrapper.orderByAsc(sortData.getProperty());
}
}
- return PageData.from(identityInfoMapper.selectPage(page, queryWrapper));
+ return PageData.from(identityInfoMapper.selectJoinPage(page,IdentityInfo.class, queryWrapper));
}
@Override
diff --git a/server/services/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java b/server/services/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java
index 9548463..7a99ec0 100644
--- a/server/services/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java
+++ b/server/services/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java
@@ -212,6 +212,12 @@
if (pageWrap.getModel().getArea() != null) {
queryWrapper.lambda().eq(Member::getArea, pageWrap.getModel().getArea());
}
+ //濡傛灉鏌ヨ鎺ュ崟鏂�
+ queryWrapper.lambda().and(Constants.equalsInteger(pageWrap.getModel().getType(),Constants.ONE ),w1->{
+ w1.eq(Member::getWorkerIdentity,Constants.TWO )
+ .or().eq(Member::getChefIdentity,Constants.TWO )
+ .or().eq(Member::getDriverIdentity,Constants.TWO );
+ });
queryWrapper.lambda().ge(pageWrap.getModel().getStartTime()!=null, Member::getCreateTime,pageWrap.getModel().getStartTime());
queryWrapper.lambda().ne(pageWrap.getModel().getEndTime()!=null,Member::getCreateTime,pageWrap.getModel().getEndTime());
--
Gitblit v1.9.3