Commit e5b65b9c by 叶立庆

Merge branch 'v5.8.6' into 'master'

上线合并

See merge request !34
2 parents 683e8aca 0632f6aa
Showing 46 changed files with 268 additions and 51 deletions
......@@ -14,7 +14,7 @@
<properties>
<shopmall.api.version>5.6.4-SNAPSHOT</shopmall.api.version>
<stoassistant.api.version>5.6.4-SNAPSHOT</stoassistant.api.version>
<smartcarlife.api.version>5.8.5-SNAPSHOT</smartcarlife.api.version>
<smartcarlife.api.version>5.8.6-SNAPSHOT</smartcarlife.api.version>
<sale.api.version>5.8.2-SNAPSHOT</sale.api.version>
<mindworkplate.api.version>5.8.5-SNAPSHOT</mindworkplate.api.version>
<strategy.api.version>5.8.5-SNAPSHOT</strategy.api.version>
......@@ -55,7 +55,7 @@
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-daily-report-api</artifactId>
<version>5.8.5-SNAPSHOT</version>
<version>5.8.6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.oreframework.boot</groupId>
......
package cn.com.glsx.dj.smartcarlife.controller.smartCarLife;
import cn.com.glsx.dj.smartcarlife.dto.merchant.MerchantDetailBatchQueryDTO;
import cn.com.glsx.dj.smartcarlife.dto.merchant.MerchantDetailResponseDTO;
import cn.com.glsx.dj.smartcarlife.remote.MerchantStoreInfoRemote;
import cn.com.glsx.dj.smartcarlife.request.smartcarlife.MerchantDetailBatchQueryRequest;
import cn.com.glsx.dj.smartcarlife.util.CommonUtil;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.IgnoreSignType;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
@Slf4j
@Api("商户门店信息")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.NO)
public class MerchantStoreInfoController {
@Autowired
private MerchantStoreInfoRemote merchantStoreInfoRemote;
@ServiceMethod(method = "dj.api.merchantstoreinfo.batchQueryDetail",
needInSession = NeedInSessionType.NO,
ignoreSign = IgnoreSignType.YES)
@ApiOperation("批量查询商户详情")
public RopResponse<List<MerchantDetailResponseDTO>> batchQueryDetail(
MerchantDetailBatchQueryRequest request) {
MerchantDetailBatchQueryDTO queryDTO = new MerchantDetailBatchQueryDTO();
queryDTO.setBaseSceneCode(request.getBaseSceneCode());
queryDTO.setMerchantIdList(request.getMerchantIdList());
RpcResponse<List<MerchantDetailResponseDTO>> rpcResp =
merchantStoreInfoRemote.MerchantDetailBatchQueryDTO(queryDTO);
return CommonUtil.convertRopResponse(rpcResp);
}
}
......@@ -267,6 +267,7 @@ public class PurchaseOrderDeliveryController {
}
}
purchaseOrderShipmentGoodsExportVO.setUpgradeGoodsName(data.getUpgradeGoodsName());
purchaseOrderShipmentGoodsExportVO.setUpgradeGoodsCommodityCode(data.getUpgradeGoodsCommodityCode());
purchaseOrderShipmentGoodsExportVO.setThirdPartyCode(data.getThirdPartyCode());
purchaseOrderShipmentGoodsExportVO.setThirdPartyName(data.getThirdPartyName());
purchaseOrderShipmentGoodsExportVO.setPurchaseGoodsName(data.getPurchaseGoodsName());
......
......@@ -66,6 +66,7 @@ public class PurchaseOrderDeliveryDetailController {
if (CollectionUtils.isNotEmpty(pagination.getList())) {
resp.setList(pagination.getList().parallelStream().map(o->{
PurchaseOrderDeliveryDetailPageResponse item = PurchaseOrderDeliveryDetailDTOConvert.INSTANCE.toPurchaseOrderDeliveryDetailPageResponse(o);
item.setUpgradeCommodityCode(o.getUpgradeCommodityCode());
//用户只能操作自己下单的采购订单
if (Objects.equals(o.getMerchantId(), loginMerchantId)) {
item.setOperatorStatus(1);
......
......@@ -88,7 +88,7 @@ public class StockFlowController {
if (response == null || response.getData() == null || CollectionUtils.isEmpty(response.getData().getList())) {
throw new Exception("数据为空");
}
String fileName = "出入库列表" + System.currentTimeMillis() + ".xlsx";
String fileName = "出入库列表" + System.currentTimeMillis();
List<StockFlowPageExportVO> list = response.getData().getList().stream()
.map(StockFlowDTOConvert.INSTANCE::toStockFlowExportVO)
.collect(Collectors.toList());
......
......@@ -150,6 +150,7 @@ public class WarehouseDeliveryController {
warehousedeliverGoodsExportVO.setType(data.getType());
warehousedeliverGoodsExportVO.setSpecificationData(data.getSpecificationData());
warehousedeliverGoodsExportVO.setUpgradeGoodsName(data.getUpgradeGoodsName());
warehousedeliverGoodsExportVO.setUpgradeGoodsCommodityCode(data.getUpgradeGoodsCommodityCode());
warehousedeliverGoodsExportVO.setThirdPartyName(data.getThirdPartyName());
warehousedeliverGoodsExportVO.setThirdPartyCode(data.getThirdPartyCode());
warehousedeliverGoodsExportVO.setPurchaseGoodsName(data.getPurchaseGoodsName());
......
......@@ -62,4 +62,10 @@ public class GoodsWarehousingInfoPageRequest extends AbstractRopRequest {
@ApiModelProperty(notes="膜卷号", dataType="string")
private String filmRollNo;
/**
* 产品ID(升级商品编码),模糊匹配采购订单商品
*/
@ApiModelProperty(notes = "产品ID(升级商品编码),模糊匹配采购订单商品")
private String commodityCode;
}
package cn.com.glsx.dj.smartcarlife.request.smartcarlife;
import com.rop.AbstractRopRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
public class MerchantDetailBatchQueryRequest extends AbstractRopRequest {
@NotNull
@ApiModelProperty(notes = "场景code")
private String baseSceneCode;
@NotNull
@ApiModelProperty(notes = "商户ID列表")
private List<Integer> merchantIdList;
}
......@@ -58,4 +58,7 @@ public class MerchantGoodsStockReduceRecordSearchRequest extends AbstractRopRequ
@ApiModelProperty(notes="库存类型(1-虚拟 2:实物)")
private Byte inventoryType;
@ApiModelProperty(notes = "产品ID")
private String commodityCode;
}
......@@ -90,4 +90,10 @@ public class StockFlowPageRequest extends AbstractRopRequest {
@ApiModelProperty(notes = "下单门店-查询条件")
private String orderMerchantName;
/**
* 产品ID(升级商品编码),模糊匹配采购订单商品
*/
@ApiModelProperty(notes = "产品ID(升级商品编码),模糊匹配采购订单商品")
private String commodityCode;
}
......@@ -73,4 +73,9 @@ public class BusinessReviewRequest extends AbstractRopRequest {
*/
private List<PurchaseOrderAuditGoodsDTO> purchaseOrderAuditGoods;
/**
* 产品ID(升级商品编码),模糊匹配采购订单商品
*/
@ApiModelProperty(notes = "产品ID(升级商品编码),模糊匹配采购订单商品")
private String commodityCode;
}
......@@ -49,4 +49,10 @@ public class DirectorReviewRequest extends AbstractRopRequest {
@ApiModelProperty(notes = "操作人")
private String operatorName;
/**
* 产品ID(升级商品编码),模糊匹配采购订单商品
*/
@ApiModelProperty(notes = "产品ID(升级商品编码),模糊匹配采购订单商品")
private String commodityCode;
}
......@@ -73,4 +73,11 @@ public class ManagerReviewRequest extends AbstractRopRequest {
@ApiModelProperty(notes = "操作人")
private String operatorName;
/**
* 产品ID(升级商品编码),模糊匹配采购订单商品
*/
@ApiModelProperty(notes = "产品ID(升级商品编码),模糊匹配采购订单商品")
private String commodityCode;
}
......@@ -73,4 +73,10 @@ public class OperatorReviewRequest extends AbstractRopRequest {
@ApiModelProperty(notes = "操作人")
private String operatorName;
/**
* 产品ID(升级商品编码),模糊匹配采购订单商品
*/
@ApiModelProperty(notes = "产品ID(升级商品编码),模糊匹配采购订单商品")
private String commodityCode;
}
......@@ -126,4 +126,10 @@ public class PurchaseOrderDeliveryDetailPageRequest extends AbstractRopRequest {
@ApiModelProperty(notes="入库状态")
private String putStatusStr;
/**
* 产品ID(升级商品编码),模糊匹配采购订单商品
*/
@ApiModelProperty(notes = "产品ID(升级商品编码),模糊匹配采购订单商品")
private String upgradeCommodityCode;
}
......@@ -97,4 +97,10 @@ public class PurchaseOrderPageRequest extends AbstractRopRequest{
*/
@ApiModelProperty(notes = "关联调拨单号")
private String allocateCode;
/**
* 产品ID(升级商品编码),精确匹配采购订单商品
*/
@ApiModelProperty(notes = "产品ID(升级商品编码),模糊匹配采购订单商品")
private String commodityCode;
}
......@@ -83,4 +83,10 @@ public class PurchaseOrderShippingListRequest extends AbstractRopRequest {
@ApiModelProperty(notes="签收状态")
private String signStatusStr;
/**
* 产品ID(升级商品编码),模糊匹配采购订单商品
*/
@ApiModelProperty(notes = "产品ID(升级商品编码),模糊匹配采购订单商品")
private String commodityCode;
}
......@@ -60,4 +60,10 @@ public class WarehouseDeliveryRequest extends AbstractRopRequest {
@ApiModelProperty(notes = "供应商编码,模糊搜索")
private String thirdPartyCode;
/**
* 产品ID(升级商品编码),模糊匹配采购订单商品
*/
@ApiModelProperty(notes = "产品ID(升级商品编码),模糊匹配采购订单商品")
private String commodityCode;
}
......@@ -70,4 +70,10 @@ public class StockAllocateDeliveryPageRequest extends AbstractRopRequest {
*/
@ApiModelProperty(notes = "关联采购订单编号")
private String purchaseOrderCode;
/**
* 产品ID(升级商品编码),模糊匹配采购订单商品
*/
@ApiModelProperty(notes = "产品ID(升级商品编码),模糊匹配采购订单商品")
private String commodityCode;
}
......@@ -56,4 +56,10 @@ public class StockAllocatePageRequest extends AbstractRopRequest {
*/
@ApiModelProperty(notes = "关联采购订单编号")
private String purchaseOrderCode;
/**
* 产品ID(升级商品编码),模糊匹配采购订单商品
*/
@ApiModelProperty(notes = "产品ID(升级商品编码),模糊匹配采购订单商品")
private String commodityCode;
}
......@@ -34,4 +34,10 @@ public class StockAllocateReviewPageRequest extends AbstractRopRequest {
@NotNull
@ApiModelProperty(notes = "查询类型(1.运营审核查询,2:商务审核查询)")
private Byte queryType;
/**
* 产品ID(升级商品编码),模糊匹配采购订单商品
*/
@ApiModelProperty(notes = "产品ID(升级商品编码),模糊匹配采购订单商品")
private String commodityCode;
}
......@@ -22,6 +22,9 @@ public class MerchantGoodsStockReduceRecordPageResponse implements Serializable
@ApiModelProperty(notes="商品名称")
private String upgradeGoodsName;
@ApiModelProperty(notes="产品ID")
private String commodityCode;
@ApiModelProperty(notes="系列")
private String goodsSeries;
......
......@@ -25,6 +25,12 @@ public class StockFlowPageResponse {
private String upgradeGoodsName;
/**
* 产品ID
*/
@ApiModelProperty(notes = "产品ID")
private String commodityCode;
/**
* 商品编码
*/
@ApiModelProperty(notes = "商品编码", example = "P20260129001")
......
......@@ -173,4 +173,10 @@ public class PurchaseOrderDeliveryDetailPageResponse implements Serializable {
@ApiModelProperty(notes="是否支持扫码入库")
private Boolean canScanEnable;
/**
* 产品ID(升级商品编码),模糊匹配采购订单商品
*/
@ApiModelProperty(notes = "产品ID(升级商品编码),模糊匹配采购订单商品")
private String upgradeCommodityCode;
}
......@@ -164,4 +164,7 @@ public class PurchaseOrderDeliveryDetailResponse implements Serializable {
@ApiModelProperty(notes = "膜卷号(来自调拨商品详情中)")
private String filmRollNo;
@ApiModelProperty(notes = "产品ID")
private String upgradeCommodityCode;
}
......@@ -148,4 +148,7 @@ public class PurchaseOrderShippingPageResponse implements Serializable {
@ApiModelProperty(notes = "发货单凭证")
private String uploadFileUrls;
@ApiModelProperty(notes = "产品ID")
private String upgradeGoodsCommodityCode;
}
......@@ -116,5 +116,6 @@ public class WarehouseDeliveryPageResponse implements Serializable {
@ApiModelProperty(notes = "素材换算数值", example = "11")
private BigDecimal conversionValue;
@ApiModelProperty(notes = "产品ID")
private String upgradeGoodsCommodityCode;
}
......@@ -33,6 +33,9 @@ public class MerchantShopGoodsStockPageResponse implements Serializable {
@ApiModelProperty(notes="商品名称")
private String upgradeGoodsName;
@ApiModelProperty(notes="产品ID")
private String commodityCode;
@ApiModelProperty(notes="商品编码")
private String productCode;
......
......@@ -54,4 +54,7 @@ public class StockAllocateDetailResponse implements Serializable {
@ApiModelProperty(notes = "已发货数量")
private BigDecimal deliveryNumber;
@ApiModelProperty(notes = "产品ID")
private String upgradeGoodsCommodityCode;
}
......@@ -87,24 +87,25 @@ public class ReconciliationBillImportService {
// ==================== Excel 读取 ====================
private List<ImportExcelRow> readExcelShop(ReconciliationBillImportRequest request) {
// 新模板已去掉第1行(全局流量方),表头占2行
List<ShopReconciliationBillImportVo> voList = readExcelInternal(
request, ShopReconciliationBillImportVo.class);
request, ShopReconciliationBillImportVo.class, 2);
return voList.stream().map(this::convertFromShopVO).collect(Collectors.toList());
}
private List<ImportExcelRow> readExcelPartner(ReconciliationBillImportRequest request) {
List<PartnerReconciliationBillImportVo> voList = readExcelInternal(
request, PartnerReconciliationBillImportVo.class);
request, PartnerReconciliationBillImportVo.class, 3);
return voList.stream().map(this::convertFromPartnerVO).collect(Collectors.toList());
}
private <T extends MergeExcelImportVo> List<T> readExcelInternal(ReconciliationBillImportRequest request, Class<T> clazz) {
private <T extends MergeExcelImportVo> List<T> readExcelInternal(ReconciliationBillImportRequest request, Class<T> clazz, int headRowNumber) {
try (InputStream inputStream = new ByteArrayInputStream(request.getFile().getContent())) {
ExcelImportReadSetting<T> setting = ExcelImportReadSetting.<T>builder()
.autoTrim(true)
.clazz(clazz)
.extraReadMerge(true)
.headRowNumber(3)
.headRowNumber(headRowNumber)
.validHeadTitle(true)
.fastFail(false)
.mergeFail(false)
......@@ -193,22 +194,31 @@ public class ReconciliationBillImportService {
// ==================== 表头提取 ====================
private HeaderInfo extractHeaderInfo(ReconciliationBillImportRequest request, Byte billType) {
int platformColIndex = Objects.equals(billType, BillTypeEnum.PARTNER.getValue()) ? 12 : 13;
boolean isPartner = Objects.equals(billType, BillTypeEnum.PARTNER.getValue());
try (Workbook workbook = WorkbookFactory.create(
new ByteArrayInputStream(request.getFile().getContent()))) {
Sheet sheet = workbook.getSheetAt(0);
Row row0 = sheet.getRow(0);
if (row0 == null) {
throw new RpcServiceException(DefaultErrorEnum.SERVER_ERROR, "表头商户名称为空");
}
String headerMerchantName = getCellStringValue(row0.getCell(0));
Row row1 = sheet.getRow(1);
if (row1 == null) {
// 平台方名称:
// SHOP 模板已去掉第1行(全局流量方),平台方在第1行(Row 0),取第14列(col 13)
// PARTNER 平台方仍在第2行(Row 1),取第13列(col 12)
int platformRowIndex = isPartner ? 1 : 0;
int platformColIndex = isPartner ? 12 : 13;
Row platformRow = sheet.getRow(platformRowIndex);
if (platformRow == null) {
throw new RpcServiceException(DefaultErrorEnum.SERVER_ERROR, "平台方名称为空");
}
String platformMerchantName = getCellStringValue(row1.getCell(platformColIndex));
String platformMerchantName = getCellStringValue(platformRow.getCell(platformColIndex));
// 表头商户名称(仅 PARTNER 使用;SHOP 新模板已无全局流量方行,不再提取)
String headerMerchantName = null;
if (isPartner) {
Row row0 = sheet.getRow(0);
if (row0 == null) {
throw new RpcServiceException(DefaultErrorEnum.SERVER_ERROR, "表头商户名称为空");
}
headerMerchantName = getCellStringValue(row0.getCell(0));
}
return new HeaderInfo(headerMerchantName, platformMerchantName);
} catch (RpcServiceException e) {
......
......@@ -11,6 +11,11 @@ public class GoodsStockAllocateDetailExportVo implements Serializable{
private static final long serialVersionUID = -3802676918903131403L;
/** 商品名称**/
private String goodsName;
/**
* 产品ID
*/
private String commodityCode;
/** 规格**/
private String specificationData;
/** 系列**/
......
......@@ -28,6 +28,9 @@ public class GoodsWarehousingInfoExportVo implements Serializable {
@ExcelProperty(value = "产品名称")
private String upgradeGoodsName;
@ExcelProperty(value = "产品ID")
private String commodityCode;
@ExcelProperty(value = "规格")
private String specificationData;
......
......@@ -26,6 +26,9 @@ public class MerchantGoodsStockReduceRecordExportVO implements Serializable {
@ExcelProperty(value="产品名称")
private String upgradeGoodsName;
@ExcelProperty(value="产品ID")
private String commodityCode;
@ExcelProperty(value="规格")
private String specificationData;
......
......@@ -16,6 +16,8 @@ public class PurchaseOrderDeliveryDetailExportVO implements Serializable {
*/
private String upgradeGoodsName;
private String upgradeCommodityCode;
/**
* 供应商名称
*/
......
......@@ -70,7 +70,14 @@ public class PurchaseOrderShipmentGoodsExportVO implements Serializable {
@ExcelProperty(value = "产品名称")
private String upgradeGoodsName;
/**
* 产品Id(升级商品编码)
*/
@ExcelMergeRow(columIndex = 11)
@ExcelProperty(value = "产品Id")
private String upgradeGoodsCommodityCode;
@ExcelMergeRow(columIndex = 12)
@ExcelProperty(value = "供应商名称")
private String thirdPartyName;
......@@ -82,107 +89,107 @@ public class PurchaseOrderShipmentGoodsExportVO implements Serializable {
/**
* 商品采购数量 卷/件
*/
@ExcelMergeRow(columIndex = 12)
@ExcelMergeRow(columIndex = 13)
@ExcelProperty(value = "审核数量")
private String goodsNumber;
/**
* 库存总量 米/件
*/
@ExcelMergeRow(columIndex = 13)
@ExcelMergeRow(columIndex = 14)
@ExcelProperty(value = "库存总量")
private String stockNum;
/**
* 已发货数量 卷/件
*/
@ExcelMergeRow(columIndex = 14)
@ExcelMergeRow(columIndex = 15)
@ExcelProperty(value = "发货数量")
private String shippedNumber;
/**
* 欠货数量 卷/件 = 发货数量 - 审核数量
*/
@ExcelMergeRow(columIndex = 15)
@ExcelMergeRow(columIndex = 16)
@ExcelProperty(value = "欠货数量")
private String toBeShippedNumber;
@ExcelMergeRow(columIndex = 16)
@ExcelMergeRow(columIndex = 17)
@ExcelProperty(value = "下单时间")
@DateTimeFormat(value="yyyy-MM-dd HH:mm:ss")
private Date orderTime;
@ExcelMergeRow(columIndex = 17)
@ExcelMergeRow(columIndex = 18)
@ExcelValueReplace(replace={"待签收_0","部分签收_1","全部签收_2"})
@ExcelProperty(value = "签收状态",converter= ReplaceIntegerToStringConvert.class)
private Integer signStatus;
@ExcelMergeRow(columIndex = 18)
@ExcelMergeRow(columIndex = 19)
@ExcelValueReplace(replace={"未发货_1","全部发货_2","部分发货_3","结束发货_4"})
@ExcelProperty(value = "发货状态",converter= ReplaceByteToStringConvert.class)
private Byte deliveryStatus;
@ExcelMergeRow(columIndex = 19)
@ExcelMergeRow(columIndex = 20)
@ExcelValueReplace(replace={"已审核_5"})
@ExcelProperty(value = "订单状态",converter= ReplaceByteToStringConvert.class)
private Byte purchaseOrderStatus = 5;
@ExcelMergeRow(columIndex = 20)
@ExcelMergeRow(columIndex = 21)
@ExcelProperty(value = "备注")
private String purchaseOrderRemark;
@ExcelMergeRow(columIndex = 21)
@ExcelMergeRow(columIndex = 22)
@ExcelProperty(value = "运营审核人")
private String operatorReviewedBy;
@ExcelMergeRow(columIndex = 22)
@ExcelMergeRow(columIndex = 23)
@ExcelProperty(value = "运营审核时间")
@DateTimeFormat(value="yyyy-MM-dd HH:mm:ss")
private Date operatorReviewedDate;
@ExcelMergeRow(columIndex = 23)
@ExcelMergeRow(columIndex = 24)
@ExcelProperty(value = "运营审核备注")
private String operatorReviewRemark;
@ExcelMergeRow(columIndex = 24)
@ExcelMergeRow(columIndex = 25)
@ExcelProperty(value = "商务审核人")
private String businessReviewedBy;
@ExcelMergeRow(columIndex = 25)
@ExcelMergeRow(columIndex = 26)
@ExcelProperty(value = "商务审核时间")
@DateTimeFormat(value="yyyy-MM-dd HH:mm:ss")
private Date businessReviewedDate;
@ExcelMergeRow(columIndex = 26)
@ExcelMergeRow(columIndex = 27)
@ExcelProperty(value = "商务审核备注")
private String businessReviewRemark;
@ExcelMergeRow(columIndex = 27)
@ExcelMergeRow(columIndex = 28)
@ExcelProperty(value = "收货人")
private String contactName;
@ExcelMergeRow(columIndex = 28)
@ExcelMergeRow(columIndex = 29)
@ExcelProperty(value = "收货人电话")
private String contactPhone;
@ExcelMergeRow(columIndex = 29)
@ExcelMergeRow(columIndex = 30)
@ExcelProperty(value = "收货人地址")
private String contactAddress;
@ExcelMergeRow(columIndex = 30)
@ExcelMergeRow(columIndex = 31)
@ExcelProperty(value = "凭证")
private String uploadFileUrls;
@ExcelMergeRow(columIndex = 36)
@ExcelMergeRow(columIndex = 37)
@ExcelProperty(value = "采购总价")
private BigDecimal goodsTotalPrice;
@ExcelMergeRow(columIndex = 37)
@ExcelMergeRow(columIndex = 38)
@ExcelProperty(value = "备注")
private String remark;
@ExcelMergeRow(columIndex = 38)
@ExcelMergeRow(columIndex = 39)
@ExcelProperty(value = "订单总价")
private BigDecimal totalPrice;
......
......@@ -33,6 +33,12 @@ public class StockFlowPageExportVO {
private String upgradeGoodsName;
/**
* 商品名称
*/
@ExcelProperty(value = "产品ID")
private String commodityCode;
/**
* 商品编码
*/
@ExcelProperty(value = "产品编码")
......
......@@ -50,6 +50,10 @@ public class WarehousedeliverGoodsExportVO implements Serializable {
private String upgradeGoodsName;
@ExcelMergeRow(columIndex = 7)
@ExcelProperty(value = "产品ID")
private String upgradeGoodsCommodityCode;
@ExcelMergeRow(columIndex = 8)
@ExcelProperty(value = "供应商名称")
private String thirdPartyName;
......@@ -58,54 +62,54 @@ public class WarehousedeliverGoodsExportVO implements Serializable {
*/
private String thirdPartyCode;
@ExcelMergeRow(columIndex = 8)
@ExcelMergeRow(columIndex = 9)
@ExcelProperty(value = "规格")
private String specificationData;
@ExcelMergeRow(columIndex = 9)
@ExcelMergeRow(columIndex = 10)
@ExcelProperty(value = "适用车型")
private String suitCarTypeNames;
/**
* 已发货数量 卷/件
*/
@ExcelMergeRow(columIndex = 10)
@ExcelMergeRow(columIndex = 11)
@ExcelProperty(value = "审核数量")
private String goodsNumber;
/**
* 库存总量 米/件
*/
@ExcelMergeRow(columIndex = 11)
@ExcelMergeRow(columIndex = 12)
@ExcelProperty(value = "库存总量")
private String stockNum;
@ExcelMergeRow(columIndex = 12)
@ExcelMergeRow(columIndex = 13)
@ExcelProperty(value = "发货数量")
private String purchaseNumber;
@ExcelMergeRow(columIndex = 13)
@ExcelMergeRow(columIndex = 14)
@ExcelProperty(value = "欠货数量")
private String toBeShippedNumber;
@ExcelMergeRow(columIndex = 14)
@ExcelMergeRow(columIndex = 15)
@ExcelProperty(value = "下单时间")
@DateTimeFormat(value="yyyy-MM-dd HH:mm:ss")
private Date orderTime;
@ExcelMergeRow(columIndex = 15)
@ExcelMergeRow(columIndex = 16)
@ExcelProperty(value = "备注")
private String purchaseOrderRemark;
@ExcelMergeRow(columIndex = 16)
@ExcelMergeRow(columIndex = 17)
@ExcelProperty(value = "收货人")
private String contactName;
@ExcelMergeRow(columIndex = 17)
@ExcelMergeRow(columIndex = 18)
@ExcelProperty(value = "收货人电话")
private String contactPhone;
@ExcelMergeRow(columIndex = 18)
@ExcelMergeRow(columIndex = 19)
@ExcelProperty(value = "收货人地址")
private String contactAddress;
......
......@@ -32,6 +32,9 @@ public class PurchaseOrderDeliveryDetailPageExportVO implements Serializable {
@ExcelProperty(value="产品名称")
private String upgradeGoodsName;
@ExcelProperty(value="产品ID")
private String upgradeCommodityCode;
@ExcelProperty(value="供应商名称")
private String thirdPartyName;
......
  • @wangxw1
    commented
    Master

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

    1. 功能缺陷:Excel 导出文件名缺失后缀(功能正确性)

    • 位置:src/main/java/cn/com/glsx/dj/smartcarlife/controller/smartCarLife/StockFlowController.java
    • 问题描述:代码将 String fileName = "出入库列表" + System.currentTimeMillis() + ".xlsx"; 修改为了去掉 .xlsx 后缀的形式。除非底层的 Excel 导出工具类库(如 EasyExcel 封装)会自动补全后缀,否则用户下载的文件将变成无后缀的未知类型文件,导致无法直接双击打开,严重影响用户体验。
    • 优化建议:恢复 .xlsx 后缀,或确认底层响应处理逻辑中已强制指定了文件扩展名及正确的 ContentType。

    2. 规范违背:远程调用方法命名不符合规范且极易混淆(可维护性)

    • 位置:src/main/java/cn/com/glsx/dj/smartcarlife/controller/smartCarLife/MerchantStoreInfoController.java
    • 问题描述:代码第 38 行调用了 merchantStoreInfoRemote.MerchantDetailBatchQueryDTO(queryDTO)。根据《阿里巴巴 Java 开发手册》命名规约,方法名必须使用 lowerCamelCase 驼峰法。此处不仅首字母大写,且直接使用了 DTO 类的名称作为方法名,这在代码阅读和维护时极易让人误以为是在实例化对象,是非常糟糕的命名实践。
    • 优化建议:修改 RPC/Feign 接口定义,将方法名改为动宾短语形式,例如:batchQueryMerchantDetail(queryDTO)。

    3. 隐患风险:新增字段命名不一致,易导致对象映射失败(健壮性与可维护性)

    • 位置:多个 Request、Response、VO 及 Controller 文件。
    • 问题描述:本次需求在多处新增了“产品ID”这一字段,但在不同的类中命名出现了严重的分歧,包括:commodityCode、upgradeCommodityCode、upgradeGoodsCommodityCode。在微服务和多层架构中,如果不统一字段名,在使用 BeanUtils、MapStruct 等工具进行对象拷贝时极易发生字段丢失(映射失败),且增加了后续开发者的认知负担。
    • 优化建议:在整个链路上(Request -> DTO -> PO -> VO)统一该业务概念的英文字段命名,建议统一为 commodityCode 或 upgradeCommodityCode,并配合代码生成或映射工具进行检查。

    二、评分明细

    评审维度 满分 得分 扣分原因/备注
    功能实现的正确性与健壮性 40 34 1. 导出的 Excel 文件名去掉了后缀,可能导致下载文件无法直接打开(-4分)。
    2. 新增的 MerchantStoreInfoController 接口未对入参 Request 及其内部属性做 @Valid 或 @Validated 校验(-2分)。
    安全性与潜在风险 30 30 未发现明显的 SQL 注入、越权访问、资源泄露等安全漏洞。Excel 解析使用了 try-with-resources 妥善关闭了流。
    最佳实践与可维护性 20 14 1. 方法命名直接使用类名大写开头(MerchantDetailBatchQueryDTO)严重违背阿里规范(-3分)。
    2. 相同业务含义的字段在各层对象中命名不统一(-3分)。
    性能与资源利用 5 5 Excel 读取和并行流处理逻辑正常,资源利用合理。
    提交信息质量 5 4 提交记录较详细,但前缀格式未完全统一(部分遵循了 feat: 规范,部分直接以版本号开头),建议统一团队的 Commit Message 规范(-1分)。

    总分:87分

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