Merge remote-tracking branch 'origin/cc_20250325_select' into cc_20250325_select

This commit is contained in:
苏竹红
2025-04-15 13:49:03 +08:00
16 changed files with 166 additions and 48 deletions

View File

@@ -239,6 +239,8 @@ public enum ErrorCodeEnum {
CREATE_PASSWORD_FAIL(131007,"身份证号信息错误",null),
GET_HOME_TEMPLATE_ERROR(131008,"获取首页模板失败",null),
THE_DATA_IS_NOT_FILLED(131009,"您有数据还未填写",null),
QUOTATION_URL_REQUIRED(131010,"请等待报价单提交",null),
DESIGN_URL_REQUIRED(131011,"请等待设计图提交",null),
TALLY_BOOK_NOT_EXIST(180001, "记账本数据不存在", null),

View File

@@ -77,8 +77,8 @@ public enum ShopSubStageStatusEnum {
//平台资料提交
SHOP_SUB_STAGE_STATUS_150(ShopSubStageEnum.SHOP_STAGE_15, 1500, "待提交", Boolean.FALSE),
SHOP_SUB_STAGE_STATUS_151(ShopSubStageEnum.SHOP_STAGE_15, 1510, "订货信息待提交", Boolean.TRUE),
SHOP_SUB_STAGE_STATUS_152(ShopSubStageEnum.SHOP_STAGE_15, 1520, "总部订货收款账户待提交",Boolean.TRUE),
SHOP_SUB_STAGE_STATUS_151(ShopSubStageEnum.SHOP_STAGE_15, 1510, "待总部填写仓配信息", Boolean.TRUE),
SHOP_SUB_STAGE_STATUS_152(ShopSubStageEnum.SHOP_STAGE_15, 1520, "总部提交订货收款信息",Boolean.TRUE),
SHOP_SUB_STAGE_STATUS_153(ShopSubStageEnum.SHOP_STAGE_15, 1530, "已完成", Boolean.TRUE),
//POS

View File

@@ -176,7 +176,7 @@
from enterprise_user_${eid}
where active = true
<if test="keyword!=null and keyword!=''">
and name like concat('%',#{keyword},'%')
and( name like concat('%',#{keyword},'%') or mobile like concat('%',#{keyword},'%'))
</if>
</select>
</mapper>

View File

@@ -25,9 +25,7 @@ public class UpdateLineRequest {
@ApiModelProperty("所属区域")
private Long regionId;
@NotNull
@Min(1)
@Max(3)
@ApiModelProperty("加盟模式 1-社会加盟模式/加盟部加盟店 2-强加盟模式/加盟公司加盟店 3-加盟公司自有店")
@ApiModelProperty("加盟模式 1-社会加盟模式/加盟部加盟店 2-强加盟模式/加盟公司加盟店 3-加盟公司自有店 4-强加盟")
private Integer joinMode;
@NotNull
@ApiModelProperty("加盟品牌")

View File

@@ -109,4 +109,7 @@ public interface LineService {
*/
Integer updatePartnerName(String username,Long lineId);
Integer updateRegionId(Long regionId,Long lineId);
Boolean hasRegionId(Long lineId);
}

View File

@@ -58,7 +58,7 @@ public interface PushService {
*/
String getPosToken(GetAccessTokenDTO dto);
List<XgjOrganizationDTO> getXgjOrganization(String partnerId);
List<XgjOrganizationDTO> getXgjOrganization(String parentId);

View File

@@ -109,4 +109,6 @@ public interface ShopService {
List<MiniShopsResponse> getShopListSuccessOpen(Long lineId);
ShopResponse getShopNameAndCode(Long shopId,Long lineId);
String getFranchiseBrandName(Long shopId);
}

View File

@@ -637,6 +637,13 @@ public class DecorationServiceImpl implements DecorationService {
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean confirmDesign(DecorationDesignRequest request, LoginUserInfo user) {
DecorationDesignInfoDO decoration = decorationDesignInfoDAO.getByShopId(request.getShopId());
if (StringUtils.isBlank(decoration.getQuotationUrl())){
throw new ServiceException(ErrorCodeEnum.QUOTATION_URL_REQUIRED);
}
if (StringUtils.isBlank(decoration.getDesignUrl())){
throw new ServiceException(ErrorCodeEnum.DESIGN_URL_REQUIRED);
}
//重复提交校验 3秒内不能重复提交
String lockKey = "confirmDesign:" + request.getShopId();
String lockValue = UUID.randomUUID().toString();
@@ -645,7 +652,6 @@ public class DecorationServiceImpl implements DecorationService {
throw new ServiceException(ErrorCodeEnum.DUPLICATE_SUBMISSION);
}
DecorationDesignInfoDO decorationDesignInfoDO = request.toDecorationDesignInfoDO();
DecorationDesignInfoDO decoration = decorationDesignInfoDAO.getByShopId(request.getShopId());
if (Objects.nonNull(decoration)) {
decorationDesignInfoDO.setId(decoration.getId());
decorationDesignInfoDAO.updateByPrimaryKeySelective(decorationDesignInfoDO);

View File

@@ -640,6 +640,32 @@ public class LineServiceImpl implements LineService {
return lineInfoDAO.updateLineInfo(lineInfo);
}
@Override
public Integer updateRegionId(Long regionId, Long lineId) {
log.info("regionID:{}",regionId);
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(lineId);
if (lineInfo == null) {
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
}
LineInfoDO lineInfoDO = new LineInfoDO();
lineInfoDO.setId(lineId);
lineInfoDO.setRegionId(regionId);
lineInfoDO.setUpdateTime(new Date());
return lineInfoDAO.updateLineInfo(lineInfoDO);
}
@Override
public Boolean hasRegionId(Long lineId) {
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(lineId);
if (lineInfo == null) {
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
}
if (lineInfo.getRegionId() != null&&lineInfo.getRegionId() != 0 ){
return true;
}
return false;
}
/**
* 计算预期时间
* @param startTime

View File

@@ -115,17 +115,19 @@ public class PointServiceImpl implements PointService {
shopPoint.setPointId(pointId);
pointDetailInfoDAO.addPointDetailInfo(shopPoint);
//推送铺位至三方平台
BerthOperationRequest request1 = new BerthOperationRequest();
request1.setOpType(OpTypeEnum.INSERT.getCode());
request1.setCode(shopPointDetailRequest.getOpportunityPointCode());
request1.setUserId(userId);
request1.setMobile(user.getMobile());
request1.setUserName(user.getName());
request1.setBerthId(Math.toIntExact(pointId));
request1.setName(pointInfo.getPointName());
request1.setAddress(pointInfo.getAddress());
request1.setLocation(shopPointDetailRequest.getLocation());
thirdOpportunityService.berthOperation(request1);
if (StringUtils.isNotBlank(shopPointDetailRequest.getOpportunityPointCode())) {
BerthOperationRequest request1 = new BerthOperationRequest();
request1.setOpType(OpTypeEnum.INSERT.getCode());
request1.setCode(shopPointDetailRequest.getOpportunityPointCode());
request1.setUserId(userId);
request1.setMobile(user.getMobile());
request1.setUserName(user.getName());
request1.setBerthId(Math.toIntExact(pointId));
request1.setName(pointInfo.getPointName());
request1.setAddress(pointInfo.getAddress());
request1.setLocation(shopPointDetailRequest.getLocation());
thirdOpportunityService.berthOperation(request1);
}
return pointId;
}
@@ -303,7 +305,7 @@ public class PointServiceImpl implements PointService {
log.error("铺位详细信息不存在");
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
}
if (!checkIsAudit(pointInfo,pointDetailInfo)) {
if (!checkIsAudit(pointInfo, pointDetailInfo)) {
throw new ServiceException(ErrorCodeEnum.THE_DATA_IS_NOT_FILLED);
}
//处理子任务审核记录表
@@ -332,17 +334,19 @@ public class PointServiceImpl implements PointService {
dealNextAuditRecord(pointInfo, pointAuditRecordMap, NodeNoEnum.NODE_NO_0.getCode());
return pointInfoDAO.updatePointInfo(updatePoint);
}
private Boolean checkIsAudit(PointInfoDO pointInfo,PointDetailInfoDO pointDetailInfoDO){
if (StringUtils.isAnyBlank(pointInfo.getPointArea(),pointInfo.getLatitude(),
pointInfo.getLongitude(),pointInfo.getAddress(),pointInfo.getProvince(),pointInfo.getCity(),
pointInfo.getDistrict(),pointInfo.getTownship(),pointInfo.getOpportunityPointCode(),pointInfo.getOpportunityPointName()
,pointInfo.getProvinceCode(),pointInfo.getCityCode(),pointInfo.getDistrictCode(),pointDetailInfoDO.getMonthRent()
,pointDetailInfoDO.getLandlordMobile())){
private Boolean checkIsAudit(PointInfoDO pointInfo, PointDetailInfoDO pointDetailInfoDO) {
if (StringUtils.isAnyBlank(pointInfo.getPointArea(), pointInfo.getLatitude(),
pointInfo.getLongitude(), pointInfo.getAddress(), pointInfo.getProvince(), pointInfo.getCity(),
pointInfo.getDistrict(), pointInfo.getTownship(), pointInfo.getOpportunityPointCode(), pointInfo.getOpportunityPointName()
, pointInfo.getProvinceCode(), pointInfo.getCityCode(), pointInfo.getDistrictCode(), pointDetailInfoDO.getMonthRent()
, pointDetailInfoDO.getLandlordMobile())) {
return false;
}
return true;
}
@Override
public Integer auditSetting(AuditSettingRequest request) {
String cacheKey = MessageFormat.format(AUDIT_SETTING_KEY, enterpriseId);
@@ -572,7 +576,7 @@ public class PointServiceImpl implements PointService {
}
}
List<PointPageVO> resultList = new ArrayList();
Page<PCPointListDTO> pointPage = pointInfoDAO.getMyPointPage(enterpriseId,request);
Page<PCPointListDTO> pointPage = pointInfoDAO.getMyPointPage(enterpriseId, request);
if (Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())) {
List<Long> regionIds = pointPage.stream().map(PointInfoDO::getRegionId).distinct().collect(Collectors.toList());
List<String> developmentManagers = pointPage.stream().map(PointInfoDO::getDevelopmentManager).distinct().collect(Collectors.toList());
@@ -601,7 +605,7 @@ public class PointServiceImpl implements PointService {
request.setPointStatus(PointStatusEnum.POINT_STATUS_4.getCode());
}
List<PointPageVO> resultList = new ArrayList();
Page<PCPointListDTO> pointPage = pointInfoDAO.getTeamPointPage( enterpriseId,request);
Page<PCPointListDTO> pointPage = pointInfoDAO.getTeamPointPage(enterpriseId, request);
if (Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())) {
List<Long> regionIds = pointPage.stream().map(PointInfoDO::getRegionId).distinct().collect(Collectors.toList());
List<String> developmentManagers = pointPage.stream().map(PointInfoDO::getDevelopmentManager).distinct().collect(Collectors.toList());
@@ -887,7 +891,7 @@ public class PointServiceImpl implements PointService {
if (Objects.isNull(lineInfo)) {
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
}
if(request.getShopId()==null){
if (request.getShopId() == null) {
PointDetailInfoDO pointDetailInfo = MiniAddPointRequest.convertDO(request);
PointInfoDO pointInfo = MiniAddPointRequest.convertPointDO(request);
pointInfo.setRegionId(lineInfo.getRegionId());
@@ -900,7 +904,7 @@ public class PointServiceImpl implements PointService {
pointDetailInfoDAO.addPointDetailInfo(pointDetailInfo);
//推送铺位至三方平台
extracted(request, lineInfo, pointId, pointInfo);
return pointId;
return pointId;
}
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
if (Objects.isNull(shopInfo)) {
@@ -952,18 +956,20 @@ public class PointServiceImpl implements PointService {
}
private void extracted(MiniAddPointRequest request, LineInfoDO lineInfo, Long pointId, PointInfoDO pointInfo) {
//推送铺位至三方平台
BerthOperationRequest request1 = new BerthOperationRequest();
request1.setOpType(OpTypeEnum.INSERT.getCode());
request1.setCode(request.getOpportunityPointCode());
request1.setUserId(lineInfo.getPartnerId());
request1.setMobile(lineInfo.getMobile());
request1.setUserName(lineInfo.getUsername());
request1.setBerthId(Math.toIntExact(pointId));
request1.setName(pointInfo.getPointName());
request1.setAddress(pointInfo.getAddress());
request1.setLocation(request.getLocation());
thirdOpportunityService.berthOperation(request1);
if (StringUtils.isNotBlank(request.getOpportunityPointCode())) {
//推送铺位至三方平台
BerthOperationRequest request1 = new BerthOperationRequest();
request1.setOpType(OpTypeEnum.INSERT.getCode());
request1.setCode(request.getOpportunityPointCode());
request1.setUserId(lineInfo.getPartnerId());
request1.setMobile(lineInfo.getMobile());
request1.setUserName(lineInfo.getUsername());
request1.setBerthId(Math.toIntExact(pointId));
request1.setName(pointInfo.getPointName());
request1.setAddress(pointInfo.getAddress());
request1.setLocation(request.getLocation());
thirdOpportunityService.berthOperation(request1);
}
}
@Override

View File

@@ -143,7 +143,7 @@ public class PushServiceImpl implements PushService {
}
@Override
public List<XgjOrganizationDTO> getXgjOrganization(String partnerId) {
public List<XgjOrganizationDTO> getXgjOrganization(String parentId) {
String key = active+"_XgjOrganization_" + eid;
String resObject = redisUtilPool.getString(key);
if (StringUtils.isBlank(resObject)) {
@@ -164,7 +164,7 @@ public class PushServiceImpl implements PushService {
}
List<XgjOrganizationDTO> filteredList = response.stream()
.filter(customer -> customer.getParentId().equals(partnerId))
.filter(customer -> customer.getParentId().equals(parentId))
.collect(Collectors.toList());
return filteredList;

View File

@@ -628,5 +628,14 @@ public class ShopServiceImpl implements ShopService {
}
@Override
public String getFranchiseBrandName(Long shopId) {
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
if (shopInfo == null){
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
}
return FranchiseBrandEnum.getDescByCode(shopInfo.getFranchiseBrand());
}
}

View File

@@ -93,7 +93,9 @@ public class SyncDataServiceImpl implements SyncDataService {
if (signFranchiseDO != null) {
List<String> partnershipSignatory = new ArrayList<>();
partnershipSignatory.add(signFranchiseDO.getPartnershipSignatoryFirst());
partnershipSignatory.add(signFranchiseDO.getPartnershipSignatorySecond());
if (StringUtils.isNotBlank(signFranchiseDO.getPartnershipSignatorySecond())) {
partnershipSignatory.add(signFranchiseDO.getPartnershipSignatorySecond());
}
request.setPartnershipSignatory(partnershipSignatory);
request.setBusinessModel(signFranchiseDO.getBusinessModel());
}
@@ -114,7 +116,7 @@ public class SyncDataServiceImpl implements SyncDataService {
request.setWqfAccount(shopInfo.getShopCode());
request.setDownstreamSystemShopName(shopInfo.getShopName());
if (DownSystemTypeEnum.XGJ.equals(systemType)) {
//todo
request.setDownstreamSystemShopName(getXgjShopName(lineInfoDO, shopInfo));
}
if (DownSystemTypeEnum.POS.equals(systemType)) {
if (buildInformationDO != null) {
@@ -242,4 +244,51 @@ public class SyncDataServiceImpl implements SyncDataService {
}
return null;
}
public String getXgjShopName(LineInfoDO lineInfoDO, ShopInfoDO shopInfoDO) {
if (StringUtils.isBlank(shopInfoDO.getShopCode())) {
return null;
}
if (String.valueOf(FranchiseBrandEnum.ZXJP.getCode()).equals(shopInfoDO.getFranchiseBrand())) {
//M10001
if (shopInfoDO.getShopCode().matches("M\\d*")) {
return "MX" + shopInfoDO.getShopName() + "(" + lineInfoDO.getUsername() + ")";
}
//FS10001
if (shopInfoDO.getShopCode().matches("FS\\d*")) {
return "FS" + shopInfoDO.getShopName() + "(" + lineInfoDO.getUsername() + ")";
}
// MS10001
if (shopInfoDO.getShopCode().matches("MS\\d*")) {
return "MS" + shopInfoDO.getShopName() + "(" + lineInfoDO.getUsername() + ")";
}
// S10001
if (shopInfoDO.getShopCode().matches("S\\d*")) {
return shopInfoDO.getShopName() + "(" + lineInfoDO.getUsername() + ")";
}
}
if (String.valueOf(FranchiseBrandEnum.MZG.getCode()).equals(shopInfoDO.getFranchiseBrand())) {
if (shopInfoDO.getShopCode().matches("MZGM\\d*")) {
return FranchiseBrandEnum.MZG.getDesc() + shopInfoDO.getShopName() + "(" + lineInfoDO.getUsername() + ")";
}
if (shopInfoDO.getShopCode().matches("MZGS\\d*")) {
return FranchiseBrandEnum.MZG.getDesc() + shopInfoDO.getShopName();
}
}
if (String.valueOf(FranchiseBrandEnum.ZJS.getCode()).equals(shopInfoDO.getFranchiseBrand())) {
if (shopInfoDO.getShopCode().matches("LX\\d*")) {
return "LX" + FranchiseBrandEnum.ZJS.getDesc() + shopInfoDO.getShopName() + "(" + lineInfoDO.getUsername() + ")";
}
if (shopInfoDO.getShopCode().matches("X\\d*")) {
return "X" + FranchiseBrandEnum.ZJS.getDesc() + shopInfoDO.getShopName() + "(" + lineInfoDO.getUsername() + ")";
}
if (shopInfoDO.getShopCode().matches("Q\\d*")) {
return "Q" + FranchiseBrandEnum.ZJS.getDesc() + shopInfoDO.getShopName() + "(" + lineInfoDO.getUsername() + ")";
}
if (shopInfoDO.getShopCode().matches("Z\\d*")) {
return FranchiseBrandEnum.ZJS.getDesc() + shopInfoDO.getShopName();
}
}
return null;
}
}

View File

@@ -179,4 +179,16 @@ public class LineInfoController {
public ResponseResult<PageInfo<LineVO>> getLines(@RequestBody LinesRequest request) {
return ResponseResult.success(lineService.getLines(request));
}
@ApiOperation("修改所属大区/分公司")
@GetMapping("/updateLineRegion")
public ResponseResult<Integer> updateLineRegion(@RequestParam("regionId")Long regionId,@RequestParam("lineId")Long lineId) {
return ResponseResult.success(lineService.updateRegionId(regionId,lineId));
}
@ApiOperation("判断是否有所属大区/分公司 0否 1是")
@GetMapping("/hasLineRegion")
public ResponseResult<Boolean> hasLineRegion(@RequestParam("lineId")Long lineId) {
return ResponseResult.success(lineService.hasRegionId(lineId));
}
}

View File

@@ -47,8 +47,8 @@ public class PCOrderSysInfoController {
@GetMapping("/getXgjOrganization")
@ApiOperation("获取新管家组织架构")
public ResponseResult<List<XgjOrganizationDTO>> getXgjOrganization(@RequestParam(value = "partnerId", required = true,defaultValue = "0") String partnerId) {
return ResponseResult.success(pushService.getXgjOrganization(partnerId));
public ResponseResult<List<XgjOrganizationDTO>> getXgjOrganization(@RequestParam(value = "parentId", required = true,defaultValue = "0") String parentId) {
return ResponseResult.success(pushService.getXgjOrganization(parentId));
}
}

View File

@@ -132,5 +132,10 @@ public class MiniShopController {
public ResponseResult<ShopResponse> getShopNameAndCode(@RequestParam(name = "shopId",required = false)Long shopId, @RequestParam("lineId")Long lineId) {
return ResponseResult.success(shopService.getShopNameAndCode(shopId,lineId));
}
@ApiOperation("获取店铺所属品牌")
@GetMapping("/getFranchiseBrandName")
public ResponseResult<String> getFranchiseBrandName(@RequestParam(name = "shopId")Long shopId) {
return ResponseResult.success(shopService.getFranchiseBrandName(shopId));
}
}