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

@@ -9,7 +9,8 @@ package com.cool.store.enums;
public enum AuditExecuteEnum {
FRANCHISEES(0, "加盟商提交"),
OPERATION(1, "运营初审"),
HEADQUARTERS(2, "总部受理");
HEADQUARTERS(2, "总部受理"),
MANAGER(3, "待招商副总裁审核");
private int code;
private String desc;
AuditExecuteEnum(int code, String desc) {

View File

@@ -75,9 +75,13 @@ public enum UserRoleEnum {
INVESTMENT_MANGER(1765266125369L, "招商经理"),
OPERATION_GENERAL_CONSULTANT(1764642515446L,"运营片区总顾问"),
ORDER_GROUP(1766387359609L,"订单组"),
DELIVERY_SPECIALIST(1767591430954L,"外卖专员"),
AI_STORE_TYPE_APPROVE(1774252055402L,"AI店型订单审核"),
DEVICE_SHIPMENT_HM(1775108261858L,"设备发货-火码"),
DEVICE_SHIPMENT_CG(1775108280524L,"设备发货-采购")
DEVICE_SHIPMENT_CG(1775108280524L,"设备发货-采购"),
OPERATION_VICE_PRESIDENT(1778035765077L, "运营副总裁"),
INVESTMENT_PRESIDENT(1778053561302L, "招商副总裁"),
;
private Long code;

View File

@@ -21,7 +21,8 @@ public enum ShopSubStageStatusEnum {
//上传租赁合同
SHOP_SUB_STAGE_STATUS_20(ShopSubStageEnum.SHOP_STAGE_2, 200, "待加盟商上传", Boolean.FALSE),
SHOP_SUB_STAGE_STATUS_21(ShopSubStageEnum.SHOP_STAGE_2, 210, "待招商经理审核", Boolean.FALSE),
SHOP_SUB_STAGE_STATUS_21(ShopSubStageEnum.SHOP_STAGE_2, 210, "待招商片区老总审核", Boolean.FALSE),
SHOP_SUB_STAGE_STATUS_21_5(ShopSubStageEnum.SHOP_STAGE_2, 215, "待分部内勤审核", Boolean.FALSE),
SHOP_SUB_STAGE_STATUS_22(ShopSubStageEnum.SHOP_STAGE_2, 220, "审核未通过", Boolean.FALSE),
SHOP_SUB_STAGE_STATUS_23(ShopSubStageEnum.SHOP_STAGE_2, 230, "审核通过", Boolean.TRUE),
@@ -50,6 +51,7 @@ public enum ShopSubStageStatusEnum {
//加盟合同签约
SHOP_SUB_STAGE_STATUS_80(ShopSubStageEnum.SHOP_STAGE_8, 800, "待加盟内勤/大区内勤提交", Boolean.FALSE),
SHOP_SUB_STAGE_STATUS_83(ShopSubStageEnum.SHOP_STAGE_8, 830, "待分部内勤审核", Boolean.FALSE),
SHOP_SUB_STAGE_STATUS_83_2(ShopSubStageEnum.SHOP_STAGE_8, 832, "待招商副总裁审核", Boolean.FALSE),
SHOP_SUB_STAGE_STATUS_83_5(ShopSubStageEnum.SHOP_STAGE_8, 835, "待财务审核", Boolean.FALSE),
SHOP_SUB_STAGE_STATUS_84(ShopSubStageEnum.SHOP_STAGE_8, 840, "已签约", Boolean.TRUE),
SHOP_SUB_STAGE_STATUS_85(ShopSubStageEnum.SHOP_STAGE_8, 850, "审核失败", Boolean.FALSE),
@@ -90,7 +92,7 @@ public enum ShopSubStageStatusEnum {
//平台资料提交
SHOP_SUB_STAGE_STATUS_150(ShopSubStageEnum.SHOP_STAGE_15, 1500, "待加盟商提交", Boolean.FALSE),
// 2025-12-26 加盟开店管理流程调整新增“待运营顾问审核”删除1520、1530、1540、1550阶段
SHOP_SUB_STAGE_STATUS_150_5(ShopSubStageEnum.SHOP_STAGE_15, 1505, "运营顾问审核", Boolean.FALSE),
SHOP_SUB_STAGE_STATUS_150_5(ShopSubStageEnum.SHOP_STAGE_15, 1505, "招商经理审核", Boolean.FALSE),
SHOP_SUB_STAGE_STATUS_151(ShopSubStageEnum.SHOP_STAGE_15, 1510, "待圆规物流填写", Boolean.FALSE),
// ----- 以下子阶段删除 -----
SHOP_SUB_STAGE_STATUS_152(ShopSubStageEnum.SHOP_STAGE_15, 1520, "待财务填写",Boolean.FALSE),

View File

@@ -0,0 +1,32 @@
package com.cool.store.dao;
import com.cool.store.entity.ShopDecorationLogDO;
import com.cool.store.mapper.ShopDecorationLogMapper;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.List;
/**
* 门店装修修改记录 DAO
*/
@Repository
public class ShopDecorationLogDAO {
@Resource
private ShopDecorationLogMapper shopDecorationLogMapper;
/**
* 插入修改记录
*/
public int insert(ShopDecorationLogDO record) {
return shopDecorationLogMapper.insertSelective(record);
}
/**
* 通过门店ID查询所有修改记录按时间倒序
*/
public List<ShopDecorationLogDO> listByShopIdOrderByTimeDesc(Long shopId) {
return shopDecorationLogMapper.listByShopIdOrderByTimeDesc(shopId);
}
}

View File

@@ -270,10 +270,11 @@ public class ShopStageInfoDAO {
return shopStageInfoMapper.updateShopStageAndAuditInfo(shopId, shopStageInfo.getShopSubStageEnum().getShopSubStage(), shopStageInfo.getShopSubStageStatus(), isTerminated, remark, auditId);
}
public Page<RentInfoToDoVO> getRentContractToDoPage(String userId, Integer pageNum, Integer pageSize) {
public Page<RentInfoToDoVO> getRentContractToDoPage(String userId, Integer pageNum, Integer pageSize,List<String> authRegionIds) {
PageHelper.startPage(pageNum, pageSize);
ShopSubStageStatusEnum shopSubStageStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21;
return shopStageInfoMapper.getRentContractToDoPage(userId, shopSubStageStatus.getShopSubStageEnum().getShopSubStage(), shopSubStageStatus.getShopSubStageStatus());
return shopStageInfoMapper.getRentContractToDoPage(userId, shopSubStageStatus.getShopSubStageEnum().getShopSubStage(),
shopSubStageStatus.getShopSubStageStatus(),authRegionIds);
}
public List<ShopStageInfoDO> getShopIdListByStageStatus(Integer shopSubStageStatus) {

View File

@@ -0,0 +1,18 @@
package com.cool.store.mapper;
import com.cool.store.entity.ShopDecorationLogDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
/**
* 门店装修修改记录表 Mapper
*/
public interface ShopDecorationLogMapper extends Mapper<ShopDecorationLogDO> {
/**
* 通过门店ID查询所有修改记录按时间倒序
*/
List<ShopDecorationLogDO> listByShopIdOrderByTimeDesc(@Param("shopId") Long shopId);
}

View File

@@ -116,7 +116,10 @@ public interface ShopStageInfoMapper extends Mapper<ShopStageInfoDO> {
* @param userId
* @return
*/
Page<RentInfoToDoVO> getRentContractToDoPage(@Param("userId") String userId, @Param("shopSubStage")Integer shopSubStage, @Param("shopSubStageStatus") Integer shopSubStageStatus);
Page<RentInfoToDoVO> getRentContractToDoPage(@Param("userId") String userId,
@Param("shopSubStage")Integer shopSubStage,
@Param("shopSubStageStatus") Integer shopSubStageStatus,
@Param("authRegionIds") List<String> authRegionIds);
List<ShopStageInfoDO> getShopIdListByStageStatus(@Param("shopSubStageStatus") Integer shopSubStageStatus);

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cool.store.mapper.ShopDecorationLogMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.ShopDecorationLogDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="shop_id" jdbcType="BIGINT" property="shopId" />
<result column="old_data" jdbcType="VARCHAR" property="oldData" />
<result column="new_data" jdbcType="VARCHAR" property="newData" />
<result column="operator" jdbcType="VARCHAR" property="operator" />
<result column="operator_time" jdbcType="TIMESTAMP" property="operatorTime" />
</resultMap>
<select id="listByShopIdOrderByTimeDesc" resultMap="BaseResultMap">
SELECT * FROM zxjp_shop_decoration_log
WHERE shop_id = #{shopId}
ORDER BY operator_time DESC
</select>
</mapper>

View File

@@ -244,8 +244,17 @@
inner join xfsg_line_info b on a.line_id = b.id
left join xfsg_shop_info c on a.shop_id = c.id
where c.deleted=0
and a.shop_sub_stage = #{shopSubStage} and a.shop_sub_stage_status = #{shopSubStageStatus} and a.deleted = 0 and
b.deleted = 0 and b.development_manager = #{userId}
and a.shop_sub_stage = #{shopSubStage}
and a.shop_sub_stage_status = #{shopSubStageStatus}
and a.deleted = 0
and b.deleted = 0
<if test="authRegionIds != null and authRegionIds.size() > 0">
and c.invest_region_id in
<foreach collection="authRegionIds" item="regionId" index="index" open="(" separator="," close=")">
#{regionId}
</foreach>
</if>
order by a.id desc
</select>

View File

@@ -70,7 +70,8 @@
<select id="selectByShopIds" resultType="com.cool.store.entity.SignFranchiseDO">
select contract_code,shop_id,sign_type,contract_start_time,contract_end_time,contract_amount,create_time,
partnership_signatory_first,partnership_signatory_second ,partnership_signatory_second_id_number,partnership_signatory_second_mobile,
introduction_award,introduce_store,introducer,protective_distance,partnership_signatory_first_which_store
introduction_award,introduce_store,introducer,protective_distance,partnership_signatory_first_which_store,
display_cabinets_num
from xfsg_sign_franchise
where 1=1
<if test="list !=null and list.size >0">

View File

@@ -0,0 +1,60 @@
package com.cool.store.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.util.Date;
/**
* 门店装修修改记录表
*/
@Table(name = "zxjp_shop_decoration_log")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ShopDecorationLogDO {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* 门店ID
*/
@Column(name = "shop_id")
@ApiModelProperty("门店ID")
private Long shopId;
/**
* 修改前数据(JSON格式)
*/
@Column(name = "old_data", columnDefinition = "json")
@ApiModelProperty("修改前数据")
private String oldData;
/**
* 修改后数据(JSON格式)
*/
@Column(name = "new_data", columnDefinition = "json")
@ApiModelProperty("修改后数据")
private String newData;
/**
* 修改人
*/
@Column(name = "operator")
@ApiModelProperty("修改人")
private String operator;
/**
* 修改时间
*/
@Column(name = "operator_time")
@ApiModelProperty("修改时间")
private Date operatorTime;
}

View File

@@ -184,4 +184,10 @@ public class SignFranchiseDO {
@Column(name = "contract_service_life")
private Integer contractServiceLife;
/**
* 展示柜数量
*/
@Column(name = "display_cabinets_num")
private Integer displayCabinetsNum;
}

View File

@@ -249,6 +249,9 @@ public class AddSignFranchiseRequest {
@ApiModelProperty("特殊情况说明")
private String specialInstruction;
@ApiModelProperty("展示柜数量")
private Integer displayCabinetsNum;
private Date firstYearStartTime;
private Date firstYearEndTime;
@@ -299,6 +302,7 @@ public class AddSignFranchiseRequest {
signFranchiseDO.setDiscountAmount(this.discountAmount);
signFranchiseDO.setCurrency(this.currency);
signFranchiseDO.setContractServiceLife(this.contractServiceLife);
signFranchiseDO.setDisplayCabinetsNum(this.displayCabinetsNum);
return signFranchiseDO;
}

View File

@@ -0,0 +1,32 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
/**
* 门店装修修改记录 Request
*/
@Data
@ApiModel
public class ShopDecorationLogRequest {
@ApiModelProperty("门店ID")
@NotNull(message = "门店ID不能为空")
private Long shopId;
@ApiModelProperty("装修等级")
private String decorationLevel;
@ApiModelProperty("装修设计要求")
private String decorationRequirement;
@ApiModelProperty("装修属性 0-新开店 1-老店新开 2-老店翻新 3-迁址")
private Integer shopDecorationAttributes;
@ApiModelProperty("特殊说明")
private String specialInstruction;
}

View File

@@ -44,6 +44,8 @@ public class StoreMasterDTO {
private String bloc;
@ApiModelProperty("所属大区")
private Long branch;
@ApiModelProperty("所属招商大区")
private Long investRegionId;
@ApiModelProperty("加盟督导-人")
private String joinSupervision;
@ApiModelProperty("管理督导-组织")

View File

@@ -357,4 +357,7 @@ public class AddSignFranchiseResponse {
@ApiModelProperty("特殊情况说明")
private String specialInstruction;
@ApiModelProperty("展示柜数量")
private Integer displayCabinetsNum;
}

View File

@@ -0,0 +1,32 @@
package com.cool.store.response;
import com.cool.store.request.ShopDecorationLogRequest;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 门店装修修改记录 Response
*/
@Data
@ApiModel
public class ShopDecorationLogResponse {
@ApiModelProperty("主键ID")
private Long id;
@ApiModelProperty("门店ID")
private Long shopId;
@ApiModelProperty("修改前数据")
private ShopDecorationLogRequest oldData;
@ApiModelProperty("修改后数据")
private ShopDecorationLogRequest newData;
@ApiModelProperty("修改人")
private String operator;
@ApiModelProperty("修改时间")
private String operatorTime;
}

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();

View File

@@ -4,8 +4,10 @@ import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.request.AuditApproveRequest;
import com.cool.store.request.BuildInformationRequest;
import com.cool.store.request.ShopDecorationLogRequest;
import com.cool.store.response.BuildInformationResponse;
import com.cool.store.response.ResponseResult;
import com.cool.store.response.ShopDecorationLogResponse;
import com.cool.store.service.BuildInformationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -13,6 +15,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* @Author: WangShuo
@@ -46,7 +49,7 @@ public class PCBuildInformationController {
return ResponseResult.success(buildInformationService.getJoinType(lineId));
}
@ApiOperation("建店资料营运顾问审批")
@ApiOperation("建店资料招商经理审批")
@PostMapping("/operationsConsultantAudit")
public ResponseResult<Boolean> operationsConsultantAudit(@RequestBody @Validated AuditApproveRequest request) {
LoginUserInfo user = CurrentUserHolder.getUser();
@@ -58,4 +61,5 @@ public class PCBuildInformationController {
public ResponseResult<Boolean> companyInvoiceVerify(@RequestParam(value = "shopId") Long shopId) {
return ResponseResult.success(buildInformationService.companyInvoiceVerify(shopId));
}
}

View File

@@ -3,12 +3,10 @@ package com.cool.store.controller.webb;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.request.AddSignFranchiseRequest;
import com.cool.store.request.AssignOperationConsultantRequest;
import com.cool.store.request.AuditApproveRequest;
import com.cool.store.request.SignFranchiseDecorationRequest;
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.SignFranchiseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
@@ -17,6 +15,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@Api(tags = "pc加盟合同签约")
@RestController
@@ -42,16 +41,23 @@ public class PCSignFranchiseController {
@ApiOperation("修改装修信息")
@PostMapping("/decorationUpdate")
public ResponseResult<Boolean> decorationUpdate(@RequestBody @Validated SignFranchiseDecorationRequest request) {
return ResponseResult.success(signFranchiseService.decorationUpdate(request));
return ResponseResult.success(signFranchiseService.decorationUpdate(request,CurrentUserHolder.getUser()));
}
@ApiOperation("加盟合同签约审核")
@ApiOperation("加盟合同签约分部内勤审核")
@PostMapping("/audit/result")
public ResponseResult<Boolean> auditSignFranchise(@RequestBody @Validated AuditApproveRequest request) {
LoginUserInfo user = CurrentUserHolder.getUser();
return ResponseResult.success(signFranchiseService.auditApprove(request,user));
}
@ApiOperation("加盟合同签约副总裁审核")
@PostMapping("/audit/manager")
public ResponseResult<Boolean> managerAuditApprove(@RequestBody @Validated AuditApproveRequest request) {
LoginUserInfo user = CurrentUserHolder.getUser();
return ResponseResult.success(signFranchiseService.managerAuditApprove(request,user));
}
@ApiOperation("加盟合同签约财务审核")
@PostMapping("/audit/finance")
public ResponseResult<Boolean> financeAuditApprove(@RequestBody @Validated AuditApproveRequest request) {
@@ -91,4 +97,10 @@ public class PCSignFranchiseController {
}
@ApiOperation("查询门店装修修改记录列表")
@GetMapping("/listShopDecorationLog")
public ResponseResult<List<ShopDecorationLogResponse>> listShopDecorationLog(@RequestParam(value = "shopId") Long shopId) {
return ResponseResult.success(signFranchiseService.listShopDecorationLog(shopId));
}
}