Commit ee95352b by 叶立庆

Merge branch 'v5.8.2.2' into 'master'

上线合并

See merge request !38
2 parents cf9fa0d7 19f37ac9
Showing 25 changed files with 357 additions and 44 deletions
......@@ -12,7 +12,7 @@
<name>rpc-dj-smartcarlife-api</name>
<properties>
<deploy.scanPackage>cn.com.glsx.dj.smartcarlife.remote</deploy.scanPackage>
<smartcarlife.api.version>5.8.2.1-SNAPSHOT</smartcarlife.api.version>
<smartcarlife.api.version>5.8.2.2-SNAPSHOT</smartcarlife.api.version>
<shopamll.api.version>5.6.4-SNAPSHOT</shopamll.api.version>
</properties>
<dependencies>
......
......@@ -21,6 +21,9 @@ public class ServiceMerchantPageWithBrandDTO implements java.io.Serializable{
@ApiModelProperty(notes = "门店名称")
private String merchantName;
@ApiModelProperty(notes = "园区店商户号")
private Integer yqMerchantId;
@ApiModelProperty(name = "merchantBrandList", notes = "品牌列表")
private List<MerchantBrandModelPageBrandDTO> merchantBrandList;
......
......@@ -7,6 +7,9 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
import java.math.BigDecimal;
@Data
@ToString
@SuperBuilder
......@@ -51,4 +54,19 @@ public class OnlineStatementAccountTradeDetailDTO extends OnlineStatementAccount
@ApiModelProperty(value = "预计到账月份")
private String estimatedArrivalMonth;
@ApiModelProperty(value = "待补录已分账收款金额")
private BigDecimal waitInputtedAmount;
@ApiModelProperty(value = "待补录未分账收款金额")
private BigDecimal waitInputtedNotDivisionAmount;
@ApiModelProperty(value = "轻改收款金额")
private BigDecimal lightChangeAmount;
@ApiModelProperty(value = "权益收款金额")
private BigDecimal equityAmount;
@ApiModelProperty(value = "延保收款金额")
private BigDecimal extendedWarrantyAmount;
}
package cn.com.glsx.dj.smartcarlife.dto.onlineStatementAccount;
import cn.com.glsx.dj.smartcarlife.model.OnlineStatementAccountTradeDistributionDetail;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
import java.math.BigDecimal;
@Data
@ToString
@SuperBuilder
......@@ -16,4 +19,15 @@ public class OnlineStatementAccountTradeDistributionDetailDTO extends OnlineStat
private OnlineStatementAccountTradeDetailDTO tradeDetail;
@ApiModelProperty(value = "待补录分账金额")
private BigDecimal waitInputtedAmount;
@ApiModelProperty(value = "轻改分账金额")
private BigDecimal lightChangeAmount;
@ApiModelProperty(value = "权益分账金额")
private BigDecimal equityAmount;
@ApiModelProperty(value = "延保分账金额")
private BigDecimal extendedWarrantyAmount;
}
......@@ -133,6 +133,18 @@ public class OnlineStatementAccountTradeDetail implements Serializable{
private String estimatedArrivalTime;
/**
* 实际分账园区店商户号
*/
@Column(name = "reality_division_yq_merchant_id")
private Integer realityDivisionYqMerchantId;
/**
* 实际分账园区店商户名称
*/
@Column(name = "reality_division_yq_merchant_name")
private String realityDivisionYqMerchantName;
/**
* 创建人
*/
@Column(name = "created_by")
......
......@@ -17,6 +17,7 @@ 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 javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
......@@ -141,4 +142,9 @@ public interface MerchantGoodsInfoRemote {
@ApiParam(name = "record", notes = "上架成功后处理", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("返回结果")
RpcResponse<Boolean> onShelfHandler(@NotNull MerchantGoodsInfoDTO record);
@ApiMethod("推送上架商品到scrm")
@ApiParam(name = "merchantGoodsIds", notes = "上架商品主键ID列表", dataType = ApiParam.DataTypeEnum.LIST, required = true)
@ApiResponse("返回结果")
RpcResponse<Boolean> sendGoods(@NotEmpty List<Integer> merchantGoodsIds);
}
......@@ -8,6 +8,9 @@ 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 javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
@ApiService(value="银盛对账单每日余额管理接口",owner="zhoulm")
public interface OnlineStatementAccountTradeDetailRemote{
......@@ -16,8 +19,19 @@ public interface OnlineStatementAccountTradeDetailRemote{
@ApiResponse("返回分页明细-收款信息")
RpcResponse<RpcPagination<OnlineStatementAccountTradeDetailDTO>> listDetailWithPage(RpcPagination<OnlineStatementAccountTradeDetailDTO> pagination);
@ApiMethod("查询明细-收款统计信息")
@ApiParam(name="condition",notes="查询条件信息",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("返回分页明细-收款统计信息")
RpcResponse<OnlineStatementAccountTradeDetailDTO> listPaymentCountTotal(@NotNull OnlineStatementAccountTradeDetailDTO condition);
@ApiMethod("分页查询月汇总-收款信息")
@ApiParam(name="pagination",notes="分页信息",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("返回分页明细-收款信息")
RpcResponse<RpcPagination<OnlineStatementAccountTradeDetailDTO>> listPaymentMonthTotal(RpcPagination<OnlineStatementAccountTradeDetailDTO> pagination);
@ApiMethod("更新交易明细任务")
@ApiParam(name="startTradeTime",notes="开始交易时间,从该时间开始更新交易明细,格式:yyyy-MM-dd",dataType= ApiParam.DataTypeEnum.STRING,required=true)
@ApiResponse("返回是否成功")
RpcResponse<Boolean> updateDetailTask(@NotEmpty String startTradeTime);
}
......@@ -9,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 javax.validation.constraints.NotNull;
@ApiService(value="银盛对账单分账明细接口",owner="zhoulm")
public interface OnlineStatementAccountTradeDistributionDetailRemote {
......@@ -17,6 +19,11 @@ public interface OnlineStatementAccountTradeDistributionDetailRemote {
@ApiResponse("返回分页明细-分账信息")
RpcResponse<RpcPagination<OnlineStatementAccountTradeDistributionDetailDTO>> listDetailWithPage(RpcPagination<OnlineStatementAccountTradeDetailDTO> pagination);
@ApiMethod("查询分账统计记录")
@ApiParam(name="condition",notes="查询条件",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("返回分账统计记录")
RpcResponse<OnlineStatementAccountTradeDistributionDetailDTO> listDivisionCountTotal(@NotNull OnlineStatementAccountTradeDetailDTO condition);
@ApiMethod("分页查询汇总-分账信息")
@ApiParam(name="pagination",notes="分页信息",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("返回分页汇总-分账信息")
......
......@@ -11,6 +11,7 @@ import cn.com.glsx.framework.core.annotation.*;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
......@@ -68,5 +69,9 @@ public interface ProductManagerRemote {
@ApiParam(name="goodsId",notes="要查询的产品id",dataType= ApiParam.DataTypeEnum.INTEGER,required=true)
@ApiResponse("返回产品规格信息")
RpcResponse<List<GoodsSpecification>>listByGoodsId(@NotNull Integer goodsId);
@ApiMethod("推送产品到SCRM")
@ApiParam(name="goodsCodeList",notes="要推送的产品编码列表",dataType= ApiParam.DataTypeEnum.LIST,required=true)
@ApiResponse("返回推送结果")
RpcResponse<Boolean> sendProduct(@NotEmpty List<String> goodsCodeList);
}
......@@ -9,14 +9,14 @@
</parent>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-smartcarlife</artifactId>
<version>5.8.2.1-SNAPSHOT</version>
<version>5.8.2.2-SNAPSHOT</version>
<name>rpc-dj-smartcarlife</name>
<packaging>war</packaging>
<properties>
<skipTests>true</skipTests>
<shopmall.api.version>5.8.2-SNAPSHOT</shopmall.api.version>
<stoassistant.api.version>5.6.4-SNAPSHOT</stoassistant.api.version>
<smartcarlife.api.version>5.8.2.1-SNAPSHOT</smartcarlife.api.version>
<smartcarlife.api.version>5.8.2.2-SNAPSHOT</smartcarlife.api.version>
<sale.api.version>5.8.0-SNAPSHOT</sale.api.version>
<mindworkplate.api.version>5.8.2-SNAPSHOT</mindworkplate.api.version>
</properties>
......
......@@ -201,22 +201,26 @@ public class PushGoodsManager {
log.error("产品信息变更同步商品异常",e);
}
}
public void sendGoods(MerchantGoodsInfoDTO merchantGoodsInfo,String updatedBy) {
public void sendGoods(MerchantGoodsInfoDTO merchantGoodsInfo,String updatedBy,boolean isSyncSend) {
if(merchantGoodsInfo == null) {
return;
}
if (Objects.equals(merchantGoodsInfo.getStatus(), MerchantGoodsStatus.ON_SHELF.getValue())) {
//商品推送众筹
sendGoodsToShopmall(merchantGoodsInfo, updatedBy);
sendGoodsToShopmall(merchantGoodsInfo, updatedBy,isSyncSend);
//1.2,1.4场景商品推送
syncTransformGoods(merchantGoodsInfo, updatedBy);
syncTransformGoods(merchantGoodsInfo, updatedBy,isSyncSend);
}
//2.0商品推送(不管是否上架都推送)
sendGoods2Scrm(merchantGoodsInfo, updatedBy);
sendGoods2Scrm(merchantGoodsInfo, updatedBy,isSyncSend);
}
public void sendGoodsToShopmall(MerchantGoodsInfo merchantGoodsInfo,String updatedBy){
public void sendGoods(MerchantGoodsInfoDTO merchantGoodsInfo,String updatedBy) {
sendGoods(merchantGoodsInfo, updatedBy,false);
}
public void sendGoodsToShopmall(MerchantGoodsInfo merchantGoodsInfo,String updatedBy,boolean isSyncSend){
try {
if (!Objects.equals(merchantGoodsInfo.getSceneType(), SceneEnum.SCENE_THREE.getValue().byteValue())) {
return;
......@@ -264,19 +268,26 @@ public class PushGoodsManager {
}).collect(Collectors.toList()));
dto.setSpecificationDetailList(Arrays.asList(info));
dto.setOperator(updatedBy);
taskExecutor.execute(() -> {
log.info("商品信息:{}", dto);
log.info("商品信息:{}", dto);
if(isSyncSend){
RpcResponse<Void> voidRpcResponse = goodsRemote.distributeGoods(dto);
if (voidRpcResponse.hasException()){
log.error("distributeGoods Exception:"+voidRpcResponse.getMessage());
}
});
}else{
taskExecutor.execute(() -> {
RpcResponse<Void> voidRpcResponse = goodsRemote.distributeGoods(dto);
if (voidRpcResponse.hasException()){
log.error("distributeGoods Exception:"+voidRpcResponse.getMessage());
}
});
}
} catch (Exception e) {
log.info("sendGoods error:"+e.getMessage(),e);
}
}
public void sendGoods2Scrm(MerchantGoodsInfoDTO merchantGoodsInfo, String updatedBy) {
public void sendGoods2Scrm(MerchantGoodsInfoDTO merchantGoodsInfo, String updatedBy,boolean isSyncSend) {
try {
if(!Objects.equals(merchantGoodsInfo.getSceneType(), SceneEnum.SCENE_ZERO.getValue().byteValue())) {
return;
......@@ -373,9 +384,13 @@ public class PushGoodsManager {
dto.setCreatedDate(new Date());
log.info("2.0商品信息:{}",dto);
taskExecutor.execute(() -> serviceMerchantConfigRemote.addMerchantConfigWithGood(dto));
//同步商品并同步创建门店商品规则
taskExecutor.execute(() -> vdRuleService.goodsPushCreateVdRule(dto));
if(isSyncSend) {
serviceMerchantConfigRemote.addMerchantConfigWithGood(dto);
}else{
taskExecutor.execute(() -> serviceMerchantConfigRemote.addMerchantConfigWithGood(dto));
}
//同步商品并同步创建门店商品规则
taskExecutor.execute(() -> vdRuleService.goodsPushCreateVdRule(dto));
} catch (Exception e) {
log.error("sendGoods2Scrm Exception:" + e.getMessage());
}
......@@ -387,7 +402,7 @@ public class PushGoodsManager {
* @param merchantGoodsInfo
* @param updatedBy
*/
public void syncTransformGoods(MerchantGoodsInfo merchantGoodsInfo, String updatedBy) {
public void syncTransformGoods(MerchantGoodsInfo merchantGoodsInfo, String updatedBy,boolean isSyncSend) {
try {
if (!Objects.equals(merchantGoodsInfo.getSceneType(), SceneTypeEnum.SCENE1_2.getValue()) &&
!Objects.equals(merchantGoodsInfo.getSceneType(), SceneTypeEnum.SCENE1_4.getValue())) {
......@@ -440,13 +455,20 @@ public class PushGoodsManager {
}).collect(Collectors.toList()));
dto.setSpecificationDetailList(Arrays.asList(info));
dto.setOperator(updatedBy);
taskExecutor.execute(() -> {
log.info("商品信息:{}", dto);
log.info("商品信息:{}", dto);
if(isSyncSend){
RpcResponse<Void> voidRpcResponse = goodsRemote.syncTransformGoods(dto);
if (voidRpcResponse.hasException()) {
log.error("syncTransformGoods Exception:" + voidRpcResponse.getMessage());
}
});
}else {
taskExecutor.execute(() -> {
RpcResponse<Void> voidRpcResponse = goodsRemote.syncTransformGoods(dto);
if (voidRpcResponse.hasException()) {
log.error("syncTransformGoods Exception:" + voidRpcResponse.getMessage());
}
});
}
} catch (Exception e) {
log.info("syncTransformGoods error:" + e.getMessage(), e);
}
......
......@@ -17,6 +17,11 @@ public interface OnlineStatementAccountTradeDetailMapper extends OreMapper<Onlin
//明细-收款
List<OnlineStatementAccountTradeDetailDTO> listDetail(OnlineStatementAccountTradeDetailDTO condition);
OnlineStatementAccountTradeDetailDTO listPaymentCountTotal(OnlineStatementAccountTradeDetailDTO condition);
//月汇总-收款
List<OnlineStatementAccountTradeDetailDTO> listPaymentMonthTotal(OnlineStatementAccountTradeDetailDTO condition);
//查询需要更新的明细列表
List<OnlineStatementAccountTradeDetailDTO> listNeedUpdateDetail(OnlineStatementAccountTradeDetailDTO condition);
}
\ No newline at end of file
......@@ -13,6 +13,8 @@ public interface OnlineStatementAccountTradeDistributionDetailMapper extends Ore
List<OnlineStatementAccountTradeDistributionDetailDTO> listDetail(OnlineStatementAccountTradeDetailDTO query);
OnlineStatementAccountTradeDistributionDetailDTO listDivisionCountTotal(OnlineStatementAccountTradeDetailDTO query);
List<OnlineStatementAccountTradeDistributionDetailDTO> listMonthTotal(OnlineStatementAccountTradeDetailDTO query);
}
\ No newline at end of file
......@@ -17,6 +17,7 @@ import cn.com.glsx.framework.core.exception.RpcServiceException;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.task.TaskExecutor;
import javax.validation.constraints.NotNull;
import java.util.Date;
......@@ -27,6 +28,8 @@ import java.util.List;
public class MerchantGoodsInfoRemoteImpl implements MerchantGoodsInfoRemote {
@Autowired
private MerchantGoodsInfoService merchantGoodsInfoService;
@Autowired
private TaskExecutor taskExecutor;
@Override
public RpcResponse<List<MerchantGoodsInfoDTO>> listByMerchantId(MerchantGoodsInfoDTO condition) {
......@@ -272,4 +275,17 @@ public class MerchantGoodsInfoRemoteImpl implements MerchantGoodsInfoRemote {
return RpcResponse.error(DefaultErrorEnum.SERVICE_ERROR, e.getMessage());
}
}
@Override
public RpcResponse<Boolean> sendGoods(List<Integer> merchantGoodsIds) {
try {
taskExecutor.execute(()->{
merchantGoodsInfoService.sendGoods(merchantGoodsIds);
});
return RpcResponse.success(true);
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
}
......@@ -26,6 +26,16 @@ public class OnlineStatementAccountTradeDetailRemoteImpl implements OnlineStatem
}
@Override
public RpcResponse<OnlineStatementAccountTradeDetailDTO> listPaymentCountTotal(OnlineStatementAccountTradeDetailDTO condition) {
try {
return RpcResponse.success(onlineStatementAccountTradeDetailService.listPaymentCountTotal(condition));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<RpcPagination<OnlineStatementAccountTradeDetailDTO>> listPaymentMonthTotal(RpcPagination<OnlineStatementAccountTradeDetailDTO> pagination) {
try {
return RpcResponse.success(RpcPagination.copyPage(onlineStatementAccountTradeDetailService.listPaymentMonthTotalWithPage(pagination)));
......@@ -34,4 +44,15 @@ public class OnlineStatementAccountTradeDetailRemoteImpl implements OnlineStatem
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<Boolean> updateDetailTask(String startTradeTime) {
try {
onlineStatementAccountTradeDetailService.updateDetailTask(startTradeTime);
return RpcResponse.success(true);
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
}
......@@ -27,6 +27,16 @@ public class OnlineStatementAccountTradeDistributionDetailRemoteImpl implements
}
@Override
public RpcResponse<OnlineStatementAccountTradeDistributionDetailDTO> listDivisionCountTotal(OnlineStatementAccountTradeDetailDTO condition) {
try {
return RpcResponse.success(onlineStatementAccountTradeDistributionDetailService.listDivisionCountTotal(condition));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
}
}
@Override
public RpcResponse<RpcPagination<OnlineStatementAccountTradeDistributionDetailDTO>> listMonthTotalWithPage(RpcPagination<OnlineStatementAccountTradeDetailDTO> pagination) {
try {
return RpcResponse.success(RpcPagination.copyPage(onlineStatementAccountTradeDistributionDetailService.listMonthTotalWithPage(pagination)));
......
......@@ -145,4 +145,18 @@ public class ProductManagerRemoteImpl implements ProductManagerRemote {
}
}
@Override
public RpcResponse<Boolean> sendProduct(List<String> goodsCodeList) {
try {
taskExecutor.execute(()->{
productManagerService.sendProduct(goodsCodeList);
});
return RpcResponse.success(true);
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
}
......@@ -1857,6 +1857,13 @@ public class SceneMerchantRefService {
}
}
public List<Integer> query4sMerchantIdListByYqMerchantId(Integer yqMerchantId) {
RpcAssert.assertNotNull(yqMerchantId, DefaultErrorEnum.DATA_NULL,"yqMerchantId not be null");
ServiceMerchantPageWithBrandDTO condition = new ServiceMerchantPageWithBrandDTO();
condition.setYqMerchantId(yqMerchantId);
return sceneMerchantRefMapper.query4sMerchantIdList(condition);
}
public Page<ServiceMerchantPageWithBrandDTO> pageList4sMerchantWithBrand(RpcPagination<ServiceMerchantPageWithBrandDTO> pagination) {
RpcAssert.assertNotNull(pagination, DefaultErrorEnum.DATA_NULL,"RpcPagination not be null");
try{
......
......@@ -2096,4 +2096,23 @@ public class MerchantGoodsInfoService {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public void sendGoods(List<Integer> merchantGoodsIds) {
try{
boolean isSync = OrePropertyConfigurer.getProperty("merchant.goods.push.to.scrm.sync", Boolean.class,false);
log.info("开始同步上架商品到SCRM, merchantGoodsIds:{}", merchantGoodsIds);
for(Integer id : merchantGoodsIds){
try{
MerchantGoodsInfoDTO goodsInfo = this.getDetailById(id);
pushGoodsManager.sendGoods(goodsInfo, CommonConstants.DEFAULT_UPDATE_BY,isSync);
log.info("同步上架商品到scrm成功:{}", id);
}catch (Exception e){
log.error("同步上架商品到scrm失败:" +id, e);
}
}
}catch(Exception e){
log.error(e.getMessage(),e);
}
log.info("同步上架商品到SCRM完成");
}
}
package cn.com.glsx.dj.smartcarlife.service.goods;
import cn.com.glsx.dj.smartcarlife.constant.CommonConstants;
import cn.com.glsx.dj.smartcarlife.converter.GoodsNewDTOConvert;
import cn.com.glsx.dj.smartcarlife.dto.*;
import cn.com.glsx.dj.smartcarlife.dto.goods.*;
......@@ -14,6 +15,7 @@ import cn.com.glsx.dj.smartcarlife.service.common.GoodsOperationLogService;
import cn.com.glsx.dj.smartcarlife.service.common.UpdateOperationLogService;
import cn.com.glsx.dj.smartcarlife.util.CommonUtil;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.enums.StatusEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
......@@ -700,4 +702,21 @@ public class ProductManagerService {
return goodsSpecificationService.listByGoodsId(goodsId);
}
public void sendProduct(List<String> goodsCodeList) {
try{
log.info("开始同步产品到SCRM, goodsCodeList:{}", goodsCodeList);
for(String goodsCode : goodsCodeList){
try{
pushGoodsManager.sendProduct(goodsCode, CommonConstants.DEFAULT_UPDATE_BY);
log.info("同步产品到scrm成功:{}", goodsCode);
}catch (Exception e){
log.error("同步产品到scrm失败:" +goodsCode, e);
}
}
}catch(Exception e){
log.error(e.getMessage(),e);
}
log.info("同步产品到SCRM完成");
}
}
......@@ -58,6 +58,16 @@ public class OnlineStatementAccountTradeDistributionDetailService {
}
}
public OnlineStatementAccountTradeDistributionDetailDTO listDivisionCountTotal(OnlineStatementAccountTradeDetailDTO condition) {
RpcAssert.assertNotNull(condition, DefaultErrorEnum.DATA_NULL, "condition not be null");
try {
return onlineStatementAccountTradeDistributionDetailMapper.listDivisionCountTotal(condition);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public List<OnlineStatementAccountTradeDistributionDetailDTO> listMonthTotalWithPage(RpcPagination<OnlineStatementAccountTradeDetailDTO> pagination) {
RpcAssert.assertNotNull(pagination, DefaultErrorEnum.DATA_NULL, "RpcPagination not be null");
try {
......
......@@ -23,6 +23,8 @@
<result column="reality_platform_merchant_id" property="realityPlatformMerchantId" jdbcType="INTEGER" />
<result column="reality_platform_merchant_name" property="realityPlatformMerchantName" jdbcType="VARCHAR" />
<result column="estimated_arrival_time" property="estimatedArrivalTime" jdbcType="VARCHAR" />
<result column="reality_division_yq_merchant_id" property="realityDivisionYqMerchantId" jdbcType="INTEGER" />
<result column="reality_division_yq_merchant_name" property="realityDivisionYqMerchantName" jdbcType="VARCHAR" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
......@@ -36,7 +38,12 @@
<result column="tradeMonth" property="tradeMonth" jdbcType="VARCHAR" />
<result column="businessType" property="businessType" jdbcType="VARCHAR" />
<result column="divisionFlag" property="divisionFlag" jdbcType="VARCHAR" />
</resultMap>
<result column="waitInputtedAmount" property="waitInputtedAmount" jdbcType="DECIMAL" />
<result column="waitInputtedNotDivisionAmount" property="waitInputtedNotDivisionAmount" jdbcType="DECIMAL" />
<result column="lightChangeAmount" property="lightChangeAmount" jdbcType="DECIMAL" />
<result column="equityAmount" property="equityAmount" jdbcType="DECIMAL" />
<result column="extendedWarrantyAmount" property="extendedWarrantyAmount" jdbcType="DECIMAL" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
......@@ -44,6 +51,7 @@
id, yq_merchant_id, yq_merchant_name, merchant_id, merchant_name, trade_amount, trade_time,
pay_order_id, service_charge, division_flag,shop_division_money, fws_division_money,
gl_division_money,division_order_code,division_date, reality_platform_merchant_id, reality_platform_merchant_name,estimated_arrival_time,
reality_division_yq_merchant_id, reality_division_yq_merchant_name,
created_by, created_date, updated_by, updated_date, deleted_flag
</sql>
......@@ -82,7 +90,8 @@
osatd.reality_platform_merchant_id,osatd.reality_platform_merchant_name,osatd.estimated_arrival_time,
osatd.trade_amount,osatd.service_charge,
case
when po.order_code is null then '待补录'
when po.order_code is null and osatd.division_flag='Y' then '待补录已分账'
when po.order_code is null and osatd.division_flag='N' then '待补录未分账'
when go.base_scene_code='100101' then '轻改'
when go.base_scene_code='110101' or go.base_scene_code='110102' then '权益'
when go.base_scene_code='110201' or go.base_scene_code='110202' then '延保'
......@@ -116,18 +125,46 @@
</where>
</select>
<select id="listPaymentCountTotal" parameterType="cn.com.glsx.dj.smartcarlife.dto.onlineStatementAccount.OnlineStatementAccountTradeDetailDTO" resultMap="DTOResultMap">
select
sum(osatd.trade_amount) as trade_amount,
sum(osatd.service_charge) as service_charge,
sum(if(po.order_code is null and osatd.division_flag='Y',osatd.trade_amount,0)) as waitInputtedAmount,
sum(if(po.order_code is null and osatd.division_flag='N',osatd.trade_amount,0)) as waitInputtedNotDivisionAmount,
sum(if(go.base_scene_code='100101',osatd.trade_amount,0)) as lightChangeAmount,
sum(if(go.base_scene_code='110101' or go.base_scene_code='110102',osatd.trade_amount,0)) as equityAmount,
sum(if(go.base_scene_code='110201' or go.base_scene_code='110202',osatd.trade_amount,0)) as extendedWarrantyAmount
from dj_car_life_online_statement_account_trade_detail osatd
left join dj_car_life_pay_order po on po.id=osatd.pay_order_id and po.deleted_flag='N'
left join dj_car_life_goods_order go on go.order_code=po.order_code and go.deleted_flag='N'
<where>
osatd.deleted_flag='N'
<if test="startTradeTime != null and startTradeTime !=''">
<![CDATA[ and osatd.trade_time >= #{startTradeTime} ]]>
</if>
<if test="endTradeTime != null and endTradeTime !=''">
<![CDATA[ and osatd.trade_time <= #{endTradeTime} ]]>
</if>
<if test="yqMerchantId != null">
and osatd.yq_merchant_id = #{yqMerchantId}
</if>
<if test="merchantId != null">
and osatd.merchant_id = #{merchantId}
</if>
</where>
</select>
<select id="listPaymentMonthTotal" parameterType="cn.com.glsx.dj.smartcarlife.dto.onlineStatementAccount.OnlineStatementAccountTradeDetailDTO" resultMap="DTOResultMap">
select
DATE_FORMAT(osatd.trade_time,'%Y年%m月') as tradeMonth,
osatd.yq_merchant_name,osatd.merchant_name,osatd.reality_platform_merchant_name,
case
when po.order_code is null then '待补录'
when go.base_scene_code='100101' then '轻改'
when go.base_scene_code='110101' or go.base_scene_code='110102' then '权益'
when go.base_scene_code='110201' or go.base_scene_code='110202' then '延保'
else null
end as businessType,
sum( osatd.trade_amount) as trade_amount
sum( osatd.trade_amount) as trade_amount,
sum(if(po.order_code is null and osatd.division_flag='Y',osatd.trade_amount,0)) as waitInputtedAmount,
sum(if(po.order_code is null and osatd.division_flag='N',osatd.trade_amount,0)) as waitInputtedNotDivisionAmount,
sum(if(go.base_scene_code='100101',osatd.trade_amount,0)) as lightChangeAmount,
sum(if(go.base_scene_code='110101' or go.base_scene_code='110102',osatd.trade_amount,0)) as equityAmount,
sum(if(go.base_scene_code='110201' or go.base_scene_code='110202',osatd.trade_amount,0)) as extendedWarrantyAmount
from dj_car_life_online_statement_account_trade_detail osatd
left join dj_car_life_pay_order po on po.id=osatd.pay_order_id and po.deleted_flag='N'
left join dj_car_life_goods_order go on go.order_code=po.order_code and go.deleted_flag='N'
......@@ -146,7 +183,23 @@
and osatd.merchant_id = #{merchantId}
</if>
</where>
GROUP BY tradeMonth,osatd.yq_merchant_id,osatd.merchant_id,osatd.reality_platform_merchant_id,businessType
GROUP BY tradeMonth,osatd.yq_merchant_id,osatd.merchant_id,osatd.reality_platform_merchant_id
</select>
<select id="listNeedUpdateDetail" parameterType="cn.com.glsx.dj.smartcarlife.dto.onlineStatementAccount.OnlineStatementAccountTradeDetailDTO" resultMap="DTOResultMap">
select
osatd.id,osatd.trade_time,osatd.pay_order_id,
go.merchant_id,go.base_scene_code
from dj_car_life_online_statement_account_trade_detail osatd
left join dj_car_life_pay_order po on po.id=osatd.pay_order_id and po.deleted_flag='N'
left join dj_car_life_goods_order go on go.order_code=po.order_code and go.deleted_flag='N'
<where>
osatd.deleted_flag = 'N' and osatd.reality_platform_merchant_id is null and go.id is not null
<if test="startTradeTime != null and startTradeTime !=''">
<![CDATA[ and osatd.trade_time >= #{startTradeTime} ]]>
</if>
</where>
order by osatd.id asc
</select>
</mapper>
\ No newline at end of file
......@@ -19,7 +19,11 @@
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<resultMap id="DTOResultMap" type="cn.com.glsx.dj.smartcarlife.dto.onlineStatementAccount.OnlineStatementAccountTradeDistributionDetailDTO" extends="BaseResultMap">
<association property="tradeDetail" javaType="cn.com.glsx.dj.smartcarlife.dto.onlineStatementAccount.OnlineStatementAccountTradeDetailDTO">
<result column="waitInputtedAmount" property="waitInputtedAmount" jdbcType="DECIMAL" />
<result column="lightChangeAmount" property="lightChangeAmount" jdbcType="DECIMAL" />
<result column="equityAmount" property="equityAmount" jdbcType="DECIMAL" />
<result column="extendedWarrantyAmount" property="extendedWarrantyAmount" jdbcType="DECIMAL" />
<association property="tradeDetail" javaType="cn.com.glsx.dj.smartcarlife.dto.onlineStatementAccount.OnlineStatementAccountTradeDetailDTO">
<result column="yq_merchant_id" property="yqMerchantId" jdbcType="INTEGER" />
<result column="yq_merchant_name" property="yqMerchantName" jdbcType="VARCHAR" />
<result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
......@@ -35,6 +39,8 @@
<result column="reality_platform_merchant_id" property="realityPlatformMerchantId" jdbcType="INTEGER" />
<result column="reality_platform_merchant_name" property="realityPlatformMerchantName" jdbcType="VARCHAR" />
<result column="estimated_arrival_time" property="estimatedArrivalTime" jdbcType="VARCHAR" />
<result column="reality_division_yq_merchant_id" property="realityDivisionYqMerchantId" jdbcType="INTEGER" />
<result column="reality_division_yq_merchant_name" property="realityDivisionYqMerchantName" jdbcType="VARCHAR" />
<result column="base_scene_code" property="baseSceneCode" jdbcType="VARCHAR" />
<result column="trade_no" property="tradeNo" jdbcType="VARCHAR" />
<result column="order_code" property="orderCode" />
......@@ -59,8 +65,9 @@
osatd.trade_time,DATE_FORMAT(osatd.trade_time,'%Y-%m') as tradeMonth,
osatd.estimated_arrival_time,DATE_FORMAT(osatd.estimated_arrival_time,'%Y-%m') as estimatedArrivalMonth,
osatd.yq_merchant_name,osatd.merchant_name,osatd.reality_platform_merchant_name,
osatd.reality_division_yq_merchant_name,
case
when po.order_code is null then '待补录'
when po.order_code is null then '待补录已分账'
when go.base_scene_code='100101' then '轻改'
when go.base_scene_code='110101' or go.base_scene_code='110102' then '权益'
when go.base_scene_code='110201' or go.base_scene_code='110202' then '延保'
......@@ -96,6 +103,35 @@
order by osatd.id asc
</select>
<select id="listDivisionCountTotal" parameterType="cn.com.glsx.dj.smartcarlife.dto.onlineStatementAccount.OnlineStatementAccountTradeDetailDTO" resultMap="DTOResultMap" >
select
sum(osatdd.division_money - osatdd.service_charge) as division_money,
sum(osatdd.service_charge) as service_charge,
sum(if(po.order_code is null,osatdd.division_money- osatdd.service_charge,0)) as waitInputtedAmount,
sum(if(go.base_scene_code='100101',osatdd.division_money- osatdd.service_charge,0)) as lightChangeAmount,
sum(if(go.base_scene_code='110101' or go.base_scene_code='110102',osatdd.division_money- osatdd.service_charge,0)) as equityAmount,
sum(if(go.base_scene_code='110201' or go.base_scene_code='110202',osatdd.division_money- osatdd.service_charge,0)) as extendedWarrantyAmount
from dj_car_life_online_statement_account_trade_distribution_detail osatdd
join dj_car_life_online_statement_account_trade_detail osatd on osatd.id=osatdd.trade_detail_id and osatd.deleted_flag='N'
left join dj_car_life_pay_order po on po.id=osatd.pay_order_id and po.deleted_flag='N'
left join dj_car_life_goods_order go on go.order_code=po.order_code and go.deleted_flag='N'
<where>
osatdd.deleted_flag='N' and osatd.estimated_arrival_time is not null
<if test="startEstimatedArrivalTime != null and startEstimatedArrivalTime !=''">
<![CDATA[ and osatd.estimated_arrival_time >= #{startEstimatedArrivalTime} ]]>
</if>
<if test="endEstimatedArrivalTime != null and endEstimatedArrivalTime !=''">
<![CDATA[ and osatd.estimated_arrival_time <= #{endEstimatedArrivalTime} ]]>
</if>
<if test="yqMerchantId != null">
and osatd.yq_merchant_id = #{yqMerchantId}
</if>
<if test="merchantId != null">
and osatd.merchant_id = #{merchantId}
</if>
</where>
</select>
<select id="listMonthTotal" parameterType="cn.com.glsx.dj.smartcarlife.dto.onlineStatementAccount.OnlineStatementAccountTradeDetailDTO" resultMap="DTOResultMap" >
select
DATE_FORMAT(osatd.division_date,'%Y-%m') as divisionMonth,
......@@ -103,13 +139,10 @@
DATE_FORMAT(osatd.estimated_arrival_time,'%Y-%m') as estimatedArrivalMonth,
osatd.yq_merchant_id,osatd.yq_merchant_name,osatd.merchant_id,osatd.merchant_name,
osatd.reality_platform_merchant_id,osatd.reality_platform_merchant_name,
case
when po.order_code is null then '待补录'
when go.base_scene_code='100101' then '轻改'
when go.base_scene_code='110101' or go.base_scene_code='110102' then '权益'
when go.base_scene_code='110201' or go.base_scene_code='110202' then '延保'
else null
end as businessType,
sum(if(po.order_code is null,osatdd.division_money- osatdd.service_charge,0)) as waitInputtedAmount,
sum(if(go.base_scene_code='100101',osatdd.division_money- osatdd.service_charge,0)) as lightChangeAmount,
sum(if(go.base_scene_code='110101' or go.base_scene_code='110102',osatdd.division_money- osatdd.service_charge,0)) as equityAmount,
sum(if(go.base_scene_code='110201' or go.base_scene_code='110202',osatdd.division_money- osatdd.service_charge,0)) as extendedWarrantyAmount,
case
when DATE_FORMAT(osatd.trade_time,'%Y-%m')=DATE_FORMAT(osatd.estimated_arrival_time,'%Y-%m') then '本月收款本月分账'
when DATE_FORMAT(DATE_ADD(osatd.trade_time,INTERVAL 1 MONTH) ,'%Y-%m')=DATE_FORMAT(osatd.estimated_arrival_time,'%Y-%m') then '上月收款本月分账'
......@@ -140,11 +173,11 @@
</where>
GROUP BY divisionMonth,tradeMonth,estimatedArrivalMonth,
osatd.yq_merchant_id,osatd.merchant_id,osatd.reality_platform_merchant_id,osatdd.reality_merchant_id,
osatdd.target_merchant_type,businessType
osatdd.target_merchant_type
ORDER BY tradeMonth asc,divisionMonth asc,estimatedArrivalMonth asc,
osatd.yq_merchant_id asc,osatd.merchant_id asc,
osatd.reality_platform_merchant_id asc,osatdd.reality_merchant_id asc,
osatdd.target_merchant_type asc,businessType asc
osatdd.target_merchant_type asc
</select>
</mapper>
\ No newline at end of file
......@@ -1105,7 +1105,7 @@
<select id="query4sMerchantIdList" resultType="java.lang.Integer">
select DISTINCT ref.main_merchant_id
from dj_car_life_scene_merchant_ref ref
from dj_car_life_scene_merchant_ref_new ref
where ref.deleted_flag = 'N'
and ref.sub_merchant_type in (6, 8)
<if test="merchantId != null">
......@@ -1114,6 +1114,9 @@
<if test="merchantName != null and merchantName!=''">
and ref.main_merchant_name like CONCAT ('%',#{merchantName},'%')
</if>
<if test="yqMerchantId != null">
and ref.sub_merchant_id = #{yqMerchantId}
</if>
group by ref.main_merchant_id
</select>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!