Merge branch 'cc_20251029_smz' into 'master'

三明治

See merge request hangzhou/java/custom_zxjp!186
This commit is contained in:
苏竹红
2025-11-12 09:38:18 +00:00
21 changed files with 151 additions and 25 deletions

View File

@@ -232,4 +232,7 @@ public class CommonConstants {
public static final int REFRESH_TOKEN_EXPIRE = 30 * 24 * 60 * 60;
public static final int BATCH_SIZE = 200;
public static final Integer INDEX_ZERO = 0;
public static final Integer INDEX_ONE = 1;
}

View File

@@ -9,7 +9,8 @@ package com.cool.store.enums;
public enum BusinessModelEnum {
NULL(0, ""),
DIRECT_SALES(1, "直营"),
JOIN_SALES(2, "加盟");
JOIN_SALES(2, "加盟"),
JOINT_STORE(3, "联营");
private Integer code;
private String desc;

View File

@@ -0,0 +1,25 @@
package com.cool.store.utils;
import org.apache.commons.lang3.StringUtils;
import java.math.BigDecimal;
/**
* <p>
* 公共工具
* </p>
*
* @author wangff
* @since 2025/10/29
*/
public class CommonUtil {
public static BigDecimal convertToBig(String value) {
if (StringUtils.isBlank(value)) {
return BigDecimal.ZERO;
}
try {
return new BigDecimal(value);
} catch (Exception ignored) {}
return BigDecimal.ZERO;
}
}

View File

@@ -4,7 +4,9 @@ import com.cool.store.constants.CommonConstants;
import com.cool.store.dto.BuildStageDTO;
import com.cool.store.dto.PlatformBuildStageDTO;
import com.cool.store.dto.Preparation.ScheduleDTO;
import com.cool.store.entity.ShopInfoDO;
import com.cool.store.entity.ShopStageInfoDO;
import com.cool.store.enums.FranchiseBrandEnum;
import com.cool.store.enums.point.ShopStageEnum;
import com.cool.store.enums.point.ShopSubStageEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
@@ -40,17 +42,22 @@ public class ShopStageInfoDAO {
/**
* 初始化店铺阶段信息
* @param lineId
* @param shopIds
* @param shopInfoList
* @return flag =true:表示意向加盟节点完成正常初始化。false:表示意向加盟节点未完成新建分店阶段都为未开始-100。
*/
public Integer initShopStageInfo(Long lineId, List<Long> shopIds, Boolean flag) {
if (CollectionUtils.isEmpty(shopIds)) {
public Integer initShopStageInfo(Long lineId, List<ShopInfoDO> shopInfoList, Boolean flag) {
if (CollectionUtils.isEmpty(shopInfoList)) {
return CommonConstants.ZERO;
}
List<ShopStageInfoDO> addShopStageList = new ArrayList<>();
LocalDate selectStartDate = LocalDate.now();
for (Long shopId : shopIds) {
for (ShopInfoDO shopInfoDO : shopInfoList) {
Long shopId = shopInfoDO.getId();
for (ShopSubStageEnum shopSubStageEnum : ShopSubStageEnum.values()) {
if (ShopSubStageEnum.SHOP_STAGE_24.equals(shopSubStageEnum) && String.valueOf(FranchiseBrandEnum.ZXSMZ.getCode()).equals(shopInfoDO.getFranchiseBrand())) {
// 三明治跳过营帐通开通
continue;
}
ShopStageInfoDO shopStageInfo = new ShopStageInfoDO();
shopStageInfo.setLineId(lineId);
shopStageInfo.setShopId(shopId);

View File

@@ -72,4 +72,8 @@ public class FranchiseFeeDO {
@ApiModelProperty("新管家已缴金额")
private BigDecimal xgjFeesPaid;
@Column(name = "cashier_fee")
@ApiModelProperty("收银费(系统费)")
private String cashierFee;
}

View File

@@ -117,4 +117,8 @@ public class OrderSysInfoDO {
/** 总部订货收款修改人 */
@Column(name = "receiving_update_user")
private String receivingUpdateUser;
/** 订货方式0先款后货、1先货后款 */
@Column(name = "order_type")
private Integer orderType;
}

View File

@@ -44,6 +44,8 @@ public class FranchiseFeeRequest {
@ApiModelProperty("加盟费优惠原因")
private String discountReason;
@ApiModelProperty("收银费(系统费)(三明治使用)")
private String cashierFee;
public FranchiseFeeDO toFranchiseFeeDO() {
FranchiseFeeDO franchiseFeeDO = new FranchiseFeeDO();
@@ -63,6 +65,7 @@ public class FranchiseFeeRequest {
franchiseFeeDO.setThirdYearFee(this.thirdYearFee);
franchiseFeeDO.setPerformanceBond(this.performanceBond);
franchiseFeeDO.setDiscountReason(this.discountReason);
franchiseFeeDO.setCashierFee(this.cashierFee);
return franchiseFeeDO;
}
}

View File

@@ -1,5 +1,6 @@
package com.cool.store.request;
import com.cool.store.constants.CommonConstants;
import com.cool.store.entity.OrderSysInfoDO;
import com.cool.store.enums.JoinModeEnum;
import com.cool.store.enums.OrderSysTypeEnum;
@@ -94,6 +95,9 @@ public class OrderSysInfoRequest {
@ApiModelProperty(value = "总部订货收款修改人" )
private String receivingUpdateUser;
@ApiModelProperty("订货方式0先款后货、1先货后款")
private Integer orderType;
public OrderSysInfoDO toOrderSysInfoDO() {
OrderSysInfoDO orderSysInfoDO = new OrderSysInfoDO();
@@ -131,7 +135,10 @@ public class OrderSysInfoRequest {
if (Objects.equals(joinMode, JoinModeEnum.FLAGSHIP_STORE.getCode())&&this.shopCode!=null){
return true;
}
if (StringUtils.isAnyBlank(this.receivingFirmName,this.receivingMsBankAccount,this.receivingMsBankBranch,this.bankUnionPayAccount,this.shopCode)){
if (StringUtils.isBlank(this.shopCode)) {
return false;
}
if (!CommonConstants.INDEX_ONE.equals(this.orderType) && StringUtils.isAnyBlank(this.receivingFirmName,this.receivingMsBankAccount,this.receivingMsBankBranch,this.bankUnionPayAccount)){
return false;
}
}

View File

@@ -3,10 +3,13 @@ package com.cool.store.request.xgj;
import com.cool.store.entity.FranchiseFeeDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import java.math.BigDecimal;
import java.util.Date;
import static com.cool.store.utils.CommonUtil.convertToBig;
/**
* @Author suzhuhong
* @Date 2025/6/3 16:52
@@ -44,17 +47,24 @@ public class PushFranchiseFeeRequest {
@ApiModelProperty( "创建时间")
private Date createTime;
@ApiModelProperty("品牌")
private Integer joinBrand;
public PushFranchiseFeeRequest(){}
public PushFranchiseFeeRequest(Long shopId, String partnerName, FranchiseFeeDO franchiseFeeDO){
this.setShopId(shopId);
this.setPartnerName(partnerName);
this.setBillId(franchiseFeeDO.getId().intValue());
this.setFranchiseFee(new BigDecimal(franchiseFeeDO.getYearFranchiseFee()));
this.setBond(new BigDecimal(franchiseFeeDO.getLoanMargin()));
this.setFirstYearManageFee(new BigDecimal(franchiseFeeDO.getFirstYearManageFee()));
this.setFirstYearFee(new BigDecimal(franchiseFeeDO.getFirstYearFee()));
this.setDesignFee(new BigDecimal(franchiseFeeDO.getPerformanceBond()));
this.setFranchiseFee(convertToBig(franchiseFeeDO.getYearFranchiseFee()));
this.setBond(convertToBig(franchiseFeeDO.getLoanMargin()));
this.setFirstYearManageFee(convertToBig(franchiseFeeDO.getFirstYearManageFee()));
this.setFirstYearFee(convertToBig(franchiseFeeDO.getFirstYearFee()));
this.setDesignFee(convertToBig(franchiseFeeDO.getPerformanceBond()));
// 三明治收银费
if (StringUtils.isNotBlank(franchiseFeeDO.getCashierFee())) {
this.setFranchiseFee(convertToBig(franchiseFeeDO.getCashierFee()));
}
this.setTotalFee(this.getBond()
.add(this.getFranchiseFee())
.add(this.getFirstYearManageFee())

View File

@@ -56,6 +56,9 @@ public class ReceiptRequest {
@ApiModelProperty( "删除标识")
private Integer deleted = 0;
@ApiModelProperty("品牌")
private Integer joinBrand;
public ReceiptRequest() {
}

View File

@@ -241,5 +241,9 @@ public class AddSignFranchiseResponse {
@ApiModelProperty("是否统管 1-统管0-不统管")
private Integer unifiedManagement;
@ApiModelProperty("收银费(系统费)")
private String cashierFee;
@ApiModelProperty("收银费(系统费)大写")
private String bigCashierFee;
}

View File

@@ -206,4 +206,7 @@ public class BuildInformationResponse {
@ApiModelProperty(value = "建店资料当前阶段状态")
private Integer shopSubStageStatus;
@ApiModelProperty("订货方式0先款后货、1先货后款")
private Integer orderType;
}

View File

@@ -63,7 +63,8 @@ public class FranchiseFeeResponse {
@ApiModelProperty("新管家已缴金额")
private BigDecimal xgjFeesPaid;
@ApiModelProperty("收银费(系统费)")
private String cashierFee;
@Data
public static class LinePay{
@@ -200,6 +201,7 @@ public class FranchiseFeeResponse {
franchiseFeeResponse.setXgjCollectionStatus(franchiseFeeDO.getXgjCollectionStatus());
franchiseFeeResponse.setXgjRemainderPayableAmount(franchiseFeeDO.getXgjRemainderPayableAmount());
franchiseFeeResponse.setXgjFeesPaid(franchiseFeeDO.getXgjFeesPaid());
franchiseFeeResponse.setCashierFee(franchiseFeeDO.getCashierFee());
return franchiseFeeResponse;
}
}

View File

@@ -213,6 +213,7 @@ public class BuildInformationServiceImpl implements BuildInformationService {
response.setReceivingMsBankAccount(orderSysInfoDO.getReceivingMsBankAccount());
response.setReceivingMsBankBranch(orderSysInfoDO.getReceivingMsBankBranch());
response.setBankUnionPayAccount(orderSysInfoDO.getBankUnionPayAccount());
response.setOrderType(orderSysInfoDO.getOrderType());
WarehouseInfoDO warehouseInfoDO = warehouseInfoMapper.getByCode(orderSysInfoDO.getDeclareGoodsLogisticsWarehouse());
if (Objects.nonNull(warehouseInfoDO)) {
response.setDeclareGoodsLogisticsWarehouseName(warehouseInfoDO.getWarehouseName());

View File

@@ -75,6 +75,13 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
if (!shopStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_70.getShopSubStageStatus())){
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
}
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(request.getShopId());
// 三明治前端没有改这块代码,还是会传这三个字段,因此后端这三个字段置空
if (Integer.valueOf(shopInfoDO.getFranchiseBrand()).equals(FranchiseBrandEnum.ZXSMZ.getCode())) {
request.setFirstYearManageFee("0");
request.setFirstYearFee("0");
request.setYearFranchiseFee("0");
}
FranchiseFeeDO franchiseFeeDO = request.toFranchiseFeeDO();
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_71);
if (request.getId() != null) {
@@ -89,11 +96,11 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
franchiseFeeDO.setCreateTime(new Date());
franchiseFeeMapper.insertSelective(franchiseFeeDO);
}
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(request.getShopId());
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(shopInfoDO.getLineId());
commonService.sendSms(lineInfoDO.getMobile(), SMSMsgEnum.PAY_FRANCHISE_FEES);
//推送加盟费信息到新管家
PushFranchiseFeeRequest feeRequest = new PushFranchiseFeeRequest(shopInfoDO.getId(), lineInfoDO.getUsername(), franchiseFeeDO);
feeRequest.setJoinBrand(Integer.valueOf(shopInfoDO.getFranchiseBrand()));
pushService.pushFranchiseFeeToXGJ(feeRequest);
return true;
}
@@ -116,6 +123,7 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
//推送加盟费信息到新管家
franchiseFeeDO.setCreateTime(franchiseFeeDO1.getCreateTime());
PushFranchiseFeeRequest feeRequest = new PushFranchiseFeeRequest(shopInfoDO.getId(), lineInfoDO.getUsername(), franchiseFeeDO);
feeRequest.setJoinBrand(Integer.valueOf(shopInfoDO.getFranchiseBrand()));
pushService.pushFranchiseFeeToXGJ(feeRequest);
return true;
}

View File

@@ -308,6 +308,10 @@ public class LinePayServiceImpl implements LinePayService {
public Boolean pushPayInfo(Long shopId, LinePayDO linePayDO) {
FranchiseFeeDO franchiseFeeDO = franchiseFeeMapper.selectByShopId(shopId);
ReceiptRequest receiptRequest = new ReceiptRequest(shopId, franchiseFeeDO.getId().intValue(), linePayDO);
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(shopId);
if (Objects.nonNull(shopInfoDO)) {
receiptRequest.setJoinBrand(Integer.valueOf(shopInfoDO.getFranchiseBrand()));
}
//推送缴费单数据到新管家
pushService.pushReceiptToXGJ(receiptRequest);
return Boolean.TRUE;

View File

@@ -143,6 +143,7 @@ public class OrderSysInfoServiceImpl implements OrderSysInfoService {
orderSysInfoDO.setReceivingMsBankAccount(request.getReceivingMsBankAccount());
orderSysInfoDO.setReceivingMsBankBranch(request.getReceivingMsBankBranch());
orderSysInfoDO.setBankUnionPayAccount(request.getBankUnionPayAccount());
orderSysInfoDO.setOrderType(request.getOrderType());
if (shopSubStageInfo.getShopSubStageStatus().equals(SHOP_SUB_STAGE_STATUS_152.getShopSubStageStatus())) {
if (orderSysInfoDO.getReceivingCreateTime() == null) {
orderSysInfoDO.setReceivingCreateTime(new Date());

View File

@@ -519,6 +519,14 @@ public class PointServiceImpl implements PointService {
if (AuditStatusEnum.REJECT.equals(auditStatus)) {
return auditRejectDeal(pointInfo, request.getReason());
}
// 如果是三明治,将地址写入门店信息表
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(pointInfo.getShopId());
if (Objects.nonNull(shopInfo) && Integer.valueOf(shopInfo.getFranchiseBrand()).equals(FranchiseBrandEnum.ZXSMZ.getCode())) {
ShopInfoDO updateShopInfo = new ShopInfoDO();
updateShopInfo.setId(pointInfo.getShopId());
updateShopInfo.setDetailAddress(pointInfo.getAddress());
shopInfoDAO.updateShopInfo(updateShopInfo);
}
//处理下一节点任务及更新point状态
return dealNextAuditRecord(pointInfo, pointAuditRecordMap, pointTodo.getNodeNo());
}

View File

@@ -146,7 +146,7 @@ public class ShopServiceImpl implements ShopService {
}
shopInfoDAO.batchAddShop(addShopList);
List<Long> shopIds = addShopList.stream().map(ShopInfoDO::getId).collect(Collectors.toList());
Integer result = shopStageInfoDAO.initShopStageInfo(lineInfo.getId(), shopIds, true);
Integer result = shopStageInfoDAO.initShopStageInfo(lineInfo.getId(), addShopList, true);
//初始化平台账号
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(lineInfo.getPartnerId());
shopAccountDAO.initShopAccount(hyPartnerUserInfoDO, shopIds);
@@ -298,7 +298,7 @@ public class ShopServiceImpl implements ShopService {
}
shopInfoDAO.batchAddShop(addShopList);
List<Long> shopIds = addShopList.stream().map(ShopInfoDO::getId).collect(Collectors.toList());
shopStageInfoDAO.initShopStageInfo(lineInfo.getId(), shopIds, true);
shopStageInfoDAO.initShopStageInfo(lineInfo.getId(), addShopList, true);
return 1L;
}
@@ -356,7 +356,7 @@ public class ShopServiceImpl implements ShopService {
shopInfoDO.setCreateUserId(userId);
Long shopId = shopInfoDAO.addShopInfo(shopInfoDO);
if (lineInfo.getWorkflowSubStageStatus().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_125.getCode())) {
shopStageInfoDAO.initShopStageInfo(request.getLineId(), Collections.singletonList(shopId), true);
shopStageInfoDAO.initShopStageInfo(request.getLineId(), Collections.singletonList(shopInfoDO), true);
HashMap<String, String> map = new HashMap<>();
map.put("partnerUsername", lineInfo.getUsername());
map.put("partnerMobile", lineInfo.getMobile());
@@ -381,7 +381,7 @@ public class ShopServiceImpl implements ShopService {
MessageEnum.MESSAGE_21,
map);
} else {
shopStageInfoDAO.initShopStageInfo(request.getLineId(), Collections.singletonList(shopId), false);
shopStageInfoDAO.initShopStageInfo(request.getLineId(), Collections.singletonList(shopInfoDO), false);
}
//初始化平台账号
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(lineInfo.getPartnerId());

View File

@@ -36,6 +36,7 @@ import java.util.stream.Collectors;
import static com.cool.store.enums.UserRoleEnum.*;
import static com.cool.store.enums.point.ShopSubStageStatusEnum.*;
import static com.cool.store.utils.CommonUtil.convertToBig;
@Service
@Slf4j
@@ -554,11 +555,12 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
} else {
if (Objects.nonNull(franchiseFeeDO)) {
BigDecimal total = new BigDecimal(franchiseFeeDO.getYearFranchiseFee())
.add(new BigDecimal(franchiseFeeDO.getLoanMargin()))
.add(new BigDecimal(franchiseFeeDO.getFirstYearFee()))
.add(new BigDecimal(franchiseFeeDO.getFirstYearManageFee()))
.add(new BigDecimal(franchiseFeeDO.getPerformanceBond()));
BigDecimal total = convertToBig(franchiseFeeDO.getYearFranchiseFee())
.add(convertToBig(franchiseFeeDO.getLoanMargin()))
.add(convertToBig(franchiseFeeDO.getFirstYearFee()))
.add(convertToBig(franchiseFeeDO.getFirstYearManageFee()))
.add(convertToBig(franchiseFeeDO.getPerformanceBond()))
.add(convertToBig(franchiseFeeDO.getCashierFee()));
addSignFranchiseResponse.setContractAmount(total.toString());
}
addSignFranchiseResponse.setMobile(lineInfoDO.getMobile());
@@ -611,9 +613,9 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
if (Objects.nonNull(franchiseFeeDO)) {
addSignFranchiseResponse.setYearFranchiseFee(franchiseFeeDO.getYearFranchiseFee());
addSignFranchiseResponse.setBigYearFranchiseFee(Convert.digitToChinese(new BigDecimal(franchiseFeeDO.getYearFranchiseFee())));
addSignFranchiseResponse.setBigYearFranchiseFee(Convert.digitToChinese(convertToBig(franchiseFeeDO.getYearFranchiseFee())));
addSignFranchiseResponse.setLoanMargin(franchiseFeeDO.getLoanMargin());
addSignFranchiseResponse.setBigLoanMargin(Convert.digitToChinese(new BigDecimal(franchiseFeeDO.getLoanMargin())));
addSignFranchiseResponse.setBigLoanMargin(Convert.digitToChinese(convertToBig(franchiseFeeDO.getLoanMargin())));
addSignFranchiseResponse.setFirstYearStartTime(franchiseFeeDO.getFirstYearStartTime());
addSignFranchiseResponse.setFirstYearEndTime(franchiseFeeDO.getFirstYearEndTime());
addSignFranchiseResponse.setFirstYearFee(franchiseFeeDO.getFirstYearFee());
@@ -625,7 +627,9 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
addSignFranchiseResponse.setThirdYearEndTime(franchiseFeeDO.getThirdYearEndTime());
addSignFranchiseResponse.setThirdYearFee(franchiseFeeDO.getThirdYearFee());
addSignFranchiseResponse.setPerformanceBond(franchiseFeeDO.getPerformanceBond());
addSignFranchiseResponse.setBigPerformanceBond(Convert.digitToChinese(new BigDecimal(franchiseFeeDO.getPerformanceBond())));
addSignFranchiseResponse.setBigPerformanceBond(Convert.digitToChinese(convertToBig(franchiseFeeDO.getPerformanceBond())));
addSignFranchiseResponse.setCashierFee(franchiseFeeDO.getCashierFee());
addSignFranchiseResponse.setBigCashierFee(Convert.digitToChinese(convertToBig(franchiseFeeDO.getCashierFee())));
}
return addSignFranchiseResponse;
}

View File

@@ -20,6 +20,8 @@ import com.cool.store.job.XxlJobHandler;
import com.cool.store.mapper.HyOpenAreaInfoMapper;
import com.cool.store.request.ShopListSuccessOpenRequest;
import com.cool.store.request.xfsgFirstOrderListRequest;
import com.cool.store.request.xgj.FranchiseFeeCallBackRequest;
import com.cool.store.request.xgj.ReceiptCallBackRequest;
import com.cool.store.response.MiniShopsResponse;
import com.cool.store.response.ResponseResult;
import com.cool.store.response.caipin.StoreUserResponse;
@@ -39,6 +41,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.ByteArrayOutputStream;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.temporal.ChronoUnit;
@@ -85,6 +88,27 @@ public class TestController {
ThirdFoodService thirdFoodService;
@Autowired
StoreService storeService;
@Resource
LinePayDAO linePayDAO;
@Resource
OpenApiService openApiService;
@PostMapping("/testXgjCallback")
public ResponseResult<Boolean> testXgjCallback(Long linePayId) {
LinePayDO linePayDO = linePayDAO.getById(linePayId);
ReceiptCallBackRequest receiptRequest = new ReceiptCallBackRequest();
receiptRequest.setReceiptId(linePayDO.getPaymentReceiptCode());
receiptRequest.setClaimStatus(1);
openApiService.changeReceiptStatus(receiptRequest);
FranchiseFeeCallBackRequest franchiseRequest = new FranchiseFeeCallBackRequest();
franchiseRequest.setShopId(linePayDO.getShopId());
franchiseRequest.setPayableFee(linePayDO.getAmount());
franchiseRequest.setPaidFees(linePayDO.getAmount());
franchiseRequest.setRemainingFee(BigDecimal.ZERO);
franchiseRequest.setPaymentStatus(2);
openApiService.changePaymentStatus(franchiseRequest);
return ResponseResult.success(true);
}
@PostMapping("/getFirstOrders")
public ResponseResult<xfsgFirstOderListResponse> getFirstOrders(@RequestBody xfsgFirstOrderListRequest storeCodeList) {