Commit c24a00a2 by 林冲

Merge branch 'v5.7.9' into 'master'

上线合并

See merge request !22
2 parents 3c8a8407 5c7034df
Showing 49 changed files with 544 additions and 231 deletions
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<properties> <properties>
<shopmall.api.version>5.6.4-SNAPSHOT</shopmall.api.version> <shopmall.api.version>5.6.4-SNAPSHOT</shopmall.api.version>
<stoassistant.api.version>5.6.4-SNAPSHOT</stoassistant.api.version> <stoassistant.api.version>5.6.4-SNAPSHOT</stoassistant.api.version>
<smartcarlife.api.version>5.8.0-SNAPSHOT</smartcarlife.api.version> <smartcarlife.api.version>5.7.9-SNAPSHOT</smartcarlife.api.version>
<sale.api.version>5.8.0-SNAPSHOT</sale.api.version> <sale.api.version>5.8.0-SNAPSHOT</sale.api.version>
<mindworkplate.api.version>5.8.0-SNAPSHOT</mindworkplate.api.version> <mindworkplate.api.version>5.8.0-SNAPSHOT</mindworkplate.api.version>
</properties> </properties>
......
package cn.com.glsx.dj.smartcarlife.config;
import cn.com.glsx.dj.smartcarlife.constant.CommonConstants;
import cn.com.glsx.dj.smartcarlife.response.common.CountryOrProvinceData;
import cn.com.glsx.dj.smartcarlife.response.common.District;
import com.google.gson.Gson;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;
import javax.annotation.PostConstruct;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Configuration
@Slf4j
public class CityCodeConfig {
@Autowired
private Environment env;
private final Map<String, District> cityCodeMap = new HashMap<>();
private final Map<String, District> provinceMap = new HashMap<>();
// cityName,pair[cityCode,pair[provinceCode,provinceName]]
private final Map<String, Pair<String, Pair<String,String>>> cityNameMap = new HashMap<>();
@PostConstruct
public void initCityCodeMap() {
try {
log.info("开始加载城市编码信息...");
String url = env.getProperty("map.districts.url", CommonConstants.BAIDU_MAP_API_URL);
String keyword = "中国";
int subAdmin = 2;
String apiUrl = String.format(url, keyword, subAdmin);
ResponseEntity<String> response = new RestTemplate().getForEntity(apiUrl, String.class);
if (!response.getStatusCode().is2xxSuccessful()) {
log.error("查询地图区域省市二级树结构失败,返回值:{}", response);
return;
}
Gson gson = new Gson();
CountryOrProvinceData responseData = gson.fromJson(response.getBody(), CountryOrProvinceData.class);
if (responseData == null || CollectionUtils.isEmpty(responseData.getDistricts())) {
log.warn("未获取到城市编码数据");
return;
}
buildCityCodeMap(responseData.getDistricts());
log.info("城市编码信息加载完成,共{}条数据", cityNameMap.size());
} catch (Exception e) {
log.error("加载城市编码信息异常", e);
}
}
private void buildCityCodeMap(List<District> districts) {
District countryDistrict = districts.get(0);
// 过滤只保留level=1(省)和level=2(市)的数据,去掉第一层(level=0的中国)
if (countryDistrict.getDistricts() != null) {
for (District district : countryDistrict.getDistricts()) {
if (district.getLevel() == 1) { // 省级
District province = new District();
province.setCode(district.getCode());
province.setName(district.getName());
province.setLevel(district.getLevel());
// 过滤出市级数据(level=2)
List<District> cityList = new ArrayList<>();
if (district.getDistricts() != null) {
for (District city : district.getDistricts()) {
if (city.getLevel() == 2) { // 市级
// 移除市的下级区域(区县级)
District cityCopy = new District();
cityCopy.setCode(city.getCode());
cityCopy.setName(city.getName());
cityCopy.setLevel(city.getLevel());
cityCopy.setDistricts(null); // 不保留区县级数据
cityList.add(cityCopy);
cityNameMap.put(city.getName(), Pair.of(city.getCode(),Pair.of(province.getCode(),province.getName())));
}
}
}
province.setDistricts(cityList);
provinceMap.put(province.getName(),province);
cityCodeMap.put(district.getCode(),district);
}
}
}
}
@Bean("cityNameMap")
public Map<String, Pair<String, Pair<String,String>>> getCityNameMap() {
return cityNameMap;
}
@Bean("provinceMap")
public Map<String, District> getProvinceMap() {
return provinceMap;
}
@Bean("cityCodeMap")
public Map<String, District> getCityCodeMap() {
return cityCodeMap;
}
}
package cn.com.glsx.dj.smartcarlife.controller.smartCarLife; package cn.com.glsx.dj.smartcarlife.controller.smartCarLife;
import org.springframework.beans.factory.annotation.Autowired;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import cn.com.glsx.dj.smartcarlife.convert.merchantSettleDistributeRule.DivisionRuleTestDTOConvert; import cn.com.glsx.dj.smartcarlife.convert.merchantSettleDistributeRule.DivisionRuleTestDTOConvert;
import cn.com.glsx.dj.smartcarlife.convert.merchantSettleDistributeRule.MerchantDivisionRuleProcessDTOConvert; import cn.com.glsx.dj.smartcarlife.convert.merchantSettleDistributeRule.MerchantDivisionRuleProcessDTOConvert;
import cn.com.glsx.dj.smartcarlife.dto.DivisionRuleTestDTO; import cn.com.glsx.dj.smartcarlife.dto.DivisionRuleTestDTO;
...@@ -7,16 +13,14 @@ import cn.com.glsx.dj.smartcarlife.remote.DivisionRuleTestRemote; ...@@ -7,16 +13,14 @@ import cn.com.glsx.dj.smartcarlife.remote.DivisionRuleTestRemote;
import cn.com.glsx.dj.smartcarlife.remote.GroupDivisionRuleTestRemote; import cn.com.glsx.dj.smartcarlife.remote.GroupDivisionRuleTestRemote;
import cn.com.glsx.dj.smartcarlife.request.smartcarlife.DivisionRuleTestMoneyValidRequest; import cn.com.glsx.dj.smartcarlife.request.smartcarlife.DivisionRuleTestMoneyValidRequest;
import cn.com.glsx.dj.smartcarlife.request.smartcarlife.merchantSettleDistributeRule.DivisionRuleTestGetRequest; import cn.com.glsx.dj.smartcarlife.request.smartcarlife.merchantSettleDistributeRule.DivisionRuleTestGetRequest;
import cn.com.glsx.dj.smartcarlife.request.smartcarlife.merchantSettleDistributeRule.DivisionRuleTestRetestRequest;
import cn.com.glsx.dj.smartcarlife.request.smartcarlife.merchantSettleDistributeRule.DivisionRuleTestUpdateMainProgressRequest;
import cn.com.glsx.dj.smartcarlife.response.smartcarlife.merchantSettleDistribute.DivisionRuleTestGetResponse; import cn.com.glsx.dj.smartcarlife.response.smartcarlife.merchantSettleDistribute.DivisionRuleTestGetResponse;
import cn.com.glsx.dj.smartcarlife.util.CommonUtil; import cn.com.glsx.dj.smartcarlife.util.CommonUtil;
import cn.com.glsx.framework.rop.response.RopResponse; import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@Slf4j @Slf4j
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES,groupTitle="分账测试") @ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES,groupTitle="分账测试")
...@@ -30,14 +34,34 @@ public class DivisionRuleTestController { ...@@ -30,14 +34,34 @@ public class DivisionRuleTestController {
@ApiOperation("获取商户财务设置进度") @ApiOperation("获取商户财务设置进度")
@ServiceMethod(method = "dj.api.smartcarlife.divisionRuleTest.get", needInSession = NeedInSessionType.NO) @ServiceMethod(method = "dj.api.smartcarlife.divisionRuleTest.get", needInSession = NeedInSessionType.NO)
public RopResponse<DivisionRuleTestGetResponse> get(DivisionRuleTestGetRequest request){ public RopResponse<DivisionRuleTestGetResponse> get(DivisionRuleTestGetRequest request){
return CommonUtil.convertRopResponse(groupDivisionRuleTestRemote.refreshGroupTestProcess(request.getGoodsTypeGroupDivisionId()), MerchantDivisionRuleProcessDTOConvert.INSTANCE::toDivisionRuleTestGetResponse); return CommonUtil.convertRopResponse(groupDivisionRuleTestRemote.refreshGroupTestProcess(request.getDivisionRuleId()), MerchantDivisionRuleProcessDTOConvert.INSTANCE::toDivisionRuleTestGetResponse);
} }
@ApiOperation("分账测试验证分账金额") @ApiOperation("分账测试验证分账金额")
@ServiceMethod(method = "dj.api.smartcarlife.divisionRuleTest.money.valid",title="分账测试验证分账金额", needInSession = NeedInSessionType.YES) @ServiceMethod(method = "dj.api.smartcarlife.divisionRuleTest.money.valid",title="分账测试验证分账金额", needInSession = NeedInSessionType.YES)
public RopResponse<DivisionRuleTestDTO> moneyValid(DivisionRuleTestMoneyValidRequest request){ public RopResponse<DivisionRuleTestDTO> moneyValid(DivisionRuleTestMoneyValidRequest request){
DivisionRuleTestDTO record = DivisionRuleTestDTOConvert.INSTANCE.fromDivisionRuleTestMoneyValidRequest(request); DivisionRuleTestDTO record = DivisionRuleTestDTOConvert.INSTANCE.fromDivisionRuleTestMoneyValidRequest(request);
record.setUpdatedBy(CommonUtil.getAccountName()); record.setUpdatedBy(CommonUtil.getUserName());
return CommonUtil.convertRopResponse(divisionRuleTestRemote.update(record)); return CommonUtil.convertRopResponse(divisionRuleTestRemote.update(record));
} }
@ApiOperation("重新测试")
@ServiceMethod(method = "dj.api.smartcarlife.divisionRuleTest.retest", needInSession = NeedInSessionType.YES)
public RopResponse<DivisionRuleTestGetResponse> get(DivisionRuleTestRetestRequest request){
return CommonUtil.convertRopResponse(divisionRuleTestRemote.retest(DivisionRuleTestDTO.builder()
.divisionRuleId(request.getDivisionRuleId()).paymentChannelId(request.getPaymentChannelId())
.updatedBy(CommonUtil.getUserName())
.build()),
MerchantDivisionRuleProcessDTOConvert.INSTANCE::toDivisionRuleTestGetResponse);
}
@ApiOperation("更新测试主进度")
@ServiceMethod(method = "dj.api.smartcarlife.divisionRuleTest.updateMainProgress", needInSession = NeedInSessionType.YES)
public RopResponse<Boolean> updateMainProgress(DivisionRuleTestUpdateMainProgressRequest request){
return CommonUtil.convertRopResponse(divisionRuleTestRemote.updateMainProgress(DivisionRuleTestDTO.builder()
.divisionRuleId(request.getDivisionRuleId()).paymentChannelId(request.getPaymentChannelId())
.updatedBy(CommonUtil.getUserName()).progress(request.getProgress())
.build()));
}
} }
...@@ -267,6 +267,9 @@ public class PurchaseOrderDeliveryController { ...@@ -267,6 +267,9 @@ public class PurchaseOrderDeliveryController {
} }
} }
purchaseOrderShipmentGoodsExportVO.setUpgradeGoodsName(data.getUpgradeGoodsName()); purchaseOrderShipmentGoodsExportVO.setUpgradeGoodsName(data.getUpgradeGoodsName());
purchaseOrderShipmentGoodsExportVO.setThirdPartyCode(data.getThirdPartyCode());
purchaseOrderShipmentGoodsExportVO.setThirdPartyName(data.getThirdPartyName());
purchaseOrderShipmentGoodsExportVO.setPurchaseGoodsName(data.getPurchaseGoodsName());
Integer goodsNumber = data.getGoodsNumber(); Integer goodsNumber = data.getGoodsNumber();
purchaseOrderShipmentGoodsExportVO.setGoodsNumber(PurchaseOrderStockUtil.getPurchaseNumberDescription(BigDecimal.valueOf(goodsNumber), goodsType)); purchaseOrderShipmentGoodsExportVO.setGoodsNumber(PurchaseOrderStockUtil.getPurchaseNumberDescription(BigDecimal.valueOf(goodsNumber), goodsType));
BigDecimal conversionValue = data.getConversionValue(); BigDecimal conversionValue = data.getConversionValue();
......
...@@ -150,6 +150,9 @@ public class WarehouseDeliveryController { ...@@ -150,6 +150,9 @@ public class WarehouseDeliveryController {
warehousedeliverGoodsExportVO.setType(data.getType()); warehousedeliverGoodsExportVO.setType(data.getType());
warehousedeliverGoodsExportVO.setSpecificationData(data.getSpecificationData()); warehousedeliverGoodsExportVO.setSpecificationData(data.getSpecificationData());
warehousedeliverGoodsExportVO.setUpgradeGoodsName(data.getUpgradeGoodsName()); warehousedeliverGoodsExportVO.setUpgradeGoodsName(data.getUpgradeGoodsName());
warehousedeliverGoodsExportVO.setThirdPartyName(data.getThirdPartyName());
warehousedeliverGoodsExportVO.setThirdPartyCode(data.getThirdPartyCode());
warehousedeliverGoodsExportVO.setPurchaseGoodsName(data.getPurchaseGoodsName());
Integer goodsNumber = data.getGoodsNumber(); Integer goodsNumber = data.getGoodsNumber();
BigDecimal conversionValue = data.getConversionValue(); BigDecimal conversionValue = data.getConversionValue();
//只有膜类订单才换算 //只有膜类订单才换算
......
...@@ -30,6 +30,7 @@ public interface PurchaseGoodsConvert { ...@@ -30,6 +30,7 @@ public interface PurchaseGoodsConvert {
@Mapping(target = "type", source = "upgradeGoods.type"), @Mapping(target = "type", source = "upgradeGoods.type"),
@Mapping(target = "upgradeCommodityCode", source = "upgradeGoods.commodityCode"), @Mapping(target = "upgradeCommodityCode", source = "upgradeGoods.commodityCode"),
@Mapping(target = "thirdPartyCode", source = "upgradeGoods.thirdPartyCode"), @Mapping(target = "thirdPartyCode", source = "upgradeGoods.thirdPartyCode"),
@Mapping(target = "thirdPartyName", source = "upgradeGoods.thirdPartyName"),
@Mapping(target = "baseCommodityCode", source = "baseGoods.commodityCode"), @Mapping(target = "baseCommodityCode", source = "baseGoods.commodityCode"),
@Mapping(target = "sapCode", source = "goodsInfo.sapCode"), @Mapping(target = "sapCode", source = "goodsInfo.sapCode"),
@Mapping(target = "goodsName", source = "goodsInfo.goodsName"), @Mapping(target = "goodsName", source = "goodsInfo.goodsName"),
......
...@@ -21,8 +21,8 @@ public class DivisionRuleTestMoneyValidRequest extends AbstractRopRequest{ ...@@ -21,8 +21,8 @@ public class DivisionRuleTestMoneyValidRequest extends AbstractRopRequest{
private BigDecimal singlePartnerDivisionMoney; private BigDecimal singlePartnerDivisionMoney;
@NotNull @NotNull
@ApiModelProperty(notes = "商品品类组规则id", dataType = "int") @ApiModelProperty(notes = "商品分账规则id", dataType = "int")
private Integer goodsTypeGroupDivisionId; private Integer divisionRuleId;
@NotEmpty @NotEmpty
@ApiModelProperty(notes="支付渠道id") @ApiModelProperty(notes="支付渠道id")
......
...@@ -29,7 +29,10 @@ public class ListUpgradeGoodsWithPageRequest extends AbstractRopRequest{ ...@@ -29,7 +29,10 @@ public class ListUpgradeGoodsWithPageRequest extends AbstractRopRequest{
@ApiModelProperty(notes = "第三方编码") @ApiModelProperty(notes = "第三方编码")
private String thirdPartyCode; private String thirdPartyCode;
@ApiModelProperty(notes = "供应商名称")
private String thirdPartyName;
@ApiModelProperty(notes = "适用车型车系搜索") @ApiModelProperty(notes = "适用车型车系搜索")
private String carTypeSearch; private String carTypeSearch;
......
package cn.com.glsx.dj.smartcarlife.request.smartcarlife.merchantSettleDistributeRule; package cn.com.glsx.dj.smartcarlife.request.smartcarlife.merchantSettleDistributeRule;
import javax.validation.constraints.NotNull;
import com.rop.AbstractRopRequest; import com.rop.AbstractRopRequest;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull;
@Data @Data
public class DivisionRuleTestGetRequest extends AbstractRopRequest { public class DivisionRuleTestGetRequest extends AbstractRopRequest {
@NotNull @NotNull
@ApiModelProperty(notes = "商品品类组规则id", dataType = "int", required = true) @ApiModelProperty(notes = "商品分账规则id")
private Integer goodsTypeGroupDivisionId; private Integer divisionRuleId;
} }
package cn.com.glsx.dj.smartcarlife.request.smartcarlife.merchantSettleDistributeRule; package cn.com.glsx.dj.smartcarlife.request.smartcarlife.merchantSettleDistributeRule;
import com.rop.AbstractRopRequest; import java.io.Serializable;
import java.math.BigDecimal;
import javax.validation.constraints.NotNull;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
@Data @Data
@ApiModel("分账商户的确认分账金额信息") @ApiModel("分账商户的确认分账金额信息")
public class DivisionRuleTestMerchantDivisionItem implements Serializable { public class DivisionRuleTestMerchantDivisionItem implements Serializable {
...@@ -29,4 +29,19 @@ public class DivisionRuleTestMerchantDivisionItem implements Serializable { ...@@ -29,4 +29,19 @@ public class DivisionRuleTestMerchantDivisionItem implements Serializable {
@ApiModelProperty(notes="实际分账金额") @ApiModelProperty(notes="实际分账金额")
private BigDecimal divisionMoney; private BigDecimal divisionMoney;
/**
* 分配对象类型(1:平台方;2:服务商;3:4s店)
*/
private Byte targetMerchantType;
/**
* 分配对象级别(1:门店;2:上级),默认门店
*/
private Byte targetMerchantLevel;
/**
* 分配金额
*/
private BigDecimal distributionMoney;
} }
package cn.com.glsx.dj.smartcarlife.request.smartcarlife.merchantSettleDistributeRule;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import com.rop.AbstractRopRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class DivisionRuleTestRetestRequest extends AbstractRopRequest {
@NotNull
@ApiModelProperty(notes = "商品分账规则id")
private Integer divisionRuleId;
@NotBlank
private String paymentChannelId;
}
package cn.com.glsx.dj.smartcarlife.request.smartcarlife.merchantSettleDistributeRule;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import com.rop.AbstractRopRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class DivisionRuleTestUpdateMainProgressRequest extends AbstractRopRequest {
@NotNull
@ApiModelProperty(notes = "商品分账规则id")
private Integer divisionRuleId;
@NotBlank
private String paymentChannelId;
@NotNull
private Byte progress;
}
...@@ -82,4 +82,7 @@ public class PurchaseOrderPageRequest extends AbstractRopRequest{ ...@@ -82,4 +82,7 @@ public class PurchaseOrderPageRequest extends AbstractRopRequest{
private String merchantName; private String merchantName;
private String putMerchantName; private String putMerchantName;
@ApiModelProperty(notes = "供应商名称,模糊搜索")
private String thirdPartyName;
} }
...@@ -73,6 +73,12 @@ public class PurchaseOrderShippingListRequest extends AbstractRopRequest { ...@@ -73,6 +73,12 @@ public class PurchaseOrderShippingListRequest extends AbstractRopRequest {
@ApiModelProperty(notes="发货方") @ApiModelProperty(notes="发货方")
private String shipper; private String shipper;
@ApiModelProperty(notes = "供应商名称,模糊搜索")
private String thirdPartyName;
@ApiModelProperty(notes = "供应商编码,模糊搜索")
private String thirdPartyCode;
private List<Integer> signStatusList; private List<Integer> signStatusList;
@ApiModelProperty(notes="签收状态") @ApiModelProperty(notes="签收状态")
......
...@@ -55,4 +55,9 @@ public class WarehouseDeliveryRequest extends AbstractRopRequest { ...@@ -55,4 +55,9 @@ public class WarehouseDeliveryRequest extends AbstractRopRequest {
@ApiModelProperty(notes="发货主体") @ApiModelProperty(notes="发货主体")
private String sendOutMerchantName; private String sendOutMerchantName;
@ApiModelProperty(notes = "供应商名称,模糊搜索")
private String thirdPartyName;
@ApiModelProperty(notes = "供应商编码,模糊搜索")
private String thirdPartyCode;
} }
...@@ -5,6 +5,7 @@ import java.util.List; ...@@ -5,6 +5,7 @@ import java.util.List;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import com.rop.AbstractRopRequest; import com.rop.AbstractRopRequest;
...@@ -35,4 +36,8 @@ public class PurchaseGoodsAddOrUpdateRequest extends AbstractRopRequest{ ...@@ -35,4 +36,8 @@ public class PurchaseGoodsAddOrUpdateRequest extends AbstractRopRequest{
@NotNull @NotNull
@ApiModelProperty(notes = "适用车型(1:通用,2:专用)") @ApiModelProperty(notes = "适用车型(1:通用,2:专用)")
private Byte suitCarType; private Byte suitCarType;
@Size(max = 30)
@ApiModelProperty(notes = "产品别名")
private String purchaseGoodsName;
} }
...@@ -50,4 +50,7 @@ public class PurchaseGoodsPageRequest extends AbstractRopRequest { ...@@ -50,4 +50,7 @@ public class PurchaseGoodsPageRequest extends AbstractRopRequest {
@ApiModelProperty(notes = "第三方编码") @ApiModelProperty(notes = "第三方编码")
private String thirdPartyCode; private String thirdPartyCode;
@ApiModelProperty(notes = "供应商名称")
private String thirdPartyName;
} }
...@@ -9,6 +9,8 @@ import java.io.Serializable; ...@@ -9,6 +9,8 @@ import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List; import java.util.List;
import javax.persistence.Column;
@Data @Data
public class DivisionRuleTestItem implements Serializable { public class DivisionRuleTestItem implements Serializable {
private static final long serialVersionUID = 8497793883159789827L; private static final long serialVersionUID = 8497793883159789827L;
...@@ -19,6 +21,8 @@ public class DivisionRuleTestItem implements Serializable { ...@@ -19,6 +21,8 @@ public class DivisionRuleTestItem implements Serializable {
@ApiModelProperty(notes="测试进度(32:没有有效的虚拟对公账户;33:不需要进行分账测试;34:POS机扫码获取订单信息;35:POS机扫码支付;36:待确认分账金额;31:验证金额失败;43:完成测试)", dataType="byte") @ApiModelProperty(notes="测试进度(32:没有有效的虚拟对公账户;33:不需要进行分账测试;34:POS机扫码获取订单信息;35:POS机扫码支付;36:待确认分账金额;31:验证金额失败;43:完成测试)", dataType="byte")
private Byte subProgress; private Byte subProgress;
private Byte progress;
@ApiModelProperty(notes="测试订单号", dataType="string") @ApiModelProperty(notes="测试订单号", dataType="string")
private String orderCode; private String orderCode;
...@@ -34,6 +38,16 @@ public class DivisionRuleTestItem implements Serializable { ...@@ -34,6 +38,16 @@ public class DivisionRuleTestItem implements Serializable {
@ApiModelProperty(notes="成本") @ApiModelProperty(notes="成本")
private BigDecimal totalGoodsCost; private BigDecimal totalGoodsCost;
/**
* 测试订单金额
*/
private BigDecimal orderMoney;
/**
* 分账测试状态标识(Y测试通过,N测试中未通过)
*/
private String testFlag;
private List<DivisionRuleTestGetSubOrderResponse> subOrders; private List<DivisionRuleTestGetSubOrderResponse> subOrders;
private List<ServiceMerchant> accountValidMerchants; private List<ServiceMerchant> accountValidMerchants;
......
...@@ -26,9 +26,15 @@ public class PurchaseOrderDeliveryDetailPageResponse implements Serializable { ...@@ -26,9 +26,15 @@ public class PurchaseOrderDeliveryDetailPageResponse implements Serializable {
@ApiModelProperty(notes="商品名称") @ApiModelProperty(notes="商品名称")
private String upgradeGoodsName; private String upgradeGoodsName;
@ApiModelProperty(notes="多规格商品规格数据(不同规格按“/”分隔)", dataType="string") @ApiModelProperty(notes="供应商名称")
private String thirdPartyName;
@ApiModelProperty(notes="多规格商品规格数据(不同规格按\"/\"分隔)", dataType="string")
private String specificationData; private String specificationData;
@ApiModelProperty(notes="产品别名")
private String purchaseGoodsName;
@ApiModelProperty(notes="商品编码") @ApiModelProperty(notes="商品编码")
private String type; private String type;
......
...@@ -25,9 +25,15 @@ public class PurchaseOrderDeliveryDetailResponse implements Serializable { ...@@ -25,9 +25,15 @@ public class PurchaseOrderDeliveryDetailResponse implements Serializable {
@ApiModelProperty(notes="商品名称") @ApiModelProperty(notes="商品名称")
private String upgradeGoodsName; private String upgradeGoodsName;
@ApiModelProperty(notes="多规格商品规格数据(不同规格按“/”分隔)", dataType="string") @ApiModelProperty(notes="供应商名称")
private String thirdPartyName;
@ApiModelProperty(notes="多规格商品规格数据(不同规格按\"/\"分隔)", dataType="string")
private String specificationData; private String specificationData;
@ApiModelProperty(notes="产品别名")
private String purchaseGoodsName;
@ApiModelProperty(notes="发货数量") @ApiModelProperty(notes="发货数量")
private BigDecimal purchaseNumber; private BigDecimal purchaseNumber;
......
...@@ -24,6 +24,12 @@ public class PurchaseOrderShippingPageResponse implements Serializable { ...@@ -24,6 +24,12 @@ public class PurchaseOrderShippingPageResponse implements Serializable {
@ApiModelProperty(notes="商品名称") @ApiModelProperty(notes="商品名称")
private String upgradeGoodsName; private String upgradeGoodsName;
@ApiModelProperty(notes = "供应商名称")
private String thirdPartyName;
@ApiModelProperty(notes = "供应商编码")
private String thirdPartyCode;
@ApiModelProperty(notes="商品编码") @ApiModelProperty(notes="商品编码")
private String type; private String type;
...@@ -36,6 +42,9 @@ public class PurchaseOrderShippingPageResponse implements Serializable { ...@@ -36,6 +42,9 @@ public class PurchaseOrderShippingPageResponse implements Serializable {
@ApiModelProperty(notes="系列") @ApiModelProperty(notes="系列")
private String goodsName; private String goodsName;
@ApiModelProperty(notes = "产品别名")
private String purchaseGoodsName;
@ApiModelProperty(notes="所属分类") @ApiModelProperty(notes="所属分类")
private Integer goodsType; private Integer goodsType;
......
...@@ -24,6 +24,12 @@ public class WarehouseDeliveryPageResponse implements Serializable { ...@@ -24,6 +24,12 @@ public class WarehouseDeliveryPageResponse implements Serializable {
@ApiModelProperty(notes="商品名称") @ApiModelProperty(notes="商品名称")
private String upgradeGoodsName; private String upgradeGoodsName;
@ApiModelProperty(notes = "供应商名称")
private String thirdPartyName;
@ApiModelProperty(notes = "供应商编码")
private String thirdPartyCode;
@ApiModelProperty(notes="商品编码") @ApiModelProperty(notes="商品编码")
private String type; private String type;
...@@ -36,6 +42,9 @@ public class WarehouseDeliveryPageResponse implements Serializable { ...@@ -36,6 +42,9 @@ public class WarehouseDeliveryPageResponse implements Serializable {
@ApiModelProperty(notes="系列") @ApiModelProperty(notes="系列")
private String goodsName; private String goodsName;
@ApiModelProperty(notes = "产品别名")
private String purchaseGoodsName;
@ApiModelProperty(notes="所属分类") @ApiModelProperty(notes="所属分类")
private Integer goodsType; private Integer goodsType;
......
...@@ -23,6 +23,7 @@ import org.apache.poi.ss.util.CellRangeAddress; ...@@ -23,6 +23,7 @@ import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.util.CellRangeAddressList; import org.apache.poi.ss.util.CellRangeAddressList;
import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -43,6 +44,11 @@ public class ProductManagerSkuBatchUpdateExportService { ...@@ -43,6 +44,11 @@ public class ProductManagerSkuBatchUpdateExportService {
@Autowired @Autowired
private Environment env; private Environment env;
@Autowired
@Qualifier("cityCodeMap")
private Map<String, District> cityCodeMap;
private static final int SINGLE_SHEET_INDEX = 0; private static final int SINGLE_SHEET_INDEX = 0;
private static final int MULTI_SHEET_INDEX = 1; private static final int MULTI_SHEET_INDEX = 1;
private static final int MULTI_TITLE_ROW_INDEX = 0; private static final int MULTI_TITLE_ROW_INDEX = 0;
...@@ -88,37 +94,13 @@ public class ProductManagerSkuBatchUpdateExportService { ...@@ -88,37 +94,13 @@ public class ProductManagerSkuBatchUpdateExportService {
if (CollectionUtils.isEmpty(skuList)) { if (CollectionUtils.isEmpty(skuList)) {
return new ExportData(singleRows, multiRows, new ArrayList<>(DEFAULT_MULTI_SPEC_HEADERS)); return new ExportData(singleRows, multiRows, new ArrayList<>(DEFAULT_MULTI_SPEC_HEADERS));
} }
Map<String,District> districtMap = new HashMap<>();
try{
//获取省份结构
String url = env.getProperty("map.districts.url", CommonConstants.BAIDU_MAP_API_URL);
String keyword = "中国";
int subAdmin = 2;
String apiUrl = String.format(url, keyword, subAdmin);
ResponseEntity<String> response = new RestTemplate().getForEntity(apiUrl, String.class);
if (response.getStatusCode().is2xxSuccessful()) {
Gson gson = new Gson();
CountryOrProvinceData responseData = gson.fromJson(response.getBody(), CountryOrProvinceData.class);
if (responseData == null || CollectionUtils.isEmpty(responseData.getDistricts())) {
log.warn("未获取到城市编码数据");
}else {
// 第一个为全国,districts为省份信息
districtMap = responseData.getDistricts().get(0).getDistricts().stream().collect(Collectors.toMap(District::getCode, Function.identity()));
}
}else {
log.error("查询地图区域省市二级树结构失败,返回值:{}", response);
}
}catch (Exception e){
log.error("加载地图区域数据发生未知异常", e);
}
int index = 1; int index = 1;
for (GoodsSkuDTO skuDTO : skuList) { for (GoodsSkuDTO skuDTO : skuList) {
// GoodsMixDTO goodsMixDTO = goodsMixMap.get(skuDTO.getBaseGoodsCommodityCode()); // GoodsMixDTO goodsMixDTO = goodsMixMap.get(skuDTO.getBaseGoodsCommodityCode());
List<String> specValues = splitSpecificationValues(skuDTO.getSpecificationData()); List<String> specValues = splitSpecificationValues(skuDTO.getSpecificationData());
// List<String> specHeaders = normalizeSpecHeaders(specList, specValues.size()); // List<String> specHeaders = normalizeSpecHeaders(specList, specValues.size());
solveAreaInfo(skuDTO,districtMap); solveAreaInfo(skuDTO);
//多规格 //多规格
if(skuDTO.getSpecificationType() == SpecificationTypeEnum.MULTI.getValue()){ if(skuDTO.getSpecificationType() == SpecificationTypeEnum.MULTI.getValue()){
specHeaderSet.addAll(specList); specHeaderSet.addAll(specList);
...@@ -136,9 +118,8 @@ public class ProductManagerSkuBatchUpdateExportService { ...@@ -136,9 +118,8 @@ public class ProductManagerSkuBatchUpdateExportService {
/** /**
* 处理适用区域信息 * 处理适用区域信息
* @param skuDTO * @param skuDTO
* @param districtMap
*/ */
private void solveAreaInfo(GoodsSkuDTO skuDTO, Map<String, District> districtMap) { private void solveAreaInfo(GoodsSkuDTO skuDTO) {
if(CollectionUtils.isEmpty(skuDTO.getUpgradeGoodsAreaList())){ if(CollectionUtils.isEmpty(skuDTO.getUpgradeGoodsAreaList())){
return; return;
} }
...@@ -148,7 +129,7 @@ public class ProductManagerSkuBatchUpdateExportService { ...@@ -148,7 +129,7 @@ public class ProductManagerSkuBatchUpdateExportService {
}else { }else {
StringJoiner sj = new StringJoiner("/"); StringJoiner sj = new StringJoiner("/");
areaMap.forEach((code, list) -> { areaMap.forEach((code, list) -> {
District district = districtMap.get(code); District district = cityCodeMap.get(code);
if (Objects.nonNull(district)) { if (Objects.nonNull(district)) {
if (list.size() == district.getDistricts().size()) { if (list.size() == district.getDistricts().size()) {
sj.add(district.getName()); sj.add(district.getName());
...@@ -206,6 +187,7 @@ public class ProductManagerSkuBatchUpdateExportService { ...@@ -206,6 +187,7 @@ public class ProductManagerSkuBatchUpdateExportService {
.operationCoefficient(toPlainString(skuDTO.getOperationCoefficient())) .operationCoefficient(toPlainString(skuDTO.getOperationCoefficient()))
.operationCost(toPlainString(skuDTO.getOperationCost())) .operationCost(toPlainString(skuDTO.getOperationCost()))
.applicableArea(skuDTO.getApplicableArea()) .applicableArea(skuDTO.getApplicableArea())
.providerName(skuDTO.getProviderName())
.remark(skuDTO.getRemark()) .remark(skuDTO.getRemark())
.build(); .build();
} }
...@@ -239,6 +221,7 @@ public class ProductManagerSkuBatchUpdateExportService { ...@@ -239,6 +221,7 @@ public class ProductManagerSkuBatchUpdateExportService {
.operationCoefficient(toPlainString(skuDTO.getOperationCoefficient())) .operationCoefficient(toPlainString(skuDTO.getOperationCoefficient()))
.operationCost(toPlainString(skuDTO.getOperationCost())) .operationCost(toPlainString(skuDTO.getOperationCost()))
.applicableArea(skuDTO.getApplicableArea()) .applicableArea(skuDTO.getApplicableArea())
.providerName(skuDTO.getProviderName())
.remark(skuDTO.getRemark()) .remark(skuDTO.getRemark())
.build(); .build();
} }
...@@ -305,7 +288,8 @@ public class ProductManagerSkuBatchUpdateExportService { ...@@ -305,7 +288,8 @@ public class ProductManagerSkuBatchUpdateExportService {
writeNumberOrTextCell(row, 9, data.getOperationCoefficient()); writeNumberOrTextCell(row, 9, data.getOperationCoefficient());
writeFormulaCell(row, 10, "I" + (rowIndex + 1) + "*J" + (rowIndex + 1), data.getOperationCost()); writeFormulaCell(row, 10, "I" + (rowIndex + 1) + "*J" + (rowIndex + 1), data.getOperationCost());
writeTextCell(row, 11, data.getApplicableArea()); writeTextCell(row, 11, data.getApplicableArea());
writeTextCell(row, 12, data.getRemark()); writeTextCell(row,12,data.getProviderName());
writeTextCell(row, 13, data.getRemark());
rowIndex++; rowIndex++;
} }
mergeSpuCodeColumn(sheet, SINGLE_DATA_START_ROW_INDEX, mergeSpuCodeColumn(sheet, SINGLE_DATA_START_ROW_INDEX,
...@@ -351,7 +335,8 @@ public class ProductManagerSkuBatchUpdateExportService { ...@@ -351,7 +335,8 @@ public class ProductManagerSkuBatchUpdateExportService {
getExcelColumnName(fixedStart + 6) + (rowIndex + 1) + "*" + getExcelColumnName(fixedStart + 7) + (rowIndex + 1), getExcelColumnName(fixedStart + 6) + (rowIndex + 1) + "*" + getExcelColumnName(fixedStart + 7) + (rowIndex + 1),
data.getOperationCost()); data.getOperationCost());
writeTextCell(row, fixedStart + 9, data.getApplicableArea()); writeTextCell(row, fixedStart + 9, data.getApplicableArea());
writeTextCell(row, fixedStart + 10, data.getRemark()); writeTextCell(row, fixedStart + 10, data.getProviderName());
writeTextCell(row, fixedStart + 11, data.getRemark());
rowIndex++; rowIndex++;
} }
mergeSpuCodeColumn(sheet, MULTI_DATA_START_ROW_INDEX, mergeSpuCodeColumn(sheet, MULTI_DATA_START_ROW_INDEX,
...@@ -800,6 +785,7 @@ public class ProductManagerSkuBatchUpdateExportService { ...@@ -800,6 +785,7 @@ public class ProductManagerSkuBatchUpdateExportService {
private String operationCoefficient; private String operationCoefficient;
private String operationCost; private String operationCost;
private String applicableArea; private String applicableArea;
private String providerName;
private String remark; private String remark;
} }
...@@ -820,6 +806,7 @@ public class ProductManagerSkuBatchUpdateExportService { ...@@ -820,6 +806,7 @@ public class ProductManagerSkuBatchUpdateExportService {
private String operationCoefficient; private String operationCoefficient;
private String operationCost; private String operationCost;
private String applicableArea; private String applicableArea;
private String providerName;
private String remark; private String remark;
} }
......
...@@ -45,8 +45,7 @@ public class SkuBatchAddImportService extends AbstractSkuBatchImportExcelHandle< ...@@ -45,8 +45,7 @@ public class SkuBatchAddImportService extends AbstractSkuBatchImportExcelHandle<
List<SkuBatchImportVo> list, SkuBatchImportVo importVo) { List<SkuBatchImportVo> list, SkuBatchImportVo importVo) {
importVo.setSelfError(true); importVo.setSelfError(true);
String errMsg = validateRow(importVo); String errMsg = validateRow(importVo);
// GoodsMixDTO goodsMixDTO = new GoodsMixDTO(); //查询 SPU 信息(带本地缓存)
//查询 SPU 信息(带本地缓存)
Map<String, GoodsMixDTO> cacheMap = spuLocalMap.get(); Map<String, GoodsMixDTO> cacheMap = spuLocalMap.get();
GoodsMixDTO goodsMixDTO = cacheMap.get(importVo.getCommodityCode()); GoodsMixDTO goodsMixDTO = cacheMap.get(importVo.getCommodityCode());
...@@ -59,14 +58,10 @@ public class SkuBatchAddImportService extends AbstractSkuBatchImportExcelHandle< ...@@ -59,14 +58,10 @@ public class SkuBatchAddImportService extends AbstractSkuBatchImportExcelHandle<
cacheMap.put(importVo.getCommodityCode(), goodsMixDTO); cacheMap.put(importVo.getCommodityCode(), goodsMixDTO);
} }
//目前只支持轻改 //目前只支持轻改
List<Integer> extendedInsuranceTypeIdList = CommonUtil.convert2Integer(OrePropertyConfigurer.getString("smartcarlife.goodsType.extendedInsurance", "155").split(","));//延保类
List<Integer> equityTypeIdList = CommonUtil.convert2Integer(OrePropertyConfigurer.getString("smartcarlife.goodsType.equity", "104,126").split(","));//权益类
Integer goodsType = goodsMixDTO.getGoodsInfo().getGoodsType(); Integer goodsType = goodsMixDTO.getGoodsInfo().getGoodsType();
if(extendedInsuranceTypeIdList.contains(goodsType) || equityTypeIdList.contains(goodsType)){ if(checkGoodsType(goodsType)){
return RopResponse.error("只支持导入轻改类目"); return RopResponse.error("只支持导入轻改类目");
} }
if(StringUtils.isNotBlank(errMsg)){ if(StringUtils.isNotBlank(errMsg)){
return RopResponse.error(errMsg); return RopResponse.error(errMsg);
} }
......
...@@ -87,11 +87,8 @@ public class SkuBatchUpdateImportService extends AbstractSkuBatchImportExcelHand ...@@ -87,11 +87,8 @@ public class SkuBatchUpdateImportService extends AbstractSkuBatchImportExcelHand
return RopResponse.error("该产品ID(SKU)不存在"); return RopResponse.error("该产品ID(SKU)不存在");
} }
//目前只支持轻改 //目前只支持轻改
List<Integer> extendedInsuranceTypeIdList = CommonUtil.convert2Integer(OrePropertyConfigurer.getString("smartcarlife.goodsType.extendedInsurance", "155").split(","));//延保类
List<Integer> equityTypeIdList = CommonUtil.convert2Integer(OrePropertyConfigurer.getString("smartcarlife.goodsType.equity", "104,126").split(","));//权益类
Integer goodsType = goodsMixDTO.getGoodsInfo().getGoodsType(); Integer goodsType = goodsMixDTO.getGoodsInfo().getGoodsType();
if(extendedInsuranceTypeIdList.contains(goodsType) || equityTypeIdList.contains(goodsType)){ if(checkGoodsType(goodsType)){
return RopResponse.error("只支持导入轻改类目"); return RopResponse.error("只支持导入轻改类目");
} }
importVo.setUpgradeId(upgradeGoodsDTO.getId()); importVo.setUpgradeId(upgradeGoodsDTO.getId());
...@@ -162,6 +159,7 @@ public class SkuBatchUpdateImportService extends AbstractSkuBatchImportExcelHand ...@@ -162,6 +159,7 @@ public class SkuBatchUpdateImportService extends AbstractSkuBatchImportExcelHand
goodsDTO.setRemark(skuBatchImportVo.getRemark()); goodsDTO.setRemark(skuBatchImportVo.getRemark());
goodsDTO.setOperationCost(operationCost); goodsDTO.setOperationCost(operationCost);
goodsDTO.setOperationCoefficient(new BigDecimal(skuBatchImportVo.getOperationCoefficient())); goodsDTO.setOperationCoefficient(new BigDecimal(skuBatchImportVo.getOperationCoefficient()));
goodsDTO.setProviderIds(skuBatchImportVo.getProviderIds());
if(StringUtils.isBlank(goodsDTO.getType())){ if(StringUtils.isBlank(goodsDTO.getType())){
goodsDTO.setType(skuBatchImportVo.getType()); goodsDTO.setType(skuBatchImportVo.getType());
} }
...@@ -270,6 +268,7 @@ public class SkuBatchUpdateImportService extends AbstractSkuBatchImportExcelHand ...@@ -270,6 +268,7 @@ public class SkuBatchUpdateImportService extends AbstractSkuBatchImportExcelHand
@Override @Override
public void clearImportCache() { public void clearImportCache() {
super.clearImportCache();
spuLocalMap.get().clear(); spuLocalMap.get().clear();
spuLocalMap.remove(); spuLocalMap.remove();
skuLocalMap.get().clear(); skuLocalMap.get().clear();
......
...@@ -150,12 +150,8 @@ public class SpuSkuBatchAddImportService extends AbstractSkuBatchImportExcelHand ...@@ -150,12 +150,8 @@ public class SpuSkuBatchAddImportService extends AbstractSkuBatchImportExcelHand
if (StringUtils.isNotBlank(errMsg)) { if (StringUtils.isNotBlank(errMsg)) {
return RopResponse.error(errMsg); return RopResponse.error(errMsg);
} }
//目前只支持轻改
List<Integer> extendedInsuranceTypeIdList = CommonUtil.convert2Integer(OrePropertyConfigurer.getString("smartcarlife.goodsType.extendedInsurance", "155").split(","));//延保类
List<Integer> equityTypeIdList = CommonUtil.convert2Integer(OrePropertyConfigurer.getString("smartcarlife.goodsType.equity", "104,126").split(","));//权益类
Integer goodsType = importVo.getGoodsType(); Integer goodsType = importVo.getGoodsType();
if(extendedInsuranceTypeIdList.contains(goodsType) || equityTypeIdList.contains(goodsType)){ if(checkGoodsType(goodsType)){
return RopResponse.error("只支持导入轻改类目"); return RopResponse.error("只支持导入轻改类目");
} }
importVo.setSelfError(false); importVo.setSelfError(false);
...@@ -174,13 +170,6 @@ public class SpuSkuBatchAddImportService extends AbstractSkuBatchImportExcelHand ...@@ -174,13 +170,6 @@ public class SpuSkuBatchAddImportService extends AbstractSkuBatchImportExcelHand
return RopResponse.success(null); return RopResponse.success(null);
} }
// String groupErrMsg = validateGroup(groupList);
// if (StringUtils.isNotBlank(groupErrMsg)) {
// return RopResponse.error(groupErrMsg);
// }
//供应方信息 //供应方信息
String code = SupplierMap.get().get(importVo.getSupplierName()); String code = SupplierMap.get().get(importVo.getSupplierName());
if(StringUtils.isBlank(code)){ if(StringUtils.isBlank(code)){
...@@ -188,16 +177,7 @@ public class SpuSkuBatchAddImportService extends AbstractSkuBatchImportExcelHand ...@@ -188,16 +177,7 @@ public class SpuSkuBatchAddImportService extends AbstractSkuBatchImportExcelHand
}else { }else {
importVo.setSupplierCode(code); importVo.setSupplierCode(code);
} }
//处理供应商数据
RpcResponse<GoodsProvider> rpcResponse = goodsProviderRemote.getByProviderName(importVo.getProviderName());
if(!rpcResponse.hasResult()){
return RopResponse.error("查询供应商信息为空");
}
if(Objects.isNull(rpcResponse.getResult())){
return RopResponse.error("查询供应商信息为空");
}
GoodsInfoDTO goodsInfo = buildGoodsInfo(importVo); GoodsInfoDTO goodsInfo = buildGoodsInfo(importVo);
goodsInfo.setProviderId(rpcResponse.getResult().getId());
// 构建规格列表 // 构建规格列表
List<GoodsSpecificationNameDTO> specificationList = buildSpecificationList(groupList, importVo.getSpecType()); List<GoodsSpecificationNameDTO> specificationList = buildSpecificationList(groupList, importVo.getSpecType());
...@@ -229,7 +209,8 @@ public class SpuSkuBatchAddImportService extends AbstractSkuBatchImportExcelHand ...@@ -229,7 +209,8 @@ public class SpuSkuBatchAddImportService extends AbstractSkuBatchImportExcelHand
throw new RpcServiceException("查询供应方信息异常为空"); throw new RpcServiceException("查询供应方信息异常为空");
} }
responseResult.forEach( dto->{ responseResult.forEach( dto->{
SupplierMap.get().put(dto.getRelatedPartyName(),dto.getRelatedPartyCode()); //使用id作为关联关系
SupplierMap.get().put(dto.getRelatedPartyName(), String.valueOf(dto.getId()));
}); });
} }
...@@ -436,11 +417,6 @@ public class SpuSkuBatchAddImportService extends AbstractSkuBatchImportExcelHand ...@@ -436,11 +417,6 @@ public class SpuSkuBatchAddImportService extends AbstractSkuBatchImportExcelHand
if (StringUtils.isBlank(importVo.getSupplierName())) { if (StringUtils.isBlank(importVo.getSupplierName())) {
errMsg.append("供应方不能为空;"); errMsg.append("供应方不能为空;");
} }
if (StringUtils.isBlank(importVo.getProviderName())) {
errMsg.append("供应商不能为空;");
} else {
importVo.setBrandMerchantName(importVo.getProviderName());
}
if (StringUtils.isBlank(importVo.getAccessoryTypeStr())) { if (StringUtils.isBlank(importVo.getAccessoryTypeStr())) {
errMsg.append("配件性质不能为空;"); errMsg.append("配件性质不能为空;");
} else { } else {
...@@ -487,7 +463,6 @@ public class SpuSkuBatchAddImportService extends AbstractSkuBatchImportExcelHand ...@@ -487,7 +463,6 @@ public class SpuSkuBatchAddImportService extends AbstractSkuBatchImportExcelHand
.thirdLevelGoodsTypeName(importVo.getThirdLevelGoodsTypeName()) .thirdLevelGoodsTypeName(importVo.getThirdLevelGoodsTypeName())
.supplierName(importVo.getSupplierName()) .supplierName(importVo.getSupplierName())
.supplierCode(importVo.getSupplierCode()) .supplierCode(importVo.getSupplierCode())
.providerName(importVo.getProviderName())
.thumbUrl(env.getProperty("export.spu.default.image.url")) .thumbUrl(env.getProperty("export.spu.default.image.url"))
.goodsSource(GoodsSource.DJ.getValue()) .goodsSource(GoodsSource.DJ.getValue())
.accessoryType(importVo.getAccessoryType()) .accessoryType(importVo.getAccessoryType())
......
package cn.com.glsx.dj.smartcarlife.util.excel; package cn.com.glsx.dj.smartcarlife.util.excel;
import cn.com.glsx.dj.smartcarlife.constant.CommonConstants;
import cn.com.glsx.dj.smartcarlife.dto.*; import cn.com.glsx.dj.smartcarlife.dto.*;
import cn.com.glsx.dj.smartcarlife.dto.goods.ProductManagerAddOrUpdateDTO; import cn.com.glsx.dj.smartcarlife.dto.goods.ProductManagerAddOrUpdateDTO;
import cn.com.glsx.dj.smartcarlife.dto.goods.UpgradeGoodsAreaDTO; import cn.com.glsx.dj.smartcarlife.dto.goods.UpgradeGoodsAreaDTO;
import cn.com.glsx.dj.smartcarlife.enums.PriceUnitEnum; import cn.com.glsx.dj.smartcarlife.enums.PriceUnitEnum;
import cn.com.glsx.dj.smartcarlife.enums.SpecificationTypeEnum; import cn.com.glsx.dj.smartcarlife.enums.SpecificationTypeEnum;
import cn.com.glsx.dj.smartcarlife.model.GoodsProvider;
import cn.com.glsx.dj.smartcarlife.model.GoodsSpecificationValue; import cn.com.glsx.dj.smartcarlife.model.GoodsSpecificationValue;
import cn.com.glsx.dj.smartcarlife.model.UpgradeGoodsArea;
import cn.com.glsx.dj.smartcarlife.remote.BaseGoodsRemote; import cn.com.glsx.dj.smartcarlife.remote.BaseGoodsRemote;
import cn.com.glsx.dj.smartcarlife.remote.GoodsProviderRemote;
import cn.com.glsx.dj.smartcarlife.remote.ProductManagerRemote; import cn.com.glsx.dj.smartcarlife.remote.ProductManagerRemote;
import cn.com.glsx.dj.smartcarlife.request.common.SingleUploadRequest; import cn.com.glsx.dj.smartcarlife.request.common.SingleUploadRequest;
import cn.com.glsx.dj.smartcarlife.response.common.CountryOrProvinceData;
import cn.com.glsx.dj.smartcarlife.response.common.District; import cn.com.glsx.dj.smartcarlife.response.common.District;
import cn.com.glsx.dj.smartcarlife.util.CommonUtil; import cn.com.glsx.dj.smartcarlife.util.CommonUtil;
import cn.com.glsx.dj.smartcarlife.vo.excel.goods.SkuBatchAddImportErrorVo; import cn.com.glsx.dj.smartcarlife.vo.excel.goods.SkuBatchAddImportErrorVo;
...@@ -19,25 +18,23 @@ import cn.com.glsx.dj.smartcarlife.vo.excel.goods.SkuBatchImportVo; ...@@ -19,25 +18,23 @@ import cn.com.glsx.dj.smartcarlife.vo.excel.goods.SkuBatchImportVo;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse; import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum; import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException; import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.alibaba.excel.EasyExcelFactory; import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.enums.CellExtraTypeEnum; import com.alibaba.excel.enums.CellExtraTypeEnum;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson; import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;
import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.ss.util.CellRangeAddress;
import org.oreframework.boot.env.OrePropertyConfigurer;
import org.oreframework.commons.office.easyexcel.EasyExcelImportResult; import org.oreframework.commons.office.easyexcel.EasyExcelImportResult;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import javax.annotation.PostConstruct;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.InputStream; import java.io.InputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -62,46 +59,17 @@ public abstract class AbstractSkuBatchImportExcelHandle<T extends SkuBatchImport ...@@ -62,46 +59,17 @@ public abstract class AbstractSkuBatchImportExcelHandle<T extends SkuBatchImport
public BaseGoodsRemote baseGoodsRemote; public BaseGoodsRemote baseGoodsRemote;
@Autowired @Autowired
private Environment env; public GoodsProviderRemote goodsProviderRemote;
//provinceName,dto @Autowired
private final Map<String, District> provinceMap = new HashMap<>(); @Qualifier("provinceMap")
private Map<String, District> provinceMap;
//cityName,pair[cityCode,pair[provinceCode,provinceName]]
private final Map<String, Pair<String, Pair<String,String>>> cityCodeMap = new HashMap<>();
// protected abstract List<String> getFixColumns();
@PostConstruct
public void initCityCodeMap() {
try {
log.info("开始加载城市编码信息...");
String url = env.getProperty("map.districts.url", CommonConstants.BAIDU_MAP_API_URL);
String keyword = "中国";
int subAdmin = 2;
String apiUrl = String.format(url, keyword, subAdmin);
ResponseEntity<String> response = new RestTemplate().getForEntity(apiUrl, String.class);
if (!response.getStatusCode().is2xxSuccessful()) {
log.error("查询地图区域省市二级树结构失败,返回值:{}", response);
return;
}
Gson gson = new Gson();
CountryOrProvinceData responseData = gson.fromJson(response.getBody(), CountryOrProvinceData.class);
if (responseData == null || CollectionUtils.isEmpty(responseData.getDistricts())) {
log.warn("未获取到城市编码数据");
return;
}
buildCityCodeMap(responseData.getDistricts());
log.info("城市编码信息加载完成,共{}条数据", cityCodeMap.size());
} catch (Exception e) {
log.error("加载城市编码信息异常", e);
}
}
@Autowired
@Qualifier("cityNameMap")
private Map<String, Pair<String, Pair<String,String>>> cityNameMap;
private final ThreadLocal<Map<String, Integer>> providerCacheMap = ThreadLocal.withInitial(HashMap::new);
/** /**
* 获取单规格表头行 * 获取单规格表头行
* @return * @return
...@@ -118,41 +86,6 @@ public abstract class AbstractSkuBatchImportExcelHandle<T extends SkuBatchImport ...@@ -118,41 +86,6 @@ public abstract class AbstractSkuBatchImportExcelHandle<T extends SkuBatchImport
return MULTI_SPEC_HEAD_ROW; return MULTI_SPEC_HEAD_ROW;
}; };
private void buildCityCodeMap(List<District> districts) {
District countryDistrict = districts.get(0);
// 过滤只保留level=1(省)和level=2(市)的数据,去掉第一层(level=0的中国)
if (countryDistrict.getDistricts() != null) {
for (District district : countryDistrict.getDistricts()) {
if (district.getLevel() == 1) { // 省级
District province = new District();
province.setCode(district.getCode());
province.setName(district.getName());
province.setLevel(district.getLevel());
// 过滤出市级数据(level=2)
List<District> cityList = new ArrayList<>();
if (district.getDistricts() != null) {
for (District city : district.getDistricts()) {
if (city.getLevel() == 2) { // 市级
// 移除市的下级区域(区县级)
District cityCopy = new District();
cityCopy.setCode(city.getCode());
cityCopy.setName(city.getName());
cityCopy.setLevel(city.getLevel());
cityCopy.setDistricts(null); // 不保留区县级数据
cityList.add(cityCopy);
cityCodeMap.put(city.getName(),Pair.of(city.getCode(),Pair.of(province.getCode(),province.getName())));
}
}
}
province.setDistricts(cityList);
provinceMap.put(province.getName(),province);
}
}
}
}
@Override @Override
public EasyExcelImportResult<T> readExcel(SingleUploadRequest request) { public EasyExcelImportResult<T> readExcel(SingleUploadRequest request) {
byte[] content = request.getFile().getContent(); byte[] content = request.getFile().getContent();
...@@ -302,6 +235,28 @@ public abstract class AbstractSkuBatchImportExcelHandle<T extends SkuBatchImport ...@@ -302,6 +235,28 @@ public abstract class AbstractSkuBatchImportExcelHandle<T extends SkuBatchImport
errMsg.append("运营系数不能为空;"); errMsg.append("运营系数不能为空;");
} }
if (StringUtils.isBlank(importVo.getProviderName())) {
errMsg.append("供应商不能为空;");
} else {
List<String> providerNameList = Arrays.stream(importVo.getProviderName().split("/"))
.distinct()
.filter(StringUtils::isNotBlank)
.collect(Collectors.toList());
importVo.setProviderName(importVo.getProviderName());
if (providerNameList.isEmpty()) {
errMsg.append("供应商不能为空;");
}
List<Integer> providerIds = new ArrayList<>();
for (String providerName : providerNameList) {
Integer providerId = validateAndGetProviderId(providerName.trim());
if (providerId == null) {
errMsg.append("供应商[").append(providerName).append("]查询失败或添加异常;");
}else {
providerIds.add(providerId);
}
}
importVo.setProviderIds(providerIds);
}
if(importVo.getSpecType() == SpecificationTypeEnum.MULTI.getValue()){ if(importVo.getSpecType() == SpecificationTypeEnum.MULTI.getValue()){
if(importVo.getSpecValues().isEmpty()){ if(importVo.getSpecValues().isEmpty()){
...@@ -329,7 +284,7 @@ public abstract class AbstractSkuBatchImportExcelHandle<T extends SkuBatchImport ...@@ -329,7 +284,7 @@ public abstract class AbstractSkuBatchImportExcelHandle<T extends SkuBatchImport
if(!areaList.contains("全国")){ if(!areaList.contains("全国")){
areaList.forEach(area ->{ areaList.forEach(area ->{
//先匹配市 //先匹配市
if(Objects.isNull(cityCodeMap.get(area))){ if(Objects.isNull(cityNameMap.get(area))){
//匹配省 //匹配省
District district = provinceMap.get(area); District district = provinceMap.get(area);
if(Objects.isNull(district)){ if(Objects.isNull(district)){
...@@ -347,6 +302,77 @@ public abstract class AbstractSkuBatchImportExcelHandle<T extends SkuBatchImport ...@@ -347,6 +302,77 @@ public abstract class AbstractSkuBatchImportExcelHandle<T extends SkuBatchImport
return errMsg.length() > 0 ? errMsg.toString() : ""; return errMsg.length() > 0 ? errMsg.toString() : "";
} }
/**
* 商品类目校验
* @param goodsType
* @return
*/
public boolean checkGoodsType(Integer goodsType){
//目前只支持轻改
List<Integer> extendedInsuranceTypeIdList = CommonUtil.convert2Integer(OrePropertyConfigurer.getString("smartcarlife.goodsType.extendedInsurance", "155").split(","));//延保类
List<Integer> equityTypeIdList = CommonUtil.convert2Integer(OrePropertyConfigurer.getString("smartcarlife.goodsType.equity", "104,126").split(","));//权益类
return extendedInsuranceTypeIdList.contains(goodsType) || equityTypeIdList.contains(goodsType);
}
/**
* 校验并获取供应商ID(带缓存)
* @param providerName 供应商名称
* @return 供应商ID,如果校验失败返回null
*/
public Integer validateAndGetProviderId(String providerName) {
if (StringUtils.isBlank(providerName)) {
return null;
}
Map<String, Integer> cacheMap = providerCacheMap.get();
if (cacheMap.containsKey(providerName)) {
return cacheMap.get(providerName);
}
RpcResponse<GoodsProvider> rpcResponse = goodsProviderRemote.getByProviderName(providerName);
if (Objects.isNull(rpcResponse)) {
log.warn("查询供应商信息异常: {}", providerName);
return null;
}
GoodsProvider goodsProvider = rpcResponse.getResult();
if (Objects.isNull(goodsProvider)) {
log.info("供应商不存在,开始创建: {}", providerName);
goodsProvider = createNewProvider(providerName);
if (goodsProvider == null || goodsProvider.getId() == null) {
log.error("创建供应商失败: {}", providerName);
return null;
}
log.info("供应商创建成功: {}, ID: {}", providerName, goodsProvider.getId());
}
cacheMap.put(providerName, goodsProvider.getId());
return goodsProvider.getId();
}
/**
* 创建新供应商
* @param providerName 供应商名称
* @return 创建后的供应商对象,失败返回null
*/
private GoodsProvider createNewProvider(String providerName) {
try {
GoodsProvider newProvider = new GoodsProvider();
newProvider.setProviderName(providerName);
newProvider.setUpdatedBy("system");
RpcResponse<GoodsProvider> insertResponse = goodsProviderRemote.insert(newProvider);
if (!insertResponse.hasResult()) {
log.error("创建供应商失败: {}, 错误信息: {}", providerName, insertResponse.getMessage());
return null;
}
return insertResponse.getResult();
} catch (Exception e) {
log.error("创建供应商异常: {}", providerName, e);
return null;
}
}
@Override @Override
public String exportErrorExcel(List<K> exportVos, public String exportErrorExcel(List<K> exportVos,
...@@ -446,7 +472,7 @@ public abstract class AbstractSkuBatchImportExcelHandle<T extends SkuBatchImport ...@@ -446,7 +472,7 @@ public abstract class AbstractSkuBatchImportExcelHandle<T extends SkuBatchImport
Map<String,UpgradeGoodsAreaDTO> areaDTOMap = new HashMap<>(); Map<String,UpgradeGoodsAreaDTO> areaDTOMap = new HashMap<>();
areaList.forEach(area ->{ areaList.forEach(area ->{
//先匹配市 //先匹配市
Pair<String, Pair<String,String>> pair = cityCodeMap.get(area); Pair<String, Pair<String,String>> pair = cityNameMap.get(area);
if(Objects.isNull(pair)){ if(Objects.isNull(pair)){
//匹配省 //匹配省
District district = provinceMap.get(area); District district = provinceMap.get(area);
...@@ -503,6 +529,7 @@ public abstract class AbstractSkuBatchImportExcelHandle<T extends SkuBatchImport ...@@ -503,6 +529,7 @@ public abstract class AbstractSkuBatchImportExcelHandle<T extends SkuBatchImport
.upgradeGoodsAreaList(areaDTOS) .upgradeGoodsAreaList(areaDTOS)
.remark(skuImportVo.getRemark()) .remark(skuImportVo.getRemark())
.specificationNameSequence(skuImportVo.getSpecificationNameSequence()) .specificationNameSequence(skuImportVo.getSpecificationNameSequence())
.providerIds(skuImportVo.getProviderIds())
.build(); .build();
} }
...@@ -665,4 +692,11 @@ public abstract class AbstractSkuBatchImportExcelHandle<T extends SkuBatchImport ...@@ -665,4 +692,11 @@ public abstract class AbstractSkuBatchImportExcelHandle<T extends SkuBatchImport
return needCover; return needCover;
} }
@Override
public void clearImportCache() {
super.clearImportCache();
providerCacheMap.get().clear();
providerCacheMap.remove();
}
} }
...@@ -3,6 +3,7 @@ package cn.com.glsx.dj.smartcarlife.util.excel; ...@@ -3,6 +3,7 @@ package cn.com.glsx.dj.smartcarlife.util.excel;
import cn.com.glsx.dj.smartcarlife.enums.SpecificationTypeEnum; import cn.com.glsx.dj.smartcarlife.enums.SpecificationTypeEnum;
import cn.com.glsx.dj.smartcarlife.vo.excel.goods.SkuBatchImportVo; import cn.com.glsx.dj.smartcarlife.vo.excel.goods.SkuBatchImportVo;
import cn.com.glsx.dj.smartcarlife.vo.excel.goods.SpuSkuBatchAddImportVo;
import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.enums.CellExtraTypeEnum; import com.alibaba.excel.enums.CellExtraTypeEnum;
import com.alibaba.excel.event.AnalysisEventListener; import com.alibaba.excel.event.AnalysisEventListener;
...@@ -25,7 +26,7 @@ public abstract class SkuBatchEventListener<T extends SkuBatchImportVo> extends ...@@ -25,7 +26,7 @@ public abstract class SkuBatchEventListener<T extends SkuBatchImportVo> extends
public static final List<String> FIXED_COLUMN_NAMES = Arrays.asList( public static final List<String> FIXED_COLUMN_NAMES = Arrays.asList(
"产品ID(SPU)","产品ID(SKU)","产品编码", "产品名称", "供应商名称", "供应商编码", "产品ID(SPU)","产品ID(SKU)","产品编码", "产品名称", "供应商名称", "供应商编码",
"计价单位", "质保时间/年", "采购成本/元", "运营系数", "运营成本/元", "适用区域", "备注" "计价单位", "质保时间/年", "采购成本/元", "运营系数", "运营成本/元", "适用区域","供应商", "备注"
); );
protected final List<T> originDataList = new ArrayList<>(); protected final List<T> originDataList = new ArrayList<>();
...@@ -227,6 +228,7 @@ public abstract class SkuBatchEventListener<T extends SkuBatchImportVo> extends ...@@ -227,6 +228,7 @@ public abstract class SkuBatchEventListener<T extends SkuBatchImportVo> extends
map.put("运营系数", SkuBatchImportVo::setOperationCoefficient); map.put("运营系数", SkuBatchImportVo::setOperationCoefficient);
map.put("运营成本/元", SkuBatchImportVo::setOperationCost); map.put("运营成本/元", SkuBatchImportVo::setOperationCost);
map.put("适用区域", SkuBatchImportVo::setApplicableArea); map.put("适用区域", SkuBatchImportVo::setApplicableArea);
map.put("供应商", SkuBatchImportVo::setProviderName);
map.put("备注", SkuBatchImportVo::setRemark); map.put("备注", SkuBatchImportVo::setRemark);
} }
......
...@@ -11,7 +11,7 @@ import java.util.function.BiConsumer; ...@@ -11,7 +11,7 @@ import java.util.function.BiConsumer;
public class SpuSkuBatchAddMultiReadListener extends SkuBatchMultiSpecReadListener<SpuSkuBatchAddImportVo> { public class SpuSkuBatchAddMultiReadListener extends SkuBatchMultiSpecReadListener<SpuSkuBatchAddImportVo> {
private static final Set<String> MERGE_FILL_COLUMNS = new LinkedHashSet<>(Arrays.asList( private static final Set<String> MERGE_FILL_COLUMNS = new LinkedHashSet<>(Arrays.asList(
"产品名称(SPU)", "类目", "供应方", "供应商", "比例换算", "配件性质", "缩略图","产品名称" "产品名称(SPU)", "类目", "供应方", "比例换算", "配件性质", "缩略图","产品名称"
)); ));
public static final List<String> FIXED_COLUMN_NAMES_VO = new ArrayList<>(); public static final List<String> FIXED_COLUMN_NAMES_VO = new ArrayList<>();
...@@ -27,14 +27,13 @@ public class SpuSkuBatchAddMultiReadListener extends SkuBatchMultiSpecReadListen ...@@ -27,14 +27,13 @@ public class SpuSkuBatchAddMultiReadListener extends SkuBatchMultiSpecReadListen
FIELD_SETTER_MAP.put("产品名称(SPU)", SpuSkuBatchAddImportVo::setProductGoodsName); FIELD_SETTER_MAP.put("产品名称(SPU)", SpuSkuBatchAddImportVo::setProductGoodsName);
FIELD_SETTER_MAP.put("类目", SpuSkuBatchAddImportVo::setGoodsTypeName); FIELD_SETTER_MAP.put("类目", SpuSkuBatchAddImportVo::setGoodsTypeName);
FIELD_SETTER_MAP.put("供应方", SpuSkuBatchAddImportVo::setSupplierName); FIELD_SETTER_MAP.put("供应方", SpuSkuBatchAddImportVo::setSupplierName);
FIELD_SETTER_MAP.put("供应商", SpuSkuBatchAddImportVo::setProviderName);
FIELD_SETTER_MAP.put("比例换算", SpuSkuBatchAddImportVo::setConvertedValue); FIELD_SETTER_MAP.put("比例换算", SpuSkuBatchAddImportVo::setConvertedValue);
FIELD_SETTER_MAP.put("配件性质", SpuSkuBatchAddImportVo::setAccessoryTypeStr); FIELD_SETTER_MAP.put("配件性质", SpuSkuBatchAddImportVo::setAccessoryTypeStr);
FIELD_SETTER_MAP.put("缩略图", SpuSkuBatchAddImportVo::setThumbUrl); FIELD_SETTER_MAP.put("缩略图", SpuSkuBatchAddImportVo::setThumbUrl);
FIELD_SETTER_MAP.put("产品名称", SpuSkuBatchAddImportVo::setBaseGoodsName); FIELD_SETTER_MAP.put("产品名称", SpuSkuBatchAddImportVo::setBaseGoodsName);
// //
FIXED_COLUMN_NAMES_VO.addAll(FIXED_COLUMN_NAMES); FIXED_COLUMN_NAMES_VO.addAll(FIXED_COLUMN_NAMES);
FIXED_COLUMN_NAMES_VO.addAll(Lists.newArrayList("产品名称(SPU)","类目","供应方","供应商","比例换算","配件性质","缩略图")); FIXED_COLUMN_NAMES_VO.addAll(Lists.newArrayList("产品名称(SPU)","类目","供应方","比例换算","配件性质","缩略图"));
} }
...@@ -78,18 +77,15 @@ public class SpuSkuBatchAddMultiReadListener extends SkuBatchMultiSpecReadListen ...@@ -78,18 +77,15 @@ public class SpuSkuBatchAddMultiReadListener extends SkuBatchMultiSpecReadListen
vo.setSupplierName(firstRowVo.getSupplierName()); vo.setSupplierName(firstRowVo.getSupplierName());
break; break;
case 3: case 3:
vo.setProviderName(firstRowVo.getProviderName());
break;
case 4:
vo.setConvertedValue(firstRowVo.getConvertedValue()); vo.setConvertedValue(firstRowVo.getConvertedValue());
break; break;
case 5: case 4:
vo.setThumbUrl(firstRowVo.getThumbUrl()); vo.setThumbUrl(firstRowVo.getThumbUrl());
break; break;
case 6: case 5:
vo.setAccessoryTypeStr(firstRowVo.getAccessoryTypeStr()); vo.setAccessoryTypeStr(firstRowVo.getAccessoryTypeStr());
break; break;
case 7: case 6:
vo.setBaseGoodsName(firstRowVo.getBaseGoodsName()); vo.setBaseGoodsName(firstRowVo.getBaseGoodsName());
break; break;
default: default:
......
...@@ -19,7 +19,7 @@ import java.util.function.BiConsumer; ...@@ -19,7 +19,7 @@ import java.util.function.BiConsumer;
public class SpuSkuBatchAddSingleReadListener extends SkuBatchSingleReadListener<SpuSkuBatchAddImportVo> { public class SpuSkuBatchAddSingleReadListener extends SkuBatchSingleReadListener<SpuSkuBatchAddImportVo> {
private static final Set<String> MERGE_FILL_COLUMNS = new LinkedHashSet<>(Arrays.asList( private static final Set<String> MERGE_FILL_COLUMNS = new LinkedHashSet<>(Arrays.asList(
"产品名称(SPU)", "类目", "供应方", "供应商", "比例换算", "配件性质", "缩略图" "产品名称(SPU)", "类目", "供应方", "比例换算", "配件性质", "缩略图"
)); ));
private final int headRowNumber; private final int headRowNumber;
...@@ -45,7 +45,6 @@ public class SpuSkuBatchAddSingleReadListener extends SkuBatchSingleReadListener ...@@ -45,7 +45,6 @@ public class SpuSkuBatchAddSingleReadListener extends SkuBatchSingleReadListener
FIELD_SETTER_MAP.put("产品名称(SPU)", SpuSkuBatchAddImportVo::setProductGoodsName); FIELD_SETTER_MAP.put("产品名称(SPU)", SpuSkuBatchAddImportVo::setProductGoodsName);
FIELD_SETTER_MAP.put("类目", SpuSkuBatchAddImportVo::setGoodsTypeName); FIELD_SETTER_MAP.put("类目", SpuSkuBatchAddImportVo::setGoodsTypeName);
FIELD_SETTER_MAP.put("供应方", SpuSkuBatchAddImportVo::setSupplierName); FIELD_SETTER_MAP.put("供应方", SpuSkuBatchAddImportVo::setSupplierName);
FIELD_SETTER_MAP.put("供应商", SpuSkuBatchAddImportVo::setProviderName);
FIELD_SETTER_MAP.put("比例换算", SpuSkuBatchAddImportVo::setConvertedValue); FIELD_SETTER_MAP.put("比例换算", SpuSkuBatchAddImportVo::setConvertedValue);
FIELD_SETTER_MAP.put("配件性质", SpuSkuBatchAddImportVo::setAccessoryTypeStr); FIELD_SETTER_MAP.put("配件性质", SpuSkuBatchAddImportVo::setAccessoryTypeStr);
FIELD_SETTER_MAP.put("缩略图", SpuSkuBatchAddImportVo::setThumbUrl); FIELD_SETTER_MAP.put("缩略图", SpuSkuBatchAddImportVo::setThumbUrl);
...@@ -79,15 +78,12 @@ public class SpuSkuBatchAddSingleReadListener extends SkuBatchSingleReadListener ...@@ -79,15 +78,12 @@ public class SpuSkuBatchAddSingleReadListener extends SkuBatchSingleReadListener
vo.setSupplierName(firstRowVo.getSupplierName()); vo.setSupplierName(firstRowVo.getSupplierName());
break; break;
case 3: case 3:
vo.setProviderName(firstRowVo.getProviderName());
break;
case 4:
vo.setConvertedValue(firstRowVo.getConvertedValue()); vo.setConvertedValue(firstRowVo.getConvertedValue());
break; break;
case 5: case 4:
vo.setThumbUrl(firstRowVo.getThumbUrl()); vo.setThumbUrl(firstRowVo.getThumbUrl());
break; break;
case 6: case 5:
vo.setAccessoryTypeStr(firstRowVo.getAccessoryTypeStr()); vo.setAccessoryTypeStr(firstRowVo.getAccessoryTypeStr());
break; break;
default: default:
......
...@@ -43,6 +43,8 @@ public class ProductManagerExportItemVo implements Serializable{ ...@@ -43,6 +43,8 @@ public class ProductManagerExportItemVo implements Serializable{
private String carTypeStr; private String carTypeStr;
/** 适用区域**/ /** 适用区域**/
private String applicableArea; private String applicableArea;
/** 供应商信息**/
private String providerName;
/** 参考售价**/ /** 参考售价**/
private BigDecimal upgradePrice; private BigDecimal upgradePrice;
/** 嘀加成本**/ /** 嘀加成本**/
......
...@@ -17,6 +17,11 @@ public class PurchaseOrderDeliveryDetailExportVO implements Serializable { ...@@ -17,6 +17,11 @@ public class PurchaseOrderDeliveryDetailExportVO implements Serializable {
private String upgradeGoodsName; private String upgradeGoodsName;
/** /**
* 供应商名称
*/
private String thirdPartyName;
/**
* 规格 * 规格
*/ */
private String specificationData; private String specificationData;
...@@ -32,6 +37,11 @@ public class PurchaseOrderDeliveryDetailExportVO implements Serializable { ...@@ -32,6 +37,11 @@ public class PurchaseOrderDeliveryDetailExportVO implements Serializable {
private String goodsName; private String goodsName;
/** /**
* 产品别名
*/
private String purchaseGoodsName;
/**
* 所属分类 * 所属分类
*/ */
private String goodsTypeName; private String goodsTypeName;
......
...@@ -52,124 +52,137 @@ public class PurchaseOrderShipmentGoodsExportVO implements Serializable { ...@@ -52,124 +52,137 @@ public class PurchaseOrderShipmentGoodsExportVO implements Serializable {
private String type; private String type;
@ExcelMergeRow(columIndex = 7) @ExcelMergeRow(columIndex = 7)
@ExcelProperty(value = "产品别名")
private String purchaseGoodsName;
@ExcelMergeRow(columIndex = 8)
@ExcelProperty(value = "规格") @ExcelProperty(value = "规格")
private String specificationData; private String specificationData;
@ExcelMergeRow(columIndex = 8) @ExcelMergeRow(columIndex = 9)
@ExcelProperty(value = "适用车型") @ExcelProperty(value = "适用车型")
private String suitCarTypeNames; private String suitCarTypeNames;
/** /**
* 升级产品名称 * 升级产品名称
*/ */
@ExcelMergeRow(columIndex = 9) @ExcelMergeRow(columIndex = 10)
@ExcelProperty(value = "产品名称") @ExcelProperty(value = "产品名称")
private String upgradeGoodsName; private String upgradeGoodsName;
@ExcelMergeRow(columIndex = 11)
@ExcelProperty(value = "供应商名称")
private String thirdPartyName;
/***
* 供应商编码
*/
private String thirdPartyCode;
/** /**
* 商品采购数量 卷/件 * 商品采购数量 卷/件
*/ */
@ExcelMergeRow(columIndex = 10) @ExcelMergeRow(columIndex = 12)
@ExcelProperty(value = "审核数量") @ExcelProperty(value = "审核数量")
private String goodsNumber; private String goodsNumber;
/** /**
* 库存总量 米/件 * 库存总量 米/件
*/ */
@ExcelMergeRow(columIndex = 11) @ExcelMergeRow(columIndex = 13)
@ExcelProperty(value = "库存总量") @ExcelProperty(value = "库存总量")
private String stockNum; private String stockNum;
/** /**
* 已发货数量 卷/件 * 已发货数量 卷/件
*/ */
@ExcelMergeRow(columIndex = 12) @ExcelMergeRow(columIndex = 14)
@ExcelProperty(value = "发货数量") @ExcelProperty(value = "发货数量")
private String shippedNumber; private String shippedNumber;
/** /**
* 欠货数量 卷/件 = 发货数量 - 审核数量 * 欠货数量 卷/件 = 发货数量 - 审核数量
*/ */
@ExcelMergeRow(columIndex = 13) @ExcelMergeRow(columIndex = 15)
@ExcelProperty(value = "欠货数量") @ExcelProperty(value = "欠货数量")
private String toBeShippedNumber; private String toBeShippedNumber;
@ExcelMergeRow(columIndex = 14) @ExcelMergeRow(columIndex = 16)
@ExcelProperty(value = "下单时间") @ExcelProperty(value = "下单时间")
@DateTimeFormat(value="yyyy-MM-dd HH:mm:ss") @DateTimeFormat(value="yyyy-MM-dd HH:mm:ss")
private Date orderTime; private Date orderTime;
@ExcelMergeRow(columIndex = 15) @ExcelMergeRow(columIndex = 17)
@ExcelValueReplace(replace={"待签收_0","部分签收_1","全部签收_2"}) @ExcelValueReplace(replace={"待签收_0","部分签收_1","全部签收_2"})
@ExcelProperty(value = "签收状态",converter= ReplaceIntegerToStringConvert.class) @ExcelProperty(value = "签收状态",converter= ReplaceIntegerToStringConvert.class)
private Integer signStatus; private Integer signStatus;
@ExcelMergeRow(columIndex = 16) @ExcelMergeRow(columIndex = 18)
@ExcelValueReplace(replace={"未发货_1","全部发货_2","部分发货_3","结束发货_4"}) @ExcelValueReplace(replace={"未发货_1","全部发货_2","部分发货_3","结束发货_4"})
@ExcelProperty(value = "发货状态",converter= ReplaceByteToStringConvert.class) @ExcelProperty(value = "发货状态",converter= ReplaceByteToStringConvert.class)
private Byte deliveryStatus; private Byte deliveryStatus;
@ExcelMergeRow(columIndex = 17) @ExcelMergeRow(columIndex = 19)
@ExcelValueReplace(replace={"已审核_5"}) @ExcelValueReplace(replace={"已审核_5"})
@ExcelProperty(value = "订单状态",converter= ReplaceByteToStringConvert.class) @ExcelProperty(value = "订单状态",converter= ReplaceByteToStringConvert.class)
private Byte purchaseOrderStatus = 5; private Byte purchaseOrderStatus = 5;
@ExcelMergeRow(columIndex = 18) @ExcelMergeRow(columIndex = 20)
@ExcelProperty(value = "备注") @ExcelProperty(value = "备注")
private String purchaseOrderRemark; private String purchaseOrderRemark;
@ExcelMergeRow(columIndex = 19) @ExcelMergeRow(columIndex = 21)
@ExcelProperty(value = "运营审核人") @ExcelProperty(value = "运营审核人")
private String operatorReviewedBy; private String operatorReviewedBy;
@ExcelMergeRow(columIndex = 20) @ExcelMergeRow(columIndex = 22)
@ExcelProperty(value = "运营审核时间") @ExcelProperty(value = "运营审核时间")
@DateTimeFormat(value="yyyy-MM-dd HH:mm:ss") @DateTimeFormat(value="yyyy-MM-dd HH:mm:ss")
private Date operatorReviewedDate; private Date operatorReviewedDate;
@ExcelMergeRow(columIndex = 21) @ExcelMergeRow(columIndex = 23)
@ExcelProperty(value = "运营审核备注") @ExcelProperty(value = "运营审核备注")
private String operatorReviewRemark; private String operatorReviewRemark;
@ExcelMergeRow(columIndex = 22) @ExcelMergeRow(columIndex = 24)
@ExcelProperty(value = "商务审核人") @ExcelProperty(value = "商务审核人")
private String businessReviewedBy; private String businessReviewedBy;
@ExcelMergeRow(columIndex = 23) @ExcelMergeRow(columIndex = 25)
@ExcelProperty(value = "商务审核时间") @ExcelProperty(value = "商务审核时间")
@DateTimeFormat(value="yyyy-MM-dd HH:mm:ss") @DateTimeFormat(value="yyyy-MM-dd HH:mm:ss")
private Date businessReviewedDate; private Date businessReviewedDate;
@ExcelMergeRow(columIndex = 24) @ExcelMergeRow(columIndex = 26)
@ExcelProperty(value = "商务审核备注") @ExcelProperty(value = "商务审核备注")
private String businessReviewRemark; private String businessReviewRemark;
@ExcelMergeRow(columIndex = 25) @ExcelMergeRow(columIndex = 27)
@ExcelProperty(value = "收货人") @ExcelProperty(value = "收货人")
private String contactName; private String contactName;
@ExcelMergeRow(columIndex = 26) @ExcelMergeRow(columIndex = 28)
@ExcelProperty(value = "收货人电话") @ExcelProperty(value = "收货人电话")
private String contactPhone; private String contactPhone;
@ExcelMergeRow(columIndex = 27) @ExcelMergeRow(columIndex = 29)
@ExcelProperty(value = "收货人地址") @ExcelProperty(value = "收货人地址")
private String contactAddress; private String contactAddress;
@ExcelMergeRow(columIndex = 28) @ExcelMergeRow(columIndex = 30)
@ExcelProperty(value = "凭证") @ExcelProperty(value = "凭证")
private String uploadFileUrls; private String uploadFileUrls;
@ExcelMergeRow(columIndex = 34) @ExcelMergeRow(columIndex = 36)
@ExcelProperty(value = "采购总价") @ExcelProperty(value = "采购总价")
private BigDecimal goodsTotalPrice; private BigDecimal goodsTotalPrice;
@ExcelMergeRow(columIndex = 35) @ExcelMergeRow(columIndex = 37)
@ExcelProperty(value = "备注") @ExcelProperty(value = "备注")
private String remark; private String remark;
@ExcelMergeRow(columIndex = 36) @ExcelMergeRow(columIndex = 38)
@ExcelProperty(value = "订单总价") @ExcelProperty(value = "订单总价")
private BigDecimal totalPrice; private BigDecimal totalPrice;
......
...@@ -2,6 +2,8 @@ package cn.com.glsx.dj.smartcarlife.vo.excel; ...@@ -2,6 +2,8 @@ package cn.com.glsx.dj.smartcarlife.vo.excel;
import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.oreframework.commons.office.easyexcel.annotation.ExcelValueReplace; import org.oreframework.commons.office.easyexcel.annotation.ExcelValueReplace;
import org.oreframework.commons.office.easyexcel.converter.ReplaceByteToStringConvert; import org.oreframework.commons.office.easyexcel.converter.ReplaceByteToStringConvert;
......
...@@ -42,57 +42,70 @@ public class WarehousedeliverGoodsExportVO implements Serializable { ...@@ -42,57 +42,70 @@ public class WarehousedeliverGoodsExportVO implements Serializable {
private String type; private String type;
@ExcelMergeRow(columIndex = 5) @ExcelMergeRow(columIndex = 5)
@ExcelProperty(value = "产品别名")
private String purchaseGoodsName;
@ExcelMergeRow(columIndex = 6)
@ExcelProperty(value = "产品名称") @ExcelProperty(value = "产品名称")
private String upgradeGoodsName; private String upgradeGoodsName;
@ExcelMergeRow(columIndex = 6) @ExcelMergeRow(columIndex = 7)
@ExcelProperty(value = "供应商名称")
private String thirdPartyName;
/**
* 供应商编码
*/
private String thirdPartyCode;
@ExcelMergeRow(columIndex = 8)
@ExcelProperty(value = "规格") @ExcelProperty(value = "规格")
private String specificationData; private String specificationData;
@ExcelMergeRow(columIndex = 7) @ExcelMergeRow(columIndex = 9)
@ExcelProperty(value = "适用车型") @ExcelProperty(value = "适用车型")
private String suitCarTypeNames; private String suitCarTypeNames;
/** /**
* 已发货数量 卷/件 * 已发货数量 卷/件
*/ */
@ExcelMergeRow(columIndex = 8) @ExcelMergeRow(columIndex = 10)
@ExcelProperty(value = "审核数量") @ExcelProperty(value = "审核数量")
private String goodsNumber; private String goodsNumber;
/** /**
* 库存总量 米/件 * 库存总量 米/件
*/ */
@ExcelMergeRow(columIndex = 9) @ExcelMergeRow(columIndex = 11)
@ExcelProperty(value = "库存总量") @ExcelProperty(value = "库存总量")
private String stockNum; private String stockNum;
@ExcelMergeRow(columIndex = 10) @ExcelMergeRow(columIndex = 12)
@ExcelProperty(value = "发货数量") @ExcelProperty(value = "发货数量")
private String purchaseNumber; private String purchaseNumber;
@ExcelMergeRow(columIndex = 11) @ExcelMergeRow(columIndex = 13)
@ExcelProperty(value = "欠货数量") @ExcelProperty(value = "欠货数量")
private String toBeShippedNumber; private String toBeShippedNumber;
@ExcelMergeRow(columIndex = 12) @ExcelMergeRow(columIndex = 14)
@ExcelProperty(value = "下单时间") @ExcelProperty(value = "下单时间")
@DateTimeFormat(value="yyyy-MM-dd HH:mm:ss") @DateTimeFormat(value="yyyy-MM-dd HH:mm:ss")
private Date orderTime; private Date orderTime;
@ExcelMergeRow(columIndex = 13) @ExcelMergeRow(columIndex = 15)
@ExcelProperty(value = "备注") @ExcelProperty(value = "备注")
private String purchaseOrderRemark; private String purchaseOrderRemark;
@ExcelMergeRow(columIndex = 14) @ExcelMergeRow(columIndex = 16)
@ExcelProperty(value = "收货人") @ExcelProperty(value = "收货人")
private String contactName; private String contactName;
@ExcelMergeRow(columIndex = 15) @ExcelMergeRow(columIndex = 17)
@ExcelProperty(value = "收货人电话") @ExcelProperty(value = "收货人电话")
private String contactPhone; private String contactPhone;
@ExcelMergeRow(columIndex = 16) @ExcelMergeRow(columIndex = 18)
@ExcelProperty(value = "收货人地址") @ExcelProperty(value = "收货人地址")
private String contactAddress; private String contactAddress;
......
...@@ -148,4 +148,14 @@ public class SkuBatchImportVo extends MergeExcelImportVo { ...@@ -148,4 +148,14 @@ public class SkuBatchImportVo extends MergeExcelImportVo {
* 规格名序列 * 规格名序列
*/ */
private String specificationNameSequence; private String specificationNameSequence;
/**
* 供应商
*/
private String providerName;
/**
* 供应商id集合
*/
private List<Integer> providerIds;
} }
...@@ -39,11 +39,6 @@ public class SpuSkuBatchAddImportVo extends SkuBatchImportVo { ...@@ -39,11 +39,6 @@ public class SpuSkuBatchAddImportVo extends SkuBatchImportVo {
private String supplierName; private String supplierName;
/** /**
* 供应商
*/
private String providerName;
/**
* 比例换算 * 比例换算
*/ */
private String convertedValue; private String convertedValue;
......
...@@ -26,8 +26,14 @@ public class PurchaseGoodsInfoExport implements Serializable{ ...@@ -26,8 +26,14 @@ public class PurchaseGoodsInfoExport implements Serializable{
@ExcelProperty(value = "产品名称") @ExcelProperty(value = "产品名称")
private String upgradeGoodsName; private String upgradeGoodsName;
@ExcelProperty(value = "供应商名称")
private String thirdPartyName;
@ExcelProperty(value = "规格") @ExcelProperty(value = "规格")
private String specificationData; private String specificationData;
@ExcelProperty(value = "产品别名")
private String purchaseGoodsName;
@ExcelProperty(value = "采购价") @ExcelProperty(value = "采购价")
private BigDecimal purchasePrice; private BigDecimal purchasePrice;
......
...@@ -32,12 +32,18 @@ public class PurchaseOrderDeliveryDetailPageExportVO implements Serializable { ...@@ -32,12 +32,18 @@ public class PurchaseOrderDeliveryDetailPageExportVO implements Serializable {
@ExcelProperty(value="产品名称") @ExcelProperty(value="产品名称")
private String upgradeGoodsName; private String upgradeGoodsName;
@ExcelProperty(value="供应商名称")
private String thirdPartyName;
@ExcelProperty(value="产品编码") @ExcelProperty(value="产品编码")
private String type; private String type;
@ExcelProperty(value="规格") @ExcelProperty(value="规格")
private String specificationData; private String specificationData;
@ExcelProperty(value="产品别名")
private String purchaseGoodsName;
@ExcelProperty(value="适用车型") @ExcelProperty(value="适用车型")
private String suitCarTypeNames; private String suitCarTypeNames;
......
  • @wangxw1
    commented
    Master

    一、关键问题与优化建议(仅限 Top 3)

    1. 潜在的 ThreadLocal 内存泄漏风险(安全性与资源利用)

    • 位置:src/main/java/cn/com/glsx/dj/smartcarlife/util/excel/AbstractSkuBatchImportExcelHandle.java
    • 问题:类中引入了 private final ThreadLocal<Map<String, Integer>> providerCacheMap = ThreadLocal.withInitial(HashMap::new);。虽然重写了 clearImportCache() 方法进行清理,但在实际的 Excel 导入解析流程中,如果发生未捕获的异常(例如网络异常、空指针等),导致 clearImportCache() 未被执行,将会引起 Web 容器(如 Tomcat)线程池的 ThreadLocal 内存泄漏。
    • 建议:必须确保导入流程的入口处(或拦截器、AOP中)使用 try-finally 语句块,将 clearImportCache() 放在 finally 块中强制执行,确保无论正常结束还是异常中断,当前线程的缓存都能被清理。

    2. 启动期同步调用外部 API 导致阻塞与健壮性问题(功能健壮性与性能)

    • 位置:src/main/java/cn/com/glsx/dj/smartcarlife/config/CityCodeConfig.java
    • 问题:在 @PostConstruct 注解的 initCityCodeMap 方法中,使用了 RestTemplate 同步请求外部百度地图 API。这会阻塞 Spring 容器的启动过程。如果外部 API 响应缓慢或超时,会导致整个应用启动卡死;此外,如果请求失败,cityCodeMap 为空,后续业务逻辑(如 ProductManagerSkuBatchUpdateExportService 中直接调用 cityCodeMap.get(code))极易触发 NullPointerException。
    • 建议:
      1. 将初始化逻辑从 @PostConstruct 移至 ApplicationRunner 或 CommandLineRunner 中,并使用异步线程(如 @Async)加载,避免阻塞主线程。
      2. 为 RestTemplate 设置严格的连接和读取超时时间。
      3. 增加本地兜底缓存(如读取本地 JSON 配置文件),当外部 API 调用失败时使用本地数据,并在业务使用方增加防空判断。

    3. Controller 层方法命名复制粘贴错误(可维护性)

    • 位置:src/main/java/cn/com/glsx/dj/smartcarlife/controller/smartCarLife/DivisionRuleTestController.java
    • 问题:新增的“重新测试”接口,其方法名被错误地命名为 get(与上方“获取商户财务设置进度”的方法名完全一致)。虽然由于 ROP 框架底层的 method 路由映射(dj.api.smartcarlife.divisionRuleTest.retest)不同,代码可能可以正常运行,但这种复制粘贴导致的同名方法不仅违反了 Java 开发规范,还极大地降低了代码的可读性和可维护性。
    • 建议:将该方法名从 get 修改为 retest,保持方法名与其实际业务逻辑及 Request 对象(DivisionRuleTestRetestRequest)相匹配。

    二、评分明细

    1. 功能实现的正确性与健壮性(34/40分):业务逻辑基本实现,新增了多处字段和导出导入逻辑。扣分点在于外部 API 强依赖且缺乏失败降级机制(可能导致 NPE),以及供应商创建并发场景下可能产生重复数据。
    2. 安全性与潜在风险(22/30分):存在 ThreadLocal 未使用 finally 强制释放的典型内存泄漏风险,对于常驻内存的 Web 应用来说风险较高。
    3. 最佳实践与可维护性(16/20分):Controller 存在明显的 Copy-Paste 命名错误;硬编码依然存在(如类目校验中默认的 "155" 等魔法值);Excel 导出合并列的硬编码数字较多,后续扩展容易出错。
    4. 性能与资源利用(4/5分):Excel 处理中加入了本地缓存避免频繁查库,思路很好。但应用启动时同步阻塞加载外部数据拖慢了启动性能。
    5. 提交信息质量(4/5分):提交信息较为详细地记录了修改点(如“新增采购别名”、“修改版本号”等),但包含了较多 Merge 冲突信息,稍显杂乱。

    总分:80分

Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!