diff --git a/coolstore-partner-dao/src/main/java/com/cool/store/dao/PlatformBuildDAO.java b/coolstore-partner-dao/src/main/java/com/cool/store/dao/PlatformBuildDAO.java index d0920f843..b861032b4 100644 --- a/coolstore-partner-dao/src/main/java/com/cool/store/dao/PlatformBuildDAO.java +++ b/coolstore-partner-dao/src/main/java/com/cool/store/dao/PlatformBuildDAO.java @@ -3,10 +3,12 @@ package com.cool.store.dao; import com.cool.store.entity.BuildInformationDO; import com.cool.store.entity.PlatformBuildDO; import com.cool.store.mapper.PlatformBuildMapper; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.stereotype.Repository; import tk.mybatis.mapper.entity.Example; import javax.annotation.Resource; +import java.util.List; /** * @Author: WangShuo @@ -42,4 +44,18 @@ public class PlatformBuildDAO { example.createCriteria().andEqualTo("shopId",shopId).andEqualTo("type",type); return platformBuildMapper.selectOneByExample(example); } + public List selectByShopId(Long shopId) { + Example example = new Example(PlatformBuildDO.class); + example.createCriteria().andEqualTo("shopId",shopId); + return platformBuildMapper.selectByExample(example); + } + public Boolean batchUpdate(List platformBuildDOList) { + if (CollectionUtils.isEmpty(platformBuildDOList)) { + return false; + } + for (PlatformBuildDO platformBuildDO : platformBuildDOList){ + platformBuildMapper.updateByPrimaryKeySelective(platformBuildDO); + } + return true; + } } diff --git a/coolstore-partner-dao/src/main/resources/mapper/BuildInformationMapper.xml b/coolstore-partner-dao/src/main/resources/mapper/BuildInformationMapper.xml index 1311e6ad1..91a158fb1 100644 --- a/coolstore-partner-dao/src/main/resources/mapper/BuildInformationMapper.xml +++ b/coolstore-partner-dao/src/main/resources/mapper/BuildInformationMapper.xml @@ -19,6 +19,7 @@ + @@ -51,7 +52,7 @@ 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, create_time,update_time,create_user, - update_user,c_shop_name,settler_bank_back_photo_url,settler_is_same_partner,juridical_is_same_partner + update_user,c_shop_name,settler_bank_back_photo_url,settler_is_same_partner,juridical_is_same_partner,juridical_name diff --git a/coolstore-partner-model/src/main/java/com/cool/store/entity/BuildInformationDO.java b/coolstore-partner-model/src/main/java/com/cool/store/entity/BuildInformationDO.java index a2ee92e0e..cf19521de 100644 --- a/coolstore-partner-model/src/main/java/com/cool/store/entity/BuildInformationDO.java +++ b/coolstore-partner-model/src/main/java/com/cool/store/entity/BuildInformationDO.java @@ -82,6 +82,12 @@ public class BuildInformationDO { @Column(name = "juridical_id_card_no") private String juridicalIdCardNo; + /** + * 法人姓名 + */ + @Column(name = "juridical_name") + private String juridicalName; + /** * 法人手持身份证正面(图片) */ diff --git a/coolstore-partner-model/src/main/java/com/cool/store/request/BuildInformationRequest.java b/coolstore-partner-model/src/main/java/com/cool/store/request/BuildInformationRequest.java index 1e0012bb8..dfdfe4495 100644 --- a/coolstore-partner-model/src/main/java/com/cool/store/request/BuildInformationRequest.java +++ b/coolstore-partner-model/src/main/java/com/cool/store/request/BuildInformationRequest.java @@ -76,6 +76,9 @@ public class BuildInformationRequest { @Length(max = 18, message = "法人身份证号长度必须为18位") @ApiModelProperty("法人身份证号") private String juridicalIdCardNo; + @ApiModelProperty("法人姓名") + @JsonProperty("juridicalName") + private String juridicalName; @NotBlank(message = "法人手持身份证正面 不能为空") @Length(max = 250 , message = "法人手持身份证正面 长度不能超过250") @@ -193,6 +196,7 @@ public class BuildInformationRequest { buildInformationDO.setDoorPhoto(this.doorPhoto); buildInformationDO.setInStorePhoto(this.inStorePhoto); buildInformationDO.setJuridicalIdCardNo(this.juridicalIdCardNo); + buildInformationDO.setJuridicalName(this.juridicalName); buildInformationDO.setJuridicalIdCardFront(this.juridicalIdCardFront); buildInformationDO.setJuridicalIdCardReverse(this.juridicalIdCardReverse); buildInformationDO.setJuridicalHandheldIdCardFront(this.juridicalHandheldIdCardFront); diff --git a/coolstore-partner-model/src/main/java/com/cool/store/request/BuildSettlerRequest.java b/coolstore-partner-model/src/main/java/com/cool/store/request/BuildSettlerRequest.java new file mode 100644 index 000000000..21d1b9639 --- /dev/null +++ b/coolstore-partner-model/src/main/java/com/cool/store/request/BuildSettlerRequest.java @@ -0,0 +1,82 @@ +package com.cool.store.request; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * @Author: WangShuo + * @Date: 2025/06/10/09:33 + * @Version 1.0 + * @注释: + */ +@Data +public class BuildSettlerRequest { + + @NotNull + private Long shopId; + + @ApiModelProperty("结算人身份证信息是否和加盟商一致,false否,true是") + @NotNull(message = "结算人身份证信息是否和加盟商一致不能为空") + private Boolean settlerIsSamePartner ; + + // @ApiModelProperty("结算人姓名") + @NotBlank(message = "结算人姓名 不能为空") + @JsonProperty("settlerName") + private String settlerName; + + // @NotBlank(message = "结算人身份证正面 不能为空") + @Length(max = 250 , message = "结算人身份证正面 长度不能超过250") + @ApiModelProperty("结算人身份证正面(图片)") + private String settlerIdCardFront; + + @NotBlank(message = "结算人手持身份证正面 不能为空") + @Length(max = 250 , message = "结算人手持身份证正面 长度不能超过250") + @ApiModelProperty("结算人手持身份证正面") + private String settlerInHandFrontPicture; + + @NotBlank(message = "结算人手持身份证反面 不能为空") + @Length(max = 250 , message = "结算人手持身份证反面 长度不能超过250") + @ApiModelProperty("结算人手持身份证反面 (图片)") + private String settlerInHandBackPicture; + + // @NotBlank(message = "结算人身份证反面 不能为空") + @Length(max = 250 , message = "结算人身份证反面 长度不能超过250") + @ApiModelProperty("结算人身份证反面(图片)") + private String settlerIdCardReverse; + + // @NotBlank(message = "结算人身份证号 不能为空") + @Length(max = 64 , message = "结算人身份证号 长度不能超过64") + @ApiModelProperty("结算人身份证号") + private String settlerIdCardNo; + + @NotBlank(message = "结算人银行卡照片 不能为空") + @Length(max = 250, message = "结算人银行卡照片 长度不能超过250") + @ApiModelProperty("结算人银行卡照片") + private String settlerBankPhotoUrl; + + @NotBlank(message = "结算人银行卡背面照片 不能为空") + @Length(max = 250, message = "结算人银行卡背面照片 长度不能超过250") + @ApiModelProperty("结算人银行卡背面照片") + @JsonProperty("settlerBankBackPhotoUrl") + private String settlerBankBackPhotoUrl; + + @NotBlank(message = "结算人银行卡号 不能为空") + @Length(max = 64 , message = "结算人银行卡号 长度不能超过64") + @ApiModelProperty("结算人银行卡号") + private String settlerBankNumber; + + @NotBlank(message = "结算人银行卡预留手机号 不能为空") + @Length(min = 11,max = 11 , message = "结算人银行卡预留手机号 长度必须为11") + @ApiModelProperty("结算人银行卡预留手机号") + private String settlerBankMobile; + + @NotBlank(message = "结算开户银行支行 不能为空") + @Length(max =100, message = "结算开户银行支行 长度不能超过100") + @ApiModelProperty("结算开户银行支行") + private String settlerBankName; +} diff --git a/coolstore-partner-model/src/main/java/com/cool/store/response/BuildInformationResponse.java b/coolstore-partner-model/src/main/java/com/cool/store/response/BuildInformationResponse.java index fb651b26c..f0795f6e0 100644 --- a/coolstore-partner-model/src/main/java/com/cool/store/response/BuildInformationResponse.java +++ b/coolstore-partner-model/src/main/java/com/cool/store/response/BuildInformationResponse.java @@ -68,6 +68,9 @@ public class BuildInformationResponse { @ApiModelProperty("法人身份证号") private String juridicalIdCardNo; + @ApiModelProperty("法人姓名") + private String juridicalName; + @ApiModelProperty("法人手持身份证正面(图片)") private String juridicalHandheldIdCardFront; diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/BuildInformationService.java b/coolstore-partner-service/src/main/java/com/cool/store/service/BuildInformationService.java index ca5b3a27d..d3b23a8c3 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/BuildInformationService.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/BuildInformationService.java @@ -2,6 +2,7 @@ package com.cool.store.service; import com.cool.store.request.BuildInformationRequest; +import com.cool.store.request.BuildSettlerRequest; import com.cool.store.response.BuildInformationResponse; /** @@ -17,4 +18,6 @@ public interface BuildInformationService { Integer getJoinType(Long lineId); + Boolean updateBuildSettler(BuildSettlerRequest request,String userId); + } diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/BuildInformationServiceImpl.java b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/BuildInformationServiceImpl.java index 29cfc0a68..5fc80c44e 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/BuildInformationServiceImpl.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/BuildInformationServiceImpl.java @@ -10,6 +10,7 @@ import com.cool.store.enums.point.ShopSubStageStatusEnum; import com.cool.store.exception.ServiceException; import com.cool.store.mapper.WarehouseInfoMapper; import com.cool.store.request.BuildInformationRequest; +import com.cool.store.request.BuildSettlerRequest; import com.cool.store.response.BuildInformationResponse; import com.cool.store.service.BuildInformationService; import com.cool.store.mapper.BuildInformationMapper; @@ -38,6 +39,8 @@ import java.util.stream.Stream; */ @Service public class BuildInformationServiceImpl implements BuildInformationService { + @Resource + private PlatformBuildDAO platformBuildDAO; @Resource private EnumInfoService enumInfoService; @Resource @@ -164,6 +167,7 @@ public class BuildInformationServiceImpl implements BuildInformationService { response.setDoorPhoto(informationDO.getDoorPhoto()); response.setInStorePhoto(informationDO.getInStorePhoto()); response.setJuridicalIdCardFront(informationDO.getJuridicalIdCardFront()); + response.setJuridicalName(informationDO.getJuridicalName()); response.setJuridicalIdCardNo(informationDO.getJuridicalIdCardNo()); response.setJuridicalIdCardReverse(informationDO.getJuridicalIdCardReverse()); response.setJuridicalHandheldIdCardReverse(informationDO.getJuridicalHandheldIdCardReverse()); @@ -210,6 +214,7 @@ public class BuildInformationServiceImpl implements BuildInformationService { LineInfoDO lineInfoDO = lineInfoDAO.getLineInfo(shopInfoDO.getLineId()); QualificationsInfoDO qualificationsInfoDO = qualificationsInfoDAO.getByLineId(lineInfoDO.getId()); if (request.getJuridicalIsSamePartner()) { + buildInformationDO.setJuridicalName(lineInfoDO.getUsername()); buildInformationDO.setJuridicalIdCardNo(qualificationsInfoDO.getIdCardNo()); buildInformationDO.setJuridicalIdCardFront(qualificationsInfoDO.getFrontOfIdCard()); buildInformationDO.setJuridicalIdCardReverse(qualificationsInfoDO.getBackOfIdCard()); @@ -239,6 +244,22 @@ public class BuildInformationServiceImpl implements BuildInformationService { return buildInformationDAO.insertSelective(buildInformationDO); } else { buildInformationDO.setUpdateTime(new Date()); + List platformBuildDOS = platformBuildDAO.selectByShopId(request.getShopId()); + if (CollectionUtils.isNotEmpty(platformBuildDOS)){ + for (PlatformBuildDO platformBuildDO : platformBuildDOS){ + platformBuildDO.setSettlerName(buildInformationDO.getSettlerName()); + platformBuildDO.setSettlerIdCardFront(buildInformationDO.getSettlerIdCardFront()); + platformBuildDO.setSettlerIdCardReverse(buildInformationDO.getSettlerIdCardReverse()); + platformBuildDO.setSettlerInHandBackPicture(buildInformationDO.getSettlerInHandBackPicture()); + platformBuildDO.setSettlerInHandFrontPicture(buildInformationDO.getSettlerInHandFrontPicture()); + platformBuildDO.setSettlerIdCardNo(buildInformationDO.getSettlerIdCardNo()); + platformBuildDO.setSettlerBankPhotoUrl(buildInformationDO.getSettlerBankPhotoUrl()); + platformBuildDO.setSettlerBankNumber(buildInformationDO.getSettlerBankNumber()); + platformBuildDO.setSettlerBankMobile(buildInformationDO.getSettlerBankMobile()); + platformBuildDO.setSettlerBankName(buildInformationDO.getSettlerBankName()); + } + } + platformBuildDAO.batchUpdate(platformBuildDOS); return buildInformationDAO.updateByShopIdSelective(buildInformationDO); } }else{ @@ -275,6 +296,54 @@ public class BuildInformationServiceImpl implements BuildInformationService { return qualificationsInfoDO.getJoinType(); } + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean updateBuildSettler(BuildSettlerRequest request,String userId) { + ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId()); + LineInfoDO lineInfoDO = lineInfoDAO.getLineInfo(shopInfo.getLineId()); + QualificationsInfoDO qualificationsInfoDO = qualificationsInfoDAO.getByLineId(shopInfo.getLineId()); + BuildInformationDO buildInformationDO = buildInformationDAO.selectOneByShopId(request.getShopId()); + if (request.getSettlerIsSamePartner()) { + buildInformationDO.setSettlerIdCardNo(qualificationsInfoDO.getIdCardNo()); + buildInformationDO.setSettlerName(lineInfoDO.getUsername()); + buildInformationDO.setSettlerIdCardFront(qualificationsInfoDO.getFrontOfIdCard()); + buildInformationDO.setSettlerIdCardReverse(qualificationsInfoDO.getBackOfIdCard()); + }else{ + buildInformationDO.setSettlerName(request.getSettlerName()); + buildInformationDO.setSettlerIdCardNo(request.getSettlerIdCardNo()); + buildInformationDO.setSettlerIdCardFront(request.getSettlerIdCardFront()); + buildInformationDO.setSettlerIdCardReverse(request.getSettlerIdCardReverse()); + } + buildInformationDO.setSettlerIsSamePartner(request.getSettlerIsSamePartner()); + buildInformationDO.setSettlerInHandBackPicture(request.getSettlerInHandBackPicture()); + buildInformationDO.setSettlerInHandFrontPicture(request.getSettlerInHandFrontPicture()); + buildInformationDO.setSettlerBankPhotoUrl(request.getSettlerBankPhotoUrl()); + buildInformationDO.setSettlerBankNumber(request.getSettlerBankNumber()); + buildInformationDO.setSettlerBankMobile(request.getSettlerBankMobile()); + buildInformationDO.setSettlerBankName(request.getSettlerBankName()); + buildInformationDO.setSettlerBankBackPhotoUrl(request.getSettlerBankBackPhotoUrl()); + buildInformationDO.setUpdateTime(new Date()); + buildInformationDO.setUpdateUser(userId); + buildInformationDAO.updateByShopIdSelective(buildInformationDO); + List platformBuildDOS = platformBuildDAO.selectByShopId(request.getShopId()); + if (CollectionUtils.isNotEmpty(platformBuildDOS)){ + for (PlatformBuildDO platformBuildDO : platformBuildDOS){ + platformBuildDO.setSettlerName(buildInformationDO.getSettlerName()); + platformBuildDO.setSettlerIdCardFront(buildInformationDO.getSettlerIdCardFront()); + platformBuildDO.setSettlerIdCardReverse(buildInformationDO.getSettlerIdCardReverse()); + platformBuildDO.setSettlerInHandBackPicture(buildInformationDO.getSettlerInHandBackPicture()); + platformBuildDO.setSettlerInHandFrontPicture(buildInformationDO.getSettlerInHandFrontPicture()); + platformBuildDO.setSettlerIdCardNo(buildInformationDO.getSettlerIdCardNo()); + platformBuildDO.setSettlerBankPhotoUrl(buildInformationDO.getSettlerBankPhotoUrl()); + platformBuildDO.setSettlerBankNumber(buildInformationDO.getSettlerBankNumber()); + platformBuildDO.setSettlerBankMobile(buildInformationDO.getSettlerBankMobile()); + platformBuildDO.setSettlerBankName(buildInformationDO.getSettlerBankName()); + } + } + platformBuildDAO.batchUpdate(platformBuildDOS); + return true; + } + } diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/PlatformBuildServiceImpl.java b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/PlatformBuildServiceImpl.java index 96706025d..c7335c3ff 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/PlatformBuildServiceImpl.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/PlatformBuildServiceImpl.java @@ -345,7 +345,7 @@ public class PlatformBuildServiceImpl implements PlatformBuildService { dto.setElMeStageStatus(stageDTO.getShopSubStageStatus()); } else if (stageDTO.getShopSubStage().equals(ShopSubStageEnum.SHOP_STAGE_22.getShopSubStage())) { dto.setKsStageStatus(stageDTO.getShopSubStageStatus()); - }else if (stageDTO.getShopSubStage().equals(ShopSubStageEnum.SHOP_STAGE_25.getShopSubStage())) { + } else if (stageDTO.getShopSubStage().equals(ShopSubStageEnum.SHOP_STAGE_25.getShopSubStage())) { dto.setJDStageStatus(stageDTO.getShopSubStageStatus()); } } @@ -364,15 +364,11 @@ public class PlatformBuildServiceImpl implements PlatformBuildService { QualificationsInfoDO qualificationsInfoDO = qualificationsInfoDAO.getByLineId(shopInfo.getLineId()); BuildInformationDO informationDO = buildInformationDAO.selectOneByShopId(shopId); LicenseTransactDO licenseTransactDO = applyLicenseMapper.selectByShopId(shopId); - if (Objects.nonNull(qualificationsInfoDO)) { - platformBuildResponse.setLegalName(qualificationsInfoDO.getLegalName()); - platformBuildResponse.setLegalIdCardFront(qualificationsInfoDO.getLegalIdCardFront()); - platformBuildResponse.setLegalIdCardBack(qualificationsInfoDO.getLegalIdCardBack()); - } - if (Objects.nonNull(pointInfo)) { - platformBuildResponse.setShopProvinceCityDistrict(pointInfo.getProvince() + pointInfo.getCity() + pointInfo.getDistrict()); - platformBuildResponse.setShopAddress(pointInfo.getAddress()); - } + platformBuildResponse.setLegalName(informationDO.getJuridicalName()); + platformBuildResponse.setLegalIdCardFront(informationDO.getJuridicalIdCardFront()); + platformBuildResponse.setLegalIdCardBack(informationDO.getSettlerIdCardReverse()); + platformBuildResponse.setShopProvinceCityDistrict(shopInfo.getProvince() + shopInfo.getCity() + shopInfo.getDistrict()); + platformBuildResponse.setShopAddress(shopInfo.getDetailAddress()); platformBuildResponse.setShopCode(shopInfo.getShopCode()); platformBuildResponse.setFranchiseBrand(FranchiseBrandEnum.getDescByCode(shopInfo.getFranchiseBrand())); platformBuildResponse.setShopName(shopInfo.getShopName()); @@ -386,11 +382,16 @@ public class PlatformBuildServiceImpl implements PlatformBuildService { platformBuildResponse.setFoodBusinessLicenseUrl(licenseTransactDO.getFoodBusinessLicenseUrl()); } } + AcceptanceInfoDO acceptanceInfoDO = acceptanceInfoDAO.selectByShopId(shopId); + if (Objects.nonNull(acceptanceInfoDO)) { + platformBuildResponse.setShopDoorwayPhoto(acceptanceInfoDO.getShopDoorwayPhoto()); + platformBuildResponse.setShopInteriorPhoto(acceptanceInfoDO.getShopInteriorPhoto()); + } if (Objects.isNull(platformBuildDO)) { BeanUtils.copyProperties(informationDO, platformBuildResponse); - AcceptanceInfoDO acceptanceInfoDO = acceptanceInfoDAO.selectByShopId(shopId); - if(Objects.nonNull(acceptanceInfoDO)){ - platformBuildResponse.setStorePositioningUrl(acceptanceInfoDO.getShopLocationScreenshots());} + if (Objects.nonNull(acceptanceInfoDO)) { + platformBuildResponse.setStorePositioningUrl(acceptanceInfoDO.getShopLocationScreenshots()); + } return platformBuildResponse; } BeanUtils.copyProperties(platformBuildDO, platformBuildResponse); @@ -407,7 +408,7 @@ public class PlatformBuildServiceImpl implements PlatformBuildService { OperationLogDO trial = operationLogDAO.getByCondition(shopId, SHOP_SUB_STAGE_STATUS_251.getShopSubStageStatus()); ShopAuditInfoDO auditInfo = shopAuditInfoDAO.getAuditInfo(platformBuildDO.getAuditId()); doSomething(platformBuildResponse, trial, auditInfo); - }else { + } else { ShopAuditInfoDO auditInfo = shopAuditInfoDAO.getAuditInfo(platformBuildDO.getAuditId()); if (Objects.nonNull(auditInfo)) { if (auditInfo.getResultType().equals(AuditResultTypeEnum.PASS.getCode())) { diff --git a/coolstore-partner-web/src/main/java/com/cool/store/controller/webc/MiniBuildInformationController.java b/coolstore-partner-web/src/main/java/com/cool/store/controller/webc/MiniBuildInformationController.java index 9e2d0eab3..c602bc24b 100644 --- a/coolstore-partner-web/src/main/java/com/cool/store/controller/webc/MiniBuildInformationController.java +++ b/coolstore-partner-web/src/main/java/com/cool/store/controller/webc/MiniBuildInformationController.java @@ -1,9 +1,12 @@ package com.cool.store.controller.webc; +import com.cool.store.context.PartnerUserHolder; import com.cool.store.request.BuildInformationRequest; +import com.cool.store.request.BuildSettlerRequest; import com.cool.store.response.BuildInformationResponse; import com.cool.store.response.ResponseResult; import com.cool.store.service.BuildInformationService; +import com.cool.store.vo.PartnerUserInfoVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.validation.annotation.Validated; @@ -42,4 +45,11 @@ public class MiniBuildInformationController { return ResponseResult.success(buildInformationService.getJoinType(lineId)); } + @ApiOperation("修改结算人信息") + @PostMapping("/updateSettler") + public ResponseResult updateSettler(@RequestBody @Validated BuildSettlerRequest request) { + PartnerUserInfoVO user = PartnerUserHolder.getUser(); + return ResponseResult.success(buildInformationService.updateBuildSettler(request,user.getPartnerId())); + } + }