Merge #118 into master from cc_20260506_newsign

feat:addShopDecorationLog

* cc_20260506_newsign: (14 commits squashed)

  - feat:新签调整

  - feat:招商

  - feat:招商

  - feat:招商

  - feat:招商

  - feat:id

  - feat:招商副总裁审核

  - feat:招商经理

  - feat:招商经理

  - feat:招商大区总审核 或者 分部内勤审核 其他状态不能审核

  - feat:SHOP_SUB_STAGE_STATUS_150_5

  - feat:建店代办处理

  - feat:addShopDecorationLog

  - feat:addShopDecorationLog

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

CR-link: https://codeup.aliyun.com/692ea314dec569489f6f167c/hangzhou/java/custom_zxjp/change/118
This commit is contained in:
正新
2026-05-10 13:10:42 +00:00
parent 814bbc342e
commit b9b022a28d
28 changed files with 589 additions and 64 deletions

View File

@@ -5,7 +5,12 @@ import com.cool.store.context.LoginUserInfo;
import com.cool.store.request.AuditApproveRequest;
import com.cool.store.request.BuildInformationRequest;
import com.cool.store.request.BuildSettlerRequest;
import com.cool.store.request.ShopDecorationLogRequest;
import com.cool.store.response.BuildInformationResponse;
import com.cool.store.response.ShopDecorationLogResponse;
import com.cool.store.response.ShopDecorationLogResponse;
import java.util.List;
/**
* @author EDY
@@ -33,4 +38,5 @@ public interface BuildInformationService {
* 开票信息企业校验
*/
Boolean companyInvoiceVerify(Long shopId);
}

View File

@@ -6,6 +6,9 @@ import com.cool.store.entity.ShopInfoDO;
import com.cool.store.request.*;
import com.cool.store.response.AddSignFranchiseResponse;
import com.cool.store.response.ResponseResult;
import com.cool.store.response.ShopDecorationLogResponse;
import java.util.List;
public interface SignFranchiseService {
/**
@@ -27,7 +30,7 @@ public interface SignFranchiseService {
/**
* 装修信息修改
*/
Boolean decorationUpdate(SignFranchiseDecorationRequest request);
Boolean decorationUpdate(SignFranchiseDecorationRequest request, LoginUserInfo user);
AddSignFranchiseResponse getSignFranchise(Long shopId);
@@ -39,6 +42,20 @@ public interface SignFranchiseService {
*/
Boolean auditApprove(AuditApproveRequest request, LoginUserInfo user);
/**
* 副总裁审核
* @param request
* @param user
* @return
*/
Boolean managerAuditApprove(AuditApproveRequest request, LoginUserInfo user);
/**
* 财务审核
* @param request
* @param user
* @return
*/
Boolean financeAuditApprove(AuditApproveRequest request, LoginUserInfo user);
/**
@@ -69,4 +86,15 @@ public interface SignFranchiseService {
Boolean assignOperationConsultant(AssignOperationConsultantRequest request);
ContractCallbackDTO pushContractRequest(ShopInfoDO shopInfoDO, Long shopId);
/**
* 新增门店装修修改记录
*/
Boolean addShopDecorationLog(ShopDecorationLogRequest request, String userId);
/**
* 通过shopId查询所有的修改记录按时间倒序
*/
List<ShopDecorationLogResponse> listShopDecorationLog(Long shopId);
}

View File

@@ -3,15 +3,20 @@ package com.cool.store.service.impl;
import cn.hutool.core.collection.CollStreamUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSON;
import com.cool.store.constants.CommonConstants;
import com.cool.store.constants.RedisConstant;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dao.*;
import com.cool.store.dao.ShopDecorationLogDAO;
import com.cool.store.entity.*;
import com.cool.store.enums.*;
import com.cool.store.enums.point.ShopSubStageEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.request.ShopDecorationLogRequest;
import com.cool.store.response.ShopDecorationLogResponse;
import com.cool.store.utils.poi.DateUtils;
import com.cool.store.mapper.ApplyLicenseMapper;
import com.cool.store.mapper.WarehouseInfoMapper;
import com.cool.store.request.AuditApproveRequest;
@@ -94,6 +99,8 @@ public class BuildInformationServiceImpl implements BuildInformationService {
private SignFranchiseService signFranchiseService;
@Resource
private ApplyLicenseMapper applyLicenseMapper;
@Resource
private ShopDecorationLogDAO shopDecorationLogDAO;
@Override
@@ -152,7 +159,7 @@ public class BuildInformationServiceImpl implements BuildInformationService {
map.put("partnerUsername", lineInfoDO.getUsername());
map.put("partnerMobile", lineInfoDO.getMobile());
map.put("storeName", shopInfoDO.getShopName());
commonService.sendQWMessage(Collections.singletonList(shopInfoDO.getOperationsConsultant()),
commonService.sendQWMessage(Collections.singletonList(shopInfoDO.getInvestmentManager()),
MessageEnum.MESSAGE_54,
map);
return buildInformationDAO.insertSelective(buildInformationDO);
@@ -183,7 +190,7 @@ public class BuildInformationServiceImpl implements BuildInformationService {
map.put("partnerUsername", lineInfoDO.getUsername());
map.put("partnerMobile", lineInfoDO.getMobile());
map.put("storeName", shopInfoDO.getShopName());
commonService.sendQWMessage(Collections.singletonList(shopInfoDO.getOperationsConsultant()),
commonService.sendQWMessage(Collections.singletonList(shopInfoDO.getInvestmentManager()),
MessageEnum.MESSAGE_54,
map);
}
@@ -205,13 +212,13 @@ public class BuildInformationServiceImpl implements BuildInformationService {
private void insertOperations(ShopInfoDO shopInfoDO, String userId, String userName) {
List<OperationLogDO> operationLogs = operationLogDAO.getBySubStageStatusEnumAndsStatus(shopInfoDO.getId(), SHOP_SUB_STAGE_STATUS_150_5, OperationTypeEnum.OPERATION_TYPE_1.getCode());
if (CollectionUtils.isEmpty(operationLogs)) {
EnterpriseUserDO operationsConsultant = enterpriseUserDAO.getUserInfoById(shopInfoDO.getOperationsConsultant());
EnterpriseUserDO investmentManager = enterpriseUserDAO.getUserInfoById(shopInfoDO.getInvestmentManager());
// 审批记录
operationLogService.addOperationLog(shopInfoDO.getId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_150, userId, userName,
OperationTypeEnum.OPERATION_TYPE_0, "建店资料提交审批", OperationStatusEnum.PROCESSED);
operationLogService.addOperationLog(shopInfoDO.getId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_150_5,
shopInfoDO.getOperationsConsultant(), Collections.singletonList(operationsConsultant),
OperationTypeEnum.OPERATION_TYPE_1, "建店资料运营顾问审核", OperationStatusEnum.NOT_PROCESSED);
userId, Collections.singletonList(investmentManager),
OperationTypeEnum.OPERATION_TYPE_1, "建店资料招商经理审核", OperationStatusEnum.NOT_PROCESSED);
}
}

View File

@@ -308,7 +308,10 @@ public class DeskServiceImpl implements DeskService {
if (userRoleIds.contains(UserRoleEnum.BRANCH_OFFICE.getCode()) || userRoleIds.contains(UserRoleEnum.REGION_OFFICE.getCode()) || isAdmin) {
subStageStatusList.add(SHOP_SUB_STAGE_STATUS_83.getShopSubStageStatus());
}
if (userRoleIds.contains(UserRoleEnum.FINANCE.getCode())) {
if (userRoleIds.contains(UserRoleEnum.INVESTMENT_PRESIDENT.getCode()) || isAdmin) {
subStageStatusList.add(SHOP_SUB_STAGE_STATUS_83_2.getShopSubStageStatus());
}
if (userRoleIds.contains(UserRoleEnum.FINANCE.getCode()) || isAdmin) {
subStageStatusList.add(SHOP_SUB_STAGE_STATUS_83_5.getShopSubStageStatus());
}
if (CollectionUtils.isEmpty(subStageStatusList)) {
@@ -359,7 +362,7 @@ public class DeskServiceImpl implements DeskService {
@Override
public PageInfo<PreparationCommonPendingVO> openingAndOperationPlanPendingList(DeskRequest deskRequest, LoginUserInfo user) {
return commonPendingVOPageInfo(deskRequest, user, ShopSubStageEnum.SHOP_STAGE_14, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_140.getShopSubStageStatus()), Boolean.FALSE);
return null;
}
@@ -550,10 +553,10 @@ public class DeskServiceImpl implements DeskService {
@Override
public PageInfo<PreparationCommonPendingVO> buildInformationPendingList(DeskRequest deskRequest, LoginUserInfo user) {
List<Long> userRoleIds = enterpriseUserRoleMapper.getUserRoleIds(user.getUserId());
if (userRoleIds.contains(UserRoleEnum.SUPERVISION.getCode())) {
return commonPendingVOPageInfoByOperationsConsultant(deskRequest, user.getUserId(), ShopSubStageEnum.SHOP_STAGE_15,
Arrays.asList(SHOP_SUB_STAGE_STATUS_150.getShopSubStageStatus(), SHOP_SUB_STAGE_STATUS_150_5.getShopSubStageStatus()), Boolean.FALSE);
}
// if (userRoleIds.contains(UserRoleEnum.SUPERVISION.getCode())) {
// return commonPendingVOPageInfoByOperationsConsultant(deskRequest, user.getUserId(), ShopSubStageEnum.SHOP_STAGE_15,
// Arrays.asList(SHOP_SUB_STAGE_STATUS_150.getShopSubStageStatus(), SHOP_SUB_STAGE_STATUS_150_5.getShopSubStageStatus()), Boolean.FALSE);
// }
//如果不是财务角色或者即是财务又是自有店财务 则不需要标识
Boolean ownShopFlag = null;
if (userRoleIds.contains(UserRoleEnum.FINANCE.getCode()) && userRoleIds.contains(UserRoleEnum.OWN_SHOP_OFFICE.getCode())) {
@@ -579,6 +582,10 @@ public class DeskServiceImpl implements DeskService {
if (userRoleIds.contains(UserRoleEnum.PRESIDENT.getCode())) {
subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_155.getShopSubStageStatus());
}
if (userRoleIds.contains(UserRoleEnum.INVESTMENT_MANGER.getCode())) {
subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_150.getShopSubStageStatus());
subStageStatusList.add(SHOP_SUB_STAGE_STATUS_150_5.getShopSubStageStatus());
}
Boolean isAdmin = sysRoleService.checkIsAdmin(user.getUserId());
if (isAdmin) {
subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151.getShopSubStageStatus());

View File

@@ -135,6 +135,8 @@ public class OperationLogServiceImpl implements OperationLogService {
|| operationLogDO.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_253.getShopSubStageStatus())
) {
auditInfoResponse.setExecute(AuditExecuteEnum.HEADQUARTERS.getCode());
}else if(operationLogDO.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_83_2.getShopSubStageStatus())){
auditInfoResponse.setExecute(AuditExecuteEnum.MANAGER.getCode());
}else {
auditInfoResponse.setExecute(AuditExecuteEnum.OPERATION.getCode());
}

View File

@@ -1196,8 +1196,9 @@ public class PointServiceImpl implements PointService {
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
}
Long pointId = request.getPointId(), shopId = request.getShopId();
ShopInfoDO shopInfo = null;
if (Objects.isNull(pointId) && Objects.nonNull(shopId)) {
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
shopInfo = shopInfoDAO.getShopInfo(shopId);
pointId = shopInfo.getPointId();
}
if (Objects.nonNull(pointId) && Objects.isNull(shopId)) {
@@ -1224,12 +1225,16 @@ public class PointServiceImpl implements PointService {
shopRentInfoDAO.updateRentContract(shopRentInfo);
}
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(shopSubStageInfo.getLineId());
HashMap<String, String> map = new HashMap<>();
map.put("partnerUsername", lineInfo.getUsername());
map.put("partnerMobile", lineInfo.getMobile());
commonService.sendQWMessage(Collections.singletonList(lineInfo.getInvestmentManager()),
MessageEnum.MESSAGE_15,
map);
if (shopInfo!=null){
List<EnterpriseUserDO> userlist = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.REGION_MANAGER, shopInfo.getInvestRegionId());
List<String> userIds = userlist.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toList());
HashMap<String, String> map = new HashMap<>();
map.put("partnerUsername", lineInfo.getUsername());
map.put("partnerMobile", lineInfo.getMobile());
commonService.sendQWMessage(userIds,
MessageEnum.MESSAGE_15,
map);
}
return shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21);
}
@@ -1268,20 +1273,26 @@ public class PointServiceImpl implements PointService {
throw new ServiceException(ErrorCodeEnum.SHOP_STAGE_NOT_OPERATE);
}
ShopStageInfoDO shopStageInfo = shopStageInfoDAO.getShopSubStageInfo(request.getShopId(), ShopSubStageEnum.SHOP_STAGE_2);
if (!shopStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21.getShopSubStageStatus())) {
//招商大区总审核 或者 分部内勤审核 其他状态不能审核
if (!(shopStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21.getShopSubStageStatus())||
shopStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21_5.getShopSubStageStatus()))) {
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
}
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(shopInfo.getLineId());
//正新放开限制
// if(!request.getOperateUserId().equals(lineInfo.getDevelopmentManager())){
// throw new ServiceException(ErrorCodeEnum.NO_PERMISSION);
// }
Long auditId = shopAuditInfoDAO.addAuditInfo(AuditRentContractRequest.convert(request, AuditTypeEnum.UPLOAD_RENT_CONTRACT));
ShopSubStageStatusEnum subStageStatus = AuditResultTypeEnum.PASS.getCode().equals(request.getResultType()) ? ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_23 : ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_22;
if (AuditResultTypeEnum.REJECT.getCode().equals(request.getResultType())) {
//commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.RENT_CONTRACT_AUDIT_FAIL, null);
ShopSubStageStatusEnum subStageStatus = null;
if (AuditResultTypeEnum.PASS.getCode().equals(request.getResultType())){
if (shopStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21.getShopSubStageStatus())){
subStageStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21_5;
}
if (shopStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21_5.getShopSubStageStatus())){
subStageStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_23;
}
}else {
subStageStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_22;
}
if (ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_23.equals(subStageStatus)) {
//审核通过铺位变为已签约
PointInfoDO updatePoint = new PointInfoDO();
@@ -1319,12 +1330,17 @@ public class PointServiceImpl implements PointService {
if (ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_22.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus())) {
shopStageInfoDAO.updateShopStageAndAuditInfo(shopRentInfo.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21, null);
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(shopSubStageInfo.getLineId());
HashMap<String, String> map = new HashMap<>();
map.put("partnerUsername", lineInfo.getUsername());
map.put("partnerMobile", lineInfo.getMobile());
commonService.sendQWMessage(Collections.singletonList(lineInfo.getInvestmentManager()),
MessageEnum.MESSAGE_15,
map);
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopSubStageInfo.getShopId());
if (shopInfo!=null){
List<EnterpriseUserDO> userlist = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.REGION_MANAGER, shopInfo.getInvestRegionId());
List<String> userIds = userlist.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toList());
HashMap<String, String> map = new HashMap<>();
map.put("partnerUsername", lineInfo.getUsername());
map.put("partnerMobile", lineInfo.getMobile());
commonService.sendQWMessage(userIds,
MessageEnum.MESSAGE_15,
map);
}
}
return shopRentInfoDAO.updateRentContract(shopRentInfo);
}
@@ -1352,7 +1368,12 @@ public class PointServiceImpl implements PointService {
@Override
public PageInfo<RentInfoToDoVO> getRentContractToDoPage(String userId, Integer pageNumber, Integer pageSize) {
Page<RentInfoToDoVO> todoPage = shopStageInfoDAO.getRentContractToDoPage(userId, pageNumber, pageSize);
List<String> authRegionIds = new ArrayList<>();
//如果是管理员 查询所有 如果是其他角色 根据管辖大区权限查询 菜单根据配置来
if (!sysRoleService.checkIsAdmin(userId)) {
authRegionIds = userAuthMappingService.getAuthRegionIdByUserId(userId,Boolean.TRUE);
}
Page<RentInfoToDoVO> todoPage = shopStageInfoDAO.getRentContractToDoPage(userId, pageNumber, pageSize,authRegionIds);
List<RentInfoToDoVO> resultList = null;
if (Objects.nonNull(todoPage) && CollectionUtils.isNotEmpty(todoPage.getResult())) {
List<Long> shopIds = todoPage.getResult().stream().map(RentInfoToDoVO::getShopId).collect(Collectors.toList());

View File

@@ -941,7 +941,6 @@ public class ShopServiceImpl implements ShopService {
return Collections.singletonList(new UserDTO(lineInfo.getUsername(), lineInfo.getMobile()));
case SHOP_SUB_STAGE_STATUS_11:
case SHOP_SUB_STAGE_STATUS_21:
case SHOP_SUB_STAGE_STATUS_50:
case SHOP_SUB_STAGE_STATUS_140:
case SHOP_SUB_STAGE_STATUS_141:
@@ -949,6 +948,7 @@ public class ShopServiceImpl implements ShopService {
case SHOP_SUB_STAGE_STATUS_171:
case SHOP_SUB_STAGE_STATUS_270:
case SHOP_SUB_STAGE_STATUS_274:
case SHOP_SUB_STAGE_STATUS_150_5:
return getUserFromInvestmentManager(shopInfo.getInvestmentManager());
case SHOP_SUB_STAGE_STATUS_122:
case SHOP_SUB_STAGE_STATUS_110:
@@ -965,6 +965,9 @@ public class ShopServiceImpl implements ShopService {
case SHOP_SUB_STAGE_STATUS_282:
return getUsersByRolesAndRegion(Arrays.asList(REGION_OFFICE, BRANCH_OFFICE), shopInfo.getInvestRegionId());
case SHOP_SUB_STAGE_STATUS_21_5:
return getUsersByRolesAndRegion(Arrays.asList( BRANCH_OFFICE), shopInfo.getInvestRegionId());
case SHOP_SUB_STAGE_STATUS_83_5:
return getUsersByRolesAndRegion(Collections.singletonList(FINANCE), shopInfo.getRegionId());
@@ -1046,6 +1049,10 @@ public class ShopServiceImpl implements ShopService {
return getUsersByRole(AI_STORE_TYPE_APPROVE);
case SHOP_SUB_STAGE_STATUS_281_2:
return getUsersByRole(DEVICE_SHIPMENT_CG);
case SHOP_SUB_STAGE_STATUS_21:
return getUsersByRoleAndRegion(REGION_MANAGER, shopInfo.getInvestRegionId());
case SHOP_SUB_STAGE_STATUS_83_2:
return getUsersByRolesAndRegion(Collections.singletonList(INVESTMENT_PRESIDENT), shopInfo.getInvestRegionId());
default:
return Collections.emptyList();
}

View File

@@ -1,6 +1,7 @@
package com.cool.store.service.impl;
import cn.hutool.core.convert.Convert;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.CommonConstants;
import com.cool.store.constants.RedisConstant;
@@ -36,6 +37,7 @@ import com.cool.store.mq.producer.SimpleMessageService;
import com.cool.store.request.*;
import com.cool.store.response.AddSignFranchiseResponse;
import com.cool.store.response.ResponseResult;
import com.cool.store.response.ShopDecorationLogResponse;
import com.cool.store.service.*;
import com.cool.store.service.dict.impl.DictService;
import com.cool.store.utils.GeoMapUtil;
@@ -172,6 +174,8 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
private SignFranchiseService signFranchiseService;
@Resource
private PreAllocationRecordDAO preAllocationRecordDAO;
@Resource
ShopDecorationLogDAO shopDecorationLogDAO;
@Override
@@ -260,7 +264,7 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
acquired = redisUtilPool.setNxExpire(lockKey, lockValue, CommonConstants.TEN_SECONDS);
if (Boolean.TRUE.equals(acquired)) {
//修改shop & point
updateShopAndPoint(request, shopInfoDO, pointInfoById);
updateShopAndPoint(request, shopInfoDO, pointInfoById,user);
SignFranchiseDO signFranchiseDO = request.toSignFranchiseDO();
if (Objects.isNull(request.getId())) {
@@ -372,7 +376,7 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
//修改信息
signFranchiseMapper.updateByPrimaryKeySelective(signFranchiseDO);
// //修改shop & point & 同步建店资料地址
updateShopAndPoint(request, shopInfoDO, pointInfoById);
updateShopAndPoint(request, shopInfoDO, pointInfoById,user);
//修改阶段状态
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_83);
//发送通知
@@ -396,7 +400,7 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
}
@Override
public Boolean decorationUpdate(SignFranchiseDecorationRequest request) {
public Boolean decorationUpdate(SignFranchiseDecorationRequest request, LoginUserInfo user) {
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
if (Objects.isNull(shopInfo)) {
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
@@ -409,6 +413,9 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
update.setId(request.getShopId());
update.setDecorationRequirement(request.getDecorationRequirement());
update.setSpecialInstruction(request.getSpecialInstruction());
//添加修改日志
handleDecorartionReq(shopInfo.getId(),shopInfo.getDecorationLevel(),request.getDecorationRequirement(),
shopInfo.getShopDecorationAttributes(),request.getSpecialInstruction(),user);
return shopInfoDAO.updateShopInfo(update) > 0;
}
@@ -450,7 +457,10 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
private void updateShopAndPoint(AddSignFranchiseRequest request, ShopInfoDO shopInfoDO, PointInfoDO pointInfoById) {
private void updateShopAndPoint(AddSignFranchiseRequest request, ShopInfoDO shopInfoDO, PointInfoDO pointInfoById,LoginUserInfo user) {
//添加修改日志
handleDecorartionReq(shopInfoDO.getId(),request.getDecorationLevel(),request.getDecorationRequirement(),
request.getShopDecorationAttributes(),request.getSpecialInstruction(),user);
//店铺信息
shopInfoDO.setManagerRegionId(request.getManagerRegionId());
shopInfoDO.setRegionId(request.getRegionId());
@@ -546,7 +556,7 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
shopAuditInfoDO.setPassReason(request.getCause());
//更新状态为加盟商
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(shopInfoDO.getLineId());
shopStageInfoDAO.updateShopStageInfo(shopId, SHOP_SUB_STAGE_STATUS_83_5);
shopStageInfoDAO.updateShopStageInfo(shopId, SHOP_SUB_STAGE_STATUS_83_2);
//推送数据
contractCallbackDTO = pushContractRequest(shopInfoDO, request.getShopId());
Boolean sendNotice = Boolean.TRUE;
@@ -555,14 +565,14 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
map.put("partnerUsername", lineInfoDO.getUsername());
map.put("partnerMobile", lineInfoDO.getMobile());
map.put("storeName", shopInfoDO.getShopName());
List<EnterpriseUserDO> userDOList = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.FINANCE, shopInfoDO.getRegionId());
List<EnterpriseUserDO> userDOList = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.INVESTMENT_PRESIDENT, shopInfoDO.getRegionId());
List<String> finances = new ArrayList<>();
if (Objects.nonNull(userDOList)) {
finances.addAll(userDOList.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toList()));
}
operationLogService.addOperationLog(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_83_5,
operationLogService.addOperationLog(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_83_2,
user.getUserId(), userDOList,
OperationTypeEnum.OPERATION_TYPE_1, "加盟签约合同财务审批", OperationStatusEnum.NOT_PROCESSED, 2);
OperationTypeEnum.OPERATION_TYPE_1, "招商副总裁审批", OperationStatusEnum.NOT_PROCESSED, 2);
commonService.sendQWMessage(finances,
MessageEnum.MESSAGE_19_1,
map);
@@ -592,6 +602,72 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
}
}
@Override
public Boolean managerAuditApprove(AuditApproveRequest request, LoginUserInfo user) {
log.info("SignFranchiseServiceImpl auditApprove request{}", JSONObject.toJSONString(request));
Long shopId = request.getShopId();
String lockKey = "managerAuditApprove:" + request.getShopId();
//流水
String lockValue = UUID.randomUUID().toString();
boolean acquired = false;
try {
//10s过期
acquired = redisUtilPool.setNxExpire(lockKey, lockValue, CommonConstants.TEN_SECONDS);
if (Boolean.TRUE.equals(acquired)) {
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(shopId);
ShopAuditInfoDO shopAuditInfoDO = new ShopAuditInfoDO();
shopAuditInfoDO.setShopId(shopId);
shopAuditInfoDO.setAuditType(AuditTypeEnum.SIGN_FRANCHISE.getCode());
shopAuditInfoDO.setSubmittedUserId(user.getUserId());
shopAuditInfoDO.setSubmittedUserName(user.getName());
//驳回
if (Constants.ZERO_INTEGER.equals(request.getAuditResult())) {
auditReject(request, shopAuditInfoDO, shopInfoDO);
} else if (Constants.ONE_INTEGER.equals(request.getAuditResult())) {
shopAuditInfoDO.setResultType(Constants.ZERO_INTEGER);
shopAuditInfoDO.setPassReason(request.getCause());
//更新状态为加盟商
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(shopInfoDO.getLineId());
shopStageInfoDAO.updateShopStageInfo(shopId, SHOP_SUB_STAGE_STATUS_83_5);
Boolean sendNotice = Boolean.TRUE;
if (sendNotice) {
HashMap<String, String> map = new HashMap<>();
map.put("partnerUsername", lineInfoDO.getUsername());
map.put("partnerMobile", lineInfoDO.getMobile());
map.put("storeName", shopInfoDO.getShopName());
List<EnterpriseUserDO> userDOList = userAuthMappingService.getAllUserByRoleEnumAndRegionId(FINANCE, shopInfoDO.getRegionId());
List<String> finances = new ArrayList<>();
if (Objects.nonNull(userDOList)) {
finances.addAll(userDOList.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toList()));
}
operationLogService.addOperationLog(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_83_5,
user.getUserId(), userDOList,
OperationTypeEnum.OPERATION_TYPE_1, "财务审批", OperationStatusEnum.NOT_PROCESSED, 2);
commonService.sendQWMessage(finances,
MessageEnum.MESSAGE_19_1,
map);
}
}
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
Long auditId = shopAuditInfoDO.getId();
signFranchiseDAO.updateAuditByShopId(auditId, shopId);
//审批记录表记录
List<OperationLogDO> operationLogs = operationLogDAO.getBySubStageStatusEnumAndsStatus(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_83_2, OperationTypeEnum.OPERATION_TYPE_1.getCode());
operationLogService.batchUpdateProcessed(operationLogs, auditId, user.getUserId(), request.getCause());
return true;
} else {
throw new ServiceException(ErrorCodeEnum.DUPLICATE_SUBMISSION);
}
} finally {
if (Boolean.TRUE.equals(acquired)) {
String currentValue = redisUtilPool.getString(lockKey);
if (lockValue.equals(currentValue)) {
redisUtilPool.delKey(lockKey);
}
}
}
}
/**
* 分部内勤/财务审批拒绝
*/
@@ -686,7 +762,8 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
shopInfoDAO.updateShopInfo(shopInfoDO);
preparationService.contractAndBuildStoreCompletion(request.getShopId());
}
//分配之后 开始以下阶段
preparationService.contractAndBuildStoreCompletion(request.getShopId());
Boolean sendNotice = Boolean.TRUE;
commonService.sendSms(lineInfoDO.getMobile(), SMSMsgEnum.SIGN_CONTRACT);
@@ -930,8 +1007,6 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
shopInfo.setOperationsConsultant(request.getOperationConsultantUserId());
shopInfoDAO.updateShopInfo(shopInfo);
//分配之后 开始以下阶段
preparationService.contractAndBuildStoreCompletion(request.getShopId());
// 推送红圈通
if (StringUtils.isBlank(shopInfo.getHqtShopId())) {
@@ -1212,4 +1287,131 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
throw new RuntimeException(e);
}
}
public Boolean handleDecorartionReq(Long shopId,String decorationLevel,String decorationRequirement,
Integer shopDecorationAttributes,String specialInstruction,LoginUserInfo userInfo){
ShopDecorationLogRequest shopDecorationLogRequest = new ShopDecorationLogRequest();
shopDecorationLogRequest.setShopId(shopId);
shopDecorationLogRequest.setDecorationLevel(decorationLevel);
shopDecorationLogRequest.setShopDecorationAttributes(shopDecorationAttributes);
shopDecorationLogRequest.setDecorationRequirement(decorationRequirement);
shopDecorationLogRequest.setSpecialInstruction(specialInstruction);
return addShopDecorationLog(shopDecorationLogRequest,userInfo.getUserId());
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean addShopDecorationLog(ShopDecorationLogRequest request, String userId) {
log.info("新增门店装修修改记录shopId:{}", JSONObject.toJSONString(request));
if (Objects.isNull(request.getShopId())) {
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
}
// 查询门店信息
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
if (Objects.isNull(shopInfo)) {
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
}
// 比较前后数据是否有变动
boolean hasChange = false;
// 比较装修等级
log.info("addShopDecorationLog:{},{},{},{},{},{},{},{}",request.getDecorationLevel(),shopInfo.getDecorationLevel()
,request.getDecorationRequirement(),shopInfo.getDecorationRequirement(),request.getShopDecorationAttributes(),shopInfo.getShopDecorationAttributes()
,request.getSpecialInstruction(),shopInfo.getSpecialInstruction());
if (!Objects.equals(request.getDecorationLevel(), shopInfo.getDecorationLevel())) {
hasChange = true;
}
// 比较装修要求
if (!Objects.equals(request.getDecorationRequirement(), shopInfo.getDecorationRequirement())) {
hasChange = true;
}
// 比较装修属性
if (!Objects.equals(request.getShopDecorationAttributes(), shopInfo.getShopDecorationAttributes())) {
hasChange = true;
}
// 比较特殊情况说明
if (!Objects.equals(request.getSpecialInstruction(), shopInfo.getSpecialInstruction())) {
hasChange = true;
}
// 如果没有任何变动,不新增日志
if (!hasChange) {
log.info("门店装修数据未变动不新增日志shopId:{}", request.getShopId());
return true;
}
// 构建修改前数据
ShopDecorationLogRequest oldDataRequest = new ShopDecorationLogRequest();
oldDataRequest.setDecorationLevel(shopInfo.getDecorationLevel());
oldDataRequest.setDecorationRequirement(shopInfo.getDecorationRequirement());
oldDataRequest.setShopDecorationAttributes(shopInfo.getShopDecorationAttributes());
oldDataRequest.setSpecialInstruction(shopInfo.getSpecialInstruction());
String oldData = JSON.toJSONString(oldDataRequest);
// 构建修改后数据
ShopDecorationLogRequest newDataRequest = new ShopDecorationLogRequest();
newDataRequest.setDecorationLevel(request.getDecorationLevel());
newDataRequest.setDecorationRequirement(request.getDecorationRequirement());
newDataRequest.setShopDecorationAttributes(request.getShopDecorationAttributes());
newDataRequest.setSpecialInstruction(request.getSpecialInstruction());
String newData = JSON.toJSONString(newDataRequest);
// 构建记录
ShopDecorationLogDO record = ShopDecorationLogDO.builder()
.shopId(shopInfo.getId())
.oldData(oldData)
.newData(newData)
.operator(userId)
.operatorTime(new Date())
.build();
// 插入记录
shopDecorationLogDAO.insert(record);
return true;
}
@Override
public List<ShopDecorationLogResponse> listShopDecorationLog(Long shopId) {
List<ShopDecorationLogDO> logList = shopDecorationLogDAO.listByShopIdOrderByTimeDesc(shopId);
if (CollectionUtils.isEmpty(logList)) {
return new ArrayList<>();
}
List<String> userIdList = logList.stream().map(ShopDecorationLogDO::getOperator).collect(Collectors.toList());
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(userIdList);
return logList.stream().map(data -> {
ShopDecorationLogResponse response = new ShopDecorationLogResponse();
response.setId(data.getId());
response.setShopId(data.getShopId());
response.setOperator(userNameMap.get(data.getOperator()));
response.setOperatorTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,data.getOperatorTime()));
// 解析JSON数据
ShopDecorationLogRequest oldDataRequest = null;
ShopDecorationLogRequest newDataRequest = null;
try {
if (org.apache.commons.lang3.StringUtils.isNotBlank(data.getOldData())) {
oldDataRequest = JSON.parseObject(data.getOldData(), ShopDecorationLogRequest.class);
}
if (org.apache.commons.lang3.StringUtils.isNotBlank(data.getNewData())) {
newDataRequest = JSON.parseObject(data.getNewData(), ShopDecorationLogRequest.class);
}
} catch (Exception e) {
log.error("解析装修记录数据失败", e);
}
response.setOldData(oldDataRequest);
response.setNewData(newDataRequest);
return response;
}).collect(Collectors.toList());
}
}

View File

@@ -115,6 +115,7 @@ public class SyncMainSysServerImpl implements SyncMainSysServer {
storeMasterDTO.setBloc(region.getGroupName());
storeMasterDTO.setBranch(region.getRegionId());
storeMasterDTO.setRegionId(shopInfo.getManagerRegionId());
storeMasterDTO.setInvestRegionId(shopInfo.getInvestRegionId());
storeMasterDTO.setJoinSupervision(shopInfo.getInvestmentManager());
StoreMasterDTO.Signer2Info signer2Info = new StoreMasterDTO.Signer2Info();