头像实体转换

This commit is contained in:
guohb
2024-05-06 09:53:38 +08:00
parent 7271dd465e
commit 47aadfc3d7
7 changed files with 81 additions and 22 deletions

View File

@@ -1,6 +1,7 @@
package com.cool.store.mapper;
import com.cool.store.entity.ShopAuditInfoDO;
import com.cool.store.vo.ShopAuditInfoVO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
@@ -12,7 +13,7 @@ public interface ShopAuditInfoMapper extends Mapper<ShopAuditInfoDO> {
List<ShopAuditInfoDO> getAuditInfoList(@Param("auditIds") List<Long> auditIds);
List<ShopAuditInfoDO> getListByShopIdAndType(@Param("shopId") Long shopId,
List<ShopAuditInfoVO> getListByShopIdAndType(@Param("shopId") Long shopId,
@Param("type") Integer type);
/**
* @Auther: wangshuo

View File

@@ -47,8 +47,9 @@
where
shop_id = #{shopId} and deleted = 0
</select>
<select id="getListByShopIdAndType" resultType="com.cool.store.entity.ShopAuditInfoDO">
select * from xfsg_shop_audit_info
<select id="getListByShopIdAndType" resultType="com.cool.store.vo.ShopAuditInfoVO">
select <include refid="Base_Column_List"/>
from xfsg_shop_audit_info
where shop_id = #{shopId}
and audit_type = #{type}
order by create_time

View File

@@ -1,11 +1,8 @@
package com.cool.store.response;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
@Data
@@ -19,7 +16,7 @@ public class AuditDetailResponse {
private String endTime;
private String checkUser;
@ApiModelProperty("稽核时间")
private String checkTime;
private Integer checkStatus;
@@ -27,6 +24,4 @@ public class AuditDetailResponse {
private String checkResult;
}

View File

@@ -2,6 +2,7 @@ package com.cool.store.response;
import com.cool.store.entity.LicenseTransactDO;
import com.cool.store.entity.ShopAuditInfoDO;
import com.cool.store.vo.ShopAuditInfoVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -86,7 +87,7 @@ public class SubmitLicenseResponse {
private Integer submitStatus;
@ApiModelProperty("流程记录")
private List<ShopAuditInfoDO> processRecords;
private List<ShopAuditInfoVO> processRecords;
public static SubmitLicenseResponse from(LicenseTransactDO licenseTransactDO) {
if (licenseTransactDO == null) {

View File

@@ -0,0 +1,59 @@
package com.cool.store.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
public class ShopAuditInfoVO {
private Long id;
private Long shopId;
@ApiModelProperty("'0-视觉验收 1-培训登记审批 2-开业运营方案 3-证照审批 4-系统建店5-三方验收")
private Integer auditType;
@ApiModelProperty("提交人ID")
private String submittedUserId;
@ApiModelProperty("提交人名称")
private String submittedUserName;
@ApiModelProperty("结果类型 0通过,1拒绝")
private Integer resultType;
@ApiModelProperty("通过原因")
private String passReason;
@ApiModelProperty("拒绝原因")
private String rejectReason;
private String certifyFile;
@ApiModelProperty("时间")
private Date createTime;
private Date updateTime;
/**
* 是否删除0.否 1.是
*/
private Boolean deleted;
@ApiModelProperty("数据类型 0-提交 1-审批")
private Integer dataType;
@ApiModelProperty("头像")
private String avatar;
}

View File

@@ -25,6 +25,7 @@ import com.cool.store.service.RegionService;
import com.cool.store.utils.StringUtil;
import com.cool.store.utils.poi.constant.Constants;
import com.cool.store.vo.OpenAcceptanceInfoListVO;
import com.cool.store.vo.ShopAuditInfoVO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
@@ -99,18 +100,19 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
throw new ServiceException(ErrorCodeEnum.LICENSE_NOT_EXIST);
}
SubmitLicenseResponse submitLicenseResponse = SubmitLicenseResponse.from(result);
List<ShopAuditInfoDO> listByShopIdAndType = shopAuditInfoMapper.getListByShopIdAndType(shopId, AuditTypeEnum.LICENSE_APPROVAL.getCode());
List<String> userIds = listByShopIdAndType.stream().map(ShopAuditInfoDO::getSubmittedUserId).collect(Collectors.toList());
List<ShopAuditInfoVO> listByShopIdAndType = shopAuditInfoMapper.getListByShopIdAndType(shopId, AuditTypeEnum.LICENSE_APPROVAL.getCode());
List<String> userIds = listByShopIdAndType.stream().map(ShopAuditInfoVO::getSubmittedUserId).collect(Collectors.toList());
List<EnterpriseUserDO> userInfoByUserIds = new ArrayList<>();
// if (CollectionUtils.isNotEmpty(userIds)){
// userInfoByUserIds = userMapper.getUserInfoByUserIds(userIds);
// Map<String, String> userAvatarMap = userInfoByUserIds.stream()
// .filter(item -> StringUtil.isNotBlank(item.getUserId()) && StringUtil.isNotBlank(item.getAvatar()))
// .collect(Collectors.toMap(k -> k.getUserId(), v -> v.getAvatar()));
// listByShopIdAndType.stream().forEach( item -> {
// item.setAvatar(userAvatarMap.get(item.getSubmittedUserId()));
// });
// }
if (CollectionUtils.isNotEmpty(userIds)){
userInfoByUserIds = userMapper.getUserInfoByUserIds(userIds);
Map<String, String> userAvatarMap = userInfoByUserIds.stream()
.filter(item -> StringUtil.isNotBlank(item.getUserId()) && StringUtil.isNotBlank(item.getAvatar()))
.collect(Collectors.toMap(k -> k.getUserId(), v -> v.getAvatar()));
listByShopIdAndType.stream().forEach( item -> {
item.setAvatar(userAvatarMap.get(item.getSubmittedUserId()));
});
}
submitLicenseResponse.setProcessRecords(listByShopIdAndType);
return submitLicenseResponse;
}

View File

@@ -107,7 +107,7 @@ public class AuditStatusServiceImpl implements AuditStatusService {
response.setEndTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, lineInterviewDO.getActualEndTime()));
}
if (Objects.nonNull(auditStatusDO.getCreateTime())){
response.setCheckTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, auditStatusDO.getCreateTime()));
response.setCheckTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, auditStatusDO.getUpdateTime()));
}
response.setCheckUser(auditStatusDO.getAuditUserName());
response.setCheckStatus(auditStatusDO.getAuditStatus());