feat:分账
This commit is contained in:
@@ -335,7 +335,7 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
|
||||
stageList.add(SHOP_SUB_STAGE_STATUS_80);
|
||||
}else {
|
||||
//标准店
|
||||
stageList.add(SHOP_SUB_STAGE_STATUS_285);
|
||||
stageList.add(SHOP_SUB_STAGE_STATUS_284_7);
|
||||
stageList.add(SHOP_SUB_STAGE_STATUS_80);
|
||||
//查询可乐机缴费状态
|
||||
PreAllocationRecordDO preAllocationRecordDO = preAllocationRecordDAO.queryPageByShopIdAndExpenseType(request.getShopId(), WalletFeeItemEnum.DEVICE_EARNEST_MONEY.getExpenseType());
|
||||
|
||||
@@ -44,8 +44,7 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.cool.store.enums.point.ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_285;
|
||||
import static com.cool.store.enums.point.ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_80;
|
||||
import static com.cool.store.enums.point.ShopSubStageStatusEnum.*;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -127,7 +126,7 @@ public class OpenApiServiceImpl implements OpenApiService {
|
||||
if (request.getClaimStatus() == 1 && preAllocationRecordDO!=null&&WalletFeeItemEnum.DEVICE_EARNEST_MONEY.getExpenseType().equals(preAllocationRecordDO.getExpenseType())){
|
||||
String key = MessageFormat.format(RedisConstant.XGJ_CALLBACK_SHOP, preAllocationRecordDO.getShopId());
|
||||
if (StringUtils.isNotEmpty(redisUtilPool.getString(key))){
|
||||
shopStageInfoDAO.batchUpdateShopStageStatus(preAllocationRecordDO.getShopId(),Arrays.asList(SHOP_SUB_STAGE_STATUS_285,SHOP_SUB_STAGE_STATUS_80));
|
||||
shopStageInfoDAO.batchUpdateShopStageStatus(preAllocationRecordDO.getShopId(),Arrays.asList(SHOP_SUB_STAGE_STATUS_284_7,SHOP_SUB_STAGE_STATUS_80));
|
||||
}
|
||||
}
|
||||
return ApiResponse.success(Boolean.TRUE);
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.cool.store.service.store;
|
||||
import com.cool.store.entity.order.PreAllocationRecordDO;
|
||||
import com.cool.store.entity.order.StoreOrderDO;
|
||||
import com.cool.store.entity.wallet.WalletTradeDO;
|
||||
import com.cool.store.request.store.PreAllocationAddRequest;
|
||||
import com.cool.store.request.store.PreAllocationEditRequest;
|
||||
import com.cool.store.request.store.PreAllocationQueryShopRequest;
|
||||
import com.cool.store.request.store.PreAllocationSaveRequest;
|
||||
import com.cool.store.request.store.TransRequest;
|
||||
@@ -37,4 +39,26 @@ public interface PreAllocationRecordService {
|
||||
*/
|
||||
Boolean transStatusRefresh(WalletTradeDO walletTradeDO);
|
||||
|
||||
/**
|
||||
* 新增预分账记录
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
Boolean add(PreAllocationAddRequest request);
|
||||
|
||||
/**
|
||||
* 编辑预分账记录
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
Boolean edit(PreAllocationEditRequest request);
|
||||
|
||||
/**
|
||||
* 删除预分账记录(软删除)
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
Boolean delete(Long id);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -43,6 +43,8 @@ import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||
import com.cool.store.enums.wallet.TradeTypeEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.FranchiseFeeMapper;
|
||||
import com.cool.store.request.store.PreAllocationAddRequest;
|
||||
import com.cool.store.request.store.PreAllocationEditRequest;
|
||||
import com.cool.store.request.store.PreAllocationSaveRequest;
|
||||
import com.cool.store.request.store.TransRequest;
|
||||
import com.cool.store.request.wallet.*;
|
||||
@@ -74,8 +76,8 @@ import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static com.cool.store.enums.order.StoreOrderStatusEnum.PAY_FAIL;
|
||||
import static com.cool.store.enums.wallet.WalletTradeModuleEnum.STANDARD_STORE;
|
||||
import static com.cool.store.enums.wallet.WalletTradeModuleEnum.TRANSFER;
|
||||
import static com.cool.store.enums.point.ShopSubStageStatusEnum.*;
|
||||
import static com.cool.store.enums.wallet.WalletTradeModuleEnum.*;
|
||||
|
||||
/**
|
||||
* @Auther zx_szh
|
||||
@@ -756,6 +758,7 @@ public class PreAllocationRecordServiceImpl implements PreAllocationRecordServic
|
||||
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE);
|
||||
}
|
||||
record.setAllocationStatus(AllocationPayStatusEnum.PAYING.getStatus());
|
||||
record.setRemark(transRequest.getRemark());
|
||||
//先改为分账中
|
||||
preAllocationRecordDAO.updateByPrimaryKeySelective(record);
|
||||
WalletTradeDO walletTradeDO = new WalletTradeDO();
|
||||
@@ -804,10 +807,68 @@ public class PreAllocationRecordServiceImpl implements PreAllocationRecordServic
|
||||
if (BigDecimalUtils.equals(unpaidAmount,new BigDecimal(0))){
|
||||
//剩余缴纳金额是0 缴费完成
|
||||
updateOrder.setStatus( StoreOrderStatusEnum.PAID.getCode());
|
||||
//阶段状态变为完成
|
||||
shopStageInfoDAO.updateShopStageInfo(storeOrder.getShopId(), SHOP_SUB_STAGE_STATUS_285);
|
||||
}
|
||||
storeOrderDAO.updateSelective(updateOrder);
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean add(PreAllocationAddRequest request) {
|
||||
if (request == null) {
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
|
||||
PreAllocationRecordDO record = PreAllocationRecordDO.builder()
|
||||
.orderId(request.getOrderId())
|
||||
.shopId(request.getShopId())
|
||||
.expenseType(request.getExpenseType())
|
||||
.payeeName(request.getPayeeName())
|
||||
.payeeCode(request.getPayeeCode())
|
||||
.payAmount(request.getPayAmount())
|
||||
.remark(request.getRemark())
|
||||
.deleted(0)
|
||||
.allocationStatus(AllocationPayStatusEnum.UNPAID.getStatus())
|
||||
.createTime(new Date())
|
||||
.updateTime(new Date())
|
||||
.build();
|
||||
|
||||
return dao.insertSelective(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean edit(PreAllocationEditRequest request) {
|
||||
if (request == null || request.getId() == null) {
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
|
||||
PreAllocationRecordDO exist = dao.getById(request.getId());
|
||||
if (exist == null) {
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
|
||||
PreAllocationRecordDO record = PreAllocationRecordDO.builder()
|
||||
.id(request.getId())
|
||||
.expenseType(request.getExpenseType())
|
||||
.payeeName(request.getPayeeName())
|
||||
.payeeCode(request.getPayeeCode())
|
||||
.payAmount(request.getPayAmount())
|
||||
.remark(request.getRemark())
|
||||
.updateTime(new Date())
|
||||
.build();
|
||||
|
||||
return dao.updateByPrimaryKeySelective(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean delete(Long id) {
|
||||
if (id == null) {
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
return dao.softDeleteById(id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user