Commit a76073da by 林冲

Merge branch 'v5.6.4' into 'master'

上线合并

See merge request !10
2 parents 52e6eff6 5a240fe9
Showing 50 changed files with 693 additions and 107 deletions
......@@ -12,7 +12,8 @@
<name>rpc-dj-smartcarlife-api</name>
<properties>
<deploy.scanPackage>cn.com.glsx.dj.smartcarlife.remote</deploy.scanPackage>
<smartcarlife.api.version>5.6.2-SNAPSHOT</smartcarlife.api.version>
<smartcarlife.api.version>5.6.4-SNAPSHOT</smartcarlife.api.version>
<shopamll.api.version>5.6.4-SNAPSHOT</shopamll.api.version>
</properties>
<dependencies>
<dependency>
......@@ -37,7 +38,7 @@
<dependency>
<groupId>cn.com.glsx.scrm</groupId>
<artifactId>rpc-scrm-shopmall-api</artifactId>
<version>4.53.0-SNAPSHOT</version>
<version>${shopamll.api.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
......
......@@ -3,7 +3,6 @@ package cn.com.glsx.dj.smartcarlife.dto;
import cn.com.glsx.dj.smartcarlife.dto.businessassistant.TechnicianConfigDTO;
import cn.com.glsx.dj.smartcarlife.dto.refund.RefundApplyRecordDTO;
import cn.com.glsx.dj.smartcarlife.dto.refund.RefundApplyRecordDetailsDTO;
import cn.com.glsx.dj.smartcarlife.model.*;
import cn.com.glsx.dj.smartcarlife.remote.GoodsOrderRemote;
import io.swagger.annotations.ApiModelProperty;
......@@ -460,6 +459,9 @@ public class GoodsOrderDTO extends GoodsOrder{
@ApiModelProperty(notes = "关联订单实付价格(原错误单)")
private BigDecimal associatedOrderCodeFinalPrice;
@ApiModelProperty(notes = "申请单关联的原错误单号")
private String incorrectOrderCode;
/**
* 对账转账订单未确认
*/
......@@ -467,4 +469,15 @@ public class GoodsOrderDTO extends GoodsOrder{
@ApiModelProperty(notes="是否为审批中撤销订单(Y:是,N:否)")
private String isInAuditRevokeOrder;
@ApiModelProperty(notes = "线上运营是否可以审核: 0-否 1-是")
private Integer canApplyFlag = 0;
@ApiModelProperty(notes = "我的待审开关 0-关 1-开")
private Integer myWaitApplySwitch;
private String loginPhone;
@ApiModelProperty(notes = "是否超管 false-否 true-是")
private Boolean adminFlag;
}
......@@ -55,9 +55,13 @@ public class GoodsSubOrderExportDTO implements Serializable {
private String packageCode;
@ExcelNumericCell(index = 28)
//@ExcelNumericCell(index = 28)
private BigDecimal totalPrice;
@ExcelNumericCell(index = 31)
@ExcelProperty(value="商品单价")
private BigDecimal upgradePrice;
private String upgradeGoodsTypeName;
private String supplierName;
......@@ -75,9 +79,21 @@ public class GoodsSubOrderExportDTO implements Serializable {
*/
private BigDecimal discountPrice;
@ExcelNumericCell(index = 38)
@ExcelProperty(value="共减")
private BigDecimal discountAmount;
@ExcelProperty(value="折扣后金额")
private BigDecimal finalPrice;
@ExcelNumericCell(index = 32)
@ExcelProperty(value="商品销售单价")
private BigDecimal singleProductSalesPrice;
@ExcelNumericCell(index = 33)
@ExcelProperty(value="商品实付单价")
private BigDecimal singleProductFinalPrice;
@ExcelProperty(value="数目")
private Integer number;
}
......@@ -49,12 +49,25 @@ public class MerchantBrandReportDetailDTO implements Serializable {
@ApiModelProperty(notes = "店端总未触客数")
private Integer notDeliveryCount;
@ApiModelProperty(notes = "实际售前触客数")
@ApiModelProperty(notes = "实际售前触客数(延保+权益/轻改)")
private Integer equityToShopCount;
@ApiModelProperty(notes = "实际售后触客数")
@ApiModelProperty(notes = "实际售后触客数(延保+权益/轻改)")
private Integer afterSaleEquityToShopCount;
@ApiModelProperty(notes = "延保售前触客数")
private Integer extendedWarrantyToShopCount;
@ApiModelProperty(notes = "延保售后触客数")
private Integer afterSaleExtendedWarrantyToShopCount;
@ApiModelProperty(notes = "权益售前触客数")
private Integer realEquityToShopCount;
@ApiModelProperty(notes = "权益售后触客数")
private Integer afterSaleRealEquityToShopCount;
@ApiModelProperty(notes = "延保成交数")
private Integer extendedWarrantyCount;
......
......@@ -39,6 +39,9 @@ public class MerchantDailyReportHuaweiExportDTO implements Serializable {
@ApiModelProperty(notes = "线上运营")
private String onlineSupervision;
@ApiModelProperty(notes = "飞行督导")
private String flightSupervision;
@ApiModelProperty(notes = "门店id")
private Integer merchantId;
......
package cn.com.glsx.dj.smartcarlife.dto;
import cn.com.glsx.dj.smartcarlife.model.ShopMerchantPointConfig;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.SuperBuilder;
......@@ -17,5 +18,6 @@ public class ShopMerchantPointConfigDTO extends ShopMerchantPointConfig {
private static final long serialVersionUID = -1L;
private List<Integer> merchantIdList;
@ApiModelProperty(notes = "当前门店是否能创建全部类型订单 0-否 1-是")
private Integer createAllGoodsFlag = 1;
}
......@@ -43,12 +43,24 @@ public class StaffDailyReportBrandDTO implements Serializable {
@ApiModelProperty(notes = "店端实际交车数")
private Integer deliveryCount;
@ApiModelProperty(notes = "实际售前触客数")
@ApiModelProperty(notes = "实际售前触客数(延保+权益/轻改)")
private Integer equityToShopCount;
@ApiModelProperty(notes = "实际售后触客数")
@ApiModelProperty(notes = "延保实际售前触客数")
private Integer extendedWarrantyToShopCount;
@ApiModelProperty(notes = "权益实际售前触客数")
private Integer realEquityToShopCount;
@ApiModelProperty(notes = "实际售后触客数(延保+权益/轻改)")
private Integer afterSaleEquityToShopCount;
@ApiModelProperty(notes = "延保实际售后触客数")
private Integer afterSaleExtendedWarrantyToShopCount;
@ApiModelProperty(notes = "权益实际售后触客数")
private Integer afterSaleRealEquityToShopCount;
@ApiModelProperty(notes = "售前整车延保成交数")
private Integer extendedWarrantyCount;
......@@ -67,6 +79,9 @@ public class StaffDailyReportBrandDTO implements Serializable {
@ApiModelProperty(notes = "安心包Max成交数")
private Integer axPackageMaxCount;
@ApiModelProperty(notes = "安心包Lite成交数")
private Integer axPackageLiteCount;
@ApiModelProperty(notes = "电池延保成交数")
private Integer batteryExtendedWarrantyCount;
......@@ -103,10 +118,10 @@ public class StaffDailyReportBrandDTO implements Serializable {
@ApiModelProperty(notes = "品牌类型:0-鸿蒙智行问界品牌,1-鸿蒙智行非问界品牌(废弃),2-其他品牌,3-智界,4-享界,5-尊界,6-尚界")
private Integer brandType;
@ApiModelProperty(notes = "今日店端实际发券数")
@ApiModelProperty(notes = "今日店端实际发券数(员工填报)")
private Integer issueCouponCount;
@ApiModelProperty(notes = "今日店端实际发券数(当前记录值)")
@ApiModelProperty(notes = "今日店端实际发券数(券日报记录)")
private Integer recordIssueCouponCount;
@ApiModelProperty(notes = "本月待邀约数")
......
......@@ -28,6 +28,12 @@ public class StaffDailyReportHuaweiExportDTO implements Serializable {
@ApiModelProperty(notes = "实际售前触客数")
private Integer totalEquityToShopCount;
@ApiModelProperty(notes = "延保实际售前触客数")
private Integer extendedWarrantyToShopCount;
@ApiModelProperty(notes = "权益实际售前触客数")
private Integer realEquityToShopCount;
@ApiModelProperty(notes = "触客率")
private String toShopRate;
......@@ -58,6 +64,12 @@ public class StaffDailyReportHuaweiExportDTO implements Serializable {
@ApiModelProperty(notes = "应触客数(按实际未触客分配)")
private BigDecimal shouldToShopCount;
@ApiModelProperty(notes = "延保应触客数")
private BigDecimal extendedWarrantyShouldToShopCount;
@ApiModelProperty(notes = "权益应触客数")
private BigDecimal equityShouldToShopCount;
@ApiModelProperty(notes = "上个月应触客数")
private BigDecimal lastMonthShouldToShopCount;
......@@ -106,6 +118,9 @@ public class StaffDailyReportHuaweiExportDTO implements Serializable {
@ApiModelProperty(notes = "安心包Pro达成数量")
private Integer axPackageProCount;
@ApiModelProperty(notes = "安心包Lite达成数量")
private Integer axPackageLiteCount;
@ApiModelProperty(notes = "安心包渗透率")
private String axPackageCountRate;
......@@ -115,6 +130,9 @@ public class StaffDailyReportHuaweiExportDTO implements Serializable {
@ApiModelProperty(notes = "安心包Pro渗透率")
private String axPackageProCountRate;
@ApiModelProperty(notes = "安心包Lite渗透率")
private String axPackageLiteCountRate;
@ApiModelProperty(notes = "广联权益成交数")
private Integer equityCount;
......
......@@ -28,23 +28,27 @@ public class StaffDailyReportScene0DetailDTO implements Serializable {
@ApiModelProperty(notes = "日报日期")
private String reportDate;
@ExcelMergeRow(columIndex = 12)
@ExcelMergeRow(columIndex = 14)
@ApiModelProperty(notes = "权益成交量")
private Integer glWorryFreeCount;
@ExcelMergeRow(columIndex = 15)
@ApiModelProperty(notes = "今日驻店人数")
private Integer staffCount;
@ExcelMergeRow(columIndex = 13)
@ExcelMergeRow(columIndex = 16)
@ApiModelProperty(notes = "当天休息 Y-是 N-否")
private String onBreak;
@ExcelMergeRow(columIndex = 14)
@ExcelMergeRow(columIndex = 17)
@ApiModelProperty(notes = "是否分配平板")
private String padPlatform; //
@ExcelMergeRow(columIndex = 15)
@ExcelMergeRow(columIndex = 18)
@ApiModelProperty(notes = "到店量")
private Integer totalEquityToShopCount;
@ExcelMergeRow(columIndex = 16)
@ExcelMergeRow(columIndex = 19)
@ApiModelProperty(notes = "APP接待数") //
private Integer receptionCount;
......
package cn.com.glsx.dj.smartcarlife.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
......@@ -44,6 +45,9 @@ public class StaffDailyReportWenJieOrderOutputDTO implements Serializable {
*/
private Integer axPackageProCount = 0;
@ApiModelProperty(notes = "安心包Lite成交数")
private Integer axPackageLiteCount = 0;
/**
* 电池延保成交数
*/
......
......@@ -43,6 +43,9 @@ public class StaffOrderStatDTO implements Serializable {
@ApiModelProperty("2.1产值表-安心包达成数量")
private Integer safePackageAchieveCount;
@ApiModelProperty("2.1产值表-安心包Lite达成数量")
private Integer safePackageLiteAchieveCount;
@ApiModelProperty("2.1产值表-电池延保成交数")
private Integer batteryWarrantyDealCount;
......
......@@ -209,4 +209,12 @@ public class MerchantGoodsInfoDTO extends MerchantGoodsInfo {
@ApiModelProperty(notes = "商品价格是否禁止修改 true-禁止 false-不禁止")
private Boolean goodsPriceModify;
@ApiModelProperty(notes = "售价临时有效状态(1待生效、2已生效、3已失效)")
private Byte sellPriceTempValidStatus;
/**
* 过滤售价有效(1:过滤售价有效)
*/
private Integer filterSellPriceValid;
}
package cn.com.glsx.dj.smartcarlife.dto.goodsOrder;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class GoodsOrderCreateWhiteListDTO implements Serializable {
private static final long serialVersionUID = -6025392031139164517L;
@ApiModelProperty(notes = "创建订单白名单")
private List<String> createWhiteList;
}
package cn.com.glsx.dj.smartcarlife.dto.staff;
import lombok.Data;
import lombok.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class StaffScoreDTO implements Serializable {
private static final long serialVersionUID = 1L;
private Integer scoreId;
private String orderCode;
private Integer infoNameType;
private String infoNameType;
private BigDecimal score;
private String operator;
private Date operateTime;
private String remark;
// 手动增加、扣减支持指定员工、门店
private Integer merchantId;
private String staffPhone;
private String staffName;
}
package cn.com.glsx.dj.smartcarlife.enums;
import lombok.Getter;
import lombok.AllArgsConstructor;
/**
* 通用标识枚举
* 0-否,1-是
*/
@Getter
@AllArgsConstructor
public enum CommonFlagEnum {
/**
* 否
*/
NO(0, "否"),
/**
* 是
*/
YES(1, "是");
/**
* 状态码
*/
private final Integer code;
/**
* 描述
*/
private final String desc;
/**
* 根据code获取枚举
*
* @param code 状态码
* @return 枚举对象
*/
public static CommonFlagEnum fromCode(Integer code) {
if (code == null) {
return null;
}
for (CommonFlagEnum flagEnum : CommonFlagEnum.values()) {
if (flagEnum.getCode().equals(code)) {
return flagEnum;
}
}
return null;
}
/**
* 判断是否为"是"
*
* @param code 状态码
* @return 是否为"是"
*/
public static boolean isYes(Integer code) {
return YES.getCode().equals(code);
}
/**
* 判断是否为"否"
*
* @param code 状态码
* @return 是否为"否"
*/
public static boolean isNo(Integer code) {
return NO.getCode().equals(code);
}
}
\ No newline at end of file
package cn.com.glsx.dj.smartcarlife.enums;
public enum SellPriceValidTypeEnum {
/**
* 终生有效
*/
LIFETIME((byte)1, "终生有效"),
/**
* 临时有效
*/
TEMPORARY((byte)2, "临时有效")
;
private byte value;
private String displayName;
SellPriceValidTypeEnum(Byte value, String displayName) {
this.value = value;
this.displayName = displayName;
}
public byte getValue() {
return value;
}
public String getDisplayName() {
return displayName;
}
public static SellPriceValidTypeEnum getByValue(Byte value){
if (value != null) {
for (SellPriceValidTypeEnum temp : SellPriceValidTypeEnum.values()) {
if (temp.getValue() == value.byteValue()) {
return temp;
}
}
}
return null;
}
/**
* 根据展示名称获取枚举
*/
public static SellPriceValidTypeEnum getByDisplayName(String displayName) {
if (displayName != null) {
for (SellPriceValidTypeEnum temp : SellPriceValidTypeEnum.values()) {
if (temp.getDisplayName().equals(displayName)) {
return temp;
}
}
}
return null;
}
}
......@@ -6,6 +6,7 @@ import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
......@@ -15,7 +16,9 @@ import javax.persistence.*;
@SuperBuilder
@Data
@Table(name = "dj_car_life_goods_order_apply_record_log")
public class GoodsOrderApplyRecordLog {
public class GoodsOrderApplyRecordLog implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
......
......@@ -383,6 +383,14 @@ public class GoodsSubOrder implements Serializable{
@Column(name = "upgrade_third_party_code")
private String upgradeThirdPartyCode;
@ApiModelProperty(notes = "商品销售单价")
@Column(name = "single_product_sales_price")
private BigDecimal singleProductSalesPrice;
@ApiModelProperty(notes = "商品实付单价")
@Column(name = "single_product_final_price")
private BigDecimal singleProductFinalPrice;
@Column(name = "discount_type")
@ApiModelProperty(name = "discountType", notes = "优惠类型(1:比例折扣,2:折扣金额,3:无折扣,4:赠品,5:非赠品)")
private Byte discountType;
......
package cn.com.glsx.dj.smartcarlife.model;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import cn.com.glsx.dj.smartcarlife.remote.MerchantGoodsInfoRemote.InsertOrUpdate;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -19,6 +7,13 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
......@@ -126,6 +121,24 @@ public class MerchantGoodsInfo implements Serializable{
*/
@Column(name = "sell_price")
private BigDecimal sellPrice;
/**
* 售价有效期类型(1:终生有效,2:临时有效)
*/
@Column(name = "sell_price_valid_type")
private Byte sellPriceValidType;
/**
* 临时有效开始日期
*/
@Column(name = "temp_valid_start_date")
private Date tempValidStartDate;
/**
* 临时有效结束日期
*/
@Column(name = "temp_valid_end_date")
private Date tempValidEndDate;
/**
* 最低售价
......
......@@ -121,18 +121,42 @@ public class StaffDailyReportHuawei implements Serializable {
private Integer notDeliveryCount;
/**
* 实际售前触客数
* 实际售前触客数(延保+权益)
*/
@Column(name = "equity_to_shop_count")
private Integer equityToShopCount;
/**
* 实际售后触客数
* 延保实际售前触客数
*/
@Column(name = "extended_warranty_to_shop_count")
private Integer extendedWarrantyToShopCount;
/**
* 权益实际售前触客数
*/
@Column(name = "real_equity_to_shop_count")
private Integer realEquityToShopCount;
/**
* 实际售后触客数(延保+权益)
*/
@Column(name = "after_sale_equity_to_shop_count")
private Integer afterSaleEquityToShopCount;
/**
* 延保实际售后触客数
*/
@Column(name = "after_sale_extended_warranty_to_shop_count")
private Integer afterSaleExtendedWarrantyToShopCount;
/**
* 权益实际售后触客数
*/
@Column(name = "after_sale_real_equity_to_shop_count")
private Integer afterSaleRealEquityToShopCount;
/**
* 售前整车延保成交数
*/
@Column(name = "extended_warranty_count")
......
package cn.com.glsx.dj.smartcarlife.remote;
import cn.com.glsx.dj.smartcarlife.dto.GoodsOrderApplyRecordDTO;
import cn.com.glsx.dj.smartcarlife.dto.GoodsOrderApplyRecordLogDTO;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiResponse;
......@@ -8,6 +9,8 @@ import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import java.util.List;
@ApiService(value="智享车生活-订单审核接口",owner="wanglq" , protocol = ApiService.ProtocolEnum.dubbo, version = "1.0.0")
public interface GoodsOrderApplyRecordRemote {
......@@ -35,4 +38,9 @@ public interface GoodsOrderApplyRecordRemote {
@ApiParam(name="merchantId",notes="门店id",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("boolean")
RpcResponse<Boolean> sendGoodsOrderApplyWechatMessage(String merchantId);
@ApiMethod("查询订单审核记录")
@ApiParam(name="condition",notes="订单号",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("审核日志记录")
RpcResponse<List<GoodsOrderApplyRecordLogDTO>> listGoodsOrderApplyRecordLog(GoodsOrderApplyRecordDTO condition);
}
......@@ -180,4 +180,8 @@ public interface PurchaseOrderRemote {
@ApiResponse("退货结果")
RpcResponse<Boolean> goodsRefund(PurchaseOrderDTO condition);
@ApiMethod("采购订单24h总监催审通知")
@ApiResponse("催审通知结果")
RpcResponse<Void> remindAuditOverTime();
}
......@@ -26,6 +26,7 @@ public class DateUtils extends cn.com.glsx.framework.core.util.DateUtils {
public static final DateTimeFormatter DEFAULT_DATE_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd");
public static final String FIRST_DATE_TIME = "yyyy-MM-dd 00:00:00";
public static final String END_DATE_TIME = "yyyy-MM-dd 23:59:59";
public static final String CN_DATE_FORMAT = "yyyy年MM月dd日";
public static final String YESTERDAY = "昨日";
public static final String TODAY = "今日";
......
......@@ -8,12 +8,14 @@
</parent>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-smartcarlife</artifactId>
<version>5.5.3-SNAPSHOT</version>
<version>5.6.4-SNAPSHOT</version>
<name>rpc-dj-smartcarlife</name>
<packaging>war</packaging>
<properties>
<skipTests>true</skipTests>
<smartcarlife.api.version>5.6.2-SNAPSHOT</smartcarlife.api.version>
<smartcarlife.api.version>5.6.4-SNAPSHOT</smartcarlife.api.version>
<shopmall.api.version>5.6.4-SNAPSHOT</shopmall.api.version>
<stoassistant.api.version>5.6.4-SNAPSHOT</stoassistant.api.version>
</properties>
<dependencies>
<dependency>
......@@ -127,7 +129,7 @@
<dependency>
<groupId>cn.com.glsx.scrm</groupId>
<artifactId>rpc-scrm-shopmall-api</artifactId>
<version>4.53.0-SNAPSHOT</version>
<version>${shopmall.api.version}</version>
</dependency>
<dependency>
<groupId>org.oreframework.boot</groupId>
......@@ -146,7 +148,7 @@
<dependency>
<groupId>cn.com.glsx.stoassistant</groupId>
<artifactId>rpc-scrm-stoassistant-api</artifactId>
<version>4.53.0-SNAPSHOT</version>
<version>${stoassistant.api.version}</version>
</dependency>
<dependency>
<groupId>cn.com.glsx.wika</groupId>
......
......@@ -5,9 +5,12 @@ import cn.com.glsx.dj.smartcarlife.dto.PurchaseOrderPageDTO;
import cn.com.glsx.dj.smartcarlife.dto.PurchaseOrderShipmentDetailExportDTO;
import cn.com.glsx.dj.smartcarlife.model.PurchaseOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.Date;
import java.util.List;
@Mapper
public interface PurchaseOrderMapper extends OreMapper<PurchaseOrder> {
......@@ -62,4 +65,11 @@ public interface PurchaseOrderMapper extends OreMapper<PurchaseOrder> {
* @return 采购订单详情
*/
PurchaseOrderPageDTO h5Detail(String orderCode);
/**
* 查询总监审核节点超过时间未审核的采购订单列表
* @param deadlineDate 截止时间
* @return 采购订单列表
*/
List<PurchaseOrderPageDTO> listDirectorAuditOverTime(@Param("deadlineDate") Date deadlineDate);
}
......@@ -35,4 +35,8 @@ public interface StaffDailyReportHuaweiMapper extends OreMapper<StaffDailyReport
List<StaffDailyReportHuaweiDTO> listStaffDailyReportHuaweiBaseInfoByCondition(StaffDailyReportHuaweiDTO singleStaffReportParam);
List<String> selectYqMerchantId(MerchantDiJiaDTO dto);
BigDecimal getStaffExtendedWarrantyShouldToShopCount(StaffDailyReportHuaweiDTO condition);
BigDecimal getStaffEquityShouldToShopCount(StaffDailyReportHuaweiDTO condition);
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package cn.com.glsx.dj.smartcarlife.remote;
import cn.com.glsx.dj.smartcarlife.dto.GoodsOrderApplyRecordDTO;
import cn.com.glsx.dj.smartcarlife.dto.GoodsOrderApplyRecordLogDTO;
import cn.com.glsx.dj.smartcarlife.dto.refund.RefundApplyRecordDTO;
import cn.com.glsx.dj.smartcarlife.service.GoodsOrderApplyRecordService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
......@@ -12,6 +13,8 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
@Slf4j
@DubboService(validation = "true", version = "1.0.0")
public class GoodsOrderApplyRecordRemoteImpl implements GoodsOrderApplyRecordRemote{
......@@ -69,4 +72,14 @@ public class GoodsOrderApplyRecordRemoteImpl implements GoodsOrderApplyRecordRem
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<GoodsOrderApplyRecordLogDTO>> listGoodsOrderApplyRecordLog(GoodsOrderApplyRecordDTO condition) {
try {
return RpcResponse.success(goodsOrderApplyRecordService.listGoodsOrderApplyRecordLog(condition));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
}
......@@ -344,4 +344,15 @@ public class PurchaseOrderRemoteImpl implements PurchaseOrderRemote {
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Void> remindAuditOverTime() {
try {
purchaseOrderService.remindAuditOverTime();
return RpcResponse.success(null);
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
}
......@@ -28,6 +28,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.compress.utils.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.RandomUtils;
import org.oreframework.boot.env.OrePropertyConfigurer;
import org.oreframework.fastdfs.DefaultFastDFSClient;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -460,7 +461,8 @@ public class GoodsInfoService {
try{
Page<GoodsInfoDTO> page = PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize());
goodsInfoMapper.list(condition);
if (page.getResult() != null) {
if (page.getResult() != null
&& page.size() <= OrePropertyConfigurer.getProperty("goods.info.listWithPage.fillDetail.threshold", Integer.class, 40)) {
for (GoodsInfoDTO dto:page.getResult()){
if (StringUtils.isNotEmpty(dto.getGoodsCode())) {
dto.setGoodsImgList(goodsResourceService.listByGoodsCodeBizType(dto.getGoodsCode(),
......
......@@ -171,6 +171,9 @@ public class GoodsOrderApplyRecordService {
orderApplyRecordDTO.setOutTradeNo(ObjectUtil.isNotNull(goodsOrderInfo.getPayOrder()) ? goodsOrderInfo.getPayOrder().getOutTradeNo() : StringUtils.EMPTY);
}
}
//填充订单申请审批操作日志
fillApplyLogList(orderApplyRecordDTO);
return orderApplyRecordDTO;
}catch(RpcServiceException e){
log.error("查询订单审核记录详情异常,异常原因:{}",e.getMessage(), e);
......@@ -182,6 +185,22 @@ public class GoodsOrderApplyRecordService {
}
/**
* @description: 填充订单申请审批日志
* @param: [orderApplyRecordDTO]
* @date: 2026/1/21 10:34
*/
private void fillApplyLogList(GoodsOrderApplyRecordDTO orderApplyRecordDTO) {
GoodsOrderApplyRecordLogDTO recordLogDTO = new GoodsOrderApplyRecordLogDTO();
recordLogDTO.setOrderCode(orderApplyRecordDTO.getOrderCode());
List<GoodsOrderApplyRecordLogDTO> recordLogDTOS = goodsOrderApplyRecordLogService.listGoodsOrderApplyRecordLog(recordLogDTO);
if (CollectionUtils.isNotEmpty(recordLogDTOS)) {
//剔除before_status为null 的数据
recordLogDTOS = recordLogDTOS.stream().filter(o -> ObjectUtil.isNotNull(o.getBeforeStatus())).collect(Collectors.toList());
orderApplyRecordDTO.setApplyLogList(recordLogDTOS);
}
}
/**
* @description: 订单申请单审批
* @param: [condition]
* @return: java.lang.Boolean
......@@ -435,4 +454,30 @@ public class GoodsOrderApplyRecordService {
}
return Boolean.TRUE;
}
/**
* @description: 查询订单审核日志记录
* @param: [condition]
* @return: java.util.List<cn.com.glsx.dj.smartcarlife.dto.GoodsOrderApplyRecordLogDTO>
* @date: 2026/3/5 9:38
*/
public List<GoodsOrderApplyRecordLogDTO> listGoodsOrderApplyRecordLog(GoodsOrderApplyRecordDTO condition) {
RpcAssert.assertNotNull(condition, DefaultErrorEnum.DATA_NULL, "GoodsOrderApplyRecordDTO not be null");
RpcAssert.assertNotNull(condition.getOrderCode(), DefaultErrorEnum.DATA_NULL, "orderCode not be null");
try {
GoodsOrderApplyRecordLogDTO goodsOrderApplyRecordLogDTO = GoodsOrderApplyRecordLogDTO.builder().orderCode(condition.getOrderCode()).build();
List<GoodsOrderApplyRecordLogDTO> recordLogDTOS = goodsOrderApplyRecordLogService.listGoodsOrderApplyRecordLog(goodsOrderApplyRecordLogDTO);
if (CollectionUtils.isNotEmpty(recordLogDTOS)) {
//剔除before_status为null 的数据
recordLogDTOS = recordLogDTOS.stream().filter(o -> ObjectUtil.isNotNull(o.getBeforeStatus())).collect(Collectors.toList());
}
return recordLogDTOS;
} catch (RpcServiceException e) {
log.error("查询订单审批记录日志异常,异常原因:{}", e.getMessage(), e);
throw e;
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
}
......@@ -404,6 +404,9 @@ public class GoodsOrderService {
@Autowired
private GoodsOrderApplyRecordLogService GoodsOrderApplyRecordLogService;
@Autowired
private ShopMerchantDirectorConfigService shopMerchantDirectorConfigService;
public String createOrderCode() {
//15位
......@@ -1116,6 +1119,20 @@ public class GoodsOrderService {
if (pagination.getCondition().getDirectSalesFlag() != null) {
pagination.getCondition().setPartnerMerchantId(djServiceMerchantId);
}
List<Integer> merchantIds;
if (Objects.nonNull(pagination.getCondition().getAdminFlag()) && !pagination.getCondition().getAdminFlag()) {
//查询当前登录人所绑定的线上运营门店ids
merchantIds = getLoginUserMerchantIds(pagination.getCondition());
//我的待审开关打开
if (Objects.nonNull(pagination.getCondition().getMyWaitApplySwitch())
&& CommonFlagEnum.YES.getCode().equals(pagination.getCondition().getMyWaitApplySwitch())) {
pagination.getCondition().setMerchantIdList(merchantIds);
pagination.getCondition().setGoodsOrderApplyStatus(GoodsOrderApplyStatusEnum.ONLINE_SUPERVISION_AUDIT.getValue());
}
} else {
merchantIds = new ArrayList<>();
}
Page<GoodsOrderDTO> page = PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize(), pagination.isNeedCount());
goodsOrderMapper.listWithPage(pagination.getCondition());
if (CollectionUtils.isNotEmpty(page.getResult())) {
......@@ -1136,6 +1153,8 @@ public class GoodsOrderService {
} else {
item.setDirectSalesFlag(OperationModeEnum.NOT_DIRECT_SALES.getValue());
}
//填充是否可以审核标识
fillCanApplyFlag(pagination.getCondition().getAdminFlag(), item, merchantIds);
});
//查询子订单关联施工单信息
if (CollectionUtils.isNotEmpty(subCodeList)) {
......@@ -1150,6 +1169,52 @@ public class GoodsOrderService {
}
}
/**
* 填充是否可以审核标识
* @param adminFlag
* @param item
* @param merchantIds
*/
private static void fillCanApplyFlag(Boolean adminFlag, GoodsOrderDTO item, List<Integer> merchantIds) {
//1、审核节点到了 “线上运营待审核”
if (Objects.nonNull(adminFlag) && Objects.equals(item.getGoodsOrderApplyStatus(), GoodsOrderApplyStatusEnum.ONLINE_SUPERVISION_AUDIT.getValue())) {
//2、超管可以直接审
if (adminFlag) {
item.setCanApplyFlag(CommonFlagEnum.YES.getCode());
}
//2、登录人为线上运营,所绑定的门店ids包含此条数据所在门店
else {
if( CollectionUtils.isNotEmpty(merchantIds) && merchantIds.contains(item.getMerchantId())){
item.setCanApplyFlag(CommonFlagEnum.YES.getCode());
}
}
}
}
/**
* 获取登录人所绑定的线上运营门店ids
* @param goodsOrderDTO
* @return
*/
private List<Integer> getLoginUserMerchantIds(GoodsOrderDTO goodsOrderDTO) {
List<Integer> merchantIds = new ArrayList<>();
if (StringUtils.isNotBlank(goodsOrderDTO.getLoginPhone())) {
List<ShopMerchantDirectorConfig> shopMerchantDirectorConfigs = shopMerchantDirectorConfigService.listShopMerchantDirectorConfigByPhone(goodsOrderDTO.getLoginPhone());
if (CollectionUtils.isNotEmpty(shopMerchantDirectorConfigs)) {
//筛选directorType为 5的数据
if (Objects.equals(goodsOrderDTO.getSceneType(), SceneTypeEnum.SCENE1_1.getValue())) {
merchantIds = shopMerchantDirectorConfigs.stream().filter(item -> item.getDirectorType().equals(DirectorTypeEnum.DF_DIRECTOR.getValue())).map(ShopMerchantDirectorConfig::getMerchantId).collect(Collectors.toList());
}
//筛选directorType为7 的数据
if (Objects.equals(goodsOrderDTO.getSceneType(), SceneTypeEnum.SCENE1_0.getValue())) {
merchantIds = shopMerchantDirectorConfigs.stream().filter(item -> item.getDirectorType().equals(DirectorTypeEnum.DF_DIRECTOR_2_1.getValue())).map(ShopMerchantDirectorConfig::getMerchantId).collect(Collectors.toList());
}
}
}
log.info("场景值:{},登录人手机号:{},绑定的线上运营门店ids:{}", goodsOrderDTO.getSceneType(),goodsOrderDTO.getLoginPhone(), JSONObject.toJSONString(merchantIds));
return merchantIds;
}
public Page<GoodsOrderDTO> listForExportWithPage(RpcPagination<GoodsOrderDTO> pagination) {
RpcAssert.assertNotNull(pagination, DefaultErrorEnum.DATA_NULL, "RpcPagination not be null");
try {
......@@ -1158,6 +1223,14 @@ public class GoodsOrderService {
if (pagination.getCondition().getDirectSalesFlag() != null) {
pagination.getCondition().setPartnerMerchantId(djServiceMerchantId);
}
//我的待审开关打开
if (Objects.nonNull(pagination.getCondition().getMyWaitApplySwitch())
&& CommonFlagEnum.YES.getCode().equals(pagination.getCondition().getMyWaitApplySwitch())) {
//查询当前登录人所绑定的线上运营门店ids
List<Integer> merchantIds = getLoginUserMerchantIds(pagination.getCondition());
pagination.getCondition().setMerchantIdList(merchantIds);
pagination.getCondition().setGoodsOrderApplyStatus(GoodsOrderApplyStatusEnum.ONLINE_SUPERVISION_AUDIT.getValue());
}
Page<GoodsOrderDTO> page = PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize(), pagination.isNeedCount());
List<GoodsOrderDTO> goodsOrderDTOS = goodsOrderMapper.listForExport(pagination.getCondition());
//查询所有服务商名称
......@@ -1225,6 +1298,19 @@ public class GoodsOrderService {
if (goodsOrderDTO.getDirectSalesFlag() != null) {
goodsOrderDTO.setPartnerMerchantId(djServiceMerchantId);
}
List<Integer> merchantIds;
if (Objects.nonNull(goodsOrderDTO.getAdminFlag()) && !goodsOrderDTO.getAdminFlag()) {
//查询当前登录人所绑定的线上运营门店ids
merchantIds = getLoginUserMerchantIds(goodsOrderDTO);
//我的待审开关打开
if (Objects.nonNull(goodsOrderDTO.getMyWaitApplySwitch())
&& CommonFlagEnum.YES.getCode().equals(goodsOrderDTO.getMyWaitApplySwitch())) {
goodsOrderDTO.setMerchantIdList(merchantIds);
goodsOrderDTO.setGoodsOrderApplyStatus(GoodsOrderApplyStatusEnum.ONLINE_SUPERVISION_AUDIT.getValue());
}
} else {
merchantIds = new ArrayList<>();
}
return goodsOrderMapper.countList(goodsOrderDTO);
} catch (Exception e) {
log.error(e.getMessage(), e);
......@@ -3908,6 +3994,10 @@ public class GoodsOrderService {
String tradeNoStr = payOrderList.stream().map(PayOrder::getTradeNo).collect(Collectors.joining(","));
String outTradeNoStr = payOrderList.stream().map(PayOrder::getOutTradeNo).collect(Collectors.joining(","));
if (StringUtils.isBlank(newOutTradeNo)) {
tradeNoStr = tradeNoStr + ",";
outTradeNoStr = outTradeNoStr + ",";
}
//按照成功时间倒叙排列
payOrderList = payOrderList.stream().sorted(Comparator.comparing(PayOrder::getSuccessDate).reversed()).collect(Collectors.toList());
......
......@@ -41,6 +41,7 @@ import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.MessageFormat;
import java.util.*;
import java.util.function.Function;
......@@ -268,7 +269,7 @@ public class GoodsSubOrderService {
subOrder.setDjOrderType(DjOrderTypeEnum.NORMAL.getValue());
}
if(subOrder.getTotalPrice() == null){
subOrder.setTotalPrice(subOrder.getUpgradePrice().multiply(subOrder.getUpgradeDiscount()).divide(BigDecimal.TEN, 2, BigDecimal.ROUND_HALF_UP));
subOrder.setTotalPrice(subOrder.getUpgradePrice().multiply(subOrder.getUpgradeDiscount()).divide(BigDecimal.TEN, 2, RoundingMode.UP));
//subOrder.setFinalPrice(subOrder.getTotalPrice());
}else{
subOrder.setUpgradeDiscount(null);
......@@ -278,26 +279,28 @@ public class GoodsSubOrderService {
if(subOrder.getTotalPrice().compareTo(BigDecimal.ZERO) < 0){
throw new RpcServiceException(DefaultErrorEnum.DATA_INVALID,"价格异常");
}
//保存一份商品修改后的价格
subOrder.setSingleProductSalesPrice(subOrder.getTotalPrice());
if (!Objects.equals(orderSource,OrderSource.OWNER_PREFERENCE_ORDER.getValue()) &&
!Objects.equals(orderSource,OrderSource.SHOPMALL_ACTIVITY_RELATION_INPUT.getValue())){
subOrder.setTotalPrice(subOrder.getTotalPrice().multiply(BigDecimal.valueOf(subOrder.getNumber())));
subOrder.setFinalPrice(subOrder.getTotalPrice());
//subOrder.setFinalPrice(subOrder.getTotalPrice());
}
//计算实际付款金额
//正常订单类型
if(Objects.equals(subOrder.getDjOrderType(),DjOrderTypeEnum.NORMAL.getValue())){
subOrder.setFinalPrice(subOrder.getTotalPrice());
}else {
//其他类型订单,计算一次实际付款金额
//其他类型订单,计算一次实际付款金额(优先取用前端传入的价格,没有时兜底后端计算一次)
BigDecimal discountAmount = BigDecimal.ZERO;
BigDecimal finalPrice = subOrder.getTotalPrice();
BigDecimal finalPrice = subOrder.getFinalPrice();
if(subOrder.getDiscountAmount() == null){
if(Objects.equals(subOrder.getDiscountType(), GoodsDiscountTypeEnum.RATIO_DISCOUNT.getValue())){
finalPrice = subOrder.getTotalPrice().multiply(subOrder.getDiscountValue()).divide(BigDecimal.TEN, 2, BigDecimal.ROUND_HALF_UP);
discountAmount = subOrder.getTotalPrice().subtract(finalPrice).setScale(2, BigDecimal.ROUND_HALF_UP);
finalPrice = subOrder.getTotalPrice().multiply(subOrder.getDiscountValue()).divide(BigDecimal.TEN, 2, RoundingMode.UP);
discountAmount = subOrder.getTotalPrice().subtract(finalPrice).setScale(2,RoundingMode.UNNECESSARY);
} else if (Objects.equals(subOrder.getDiscountType(), GoodsDiscountTypeEnum.AMOUNT_DISCOUNT.getValue())) {
finalPrice = subOrder.getTotalPrice().subtract(subOrder.getDiscountValue()).setScale(2, BigDecimal.ROUND_HALF_UP);
discountAmount = subOrder.getDiscountValue().setScale(2, BigDecimal.ROUND_HALF_UP);
finalPrice = subOrder.getTotalPrice().subtract(subOrder.getDiscountValue()).setScale(2, RoundingMode.UP);
discountAmount = subOrder.getDiscountValue().setScale(2,RoundingMode.UNNECESSARY);
} else if (Objects.equals(subOrder.getDiscountType(), GoodsDiscountTypeEnum.NO_DISCOUNT.getValue()) || Objects.equals(subOrder.getDiscountType(), GoodsDiscountTypeEnum.NO_GIFT.getValue())){
finalPrice = subOrder.getTotalPrice();
discountAmount = BigDecimal.ZERO;
......@@ -306,7 +309,6 @@ public class GoodsSubOrderService {
discountAmount = subOrder.getTotalPrice();
}
}else {
finalPrice = subOrder.getTotalPrice().subtract(subOrder.getDiscountAmount()).setScale(2, BigDecimal.ROUND_HALF_UP);
discountAmount = subOrder.getDiscountAmount();
}
subOrder.setFinalPrice(finalPrice);
......
......@@ -1214,8 +1214,8 @@ public class WaitInputOrderService {
return totalFee;
}).reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal totalOrderFee = orderDTOS.stream()
.filter(o -> o != null && o.getTotalPrice() != null)
.map(GoodsOrderDTO::getTotalPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
.filter(o -> o != null && o.getFinalPrice() != null)
.map(GoodsOrderDTO::getFinalPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
if (!Objects.equals(totalTradeFee, totalOrderFee)) {
StringBuilder msg = new StringBuilder();
for (String tradeNo : dto.getTradeNos()) {
......
package cn.com.glsx.dj.smartcarlife.service.goods;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import cn.com.glsx.dj.smartcarlife.dto.strategy.MerchantBusinessDTO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.RandomUtils;
import org.apache.commons.lang3.StringUtils;
import org.oreframework.boot.env.OrePropertyConfigurer;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import cn.com.glsx.dj.smartcarlife.constant.CommonConstants;
import cn.com.glsx.dj.smartcarlife.dto.MerchantPackageRequestDTO;
import cn.com.glsx.dj.smartcarlife.dto.ProductSupplyRatioDTO;
......@@ -35,34 +9,19 @@ import cn.com.glsx.dj.smartcarlife.dto.createBusiness.CreateBusinessProductDTO;
import cn.com.glsx.dj.smartcarlife.dto.goods.MerchantGoodsInfoDTO;
import cn.com.glsx.dj.smartcarlife.dto.goods.MerchantPackageGoodsInfoDTO;
import cn.com.glsx.dj.smartcarlife.dto.goods.PartnerMerchantGoodsInfoDTO;
import cn.com.glsx.dj.smartcarlife.enums.CarLifeEnum;
import cn.com.glsx.dj.smartcarlife.dto.strategy.MerchantBusinessDTO;
import cn.com.glsx.dj.smartcarlife.enums.*;
import cn.com.glsx.dj.smartcarlife.enums.CarLifeEnum.GoodsReviewTypeEnum;
import cn.com.glsx.dj.smartcarlife.enums.CarLifeEnum.MerchantGoodsStatus;
import cn.com.glsx.dj.smartcarlife.enums.CarLifeEnum.MerchantShelfSource;
import cn.com.glsx.dj.smartcarlife.enums.CarLifeEnum.SupplyMode;
import cn.com.glsx.dj.smartcarlife.enums.RpcErrorEnum;
import cn.com.glsx.dj.smartcarlife.enums.SceneTypeEnum;
import cn.com.glsx.dj.smartcarlife.enums.StaffStatusEnum;
import cn.com.glsx.dj.smartcarlife.enums.createBusinessApprove.ProductTypeEnum;
import cn.com.glsx.dj.smartcarlife.enums.createBusinessApprove.SystemStatusEnum;
import cn.com.glsx.dj.smartcarlife.manager.PushGoodsManager;
import cn.com.glsx.dj.smartcarlife.mapper.MerchantGoodsInfoMapper;
import cn.com.glsx.dj.smartcarlife.model.GoodsInfo;
import cn.com.glsx.dj.smartcarlife.model.GoodsPositionRelation;
import cn.com.glsx.dj.smartcarlife.model.GoodsReviewLog;
import cn.com.glsx.dj.smartcarlife.model.MerchantGoodsInfo;
import cn.com.glsx.dj.smartcarlife.model.MerchantGoodsRef;
import cn.com.glsx.dj.smartcarlife.model.MerchantPackageGoodsInfo;
import cn.com.glsx.dj.smartcarlife.model.UpgradeGoods;
import cn.com.glsx.dj.smartcarlife.model.UpgradeGoodsServiceItemsRelation;
import cn.com.glsx.dj.smartcarlife.model.*;
import cn.com.glsx.dj.smartcarlife.response.goods.PackageGoodsResponse;
import cn.com.glsx.dj.smartcarlife.service.BaseGoodsService;
import cn.com.glsx.dj.smartcarlife.service.GoodsPositionRelationService;
import cn.com.glsx.dj.smartcarlife.service.GoodsReviewLogService;
import cn.com.glsx.dj.smartcarlife.service.MerchantService;
import cn.com.glsx.dj.smartcarlife.service.UpgradeGoodsService;
import cn.com.glsx.dj.smartcarlife.service.UpgradeGoodsServiceItemsRelationService;
import cn.com.glsx.dj.smartcarlife.service.YqMerchantConfigService;
import cn.com.glsx.dj.smartcarlife.service.*;
import cn.com.glsx.dj.smartcarlife.service.createBusiness.CreateBusinessProductService;
import cn.com.glsx.dj.smartcarlife.service.stock.MerchantGoodsStockMonthReportService;
import cn.com.glsx.dj.smartcarlife.util.CommonUtil;
......@@ -79,8 +38,25 @@ import cn.com.glsx.scrm.equity.dto.service.ServiceItemsGradeConfigDTO;
import cn.com.glsx.scrm.equity.remote.ServiceItemsRemote;
import cn.com.glsx.scrm.shopmall.dto.DistributeGoodsStatusDTO;
import cn.com.glsx.scrm.shopmall.remote.GoodsRemote;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.RandomUtils;
import org.apache.commons.lang3.StringUtils;
import org.oreframework.boot.env.OrePropertyConfigurer;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@Service
@Transactional(propagation= Propagation.SUPPORTS,rollbackFor= RpcServiceException.class)
......@@ -188,6 +164,22 @@ public class MerchantGoodsInfoService {
}
public void updateBeforeValid(MerchantGoodsInfoDTO record,boolean isPackage) {
// 售价有效期:默认终生有效;临时有效必须有完整区间且开始<=结束
if(record.getSellPriceValidType() == null) {
record.setSellPriceValidType(SellPriceValidTypeEnum.LIFETIME.getValue());
}
if(record.getSellPriceValidType() == SellPriceValidTypeEnum.LIFETIME.getValue()) {
record.setTempValidStartDate(null);
record.setTempValidEndDate(null);
}else if(record.getSellPriceValidType() == SellPriceValidTypeEnum.TEMPORARY.getValue()) {
RpcAssert.assertNotNull(record.getTempValidStartDate(), DefaultErrorEnum.DATA_NULL, "临时有效开始日期未填写");
RpcAssert.assertNotNull(record.getTempValidEndDate(), DefaultErrorEnum.DATA_NULL, "临时有效结束日期未填写");
record.setTempValidStartDate(truncateToDate(record.getTempValidStartDate()));
record.setTempValidEndDate(truncateToDate(record.getTempValidEndDate()));
RpcAssert.assertIsTrue(!record.getTempValidStartDate().after(record.getTempValidEndDate()),
DefaultErrorEnum.SERVICE_ERROR, "临时有效开始日期不得晚于结束日期");
}
UpgradeGoodsDTO upgradeGoods = thiz.goodsPositionValid(record,false);
List<Integer> extendedInsuranceTypeIdList = CommonUtil.convert2Integer(env.getProperty("smartcarlife.goodsType.extendedInsurance", "1").split(","));//延保类
List<Integer> equityTypeIdList = CommonUtil.convert2Integer(env.getProperty("smartcarlife.goodsType.equity", "126").split(","));//权益类
......@@ -230,6 +222,19 @@ public class MerchantGoodsInfoService {
}
}
private Date truncateToDate(Date date) {
if(date == null) {
return null;
}
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
return calendar.getTime();
}
public long count(MerchantGoodsInfoDTO condition) {
try {
return merchantGoodsInfoMapper.count(condition);
......@@ -255,7 +260,7 @@ public class MerchantGoodsInfoService {
record.setCreatedBy(record.getUpdatedBy());
record.setCreatedDate(record.getUpdatedDate());
record.setFinanceCheckFlag(StatusEnum.NO.getValue());
merchantGoodsInfoMapper.insertUseGeneratedKeys(record);
merchantGoodsInfoMapper.insertSelective(record);
List<MerchantGoodsRef> merchantGoodsRefList = new ArrayList<>();
merchantGoodsRefList.add(MerchantGoodsRef.builder().merchantId(CommonConstants.DEFAULT_TEST_MERCHANT_ID).merchantName("测试商户").build());
......@@ -293,7 +298,7 @@ public class MerchantGoodsInfoService {
record.setMerchantGoodsCode(this.createMerchantGoodsCode());
record.setCreatedBy(record.getUpdatedBy());
record.setCreatedDate(record.getUpdatedDate());
merchantGoodsInfoMapper.insertUseGeneratedKeys(record);
merchantGoodsInfoMapper.insertSelective(record);
merchantGoodsRefService.updateBatch(record.getId(), record.getMerchantGoodsRefList(), record.getUpdatedBy());
if(!isPackageGoods) {
......@@ -574,7 +579,7 @@ public class MerchantGoodsInfoService {
record.setUpdatedDate(now);
record.setDeletedFlag(DeletedFlagEnum.N.name());
record.setFinanceCheckFlag(StatusEnum.NO.getValue());
merchantGoodsInfoMapper.insertUseGeneratedKeys(record);
merchantGoodsInfoMapper.insertSelective(record);
}
......
......@@ -153,6 +153,7 @@ public class SelectOrderGoodsService {
condition.setSuitCarPrice(request.getSuitCarPrice());
condition.setFilsterPackageGoods(1);//非套餐商品
condition.setSeriesId(request.getSeriesId());
condition.setFilterSellPriceValid(1);
List<MerchantGoodsInfoDTO> merchantGoodsList = merchantGoodsInfoService.listByMerchantId(condition);
if(CollectionUtils.isNotEmpty(merchantGoodsList)) {
Map<String,GoodsResponse> multipleSpecificationsGoodsMap = new HashMap<>();
......
......@@ -2095,6 +2095,7 @@ public class VdQuotationService {
.packageCode(goodsMap.get(quotationGoods.getId().toString()).getPackageId())
.totalPrice(price)
.finalPrice(finalPrice)
.singleProductFinalPrice(finalPrice)
.discountType(discountTypeByte)
.discountValue(discountValue)
.discountAmount(discountAmount)
......@@ -2119,11 +2120,13 @@ public class VdQuotationService {
BigDecimal discountAmount = new BigDecimal(String.valueOf(discountAmountDb)).divide(new BigDecimal("100.00"), 2, BigDecimal.ROUND_HALF_UP);
goodsSubOrderDTO.setTotalPrice(price);
goodsSubOrderDTO.setFinalPrice(finalPrice);
goodsSubOrderDTO.setSingleProductFinalPrice(finalPrice);
goodsSubOrderDTO.setDiscountAmount(discountAmount);
if (envType != null && envType.equals("test")) {
//测试环境支付永远设置为0.01元
goodsSubOrderDTO.setTotalPrice(new BigDecimal("0.01"));
goodsSubOrderDTO.setFinalPrice(new BigDecimal("0.01"));
goodsSubOrderDTO.setSingleProductFinalPrice(new BigDecimal("0.01"));
goodsSubOrderDTO.setDiscountAmount(new BigDecimal("0"));
}
subOrderList.add(goodsSubOrderDTO);
......
......@@ -124,6 +124,33 @@ public class DataUtils {
}
/**
* 对两个 Integer 对象求和,如果为 null 则视为 0。
*
* @param a 第一个整数
* @param b 第二个整数
* @return 两个整数的和
*/
public static int sumWithNullAsZero(Integer a, Integer b) {
return (a == null ? 0 : a) + (b == null ? 0 : b);
}
/**
* 对多个 Integer 对象求和,如果为 null 则视为 0。
*
* @param numbers 整数数组(可变参数)
* @return 所有整数的和
*/
public static int sumWithNullAsZero(Integer... numbers) {
int total = 0;
if (numbers != null) {
for (Integer num : numbers) {
total += (num == null ? 0 : num);
}
}
return total;
}
/**
* @description: 去除掉字符串中的filterStr字段,并去重后用/拼接
* @param: [input, filterStr]
* @return: java.lang.String
......
......@@ -83,6 +83,7 @@
<result column="latestOrderDate" property="latestOrderDate"/>
<result column="partner_merchant_id" property="partnerMerchantId"/>
<result column="goodsOrderApplyStatus" property="goodsOrderApplyStatus"/>
<result column="incorrect_order_code" property="incorrectOrderCode" jdbcType="VARCHAR" />
<association property="customer" javaType="cn.com.glsx.dj.smartcarlife.dto.GoodsOrderCustomerDTO">
<result column="customer_id" property="customerId"/>
<result column="stand_no" property="standNo" jdbcType="VARCHAR" />
......@@ -222,6 +223,8 @@
<result column="upgrade_warranty_period" property="upgradeWarrantyPeriod"/>
<result column="gift_cost" jdbcType="DECIMAL" property="giftCost" />
<result column="partner_profit_per" property="partnerProfitPer" jdbcType="DECIMAL" />
<result column="single_product_sales_price" property="singleProductSalesPrice" jdbcType="DECIMAL" />
<result column="single_product_final_price" property="singleProductFinalPrice" jdbcType="DECIMAL" />
<result column="dclgso_total_price" property="totalPrice" jdbcType="DECIMAL" />
<result column="dclgso_final_price" property="finalPrice" jdbcType="DECIMAL" />
<result column="discount_type" property="discountType" jdbcType="TINYINT" />
......@@ -253,6 +256,7 @@
<result column="approver_name" property="approverName"/>
<result column="construction_flag_new" property="constructionFlag"/>
<result column="construction_status" property="constructionStatus"/>
<result column="single_product_sales_price" jdbcType="DECIMAL" property="singleProductSalesPrice"/>
</collection>
<collection property="technicianConfigDTOList" javaType="java.util.List" ofType="cn.com.glsx.dj.smartcarlife.dto.businessassistant.TechnicianConfigDTO">
<result column="tc_id" property="id"/>
......@@ -356,6 +360,9 @@
<if test="businessType != null">
and go.business_type = #{businessType}
</if>
<if test="djOrderType != null">
and go.dj_order_type = #{djOrderType}
</if>
<if test="orderCode != null and orderCode !=''">
and go.order_code = #{orderCode}
</if>
......@@ -753,12 +760,13 @@
dclgso.upgrade_brand_merchant_code, dclgso.upgrade_brand_merchant_name, dclgso.film_roll_no,
dclgso.upgrade_thumb_url, dclgso.upgrade_shop_price, dclgso.upgrade_price, dclgso.upgrade_discount, dclgso.upgrade_extra_cost,
dclgso.partner_profit_per, dclgso.upgrade_retail_price,upgrade_incentive_type, dclgso.upgrade_incentive_cost, dclgso.base_shop_price,
dclgso.upgrade_shop_min_price, dclgso.upgrade_warranty_period, dclgso.total_price as dclgso_total_price,dclgso.final_price as dclgso_final_price ,dclgso.dj_order_type as dclgso_dj_order_type,dclgso.discount_type,dclgso.discount_amount,dclgso.discount_value,
dclgso.upgrade_shop_min_price, dclgso.upgrade_warranty_period, dclgso.total_price as dclgso_total_price,dclgso.final_price as dclgso_final_price,
dclgso.dj_order_type as dclgso_dj_order_type,dclgso.discount_type,dclgso.discount_amount,dclgso.discount_value,dclgso.single_product_sales_price, dclgso.single_product_final_price,
dclgso.profit_type, dclgso.profit_value, dclgso.number,
dclcwc.card_code, dclcwc.warranty_price,dclgso.goods_source, dclgso.merchant_goods_id, dclgso.virtual_account_cost, dclgso.recovery_cost, dclgso.upgrade_dj_cost, dclgso.upgrade_third_party_cost,
dclgso.technician_name as dclgso_technician_name,dclgso.technician_uuid as dclgso_technician_uuid,dclgso.technician_id as dclgso_technician_id,
dclgso.status as dclgso_status,dclgso.refund_amount as sub_refund_amount,
dclgso.specification_name_sequence,dclgso.specification_type_sequence,dclgso.specification_data,dclgso.construction_flag as construction_flag_new,
dclgso.specification_name_sequence,dclgso.specification_type_sequence,dclgso.specification_data,dclgso.construction_flag as construction_flag_new,dclgso.single_product_sales_price,
<!-- 子订单技师施工图审批 -->
otca.approve_status,otca.approver_uuid,otca.approver_name,
<!-- 订单评论信息 -->
......@@ -858,6 +866,7 @@
dclgso.order_code as dclgso_order_code, dclgso.sub_order_code, dclgso.base_goods_commodity_code, dclgso.base_goods_name,
dclgso.upgrade_goods_commodity_code, dclgso.upgrade_goods_name, dclgso.upgrade_goods_alias, dclgso.upgrade_warranty_period,
dclgso.total_price as dclgso_total_price,dclgso.final_price as dclgso_final_price, dclgso.discount_amount,
dclgso.single_product_sales_price, dclgso.single_product_final_price,dclgso.upgrade_price,
dclgso.number, dclgso.upgrade_goods_position, dclgso.merchant_goods_id, dclgso.upgrade_brand_merchant_name,
dclgso.film_roll_no, dclgso.merchant_goods_code,dclgso.package_code, dclgso.package_name, dclgso.package_alias,
dclgso.specification_data, dclgso.specification_type_sequence, dclgso.upgrade_goods_type_name, dclgso.supplier_name,
......@@ -875,7 +884,7 @@
go.failure_flag, go.install_merchant_name, go.marketing_merchant_name, go.sub_shop_merchant_id,go.sub_shop_merchant_name,go.merchant_id,go.scene_type,
go.profit_allocation_status, go.wait_profit_allocation_date, go.specify_account_rule_id, go.specify_division_rule_id,
go.technician_name as go_technician_name, go.technician_uuid, go.technician_id as go_technician_id, go.business_type,ifnull(go.invoice_status,1) as invoice_status,
go.dj_order_type,go.abnormal_flag,
go.dj_order_type,go.abnormal_flag, CASE WHEN go.status = 11 THEN null ELSE go.associated_order_code END AS incorrect_order_code,
<!-- 订单客户信息 -->
goc.stand_no, goc.car_brand, goc.car_childs_brand_name, goc.car_series_name, goc.car_type_name, goc.customer_name, goc.customer_phone,
goc.sales_type,
......@@ -939,7 +948,11 @@
left join dj_car_life_goods_order_customer goc on goc.order_code=go.order_code and goc.deleted_flag='N'
left join dj_car_life_pay_order po on po.order_code=go.order_code and po.deleted_flag='N'
left join dj_car_life_yqmerchant_config yc on go.seller_merchant_id = yc.merchant_id and yc.deleted_flag = 'N'
left join dj_car_life_goods_order_apply_record goar on go.order_code = goar.order_code and goar.deleted_flag = 'N'
<include refid="listCondition"/>
<if test="goodsOrderApplyStatus != null">
and goar.status = #{goodsOrderApplyStatus}
</if>
</select>
<select id="count" parameterType="cn.com.glsx.dj.smartcarlife.dto.GoodsOrderDTO" resultMap="countResultMap">
......@@ -1464,6 +1477,7 @@
go.install_merchant_name, go.marketing_merchant_name,go.profit_allocation_status, go.wait_profit_allocation_date,
go.specify_account_rule_id, go.specify_division_rule_id, go.film_order,CASE WHEN go.abnormal_flag = 'Y' AND go.status IN (4, 6, 12, 13) THEN COALESCE(go.associated_order_code, 'Y') ELSE 'N' END as abnormal_flag,
go.technician_name as go_technician_name, go.technician_uuid, go.technician_id as go_technician_id,ifnull(go.invoice_status,1) as invoice_status,
CASE WHEN go.status = 11 THEN null ELSE go.associated_order_code END AS incorrect_order_code,
<!-- 订单客户信息 -->
goc.customer_id,goc.stand_no,goc.car_key_no, goc.car_brand_id, goc.car_brand,
goc.car_childs_brand_id, goc.car_childs_brand_name,goc.car_series_id, goc.car_series_name, goc.car_type_id,
......@@ -2896,8 +2910,8 @@
</where>
</sql>
<select id="listForBatchRef" resultMap="DTOResultMap">
select dclgo.order_code, dclgo.order_time, dclgo.total_price, dclgo.status, dclpo.pay_type
<select id="listForBatchRef" parameterType="cn.com.glsx.dj.smartcarlife.dto.GoodsOrderDTO" resultMap="DTOResultMap">
select dclgo.order_code, dclgo.order_time, dclgo.total_price, dclgo.final_price, dclgo.status, dclpo.pay_type
from dj_car_life_goods_order dclgo
left join dj_car_life_pay_order dclpo on dclgo.order_code = dclpo.order_code and dclpo.deleted_flag = 'N'
<where>
......@@ -2929,6 +2943,9 @@
<if test="totalPrice != null">
and dclgo.total_price = #{totalPrice}
</if>
<if test="finalPrice != null">
and dclgo.final_price = #{finalPrice}
</if>
<if test="sceneList != null and sceneList.size()>0">
and dclgo.scene_type in
<foreach collection="sceneList" item="item" open="(" separator="," close=")">
......
......@@ -63,6 +63,8 @@
<result column="upgrade_shop_min_price" jdbcType="DECIMAL" property="upgradeShopMinPrice" />
<result column="upgrade_warranty_period" jdbcType="DECIMAL" property="upgradeWarrantyPeriod" />
<result column="upgrade_third_party_code" property="upgradeThirdPartyCode"/>
<result column="single_product_sales_price" property="singleProductSalesPrice"/>
<result column="single_product_final_price" property="singleProductFinalPrice"/>
<result column="total_price" jdbcType="DECIMAL" property="totalPrice" />
<result column="final_price" jdbcType="DECIMAL" property="finalPrice" />
<result column="profit_type" jdbcType="TINYINT" property="profitType" />
......
......@@ -21,6 +21,9 @@
<result column="base_supply_mode" jdbcType="TINYINT" property="baseSupplyMode" />
<result column="upgrade_supply_mode" jdbcType="TINYINT" property="upgradeSupplyMode" />
<result column="sell_price" jdbcType="DECIMAL" property="sellPrice" />
<result column="sell_price_valid_type" jdbcType="TINYINT" property="sellPriceValidType" />
<result column="temp_valid_start_date" jdbcType="DATE" property="tempValidStartDate" />
<result column="temp_valid_end_date" jdbcType="DATE" property="tempValidEndDate" />
<result column="min_sell_price" jdbcType="DECIMAL" property="minSellPrice" />
<result column="valid_min_sell_price" property="validMinSellPrice"/>
<result column="upgrade_product_cost" jdbcType="DECIMAL" property="upgradeProductCost" />
......@@ -65,7 +68,8 @@
-->
id, merchant_goods_code,package_code, merchant_id, merchant_name, scene_type, upgrade_goods_id,
goods_alias, brand_merchant_name, supplier_name, warranty_type, base_product_flag,
upgrade_product_flag, base_supply_mode, upgrade_supply_mode, sell_price, min_sell_price,valid_min_sell_price,
upgrade_product_flag, base_supply_mode, upgrade_supply_mode, sell_price, sell_price_valid_type,
temp_valid_start_date, temp_valid_end_date, min_sell_price,valid_min_sell_price,
upgrade_product_cost, gift_cost, recovery_cost, virtual_account_cost,dj_cost,third_party_cost, status,
last_on_shelf_time,position,shelf_source,finance_check_flag,
created_by, created_date, updated_by, updated_date, deleted_flag
......@@ -193,7 +197,8 @@
<!-- 商户商品信息 -->
mgi.id,mgi.merchant_goods_code,mgi.package_code, mgi.scene_type, mgi.upgrade_goods_id, mgi.goods_alias,
mgi.warranty_type, mgi.base_product_flag, mgi.upgrade_product_flag, mgi.base_supply_mode,
mgi.upgrade_supply_mode, mgi.sell_price, mgi.min_sell_price,mgi.valid_min_sell_price, mgi.upgrade_product_cost,
mgi.upgrade_supply_mode, mgi.sell_price, mgi.sell_price_valid_type, mgi.temp_valid_start_date,
mgi.temp_valid_end_date, mgi.min_sell_price,mgi.valid_min_sell_price, mgi.upgrade_product_cost,
mgi.gift_cost, mgi.recovery_cost, mgi.virtual_account_cost, mgi.status,mgi.last_on_shelf_time,mgi.created_date,
mgi.brand_merchant_name, mgi.supplier_name,mgi.position,mgi.created_by,mgi.updated_by,mgi.shelf_source,
mgi.dj_cost,mgi.third_party_cost,mgi.finance_check_flag,
......@@ -422,6 +427,19 @@
<if test="position != null">
and mgi.position = #{position}
</if>
<if test="sellPriceTempValidStatus != null">
and mgi.sell_price_valid_type = 2
<if test="sellPriceTempValidStatus == 1">
and mgi.temp_valid_start_date <![CDATA[ >= ]]> DATE_ADD(CURDATE(), INTERVAL 1 DAY)
</if>
<if test="sellPriceTempValidStatus == 2">
and mgi.temp_valid_start_date <![CDATA[ < ]]> DATE_ADD(CURDATE(), INTERVAL 1 DAY)
and mgi.temp_valid_end_date <![CDATA[ >= ]]> CURDATE()
</if>
<if test="sellPriceTempValidStatus == 3">
and mgi.temp_valid_end_date <![CDATA[ < ]]> CURDATE()
</if>
</if>
<if test="financeCheckFlag != null and financeCheckFlag !=''">
and mgi.finance_check_flag = #{financeCheckFlag}
</if>
......@@ -433,7 +451,8 @@
<!-- 商户商品信息 -->
mgi.id, mgi.merchant_goods_code,mgi.package_code, mgi.scene_type, mgi.upgrade_goods_id, mgi.goods_alias,
mgi.warranty_type, mgi.base_product_flag, mgi.upgrade_product_flag, mgi.base_supply_mode,
mgi.upgrade_supply_mode, mgi.sell_price, mgi.min_sell_price,mgi.valid_min_sell_price, mgi.upgrade_product_cost,mgi.updated_date,
mgi.upgrade_supply_mode, mgi.sell_price, mgi.sell_price_valid_type, mgi.temp_valid_start_date,
mgi.temp_valid_end_date, mgi.min_sell_price,mgi.valid_min_sell_price, mgi.upgrade_product_cost,mgi.updated_date,
mgi.gift_cost, mgi.recovery_cost, mgi.virtual_account_cost, mgi.status,mgi.last_on_shelf_time,mgi.created_date,
mgi.position,mgi.dj_cost,mgi.third_party_cost,mgi.shelf_source,mgi.finance_check_flag,
<!-- 升级商品信息 -->
......@@ -548,6 +567,9 @@
)
)
</if>
<if test="filterSellPriceValid != null and filterSellPriceValid == 1">
and (mgi.sell_price_valid_type = 1 or (mgi.sell_price_valid_type = 2 and mgi.temp_valid_start_date <![CDATA[ < ]]> DATE_ADD(CURDATE(), INTERVAL 1 DAY) and mgi.temp_valid_end_date <![CDATA[ >= ]]> CURDATE()))
</if>
</where>
order by mgi.created_date desc
</select>
......
......@@ -522,4 +522,22 @@
else -1 end) desc,
po.order_time desc
</select>
<select id="listDirectorAuditOverTime" resultMap="DTOResultMap">
select distinct dclpo.order_code,
dclpo.total_price,
dclpo.order_time,
dclpo.merchant_name,
dclpo.purchasing_pattern,
dclpo.send_out_merchant_name
from dj_car_life_purchase_order dclpo
where dclpo.deleted_flag = 'N'
and dclpo.status = 2
and exists(select 1
from dj_car_life_purchase_order_audit_detail t1
where t1.order_code = dclpo.order_code
and t1.STATUS = 2
group by t1.order_code
having max(reviewed_date) &lt; #{deadlineDate})
</select>
</mapper>
......@@ -178,7 +178,7 @@
END
SEPARATOR ', '),'') AS staff_scene_label
FROM dj_car_life_staff_info si LEFT JOIN dj_car_life_goods_order go ON si.staff_uuid = go.seller_user_id
AND go.install_upgrade_time >= DATE_SUB(CURDATE(), INTERVAL 30 DAY)
where go.install_upgrade_time >= DATE_SUB(CURDATE(), INTERVAL 30 DAY)
GROUP BY si.phone_number) as tempTable on sbi.staff_phone = tempTable.phone_number
left join dj_car_life_staff_info glsksi on glsksi.merchant_id=#{glskMerchantId} and glsksi.phone_number=sbi.staff_phone and glsksi.deleted_flag='N'
left join dj_car_life_staff_base_info msbi on msbi.mentor_phone=sbi.staff_phone and msbi.deleted_flag='N'
......
......@@ -36,7 +36,7 @@ public class StaffScoreServiceTest extends BaseServiceTest {
dto.setRemark("123");
dto.setScoreId(2103984);
dto.setOrderCode("250427112750133");
dto.setInfoNameType(ScoreInfoNameEnum.MOTIVATION_CANCEL_DEDUCT.getFallType());
dto.setInfoNameType(ScoreInfoNameEnum.MOTIVATION_CANCEL_DEDUCT.getName());
dto.setOperator("lyjtest");
Boolean res = staffScoreService.changeScore(dto);
System.out.println(res);
......
  • @wangxw1
    commented
    Master

    你好,我是资深的 Java 开发工程师。针对你提供的代码变更,我进行了详细的审查。以下是核心问题与优化建议。

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

    1. 安全性高危风险:权限校验依赖不可信的入参 (Security)

    涉及文件:GoodsOrderService.java 问题描述: 在 listWithPage 和 listForExportWithPage 方法中,权限控制逻辑直接使用了入参 DTO 中的 adminFlag 和 loginPhone 字段:

    // 危险代码示例
    if (Objects.nonNull(pagination.getCondition().getAdminFlag()) && !pagination.getCondition().getAdminFlag()) {
        // 依赖前端/调用方传递的 loginPhone 来获取权限范围
        merchantIds = getLoginUserMerchantIds(pagination.getCondition());
        // ...
    }
    

    风险分析:这是一个典型的越权漏洞(IDOR / Privilege Escalation)。GoodsOrderDTO 通常直接映射自 API 接口的 JSON 请求体。如果攻击者在请求中伪造 adminFlag=true,或者将 loginPhone 修改为管理员或其他高权限用户的手机号,即可绕过权限过滤,查看所有订单或他人数据。 优化建议:

    • 严禁信任前端传递的权限标识字段。
    • 必须从可信的服务器端上下文(如 UserContext、SecurityContext、Session 或网关透传的 Header)中获取当前登录用户的身份信息(User ID/Phone)和角色(IsAdmin)。
    • 在 Service 层覆盖 DTO 中的这些字段,或者完全移除 DTO 中的这些字段,改用独立的 Context 参数传递用户信息。

    2. 代码可维护性差:上帝类与巨型方法 (Maintainability)

    涉及文件:StaffDailyReportHuaweiService.java 问题描述: listMerchantDailyReportExcelByBrandType 等方法过于庞大,逻辑极其复杂,包含深层嵌套的 if-else、大量的代码复制粘贴(Duplicate Code)以及大段被注释掉的代码。 风险分析:

    • 可读性极低:后续维护人员难以理解业务逻辑,极易引入 Bug。
    • 难以测试:如此复杂的逻辑难以编写单元测试覆盖所有分支。
    • 违反单一职责原则:该方法同时处理了数据聚合、业务计算、格式化等多种逻辑。 优化建议:
    • 重构:采用策略模式(Strategy Pattern)或拆分私有方法。按“品牌”或“报表类型”将计算逻辑抽取为独立的 Handler/Service。
    • 清理:删除无用的注释代码,保持代码整洁。

    3. 敏感信息硬编码与配置错误 (Security & Correctness)

    涉及文件:PurchaseOrderService.java, rpc-dj-smartcarlife-api/pom.xml 问题描述:

    1. 敏感信息泄露:在 PurchaseOrderService.java 中,purchase.wechat.notify.staff.list 的默认值硬编码了一个包含大量真实姓名和手机号的 JSON 字符串。这属于PII(个人敏感信息)泄露,且硬编码在代码中极难管理。
    2. 构建风险:在 rpc-dj-smartcarlife-api/pom.xml 中存在拼写错误 <shopamll.api.version> (应为 shopmall),虽然依赖引用时也用了错的变量名 ${shopamll.api.version} 导致暂时能跑通,但主 POM 中定义的是正确的 shopmall。这种不一致会导致版本管理混乱或构建失败。 优化建议:
    3. 移除硬编码:将默认的员工列表 JSON 移除,或仅保留空列表/脱敏后的示例。真实配置应完全托管在配置中心(如 Nacos/Apollo)。
    4. 修正 POM:统一修正 shopamll 为 shopmall,确保父子工程属性名一致。

    二、评分明细

    维度 评分 扣分项说明
    功能正确性 (40分) 30 POM 文件存在拼写错误可能导致依赖解析问题;报表计算逻辑中存在复杂的 BigDecimal 运算,部分除法未严谨处理分母为0的情况(虽有判空但逻辑混乱)。
    安全性 (30分) 10 严重:Service 层权限校验依赖不可信的 DTO 入参(adminFlag, loginPhone),存在越权风险;源代码中包含硬编码的敏感人员信息(姓名、手机号)。
    可维护性 (20分) 8 StaffDailyReportHuaweiService 存在巨型方法和大量注释代码,代码异味严重;BatchMessagingManager 中使用 AtomicReference 进行字符串拼接,可读性差且非必要。
    性能 (5分) 4 GoodsInfoService 增加了分页查询大小的阈值校验,这点很好;但在循环中进行字符串拼接(BatchMessagingManager)略微影响性能。
    提交信息 (5分) 5 提交信息清晰,包含关联的 Issue/Merge Request 信息。

    总分:57分

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