Merge #102 into master from cc_20260414_invoice

开票管理

* cc_20260414_invoice: (6 commits squashed)

  - fix:门店开票信息

  - fix:新增企业开票校验接口;闭店列表新增筛选条件

  - fix

  - Merge branch 'master' into cc_20260414_invoice

  - Merge remote-tracking branch 'origin/cc_20260414_invoice' into cc_20260414_invoice
    
    # Conflicts:
    #	coolstore-partner-common/src/main/java/com/cool/store/enums/ErrorCodeEnum.java

  - Merge branch 'master' into cc_20260414_invoice
    
    # Conflicts:
    #	coolstore-partner-model/src/main/java/com/cool/store/request/StoreMasterDTO.java

Signed-off-by: 王非凡 <accounts_67eba0c5fee9c49c80c8e2b4@mail.teambition.com>
Merged-by: 正新 <accounts_6964c7bcd2a2c377c5bbd01b@mail.teambition.com>

CR-link: https://codeup.aliyun.com/692ea314dec569489f6f167c/hangzhou/java/custom_zxjp/change/102
This commit is contained in:
王非凡
2026-04-17 08:53:50 +00:00
committed by 正新
parent 7102127358
commit 8c4f55ab20
14 changed files with 120 additions and 3 deletions

View File

@@ -475,6 +475,7 @@ public enum ErrorCodeEnum {
WALLET_PAY_CANNOT_CANCEL(1830020, "该交易无法取消", null), WALLET_PAY_CANNOT_CANCEL(1830020, "该交易无法取消", null),
TOTAL_FEES_NEED_EQUAL(1830021, "分账总金额需与合计缴费金额一致", null), TOTAL_FEES_NEED_EQUAL(1830021, "分账总金额需与合计缴费金额一致", null),
NOT_EXIST_WANG_SHANG_ACCOUNT(1830022, "当前门店未开通网商钱包账户,请先开通!", null), NOT_EXIST_WANG_SHANG_ACCOUNT(1830022, "当前门店未开通网商钱包账户,请先开通!", null),
SIGNER_NOT_EQUAL_LEGAL_PERSON(1840022, "法人与签约人不一致", null),
IP_LIMIT(1840000, "IP访问次数超限", null), IP_LIMIT(1840000, "IP访问次数超限", null),

View File

@@ -41,6 +41,9 @@
<result property="settlerBankBackPhotoUrl" column="settler_bank_back_photo_url" jdbcType="VARCHAR"/> <result property="settlerBankBackPhotoUrl" column="settler_bank_back_photo_url" jdbcType="VARCHAR"/>
<result property="settlerIsSamePartner" column="settler_is_same_partner" jdbcType="TINYINT"/> <result property="settlerIsSamePartner" column="settler_is_same_partner" jdbcType="TINYINT"/>
<result property="juridicalIsSamePartner" column="juridical_is_same_partner" jdbcType="TINYINT"/> <result property="juridicalIsSamePartner" column="juridical_is_same_partner" jdbcType="TINYINT"/>
<result property="invoiceType" column="invoice_type" jdbcType="TINYINT"/>
<result property="invoiceTitle" column="invoice_title" jdbcType="VARCHAR"/>
<result property="invoiceTin" column="invoice_tin" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
@@ -52,7 +55,7 @@
settler_id_card_front,settler_id_card_reverse,settler_in_hand_front_picture,settler_in_hand_back_picture,settler_id_card_no, settler_id_card_front,settler_id_card_reverse,settler_in_hand_front_picture,settler_in_hand_back_picture,settler_id_card_no,
settler_bank_number,settler_bank_mobile,settler_bank_name, settler_bank_number,settler_bank_mobile,settler_bank_name,
create_time,update_time,create_user, create_time,update_time,create_user,
update_user,c_shop_name,settler_bank_back_photo_url,settler_is_same_partner,juridical_is_same_partner,juridical_name update_user,c_shop_name,settler_bank_back_photo_url,settler_is_same_partner,juridical_is_same_partner,juridical_name,invoice_type,invoice_title,invoice_tin
</sql> </sql>
<insert id="batchInsertSpecific"> <insert id="batchInsertSpecific">
<foreach collection="list" item="item" index="index" separator=";"> <foreach collection="list" item="item" index="index" separator=";">

View File

@@ -65,9 +65,12 @@
</if> </if>
<if test="regionIds != null and !regionIds.isEmpty()"> <if test="regionIds != null and !regionIds.isEmpty()">
AND <foreach collection="regionIds" item="regionId" separator=" OR " open="(" close=")"> AND <foreach collection="regionIds" item="regionId" separator=" OR " open="(" close=")">
c.region_path LIKE CONCAT('%', #{regionId}, '%') c.region_path LIKE CONCAT('%/', #{regionId}, '/%')
</foreach> </foreach>
</if> </if>
<if test="request.regionId != null">
AND c.region_path LIKE CONCAT('%/', #{request.regionId}, '/%')
</if>
</where> </where>
ORDER BY b.create_time DESC ORDER BY b.create_time DESC
</select> </select>

View File

@@ -214,4 +214,23 @@ public class BuildInformationDO {
@Column(name = "juridical_is_same_partner") @Column(name = "juridical_is_same_partner")
private Boolean juridicalIsSamePartner; private Boolean juridicalIsSamePartner;
// ===== 开票信息 =====
/**
* 抬头类型
*/
@Column(name = "invoice_type")
private Integer invoiceType;
/**
* 发票抬头
*/
@Column(name = "invoice_title")
private String invoiceTitle;
/**
* 税号
*/
@Column(name = "invoice_tin")
private String invoiceTin;
} }

View File

@@ -178,6 +178,15 @@ public class BuildInformationRequest {
@ApiModelProperty(value = "详细地址" ) @ApiModelProperty(value = "详细地址" )
private String addresseeAddress; private String addresseeAddress;
@ApiModelProperty("抬头类型")
private Integer invoiceType;
@ApiModelProperty("发票抬头")
private String invoiceTitle;
@ApiModelProperty("税号")
private String invoiceTin;
public BuildInformationDO toDO(){ public BuildInformationDO toDO(){
BuildInformationDO buildInformationDO = new BuildInformationDO(); BuildInformationDO buildInformationDO = new BuildInformationDO();
buildInformationDO.setShopId(this.shopId); buildInformationDO.setShopId(this.shopId);
@@ -210,6 +219,9 @@ public class BuildInformationRequest {
buildInformationDO.setCShopName(this.miniProgramsShopName); buildInformationDO.setCShopName(this.miniProgramsShopName);
buildInformationDO.setSettlerIsSamePartner(this.settlerIsSamePartner); buildInformationDO.setSettlerIsSamePartner(this.settlerIsSamePartner);
buildInformationDO.setJuridicalIsSamePartner(this.juridicalIsSamePartner); buildInformationDO.setJuridicalIsSamePartner(this.juridicalIsSamePartner);
buildInformationDO.setInvoiceType(this.invoiceType);
buildInformationDO.setInvoiceTitle(this.invoiceTitle);
buildInformationDO.setInvoiceTin(this.invoiceTin);
return buildInformationDO; return buildInformationDO;
} }

View File

@@ -125,6 +125,15 @@ public class StoreMasterDTO {
*/ */
private String storeTypeName; private String storeTypeName;
@ApiModelProperty("抬头类型")
private Integer invoiceType;
@ApiModelProperty("发票抬头")
private String invoiceTitle;
@ApiModelProperty("税号")
private String invoiceTin;
@Data @Data
public static class SignerInfo { public static class SignerInfo {
@ApiModelProperty("签约人1姓名") @ApiModelProperty("签约人1姓名")

View File

@@ -48,4 +48,7 @@ public class CloseStoreQueryRequest extends PageBasicInfo {
@ApiModelProperty(value = "所属品牌列表", hidden = true) @ApiModelProperty(value = "所属品牌列表", hidden = true)
private List<Integer> joinBrands; private List<Integer> joinBrands;
@ApiModelProperty("区域id")
private Long regionId;
} }

View File

@@ -212,4 +212,13 @@ public class BuildInformationResponse {
@ApiModelProperty("订货备注") @ApiModelProperty("订货备注")
private String orderRemark; private String orderRemark;
@ApiModelProperty("抬头类型")
private Integer invoiceType;
@ApiModelProperty("发票抬头")
private String invoiceTitle;
@ApiModelProperty("税号")
private String invoiceTin;
} }

View File

@@ -28,4 +28,9 @@ public interface BuildInformationService {
* @param user 用户 * @param user 用户
*/ */
Boolean operationsConsultantAudit(AuditApproveRequest request, LoginUserInfo user); Boolean operationsConsultantAudit(AuditApproveRequest request, LoginUserInfo user);
/**
* 开票信息企业校验
*/
Boolean companyInvoiceVerify(Long shopId);
} }

View File

@@ -12,10 +12,12 @@ import com.cool.store.enums.*;
import com.cool.store.enums.point.ShopSubStageEnum; import com.cool.store.enums.point.ShopSubStageEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum; import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.exception.ServiceException; import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.ApplyLicenseMapper;
import com.cool.store.mapper.WarehouseInfoMapper; import com.cool.store.mapper.WarehouseInfoMapper;
import com.cool.store.request.AuditApproveRequest; import com.cool.store.request.AuditApproveRequest;
import com.cool.store.request.BuildInformationRequest; import com.cool.store.request.BuildInformationRequest;
import com.cool.store.request.BuildSettlerRequest; import com.cool.store.request.BuildSettlerRequest;
import com.cool.store.response.AddSignFranchiseResponse;
import com.cool.store.response.BuildInformationResponse; import com.cool.store.response.BuildInformationResponse;
import com.cool.store.service.*; import com.cool.store.service.*;
import com.cool.store.utils.RedisConstantUtil; import com.cool.store.utils.RedisConstantUtil;
@@ -88,6 +90,10 @@ public class BuildInformationServiceImpl implements BuildInformationService {
private OperationLogDAO operationLogDAO; private OperationLogDAO operationLogDAO;
@Autowired @Autowired
private RegionDao regionDao; private RegionDao regionDao;
@Resource
private SignFranchiseService signFranchiseService;
@Resource
private ApplyLicenseMapper applyLicenseMapper;
@Override @Override
@@ -350,6 +356,9 @@ public class BuildInformationServiceImpl implements BuildInformationService {
response.setSettlerBankBackPhotoUrl(informationDO.getSettlerBankBackPhotoUrl()); response.setSettlerBankBackPhotoUrl(informationDO.getSettlerBankBackPhotoUrl());
response.setSettlerIsSamePartner(informationDO.getSettlerIsSamePartner()); response.setSettlerIsSamePartner(informationDO.getSettlerIsSamePartner());
response.setJuridicalIsSamePartner(informationDO.getJuridicalIsSamePartner()); response.setJuridicalIsSamePartner(informationDO.getJuridicalIsSamePartner());
response.setInvoiceType(informationDO.getInvoiceType());
response.setInvoiceTitle(informationDO.getInvoiceTitle());
response.setInvoiceTin(informationDO.getInvoiceTin());
} }
private static @NotNull OrderSysInfoDO getOrderSysInfoDO(BuildInformationRequest request) { private static @NotNull OrderSysInfoDO getOrderSysInfoDO(BuildInformationRequest request) {
@@ -465,6 +474,27 @@ public class BuildInformationServiceImpl implements BuildInformationService {
return true; return true;
} }
@Override
public Boolean companyInvoiceVerify(Long shopId) {
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
if (Objects.isNull(shopInfo)) {
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
}
ShopStageInfoDO stageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_3);
if (!stageInfo.getShopSubStageStatus().equals(SHOP_SUB_STAGE_STATUS_33.getShopSubStageStatus())) {
throw new ServiceException(ErrorCodeEnum.LICENSE_LEGAL_STAGE_FAIL);
}
LicenseTransactDO license = applyLicenseMapper.selectByShopId(shopId);
if (Objects.isNull(license) || StringUtils.isBlank(license.getLicenseLegalPerson())) {
throw new ServiceException(ErrorCodeEnum.LICENSE_LEGAL_STAGE_FAIL);
}
AddSignFranchiseResponse signFranchise = signFranchiseService.getSignFranchise(shopId);
if (!signFranchise.getPartnershipSignatoryFirst().equals(license.getLicenseLegalPerson())
&& !signFranchise.getPartnershipSignatorySecond().equals(license.getLicenseLegalPerson())) {
throw new ServiceException(ErrorCodeEnum.SIGNER_NOT_EQUAL_LEGAL_PERSON);
}
return true;
}
} }

View File

@@ -150,6 +150,9 @@ public class SyncMainSysServerImpl implements SyncMainSysServer {
settlerInfo.setSettlerBankPhotoUrl(buildInformationDO.getSettlerBankPhotoUrl()); settlerInfo.setSettlerBankPhotoUrl(buildInformationDO.getSettlerBankPhotoUrl());
settlerInfo.setSettlerBankBackPhotoUrl(buildInformationDO.getSettlerBankBackPhotoUrl()); settlerInfo.setSettlerBankBackPhotoUrl(buildInformationDO.getSettlerBankBackPhotoUrl());
storeMasterDTO.setSettlerInfo(settlerInfo); storeMasterDTO.setSettlerInfo(settlerInfo);
storeMasterDTO.setInvoiceType(buildInformationDO.getInvoiceType());
storeMasterDTO.setInvoiceTitle(buildInformationDO.getInvoiceTitle());
storeMasterDTO.setInvoiceTin(buildInformationDO.getInvoiceTin());
} }

View File

@@ -369,12 +369,21 @@ public class WalletServiceImpl implements WalletService {
@Override @Override
public AccountDataVO getAccountList(AccountQueryRequest request) { public AccountDataVO getAccountList(AccountQueryRequest request) {
String storeId = getStoreId(request); String storeId = getStoreId(request);
// 处理shopInfo和store表storeId不一致的问题使用开店shop_info表的storeId
if (StringUtils.isNotBlank(request.getStoreId())) {
StoreDO storeDO = storeDao.getByStoreId(request.getStoreId());
ShopInfoDO shopInfo = shopInfoDAO.getShopInfoByShopCode(storeDO.getStoreNum());
if (Objects.nonNull(shopInfo) && !storeDO.getStoreId().equals(shopInfo.getStoreId())) {
storeId = shopInfo.getStoreId();
}
}
List<AccountInfoDTO> accountInfo = walletApiService.getAccountInfo(new OutStoreIdRequest(storeId)); List<AccountInfoDTO> accountInfo = walletApiService.getAccountInfo(new OutStoreIdRequest(storeId));
String finalStoreId = storeId;
List<AccountInfoVO> accountList = accountInfo.stream() List<AccountInfoVO> accountList = accountInfo.stream()
.filter(v -> Objects.isNull(request.getWalletType()) || request.getWalletType().equals(v.getWalletType())) .filter(v -> Objects.isNull(request.getWalletType()) || request.getWalletType().equals(v.getWalletType()))
.map(v -> { .map(v -> {
AccountInfoVO vo = BeanUtil.toBean(v, AccountInfoVO.class); AccountInfoVO vo = BeanUtil.toBean(v, AccountInfoVO.class);
String key = MessageFormat.format(RedisConstant.WALLET_OPEN_FAIL, storeId, String.valueOf(v.getWalletType())); String key = MessageFormat.format(RedisConstant.WALLET_OPEN_FAIL, finalStoreId, String.valueOf(v.getWalletType()));
vo.setFailReason(redisUtilPool.getString(key)); vo.setFailReason(redisUtilPool.getString(key));
return vo; return vo;
}).collect(Collectors.toList()); }).collect(Collectors.toList());

View File

@@ -52,4 +52,10 @@ public class PCBuildInformationController {
LoginUserInfo user = CurrentUserHolder.getUser(); LoginUserInfo user = CurrentUserHolder.getUser();
return ResponseResult.success(buildInformationService.operationsConsultantAudit(request, user)); return ResponseResult.success(buildInformationService.operationsConsultantAudit(request, user));
} }
@ApiOperation("开票信息选择企业时校验")
@GetMapping("/companyInvoiceVerify")
public ResponseResult<Boolean> companyInvoiceVerify(@RequestParam(value = "shopId") Long shopId) {
return ResponseResult.success(buildInformationService.companyInvoiceVerify(shopId));
}
} }

View File

@@ -53,4 +53,9 @@ public class MiniBuildInformationController {
return ResponseResult.success(buildInformationService.updateBuildSettler(request,user.getPartnerId())); return ResponseResult.success(buildInformationService.updateBuildSettler(request,user.getPartnerId()));
} }
@ApiOperation("开票信息选择企业时校验")
@GetMapping("/companyInvoiceVerify")
public ResponseResult<Boolean> companyInvoiceVerify(@RequestParam(value = "shopId") Long shopId) {
return ResponseResult.success(buildInformationService.companyInvoiceVerify(shopId));
}
} }