mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
1、分析页板材信息名称规范;2、新增登录短信验证码校验接口;
This commit is contained in:
+1
-1
@@ -27,7 +27,7 @@ public class OrderGoodsPlateRespVO implements Comparable<OrderGoodsPlateRespVO>
|
||||
private String color;
|
||||
|
||||
@Schema(description = "纹路")
|
||||
private Integer texture;
|
||||
private Boolean texture;
|
||||
|
||||
@Schema(description = "宽度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private BigDecimal width;
|
||||
|
||||
+44
-20
@@ -33,6 +33,7 @@ import com.cf.imes.module.system.api.dict.DictDataApi;
|
||||
import com.cf.imes.module.system.api.dict.dto.DictDataRespDTO;
|
||||
import com.cf.imes.module.system.enums.DictTypeConstants;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@@ -290,12 +291,10 @@ public class OrderStatisticsServiceImpl implements OrderStatisticsService {
|
||||
seriesItem.put("id", entry.getKey());
|
||||
// 材质-商品名称-颜色-纹理-宽-高-厚-品牌
|
||||
OrderGoodsPlateRespVO orderGoodsPlateRespVO = entry.getValue();
|
||||
// 获取纹路描述
|
||||
DictDataRespDTO grainDTO = dictDataApi.getDictData(DictTypeConstants.GRAIN_TYPE, String.valueOf(orderGoodsPlateRespVO.getTexture())).getData();
|
||||
String texture = ObjectUtil.isNotNull(grainDTO) ? grainDTO.getLabel() : "";
|
||||
seriesItem.put("name", orderGoodsPlateRespVO.getMaterial() + "-" + orderGoodsPlateRespVO.getGoodsName() +
|
||||
"-" + orderGoodsPlateRespVO.getColor() + "-" + texture + "-" + stripTrailingZeros(orderGoodsPlateRespVO.getWidth()) +
|
||||
"×" + stripTrailingZeros(orderGoodsPlateRespVO.getHeight()) + "×" + stripTrailingZeros(orderGoodsPlateRespVO.getThickness()) + "-" + orderGoodsPlateRespVO.getBrand());
|
||||
String specification = formatGoodsName('x', stripTrailingZeros(orderGoodsPlateRespVO.getWidth()),
|
||||
stripTrailingZeros(orderGoodsPlateRespVO.getHeight()), stripTrailingZeros(orderGoodsPlateRespVO.getThickness()));
|
||||
String goodsName = formatGoodsName('-', orderGoodsPlateRespVO.getMaterial(), orderGoodsPlateRespVO.getGoodsName(), orderGoodsPlateRespVO.getColor(), getTextureFromDict(orderGoodsPlateRespVO.getTexture()), specification, orderGoodsPlateRespVO.getBrand());
|
||||
seriesItem.put("name", goodsName);
|
||||
series.add(seriesItem);
|
||||
}
|
||||
resultMap.put(DATELIST_FIELD_NAME, dateList.stream().map(date -> generateDateRangeAxis(date, reqVO.getUnit())).toList());
|
||||
@@ -362,12 +361,10 @@ public class OrderStatisticsServiceImpl implements OrderStatisticsService {
|
||||
seriesItem.put("id", entry.getKey());
|
||||
// 材质-商品名称-颜色-纹理-宽-高-厚-品牌
|
||||
OrderGoodsPlateRespVO orderGoodsPlateRespVO = entry.getValue();
|
||||
// 获取纹路描述
|
||||
DictDataRespDTO grainDTO = dictDataApi.getDictData(DictTypeConstants.GRAIN_TYPE, String.valueOf(orderGoodsPlateRespVO.getTexture())).getData();
|
||||
String texture = ObjectUtil.isNotNull(grainDTO) ? grainDTO.getLabel() : "";
|
||||
seriesItem.put("name", orderGoodsPlateRespVO.getMaterial() + "-" + orderGoodsPlateRespVO.getGoodsName() +
|
||||
"-" + orderGoodsPlateRespVO.getColor() + "-" + texture + "-" + stripTrailingZeros(orderGoodsPlateRespVO.getWidth()) +
|
||||
"×" + stripTrailingZeros(orderGoodsPlateRespVO.getHeight()) + "×" + stripTrailingZeros(orderGoodsPlateRespVO.getThickness()) + "-" + orderGoodsPlateRespVO.getBrand());
|
||||
String specification = formatGoodsName('x', stripTrailingZeros(orderGoodsPlateRespVO.getWidth()),
|
||||
stripTrailingZeros(orderGoodsPlateRespVO.getHeight()), stripTrailingZeros(orderGoodsPlateRespVO.getThickness()));
|
||||
String goodsName = formatGoodsName('-', orderGoodsPlateRespVO.getMaterial(), orderGoodsPlateRespVO.getGoodsName(), orderGoodsPlateRespVO.getColor(), getTextureFromDict(orderGoodsPlateRespVO.getTexture()), specification, orderGoodsPlateRespVO.getBrand());
|
||||
seriesItem.put("name", goodsName);
|
||||
series.add(seriesItem);
|
||||
}
|
||||
resultMap.put(DATELIST_FIELD_NAME, dateList.stream().map(date -> generateDateRangeAxis(date, reqVO.getUnit())).toList());
|
||||
@@ -485,9 +482,10 @@ public class OrderStatisticsServiceImpl implements OrderStatisticsService {
|
||||
}
|
||||
// 任意取一个类型
|
||||
PlateGoodDO plateGoodDO = plateGoodDOList.get(0);
|
||||
seriesItem.put("name", plateGoodDO.getMaterial() + "-" + plateGoodDO.getGoodsName() +
|
||||
"-" + plateGoodDO.getColor() + "-" + getTextureFromDict(plateGoodDO) + "-" + stripTrailingZeros(BigDecimal.valueOf(plateGoodDO.getWidth())) +
|
||||
"×" + stripTrailingZeros(BigDecimal.valueOf(plateGoodDO.getHeight())) + "×" + stripTrailingZeros(BigDecimal.valueOf(plateGoodDO.getThickness())) + "-" + plateGoodDO.getBrand());
|
||||
String specification = formatGoodsName('x', stripTrailingZeros(BigDecimal.valueOf(plateGoodDO.getWidth())),
|
||||
stripTrailingZeros(BigDecimal.valueOf(plateGoodDO.getHeight())), stripTrailingZeros(BigDecimal.valueOf(plateGoodDO.getThickness())));
|
||||
String goodsName = formatGoodsName('-', plateGoodDO.getMaterial(), plateGoodDO.getGoodsName(), plateGoodDO.getColor(), getTextureFromDict(plateGoodDO.getTexture()), specification, plateGoodDO.getBrand());
|
||||
seriesItem.put("name", goodsName);
|
||||
series.add(seriesItem);
|
||||
}
|
||||
resultMap.put(DATELIST_FIELD_NAME, dateList.stream().map(date -> generateDateRangeAxis(date, unit)).toList());
|
||||
@@ -498,18 +496,44 @@ public class OrderStatisticsServiceImpl implements OrderStatisticsService {
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 板材信息用-连接
|
||||
*
|
||||
* @param connChar 连接符
|
||||
* @param texts 信息内容
|
||||
* @return 为空时不带connChar
|
||||
*/
|
||||
private String formatGoodsName(char connChar, String... texts) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String text : texts) {
|
||||
if (StringUtils.isNotEmpty(text)) {
|
||||
sb.append(text).append(connChar);
|
||||
}
|
||||
}
|
||||
// 移除最后一个 -
|
||||
if (sb.length() > 0 && sb.charAt(sb.length() - 1) == connChar) {
|
||||
sb.deleteCharAt(sb.length() - 1);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据纹路枚举获取字典中纹路描述
|
||||
* @param plateGoodDO
|
||||
*
|
||||
* @param texture
|
||||
* @return
|
||||
*/
|
||||
private String getTextureFromDict(PlateGoodDO plateGoodDO) {
|
||||
private String getTextureFromDict(Boolean texture) {
|
||||
if (ObjectUtil.isNull(texture)) {
|
||||
return "无";
|
||||
}
|
||||
// 获取纹路描述
|
||||
DictDataRespDTO grainDTO = dictDataApi.getDictData(DictTypeConstants.GRAIN_TYPE, String.valueOf(plateGoodDO.getTexture())).getData();
|
||||
DictDataRespDTO grainDTO = dictDataApi.getDictData(DictTypeConstants.PLATE_TEXTURE_TYPE, String.valueOf(texture)).getData();
|
||||
if (ObjectUtil.isNotNull(grainDTO)) {
|
||||
return grainDTO.getLabel();
|
||||
return Objects.equals("是", grainDTO.getLabel()) ? "有" : "无";
|
||||
} else {
|
||||
return "";
|
||||
return "无";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user