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

This commit is contained in:
bianyadong
2024-04-23 19:12:35 +08:00
64 changed files with 2721 additions and 146 deletions

View File

@@ -0,0 +1,43 @@
package com.cool.store.enums;
public enum AuditEnum {
CONTRACT_INTENTION("intention", "意向加盟合同API","intentAgreementServiceImpl"),
SYS_BUILD("sysBuild", "系统建店API","sysStoreAppServiceImpl"),
;
private String code;
private String message;
private String clazz;
AuditEnum(String code, String message, String clazz) {
this.code = code;
this.message = message;
this.clazz = clazz;
}
public String getCode() {
return code;
}
public String getMessage() {
return message;
}
public String getClazz() {
return clazz;
}
public static AuditEnum getWorkflowSubStageEnum(String flag) {
for (AuditEnum auditEnum : AuditEnum.values()) {
if (auditEnum.getCode().equals(flag)) {
return auditEnum;
}
}
return null;
}
}

View File

@@ -0,0 +1,28 @@
package com.cool.store.enums;
public enum AuditTypeEnum {
VISUAL_ACCEPTANCE(0, "视觉验收"),
TRAINING_REGISTRATION_APPROVAL(1, "培训登记审批"),
OPENING_OPERATION_PLAN(2, "开业运营方案"),
LICENSE_APPROVAL(3, "证照审批"),
SYS_BUILD(4, "系统建店"),
;
private Integer code;
private String name;
private AuditTypeEnum(Integer code, String name) {
this.code = code;
this.name = name;
}
public Integer getCode() {
return code;
}
public String getName() {
return name;
}
}

View File

@@ -1,14 +1,20 @@
package com.cool.store.enums;
/**
* @author zhangchenbiao
* @FileName: SmsCodeTypeEnum
* @Description: 短信验证码类型
* @date 2021-07-20 9:47
*/
public enum SmsCodeTypeEnum {
LOGIN("SMS_220325070","验证码登录", 10 * 60),
FORGOT_PWD("SMS_220325070","忘记密码", 10 * 60),
MODIFY_PWD("SMS_220325070","修改密码", 10 * 60),
IMPROVE_INFO("SMS_220325070","完善用户信息", 10 * 60),
USER_REGISTER("SMS_220325070","用户注册", 10 * 60),
ENTERPRISE_REGISTER("SMS_220325070","企业注册", 10 * 60),
LOGIN2("SMS_232163403","验证码登录", 10 * 60),
;
private String templateCode;

View File

@@ -10,11 +10,11 @@ public enum WorkflowSubStageEnum{
/**
* 流程子阶段枚举
*/
INTEND(1, "加盟意向申请", WorkflowSubStageStatusEnum.INTENT_0,"joinIntentionServiceImpl",1),
INTEND(1, "加盟意向申请", WorkflowSubStageStatusEnum.INTENT_0,"joinIntentionServiceImpl",0),
INVITING_INTERVIEWS(5, "邀约面谈", WorkflowSubStageStatusEnum.INVITING_INTERVIEWS_10, "lineInterviewServiceImpl",2),
FIRST_INTERVIEWS(10, "一审面试", WorkflowSubStageStatusEnum.FIRST_INTERVIEWS_25, "lineInterviewServiceImpl",4),
PAY_DEPOSIT(15, "缴纳意向金", WorkflowSubStageStatusEnum.PAY_DEPOSIT_45, "bankServiceImpl",5),
SIGN_INTENT_AGREEMENT(20, "签署意向协议", WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_60, "intentAgreementServiceImpl",7),
PAY_DEPOSIT(15, "缴纳意向金", WorkflowSubStageStatusEnum.PAY_DEPOSIT_45, "bankServiceImpl",4),
SIGN_INTENT_AGREEMENT(20, "签署意向协议", WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_60, "intentAgreementServiceImpl",6),
STORE_EXPERIENCE(25, "门店体验", WorkflowSubStageStatusEnum.STORE_EXPERIENCE_85, "trainingExperienceServiceImpl",9),
SECOND_INTERVIEWS(30, "二审面试", WorkflowSubStageStatusEnum.SECOND_INTERVIEWS_100, "lineInterviewServiceImpl",10);

View File

@@ -13,21 +13,21 @@ import java.util.Objects;
*/
public enum ShopSubStageEnum {
SHOP_STAGE_1(ShopStageEnum.SHOP_STAGE_1, 10, "选址", 3),
SHOP_STAGE_2(ShopStageEnum.SHOP_STAGE_1, 20, "上传租赁合同", 2),
SHOP_STAGE_3(ShopStageEnum.SHOP_STAGE_2, 30, "系统建店", 2),
SHOP_STAGE_4(ShopStageEnum.SHOP_STAGE_2, 40, "证照办理", 2),
SHOP_STAGE_5(ShopStageEnum.SHOP_STAGE_2, 50, "员工招聘", 2),
SHOP_STAGE_6(ShopStageEnum.SHOP_STAGE_2, 60, "加盟商/员工培训", 2),
SHOP_STAGE_7(ShopStageEnum.SHOP_STAGE_2, 70, "缴纳加盟费/保证金", 2),
SHOP_STAGE_8(ShopStageEnum.SHOP_STAGE_2, 80, "加盟合同签约", 2),
SHOP_STAGE_9(ShopStageEnum.SHOP_STAGE_2, 90, "设计阶段", 2),
SHOP_STAGE_10(ShopStageEnum.SHOP_STAGE_2, 100, "装修款", 2),
SHOP_STAGE_11(ShopStageEnum.SHOP_STAGE_2, 110, "施工阶段", 2),
SHOP_STAGE_12(ShopStageEnum.SHOP_STAGE_2, 120, "三方验收", 2),
SHOP_STAGE_13(ShopStageEnum.SHOP_STAGE_2, 130, "视觉验收", 2),
SHOP_STAGE_14(ShopStageEnum.SHOP_STAGE_2, 140, "开业运营方案", 2),
SHOP_STAGE_15(ShopStageEnum.SHOP_STAGE_2, 150, "首批订货清单", 2),
SHOP_STAGE_1(ShopStageEnum.SHOP_STAGE_1, 10, "选址", 12),
SHOP_STAGE_2(ShopStageEnum.SHOP_STAGE_1, 20, "上传租赁合同", 14),
SHOP_STAGE_3(ShopStageEnum.SHOP_STAGE_2, 30, "系统建店", 19),
SHOP_STAGE_4(ShopStageEnum.SHOP_STAGE_2, 40, "证照办理", 24),
SHOP_STAGE_5(ShopStageEnum.SHOP_STAGE_2, 50, "员工招聘", 23),
SHOP_STAGE_6(ShopStageEnum.SHOP_STAGE_2, 60, "加盟商/员工培训", 30),
SHOP_STAGE_7(ShopStageEnum.SHOP_STAGE_2, 70, "缴纳加盟费/保证金", 1),
SHOP_STAGE_8(ShopStageEnum.SHOP_STAGE_2, 80, "加盟合同签约", 4),
SHOP_STAGE_9(ShopStageEnum.SHOP_STAGE_2, 90, "设计阶段", 24),
SHOP_STAGE_10(ShopStageEnum.SHOP_STAGE_2, 100, "装修款", 25),
SHOP_STAGE_11(ShopStageEnum.SHOP_STAGE_2, 110, "施工阶段", 29),
SHOP_STAGE_12(ShopStageEnum.SHOP_STAGE_2, 120, "三方验收", 26),
SHOP_STAGE_13(ShopStageEnum.SHOP_STAGE_2, 130, "视觉验收", 26),
SHOP_STAGE_14(ShopStageEnum.SHOP_STAGE_2, 140, "开业运营方案", 23),
SHOP_STAGE_15(ShopStageEnum.SHOP_STAGE_2, 150, "首批订货清单", 20),
;
//阶段

View File

@@ -0,0 +1,55 @@
package com.cool.store.enums.prepare.newStore;
import com.cool.store.enums.ThirdRegionTypeEnum;
import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* 社区类型
*/
public enum BusinessDistrictEnum {
COMMUNITY(10,"社区型"),
COMMERCIAL_STREET(20,"商业街边型"),
SCHOOL(30,"学校型"),
CBD_OFFICE(40,"CBD/办公型"),
HOSPITAL(60,"医院型"),
VEGETABLE_MARKET(70,"-菜场型"),
;
private Integer code;
private String desc;
BusinessDistrictEnum(Integer code, String desc) {
this.code = code;
this.desc = desc;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public static final Map<Integer, BusinessDistrictEnum> map
= Arrays.stream(values()).collect(Collectors.toMap(BusinessDistrictEnum::getCode, Function.identity()));
public static BusinessDistrictEnum getByCode(Integer code) {
return map.get(code);
}
}

View File

@@ -0,0 +1,52 @@
package com.cool.store.enums.prepare.newStore;
import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* 线下竞争对手
*/
public enum OfflineCompetitorEnum {
BRAND_FRUIT(10,"品牌水果店"),
COUPLES_FRUIT(20,"夫妻水果店"),
VEGETABLE_MARKET(30,"菜场店"),
BIG_BUSINESS(40,"大商超"),
FRESH_FOOD(50,"生鲜店"),
NONE(60,""),
;
private Integer code;
private String desc;
OfflineCompetitorEnum(Integer code, String desc) {
this.code = code;
this.desc = desc;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public static final Map<Integer, OfflineCompetitorEnum> map
= Arrays.stream(values()).collect(Collectors.toMap(OfflineCompetitorEnum::getCode, Function.identity()));
public static OfflineCompetitorEnum getByCode(Integer code) {
return map.get(code);
}
}

View File

@@ -0,0 +1,47 @@
package com.cool.store.enums.prepare.newStore;
import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
public enum PassengerFlowEnum {
BELOW_1000(0,"1000以下"),
TO_1000_10000(1,"1000-1万"),
MORE_THAN_10000(2,"1万以上"),
;
private Integer code;
private String desc;
PassengerFlowEnum(Integer code, String desc) {
this.code = code;
this.desc = desc;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public static final Map<Integer, PassengerFlowEnum> map
= Arrays.stream(values()).collect(Collectors.toMap(PassengerFlowEnum::getCode, Function.identity()));
public static PassengerFlowEnum getByCode(Integer code) {
return map.get(code);
}
}

View File

@@ -0,0 +1,46 @@
package com.cool.store.enums.prepare.newStore;
import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
public enum StoreOperatorEnum {
FRANCHISEE(10,"加盟商"),
STORE_MANAGER(20,"店长"),
;
private Integer code;
private String desc;
StoreOperatorEnum(Integer code, String desc) {
this.code = code;
this.desc = desc;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public static final Map<Integer, StoreOperatorEnum> map
= Arrays.stream(values()).collect(Collectors.toMap(StoreOperatorEnum::getCode, Function.identity()));
public static StoreOperatorEnum getByCode(Integer code) {
return map.get(code);
}
}

View File

@@ -0,0 +1,93 @@
package com.cool.store.utils;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* @author zhangchenbiao
* @FileName: GeoMapUtil
* @Description:
* @date 2024-04-23 11:26
*/
public class GeoMapUtil {
private static final String AMAP_API_URL = "https://restapi.amap.com/v3/geocode/regeo";
private static final String API_KEY = "bdf789122b56e8fd3d4a4410800382a6"; // 替换为你的高德地图API密钥
public static void main(String[] args) {
AddressInfo addressInfo = reverseGeoCoding("30.41875", "120.2985");
System.out.println(JSONObject.toJSONString(addressInfo));
System.out.println(JSONObject.toJSONString(reverseGeoCoding("30.41", "120.29")));
System.out.println(JSONObject.toJSONString(reverseGeoCoding("30.42", "120.30")));
System.out.println(JSONObject.toJSONString(reverseGeoCoding("30.4", "120.2")));
System.out.println(JSONObject.toJSONString(reverseGeoCoding("30.5", "120.3")));
System.out.println(JSONObject.toJSONString(reverseGeoCoding("30.419", "120.299")));
}
public static AddressInfo reverseGeoCoding(String latitude, String longitude) {
BufferedReader in = null;
try {
URL url = new URL(AMAP_API_URL + "?location=" + longitude + "," + latitude + "&output=json&key=" + API_KEY);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.connect();
if(connection.getResponseCode() == HttpURLConnection.HTTP_OK){
in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String inputLine;
StringBuilder content = new StringBuilder();
while ((inputLine = in.readLine()) != null) {
content.append(inputLine);
}
JSONObject jsonObject = JSONObject.parseObject(content.toString());
// 提取并构建AddressInfo对象
AddressInfo addressInfo = extractAddressInfo(jsonObject.getJSONObject("regeocode"));
return addressInfo;
}
} catch (IOException e) {
System.out.println("Error occurred while making the request: " + e.getMessage());
}finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return null;
}
private static AddressInfo extractAddressInfo(JSONObject geoJson) {
JSONObject addressComponent = geoJson.getJSONObject("addressComponent");
// 根据实际响应结构解析省市区街道信息,此处仅为示例
String province = (String) addressComponent.get("province");
String city = (String) addressComponent.get("city");
String district = (String) addressComponent.get("district");
String township = (String) addressComponent.get("township");
String address = geoJson.getString("formatted_address");
return new AddressInfo(province, city, district, township, address);
}
@Data
public static class AddressInfo {
private String province;
private String city;
private String district;
private String township;
private String address;
public AddressInfo(String province, String city, String district, String township, String address) {
this.province = province;
this.city = city;
this.district = district;
this.township = township;
this.address = address;
}
}
}

View File

@@ -125,8 +125,8 @@ public class LineInfoDAO {
return lineInfo;
}
public List<LineInfoDO> publicLineList(PublicLineListRequest publicLineListRequest) {
List<LineInfoDO> lineInfo = lineInfoMapper.publicLineList(publicLineListRequest);
public List<LineInfoDO> publicLineList(PublicLineListRequest publicLineListRequest,Boolean publicFlag) {
List<LineInfoDO> lineInfo = lineInfoMapper.publicLineList(publicLineListRequest,publicFlag);
return lineInfo;
}

View File

@@ -55,7 +55,7 @@ public interface LineInfoMapper extends Mapper<LineInfoDO> {
* @param publicLineListRequest
* @return
*/
List<LineInfoDO> publicLineList(@Param("request") PublicLineListRequest publicLineListRequest);
List<LineInfoDO> publicLineList(@Param("request") PublicLineListRequest publicLineListRequest, @Param("publicFlag") Boolean publicFlag);
/**
* 根据lineId判断是更新还是插入

View File

@@ -72,4 +72,13 @@ public interface PointInfoMapper extends Mapper<PointInfoDO> {
* @return
*/
Integer recyclePoint(@Param("pointId") Long pointId);
/**
* 根据shopId与lineId查找铺位信息
* @param lineId
* @param shopId
* @return
*/
PointInfoDO getDataByShopIdAndLineId(@Param("lineId") Long lineId,
@Param("shopId") Long shopId);
}

View File

@@ -100,4 +100,6 @@ public interface RegionMapper {
RegionDO getRegionByStoreId(@Param("storeId") String storeId);
RegionDO getBigRegionByRegionId(@Param("regionId") long regionId);
}

View File

@@ -0,0 +1,8 @@
package com.cool.store.mapper;
import com.cool.store.entity.SystemBuildingShopDO;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface SystemBuildingShopMapper extends tk.mybatis.mapper.common.Mapper<SystemBuildingShopDO> {
}

View File

@@ -0,0 +1,39 @@
package com.cool.store.mapper;
import com.cool.store.entity.ThirdDepartmentDO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 主应用移植,完整的使用去主应用找
*/
public interface ThirdDepartmentMapper {
/**
*
* 默认查询方法,通过主键获取所有字段的值
* dateTime:2024-04-02 04:42
*/
ThirdDepartmentDO selectByPrimaryKey(Long id);
/**
*
* 默认更新方法,根据主键物理删除
* dateTime:2024-04-02 04:42
*/
int deleteByPrimaryKey(Long id);
Integer deleteThirdDepartment(@Param("departmentCodes") List<String> departmentCodes);
void batchInsertOrUpdate(@Param("thirdDepartments") List<ThirdDepartmentDO> thirdDepartments);
List<ThirdDepartmentDO> listByDeptPrincipals(@Param("deptPrincipals") List<String> deptPrincipals);
List<ThirdDepartmentDO> listAllThirdDepartment();
ThirdDepartmentDO getByDepartmentCode(@Param("departmentCode") String departmentCode);
ThirdDepartmentDO getByName(@Param("name")String name);
}

View File

@@ -436,14 +436,20 @@
<select id="publicLineList" resultMap="BaseResultMap">
select * from xfsg_line_info
where deleted = 0 and line_status = 0 and join_status = 0
<if test="publicFlag">
and investment_manager is not null
</if>
<if test="publicFlag==false">
and investment_manager is null
</if>
<if test="request.userName != null and request.username!=''">
and username = #{request.userName}
and username like concat('%',#{request.userName},'%')
</if>
<if test="request.mobile != null and request.mobile!=''">
and mobile = #{request.mobile}
and mobile like concat('%', #{request.mobile},'%')
</if>
<if test="request.keyword != null and request.keyword!=''">
and (username like #{request.keyword} or mobile like #{request.keyword})
and (username like concat('%',#{request.keyword},'%') or mobile like concat('%', #{request.keyword},'%'))
</if>
<if test="request.lineSource != null">
and line_source = #{request.lineSource}

View File

@@ -111,7 +111,7 @@
<select id="getInterviewByLineId" resultMap="BaseResultMap">
select * from
xfsg_line_interview
where line_id = #{lineId}
where line_id = #{lineId} and interview_status = 3
and deleted = '0'
</select>

View File

@@ -190,8 +190,16 @@
</foreach>
</if>
</select>
<select id="getDataByShopIdAndLineId" resultType="com.cool.store.entity.PointInfoDO">
SELECT
<include refid="allColumn"/>
FROM xfsg_point_info
WHERE shop_id = #{shopId}
AND line_id = #{lineId}
AND deleted = 0
</select>
<update id="recyclePoint">
<update id="recyclePoint">
update xfsg_point_info set line_id = null, shop_id = null, select_status = 0, update_time = now(), point_status = if(point_status = 6, 5, point_status)) where id = #{pointId}
</update>

View File

@@ -364,6 +364,16 @@
and store_id = #{storeId}
and region_type = 'store'
</select>
<select id="getBigRegionByRegionId" resultType="com.cool.store.entity.RegionDO">
select <include refid="fields"/>
from region_${enterpriseId}
where deleted = 0
and id = (
SELECT parent_id
FROM region_${enterpriseId}
WHERE id = #{regionId}
)
</select>
</mapper>

View File

@@ -8,6 +8,7 @@
<result column="rent_type" jdbcType="TINYINT" property="rentType" />
<result column="sign_time" jdbcType="TIMESTAMP" property="signTime" />
<result column="contract_start_time" jdbcType="TIMESTAMP" property="contractStartTime" />
<result column="contract_end_time" jdbcType="TIMESTAMP" property="contractEndTime" />
<result column="contract_months" jdbcType="INTEGER" property="contractMonths" />
<result column="shop_rent_type" jdbcType="TINYINT" property="shopRentType" />
<result column="month_rent" jdbcType="VARCHAR" property="monthRent" />
@@ -23,7 +24,7 @@
</resultMap>
<sql id="allColumn">
id, shop_id, point_id, rent_type, sign_time, contract_start_time, contract_months, shop_rent_type,
id, shop_id, point_id, rent_type, sign_time, contract_start_time, contract_end_time, contract_months, shop_rent_type,
month_rent, first_year_month_rent, second_year_month_rent, third_year_month_rent, contract_pic,
house_certificate_pic, audit_id, deleted, create_time, update_time
</sql>

View File

@@ -0,0 +1,12 @@
<?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.SystemBuildingShopMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.SystemBuildingShopDO">
<id column="id" jdbcType="BIGINT" property="id" />
</resultMap>
<sql id="Base_Column_List">
</sql>
</mapper>

View File

@@ -0,0 +1,112 @@
<?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.ThirdDepartmentMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.ThirdDepartmentDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="department_code" jdbcType="VARCHAR" property="departmentCode" />
<result column="department_name" jdbcType="VARCHAR" property="departmentName" />
<result column="dept_principal" jdbcType="VARCHAR" property="deptPrincipal" />
<result column="parent_department_code" jdbcType="VARCHAR" property="parentDepartmentCode" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
id, department_code,
department_name,
dept_principal,
parent_department_code,
create_time,
update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from third_department_${enterpriseId}
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from third_department_${enterpriseId}
where id = #{id,jdbcType=BIGINT}
</delete>
<sql id="dynamicQuery">
<trim prefix="WHERE" prefixOverrides="AND | OR">
<if test="null != id">
and t.id = #{id,jdbcType=BIGINT}
</if>
<if test="null != departmentCode">
and t.department_code = #{departmentCode,jdbcType=VARCHAR}
</if>
<if test="null != departmentName">
and t.department_name = #{departmentName,jdbcType=VARCHAR}
</if>
<if test="null != deptPrincipal">
and t.dept_principal = #{deptPrincipal,jdbcType=VARCHAR}
</if>
<if test="null != parentDepartmentCode">
and t.parent_department_code = #{parentDepartmentCode,jdbcType=VARCHAR}
</if>
<if test="null != createTime">
and t.create_time = #{createTime,jdbcType=TIMESTAMP}
</if>
<if test="null != updateTime">
and t.update_time = #{updateTime,jdbcType=TIMESTAMP}
</if>
</trim>
</sql>
<delete id="deleteThirdDepartment">
delete from third_department_${enterpriseId}
where department_code in
<foreach collection="departmentCodes" item="departmentCode" open="(" separator="," close=")">
#{departmentCode}
</foreach>
</delete>
<insert id="batchInsertOrUpdate" parameterType="java.util.List">
insert into third_department_${enterpriseId}
(
department_code,
department_name,
dept_principal,
parent_department_code,
create_time
) values
<foreach collection="thirdDepartments" item="thirdDepartment" separator=",">
(
#{thirdDepartment.departmentCode},
#{thirdDepartment.departmentName},
#{thirdDepartment.deptPrincipal},
#{thirdDepartment.parentDepartmentCode},
now()
)
</foreach>
ON DUPLICATE KEY UPDATE update_time=values(update_time),department_name=values(department_name),
dept_principal=values(dept_principal),parent_department_code=values(parent_department_code)
</insert>
<select id="listByDeptPrincipals" resultType="com.cool.store.entity.ThirdDepartmentDO">
select <include refid="Base_Column_List" />
from third_department_${enterpriseId}
where dept_principal in
<foreach collection="deptPrincipals" item="deptPrincipal" open="(" separator="," close=")">
#{deptPrincipal}
</foreach>
</select>
<select id="listAllThirdDepartment" resultType="com.cool.store.entity.ThirdDepartmentDO">
select <include refid="Base_Column_List" />
from third_department_${enterpriseId}
</select>
<select id="getByDepartmentCode" resultType="com.cool.store.entity.ThirdDepartmentDO">
select <include refid="Base_Column_List" />
from third_department_${enterpriseId}
where department_code = #{departmentCode}
</select>
<select id="getByName" resultType="com.cool.store.entity.ThirdDepartmentDO">
SELECT <include refid="Base_Column_List"/>
FROM third_department_${enterpriseId}
WHERE department_name = #{name}
</select>
</mapper>

View File

@@ -574,9 +574,6 @@ public class PointDetailInfoDO {
if(Objects.isNull(this.dayTrader) || Objects.isNull(this.profitRate) || Objects.isNull(this.monthProfitRate)){
return false;
}
if(Objects.isNull(this.deliveryRate) || Objects.isNull(this.deliveryFee)){
return false;
}
if(Objects.isNull(this.brandUseFee) || Objects.isNull(this.brandUseRate)){
return false;
}

View File

@@ -19,7 +19,7 @@ public class ShopAuditInfoDO {
* 0-视觉验收 1-培训登记审批 2-开业运营方案 3-证照审批
*/
@Column(name = "audit_type")
private Byte auditType;
private Integer auditType;
/**
* 提交人ID
@@ -37,7 +37,7 @@ public class ShopAuditInfoDO {
* 结果类型 0通过,1拒绝
*/
@Column(name = "result_type")
private Byte resultType;
private Integer resultType;
/**
* 通过原因
@@ -111,7 +111,7 @@ public class ShopAuditInfoDO {
*
* @return audit_type - 0-视觉验收 1-培训登记审批 2-开业运营方案 3-证照审批
*/
public Byte getAuditType() {
public Integer getAuditType() {
return auditType;
}
@@ -120,7 +120,7 @@ public class ShopAuditInfoDO {
*
* @param auditType 0-视觉验收 1-培训登记审批 2-开业运营方案 3-证照审批
*/
public void setAuditType(Byte auditType) {
public void setAuditType(Integer auditType) {
this.auditType = auditType;
}
@@ -165,7 +165,7 @@ public class ShopAuditInfoDO {
*
* @return result_type - 结果类型 0通过,1拒绝
*/
public Byte getResultType() {
public Integer getResultType() {
return resultType;
}
@@ -174,7 +174,7 @@ public class ShopAuditInfoDO {
*
* @param resultType 结果类型 0通过,1拒绝
*/
public void setResultType(Byte resultType) {
public void setResultType(Integer resultType) {
this.resultType = resultType;
}

View File

@@ -42,6 +42,12 @@ public class ShopRentInfoDO {
@Column(name = "contract_start_time")
private Date contractStartTime;
/**
* 合同结束日期
*/
@Column(name = "contract_end_time")
private Date contractEndTime;
/**
* 签约年限
*/

View File

@@ -0,0 +1,177 @@
package com.cool.store.entity;
import com.cool.store.request.SysStoreAppRequest;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.util.Date;
import java.util.Objects;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "xfsg_system_building_shop")
public class SystemBuildingShopDO {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "shop_id")
private Long shopId;
@Column(name = "line_id")
private Long lineId;
@Column(name = "audit_id")
private Long auditId;
@Column(name = "franchisee_type")
private Integer franchiseeType;
@Column(name = "store_invitees_name")
private String storeInviteesName;
@Column(name = "store_invitees_id")
private String storeInviteesId;
@Column(name = "store_nature")
private Integer storeNature;
@Column(name = "store_operator")
private Integer storeOperator;
@Column(name = "big_desc")
private String bigDesc;
@Column(name = "big_name")
private String bigName;
@Column(name = "big_code")
private String bigCode;
@Column(name = "fight_desc")
private String fightDesc;
@Column(name = "fight_name")
private String fightName;
@Column(name = "fight_code")
private String fightCode;
@Column(name = "small_code")
private String smallCode;
@Column(name = "small_desc")
private String smallDesc;
@Column(name = "small_name")
private String smallName;
@Column(name = "main_business_type")
private Integer mainBusinessType;
@Column(name = "sub_business_type")
private Integer subBusinessType;
@Column(name = "offline_competitor")
private Integer offlineCompetitor;
@Column(name = "offline_competing_brand")
private String offlineCompetingBrand;
@Column(name = "average_price_sh")
private Integer averagePriceSh;
@Column(name = "average_daily_rs")
private Integer averageDailyRs;
@Column(name = "business_store_type")
private String businessStoreType;
@Column(name = "estimated_turnover")
private Integer estimatedTurnover;
@Column(name = "sign_date")
private Date signDate;
@Column(name = "landlord_name")
private String landlordName;
@Column(name = "contract_delivery_date")
private Date contractDeliveryDate;
@Column(name = "landlord_mobile")
private String landlordMobile;
@Column(name = "reservation")
private Date reservation;
@Column(name = "store_rent")
private Integer storeRent;
@Column(name = "store_franchise_fee")
private Integer storeFranchiseFee;
@Column(name = "store_security_deposit")
private Integer storeSecurityDeposit;
@Column(name = "reasons")
private String reasons;
@Column(name = "supervisor_name")
private String supervisorName;
@Column(name = "supervisor_id")
private String supervisorId;
@Column(name = "regio_general")
private String regioGeneral;
@Column(name = "regio_general_id")
private String regioGeneralId;
@Column(name = "create_time")
private Date createTime;
@Column(name = "update_time")
private Date updateTime;
public static SystemBuildingShopDO convertToSystemBuildingShopDO(SysStoreAppRequest sysStoreAppRequest) {
if (Objects.isNull(sysStoreAppRequest)) {
return null;
}
SystemBuildingShopDO systemBuildingShopDO = new SystemBuildingShopDO();
// id
// shopInfoId
systemBuildingShopDO.setShopId(sysStoreAppRequest.getShopId());
// lineId
systemBuildingShopDO.setLineId(sysStoreAppRequest.getLineId());
// franchiseeType
systemBuildingShopDO.setFranchiseeType(sysStoreAppRequest.getFranInfo().getFranchiseeType());
// storeInviteesName
systemBuildingShopDO.setStoreInviteesName(sysStoreAppRequest.getFranInfo().getStoreInviteesName());
// // storeInviteesId
systemBuildingShopDO.setStoreInviteesId(sysStoreAppRequest.getFranInfo().getInviteUserId());
// storeNature
systemBuildingShopDO.setStoreNature(sysStoreAppRequest.getStoreDetail().getStoreNature());
// storeOperator
// systemBuildingShopDO.setStoreOperator(sysStoreAppRequest.getStoreDetail().getstore);
// bigDesc
systemBuildingShopDO.setBigDesc(sysStoreAppRequest.getStoreDetail().getBigDesc());
// fightDesc
systemBuildingShopDO.setFightDesc(sysStoreAppRequest.getStoreDetail().getFightDesc());
// smallCode
systemBuildingShopDO.setSmallCode(sysStoreAppRequest.getStoreDetail().getSmallCode());
// smallDesc
systemBuildingShopDO.setSmallDesc(sysStoreAppRequest.getStoreDetail().getSmallDesc());
// mainBusinessType
systemBuildingShopDO.setMainBusinessType(sysStoreAppRequest.getStoreDetail().getMainBusinessType());
// subBusinessType
systemBuildingShopDO.setSubBusinessType(sysStoreAppRequest.getStoreDetail().getSubBusinessType());
// offlineCompetitor
systemBuildingShopDO.setOfflineCompetitor(sysStoreAppRequest.getStoreDetail().getOfflineCompetitor());
// offlineCompetingBrand
systemBuildingShopDO.setOfflineCompetingBrand(sysStoreAppRequest.getStoreDetail().getOfflineCompetingBrand());
// averagePriceSh
systemBuildingShopDO.setAveragePriceSh(sysStoreAppRequest.getStoreDetail().getAveragePriceSh());
// averageDailyRs
systemBuildingShopDO.setAverageDailyRs(sysStoreAppRequest.getStoreDetail().getAverageDailyRs());
// businessStoreType
systemBuildingShopDO.setBusinessStoreType(sysStoreAppRequest.getStoreDetail().getBusinessStoreType());
// estimatedTurnover
systemBuildingShopDO.setEstimatedTurnover(sysStoreAppRequest.getStoreDetail().getEstimatedTurnover());
// signDate
systemBuildingShopDO.setSignDate(sysStoreAppRequest.getStoreDetail().getSignDate());
// landlordName
systemBuildingShopDO.setLandlordName(sysStoreAppRequest.getStoreDetail().getLandlordName());
// contractDeliveryDate
systemBuildingShopDO.setContractDeliveryDate(sysStoreAppRequest.getStoreDetail().getContractDeliveryDate());
// landlordMobile
systemBuildingShopDO.setLandlordMobile(sysStoreAppRequest.getStoreDetail().getLandlordMobile());
// reservation
systemBuildingShopDO.setReservation(sysStoreAppRequest.getStoreDetail().getReservation());
// storeRent
systemBuildingShopDO.setStoreRent(sysStoreAppRequest.getStoreDetail().getStoreRent());
// storeFranchiseFee
systemBuildingShopDO.setStoreFranchiseFee(sysStoreAppRequest.getStoreDetail().getStoreFranchiseFee());
// storeSecurityDeposit
systemBuildingShopDO.setStoreSecurityDeposit(sysStoreAppRequest.getStoreDetail().getStoreSecurityDeposit());
// reasons
systemBuildingShopDO.setReasons(sysStoreAppRequest.getStoreDetail().getReasons());
// supervisorName
systemBuildingShopDO.setSupervisorName(sysStoreAppRequest.getSupervisorDetail().getSupervisorName());
// supervisorId
systemBuildingShopDO.setSupervisorId(sysStoreAppRequest.getSupervisorDetail().getSupervisorId());
// regioGeneral
systemBuildingShopDO.setRegioGeneral(sysStoreAppRequest.getSupervisorDetail().getRegioGeneral());
// regioGeneralId
systemBuildingShopDO.setRegioGeneralId(sysStoreAppRequest.getSupervisorDetail().getRegioGeneralId());
return systemBuildingShopDO;
}
}

View File

@@ -0,0 +1,38 @@
package com.cool.store.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ThirdDepartmentDO implements Serializable {
@ApiModelProperty("主键")
private Long id;
@ApiModelProperty("三方部门code")
private String departmentCode;
@ApiModelProperty("三方部门名称")
private String departmentName;
@ApiModelProperty("部门负责人 鲜丰水果是工号")
private String deptPrincipal;
@ApiModelProperty("父部门code")
private String parentDepartmentCode;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("更新时间")
private Date updateTime;
}

View File

@@ -40,6 +40,9 @@ public class AddRentContractRequest {
@ApiModelProperty("合同开始日期")
private Date contractStartTime;
@ApiModelProperty("合同结束日期")
private Date contractEndTime;
@ApiModelProperty("签约年限")
private Integer contractMonths;
@@ -79,7 +82,7 @@ public class AddRentContractRequest {
}
return true;
}
if(Objects.isNull(signTime) || Objects.isNull(contractStartTime)){
if(Objects.isNull(signTime) || Objects.isNull(contractStartTime) || Objects.isNull(contractEndTime)){
return false;
}
if(Objects.isNull(contractMonths) || Objects.isNull(shopRentType)){
@@ -111,6 +114,7 @@ public class AddRentContractRequest {
shopRentInfoDO.setRentType(param.getRentType());
shopRentInfoDO.setSignTime(param.getSignTime());
shopRentInfoDO.setContractStartTime(param.getContractStartTime());
shopRentInfoDO.setContractEndTime(param.getContractEndTime());
shopRentInfoDO.setContractMonths(param.getContractMonths());
shopRentInfoDO.setShopRentType(param.getShopRentType());
shopRentInfoDO.setMonthRent(param.getMonthRent());

View File

@@ -5,7 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("意向加盟合同审核结果请求体")
@ApiModel("审核结果请求体")
public class AuditResultRequest {
@ApiModelProperty("kdz业务id唯一标识")
@@ -19,4 +19,7 @@ public class AuditResultRequest {
@ApiModelProperty("通过/失败原因")
private String cause = "";
@ApiModelProperty("门店编码(系统建店时使用)")
private String storeNum;
}

View File

@@ -0,0 +1,427 @@
package com.cool.store.request;
import lombok.Data;
import java.util.List;
@Data
public class FranchiseAgreementRequest {
/**
* 流程发起人工号
*/
private String apply_user;
/**
* 公司主体0.鲜丰水果股份有限公司
*/
private long company;
/**
* 第一年度结束时间
*/
private String end1;
/**
* 第二年度结束时间
*/
private String end2;
/**
* 第三年度结束时间
*/
private String end3;
/**
* 特许经营合同
*/
private List<String> fjsc;
/**
* 发起公司名称,默认值:鲜丰水果股份有限公司
*/
private String fqgsmc;
/**
* 辅助字段0.个人签字 1.企业盖章
*/
private long fzzd1;
/**
* 工程装修合同发起人工号默认20230724
*/
private String gczxhtfqr;
/**
* 货款保证金
*/
private long hkbzj;
/**
* 货款保证金大写
*/
private long hkbzjdx;
/**
* 货款保证金大写文本
*/
private String hkbzjwb;
/**
* 合同开始日
*/
private long ht_day;
/**
* 合同结束日
*/
private long ht_day2;
/**
* 合同开始月
*/
private long ht_month1;
/**
* 合同结束月
*/
private long ht_month2;
/**
* 合同开始年
*/
private long ht_year1;
/**
* 合同结束年
*/
private long ht_year2;
/**
* 身份证正面
*/
private List<String> idcard_1;
/**
* 身份证反面
*/
private List<String> idcard_2;
/**
* 身份证地址
*/
private String idcard_address;
/**
* 是否有营业执照
*/
private long is_business_license;
/**
* 是否补缴保证金0.是 1.否
*/
private long is_deposit;
/**
* 是否有食品许可证0.是 2.否[二证合一] 3.否[三小一摊] 4.否[暂未办理]
*/
private long is_food_license;
/**
* 缴款日期
*/
private String jiaokuandate;
/**
* 缴款人
*/
private String jkr;
/**
* 加盟店区县
*/
private String jmd_area;
/**
* 加盟店市
*/
private String jmd_city;
/**
* 加盟店省
*/
private String jmd_province;
/**
* 加盟店街
*/
private String jmd_street;
/**
* 每年加盟费
*/
private long jmf;
/**
* 第一年度加盟费
*/
private long jmf2;
/**
* 第二年度加盟费
*/
private long jmf3;
/**
* 第三年度加盟费
*/
private long jmf4;
/**
* 第一年度开始日
*/
private long jmfday1;
/**
* 第一年度结束日
*/
private long jmfday2;
/**
* 第二年度开始日
*/
private long jmfday3;
/**
* 第二年度结束日
*/
private long jmfday4;
/**
* 第三年度开始日
*/
private long jmfday5;
/**
* 第三年度结束日
*/
private long jmfday6;
/**
* 加盟费
*/
private long jmfdx;
/**
* 第一年度开始月
*/
private long jmfmonth1;
/**
* 第一年度结束月
*/
private long jmfmonth2;
/**
* 第二年度开始月
*/
private long jmfmonth3;
/**
* 第二年度结束月
*/
private long jmfmonth4;
/**
* 第三年度开始月
*/
private long jmfmonth5;
/**
* 第三年度结束月
*/
private long jmfmonth6;
/**
* 加盟费大写文本
*/
private String jmfwb;
/**
* 第一年度开始年
*/
private long jmfyear1;
/**
* 第一年度结束年
*/
private long jmfyear2;
/**
* 第二年度开始年
*/
private long jmfyear3;
/**
* 第二年度结束年
*/
private long jmfyear4;
/**
* 第三年度开始年
*/
private long jmfyear5;
/**
* 第三年度结束年
*/
private long jmfyear6;
/**
* 加盟费/保证金打款截图,上传文件,是否补签=否时必填,是否补签=是时不传
*/
private List<String> jmsdkjt;
/**
* 加盟商代码88888888
*/
private String jmsdm;
/**
* 加盟商合同状态0.生效 1.终止 2.转让 3.草稿默认值0
*/
private long jmshtzt;
/**
* 加盟商类型0.新加盟商开单店 1.老加盟商开单店 2.老加盟商开区域单店 3.新加盟商开区域单店
*/
private long jmslx;
/**
* 加盟商联系方式
*/
private String jmslxfs;
/**
* 加盟商身份证号
*/
private String jmssfzhm;
/**
* 加盟商编码
*/
private String jmsxm;
/**
* 加盟商姓名
*/
private String jmsxm1;
/**
* 合同结束日期
*/
private String jsrq;
/**
* 加盟商结算账户账号
*/
private String jszhhz;
/**
* 酷店掌业务id
*/
private String kdzBusinessId;
/**
* 加盟商结算账户开户行
*/
private String khhjzh;
/**
* 履约保证金
*/
private long lvbzj;
/**
* 履约保证金大写
*/
private long lybzjdx;
/**
* 履约保证金大写文本
*/
private String lybzjwb;
/**
* 门店地址
*/
private String mddz;
/**
* 门店代码
*/
private String mdmc;
/**
* 门店名称文本
*/
private String mdmcwb;
/**
* 所属大区ehr代码
*/
private String oacompany;
/**
* 营业执照名称
*/
private String partyb_name;
/**
* 经营者
*/
private String partyb_operator;
/**
* 类型0.个体工商户 1.有限责任公司 2.独资企业 3.自然人经营
*/
private long partyb_type;
/**
* 品牌使用费比例默认值0.05
*/
private double ppsyfbl;
/**
* 配送费率,默认值:以实际结算为准
*/
private String psfl;
/**
* 签署动作默认值PUBLIC_COMPANY,PUBLIC_OPERATOR
*/
private String qsdz;
/**
* 合同开始日期
*/
private String qsrq;
/**
* 签约类型,0.转让 1.新签 2.续签 3.迁址 5.新签同异业转化
*/
private long qylx;
/**
* 契约锁电子印章默认值2731707107593166911
*/
private String qys_dzyz;
/**
* 契约锁电子合同分类默认值3051420203180101971
*/
private String qys_htywfl;
/**
* 非常规营业时间原因常规时间07:00-23:00
*/
private String reason2;
/**
* 备注说明
*/
private String remark;
/**
* 此店享受加盟费保证金优惠原因
*/
private String remark2;
/**
* 是否补签0.是 1.否
*/
private long sfbq__add;
/**
* 营业开始时间
*/
private String sj1;
/**
* 营业结束时间
*/
private String sj2;
/**
* 社会信用代码
*/
private String social_credit_code;
/**
* 食品流通许可证
*/
private List<String> spltxkz;
/**
* 申请人姓名
*/
private String sqr_name;
/**
* 申请日期
*/
private String sqrq;
/**
* 第一年度开始时间
*/
private String start1;
/**
* 第二年度开始时间
*/
private String start2;
/**
* 第三年度开始时间
*/
private String start3;
/**
* 流程标题特许经营合同审批申请2023-{申请人姓名}-{申请日期yyyy-MM-dd}
*/
private String title;
/**
* 物理印章编码,默认值:201905081151092R
*/
private String wlyzbm;
/**
* 用印次数
*/
private long yycs;
/**
* 营业执照办理授权书
*/
private List<String> yyzzblsqs;
/**
* 营业执照复印件,上传文件
*/
private List<String> yyzzfyj;
/**
* 支行
*/
private String zhihang;
/**
* SAP签约类型与签约类型关联A104-转让 A101-新签 A102-续签 A103-迁址 A105-同业转换
* 签约类型 SAP签约类型
* 0 A104
* 1 A101
* 2 A102
* 3 A103
* 5 A105
*/
private String zqyty;
}

View File

@@ -0,0 +1,266 @@
package com.cool.store.request;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.entity.PointInfoDO;
import com.cool.store.entity.RegionDO;
import lombok.Data;
import java.util.List;
@Data
public class NewStoreRequest {
/**
* 选址确认书(加盟商签字版)上传文件
*/
private List<String> accessory_address;
/**
* 流程发起人工号
*/
private String apply_user;
/**
* 所在市
*/
private String city1;
/**
* 所属大区的ehr编码
*/
private String csgs;
/**
* 次商圈名称 10-社区型;20-商业街边型;30-学校型;40-CBD/办公型;60-医院型;70-菜场型
*/
private String csqmc;
/**
* 督导
*/
private String ddxm;
/**
* 店铺租赁合同 上传文件
*/
private List<String> dpzlht;
/**
* 营业结束时间
*/
private String end_time;
/**
* 预估营业额
*/
private Integer forecast_turnover;
/**
* 门店邀约人
*/
private String invite_people;
/**
* 加盟商编号
*/
private String jms_id;
/**
* 加盟商客户登记表(完整截图)上传图片
*/
private List<String> jmskhdjbwzjt;
/**
* 加盟商类型
* 0-新加盟商开单店;1-老加盟商开单店;2-新加盟商开新区域单店;3-新加盟商开老区域单店;4-老加盟商开新区域单店;5-老加盟商开老区域单店;6-直营门店;7-同异业转化;8-老加盟商迁址开新店
*/
private Integer join_channel;
/**
* 竞争对手名称
*/
private String jzdsmc;
/**
* 酷店掌业务id
*/
private String kdzBusinessId;
/**
* 客流量指数名称
*/
private String kllzsmc;
/**
* 房东姓名
*/
private String landlord_name;
/**
* 房东联系方式
*/
private String landlord_tel;
/**
* 门店选址人工号
*/
private String location_people;
/**
* 门店月租金
*/
private Integer mdyzj;
/**
* 招商工号
*/
private String merchant_people;
/**
* 门店名称
*/
private String name1;
/**
* 所在省
*/
private String regio;
/**
* 预约量房日期yyyy-MM-dd
*/
private String reservation_date;
/**
* 合同交房日期yyyy-MM-dd
*/
private String room_date;
/**
* 上传建店须知 上传文件
*/
private List<String> scjdxz;
/**
* 签约日期yyyy-MM-dd
*/
private String signing_date;
/**
* 商圈门店类型
*/
private String sqmdlx;
/**
* 申请日期
*/
private String sqrq;
/**
* 大区
*/
private String ssdq;
/**
* 小区
*/
private String ssxq;
/**
* 战区
*/
private String sszq;
/**
* 营业起始时间
*/
private String start_time;
/**
* 此店保证金/元
*/
private Integer store_bzj;
/**
* 此店加盟费/元
*/
private Integer store_jmf;
/**
* 享受加盟费和保证金优惠原因
*/
private String store_reason;
/**
* 所在街道
*/
private String street;
/**
* 流程标题SAP-新店开业申请-{申请人姓名}-{申请日期yyyy-MM-dd}
*/
private String title;
/**
* 次商圈类型 10-社区型;20-商业街边型;30-学校型;40-CBD/办公型;60-医院型;70-菜场型
*/
private Integer zcsqlx;
/**
* 大区名称
*/
private String zdqms;
/**
* 是否货款控制:默认=YY-控制)
*/
private String zhkkz;
/**
* 加盟商编码
*/
private String zjmsbm;
/**
* 加盟商电话
*/
private String zmddh;
/**
* 门店经营者代码10-加盟商 20-店长
*/
private Integer zmdjyz;
/**
* 门店经营者10-加盟商 20-店长
*/
private String zmdjyz_name;
/**
* 门店性质代码:默认=20
*/
private Integer zmdxz;
/**
* 门店性质:默认=加盟
*/
private String zmdxz_name;
/**
* 营业状态:默认值=1010-营业)
*/
private Integer zmdzt;
/**
* 100米周末日均客流量指数
*/
private Integer zmrjkllzs1;
/**
* 品牌使用费费率
*/
private Double zppsyfy;
/**
* 所在区
*/
private String zq;
/**
* 主商圈名称 10-社区型;20-商业街边型;30-学校型;40-CBD/办公型;60-医院型;70-菜场型
*/
private String zsqmc;
/**
* 所属公司:默认值=10601060-鲜丰水果股份)
*/
private String zssgs;
/**
* 业务类型:默认=Z1
*/
private String ztype;
/**
* 周围500米内二手房均价
*/
private Integer zwesfj;
/**
* 小区名称
*/
private String zxqms;
/**
* 主要竞争品牌
*/
private String zxszyjzds;
/**
* 详细地址(路门牌号)
*/
private String zxxdz;
/**
* 线下主要竞争对手 10-品牌水果店;20-夫妻水果店;30-菜场店;40-大商超;50-生鲜店;60-无
*/
private Integer zxxzyjzds;
/**
* 门店编码
*/
private String zymdbm;
/**
* 战区名称
*/
private String zzqms;
/**
* 主商圈类型 10-社区型;20-商业街边型;30-学校型;40-CBD/办公型;60-医院型;70-菜场型
*/
private Integer zzsqlx;
}

View File

@@ -0,0 +1,75 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@ApiModel("提交证照办理请求体")
public class SubmitLicenseRequest {
@ApiModelProperty("营业执照拍照上传")
private String licenseUrl;
@ApiModelProperty("营业执照名称")
private String licenseName;
@ApiModelProperty("营业执照类型 0:有限责任公司 1:工体工商")
private Integer licenseType;
@ApiModelProperty("营业执照上的法人")
private String licenseLegalPerson;
@ApiModelProperty("统一社会信用代码")
private String socialCreditCode;
@ApiModelProperty("发证日期")
private Date issueTime;
@ApiModelProperty("营业执照经营场所")
private String licenseAddress;
@ApiModelProperty("有效期")
private Object validity;
@ApiModelProperty("法人双手持身份证正面+营业执照")
private String idCardAndLicense1;
@ApiModelProperty("法人双手持身份证反面+营业执照")
private String idCardAndLicense2;
@ApiModelProperty("食品经营许可证图片上传")
private String foodLicenseUrl;
@ApiModelProperty("经营者")
private String operator;
@ApiModelProperty("食品经营许可证上的法人")
private String foodLicenseLegalPerson;
@ApiModelProperty("食营经营场所")
private String businessPremises;
@ApiModelProperty("主体业态")
private String mainBusiness;
@ApiModelProperty("经营项目")
private String businessProject;
@ApiModelProperty("许可证编号")
private String foodLicenseCode;
@ApiModelProperty("许可证开始时间")
private Date foodLicenseStartTime;
@ApiModelProperty("许可证截止时间")
private Date foodLicenseEndTime;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("备注图片")
private String remarkUrl;
}

View File

@@ -0,0 +1,16 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class SysBuildResultRequest {
@ApiModelProperty("kdz业务id唯一标识")
private Long kdzBusinessId;
@ApiModelProperty("审核结果 1成功 0失败")
private Integer auditResult;
@ApiModelProperty("通过/失败原因")
private String cause = "";
@ApiModelProperty("门店编码")
private String storeNum;
}

View File

@@ -0,0 +1,138 @@
package com.cool.store.request;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@ApiModel("系统建店申请")
public class SysStoreAppRequest {
@ApiModelProperty("主键id")
private Long id;
@ApiModelProperty("线索id")
private Long lineId;
@ApiModelProperty("筹建门店id")
private Long shopId;
private FranInfo franInfo;
private StoreDetail storeDetail;
private SupervisorDetail supervisorDetail;
@Data
@ApiModel("加盟商信息")
public static class FranInfo {
@ApiModelProperty("加盟商类型" +
"0-新加盟商开单店;1-老加盟商开单店;" +
"2-新加盟商开新区域单店;" +
"3-新加盟商开老区域单店;" +
"4-老加盟商开新区域单店;" +
"5-老加盟商开老区域单店;" +
"6-直营门店;" +
"7-同异业转化;" +
"8-老加盟商迁址开新店")
private Integer franchiseeType;
@ApiModelProperty("门店邀约人id")
private String inviteUserId;
@ApiModelProperty("门店邀约人姓名")
private String storeInviteesName;
}
@Data
@ApiModel("门店信息")
public static class StoreDetail{
@ApiModelProperty("门店性质")
private Integer storeNature;
@ApiModelProperty("门店经营者")
private Integer storeOperator;
@ApiModelProperty("门店名称(默认带入一个门店名称,但是可修改)")
private String storeName;
@ApiModelProperty("大区描述")
private String bigDesc;
@ApiModelProperty("大区名称")
private String bigName;
@ApiModelProperty("大区code")
private String bigCode;
@ApiModelProperty("战区描述")
private String fightDesc;
@ApiModelProperty("战区描述")
private String fightCode;
@ApiModelProperty("战区名称")
private String fightName;
@ApiModelProperty("小区code")
private String smallCode;
@ApiModelProperty("小区描述")
private String smallDesc;
@ApiModelProperty("小区名称")
private String smallName;
@ApiModelProperty("主商圈类型 10-社区型;20-商业街边型;30-学校型;40-CBD/办公型;60-医院型;70-菜场型")
private Integer mainBusinessType;
@ApiModelProperty("次商圈类型 10-社区型;20-商业街边型;30-学校型;40-CBD/办公型;60-医院型;70-菜场型")
private Integer subBusinessType;
@ApiModelProperty("线下主要竞争对手 10-品牌水果店;20-夫妻水果店;30-菜场店;40-大商超;50-生鲜店;60-无")
private Integer offlineCompetitor;
@ApiModelProperty("线下主要竞争品牌")
private String offlineCompetingBrand;
@ApiModelProperty("周边500米内二手房均价")
private Integer averagePriceSh;
@ApiModelProperty("100米周末日均客流量指数 01000以下 11000-1万 21万以上")
private Integer averageDailyRs;
@ApiModelProperty("商圈门店类型 普通社区店 高档社区店")
private String businessStoreType;
@ApiModelProperty("预估营业额")
private Integer estimatedTurnover;
@ApiModelProperty("签约日期")
private Date signDate;
@ApiModelProperty("房东姓名")
private String landlordName;
@ApiModelProperty("合同交房日期")
private Date contractDeliveryDate;
@ApiModelProperty("房东联系电话")
private String landlordMobile;
@ApiModelProperty("预约量房日期")
private Date reservation;
@ApiModelProperty("门店月租金")
private Integer storeRent;
@ApiModelProperty("此店加盟费")
private Integer storeFranchiseFee;
@ApiModelProperty("此店保证金")
private Integer storeSecurityDeposit;
@ApiModelProperty("享受加盟费和保证金优惠原因")
private String reasons;
}
@Data
@ApiModel("督导相关信息")
public static class SupervisorDetail{
@ApiModelProperty("督导姓名")
private String supervisorName;
@ApiModelProperty("督导工号")
private String supervisorId;
@ApiModelProperty("大区总姓名")
private String regioGeneral;
@ApiModelProperty("大区总工号")
private String regioGeneralId;
}
}

View File

@@ -28,11 +28,9 @@ public class UpdateRentContractRequest {
@ApiModelProperty("租赁id")
private Long rentId;
@NotNull
@ApiModelProperty("店铺id")
private Long shopId;
@NotNull
@ApiModelProperty("铺位id")
private Long pointId;
@@ -79,9 +77,6 @@ public class UpdateRentContractRequest {
if(Objects.isNull(rentId)){
return false;
}
if(Objects.isNull(shopId) || Objects.isNull(pointId)){
return false;
}
if(RentTypeEnum.OWN.getCode().equals(rentType)){
if(CollectionUtils.isEmpty(houseCertificatePic) || houseCertificatePic.size() > 3){
return false;

View File

@@ -0,0 +1,154 @@
package com.cool.store.response;
import com.cool.store.entity.SystemBuildingShopDO;
import com.cool.store.request.SysStoreAppRequest;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.Objects;
@Data
public class SysStoreAppResponse {
@ApiModelProperty("主键id")
private Long id;
@ApiModelProperty("线索id")
private Long lineId;
@ApiModelProperty("筹建门店id")
private Long shopId;
private Long auditId;
private FranInfo franInfo;
private StoreDetail storeDetail;
private SupervisorDetail supervisorDetail;
@Data
@ApiModel("加盟商信息")
public static class FranInfo {
@ApiModelProperty("加盟商姓名")
private String franchiseeName;
@ApiModelProperty("所属大区")
private String subregion;
@ApiModelProperty("加盟商编码")
private String partnerNum;
@ApiModelProperty("加盟商电话")
private String franchiseeMobile;
@ApiModelProperty("加盟商类型" +
"0-新加盟商开单店;1-老加盟商开单店;" +
"2-新加盟商开新区域单店;" +
"3-新加盟商开老区域单店;" +
"4-老加盟商开新区域单店;" +
"5-老加盟商开老区域单店;" +
"6-直营门店;" +
"7-同异业转化;" +
"8-老加盟商迁址开新店")
private Integer franchiseeType;
@ApiModelProperty("门店邀约人id")
private String inviteUserId;
@ApiModelProperty("门店邀约人姓名")
private String storeInviteesName;
}
@Data
@ApiModel("门店信息")
public static class StoreDetail{
@ApiModelProperty("门店性质")
private Integer storeNature;
@ApiModelProperty("门店经营者")
private Integer storeOperator;
@ApiModelProperty("门店名称(默认带入一个门店名称,但是可修改)")
private String storeName;
@ApiModelProperty("大区描述")
private String bigDesc;
@ApiModelProperty("大区名称")
private String bigName;
@ApiModelProperty("大区code")
private String bigCode;
@ApiModelProperty("战区描述")
private String fightDesc;
@ApiModelProperty("战区描述")
private String fightCode;
@ApiModelProperty("战区名称")
private String fightName;
@ApiModelProperty("小区code")
private String smallCode;
@ApiModelProperty("小区描述")
private String smallDesc;
@ApiModelProperty("小区名称")
private String smallName;
@ApiModelProperty("主商圈类型 10-社区型;20-商业街边型;30-学校型;40-CBD/办公型;60-医院型;70-菜场型")
private Integer mainBusinessType;
@ApiModelProperty("次商圈类型 10-社区型;20-商业街边型;30-学校型;40-CBD/办公型;60-医院型;70-菜场型")
private Integer subBusinessType;
@ApiModelProperty("线下主要竞争对手 10-品牌水果店;20-夫妻水果店;30-菜场店;40-大商超;50-生鲜店;60-无")
private Integer offlineCompetitor;
@ApiModelProperty("线下主要竞争品牌")
private String offlineCompetingBrand;
@ApiModelProperty("周边500米内二手房均价")
private Integer averagePriceSh;
@ApiModelProperty("100米周末日均客流量指数 01000以下 11000-1万 21万以上")
private Integer averageDailyRs;
@ApiModelProperty("商圈门店类型 普通社区店 高档社区店")
private String businessStoreType;
@ApiModelProperty("预估营业额")
private Integer estimatedTurnover;
@ApiModelProperty("签约日期")
private Date signDate;
@ApiModelProperty("房东姓名")
private String landlordName;
@ApiModelProperty("合同交房日期")
private Date contractDeliveryDate;
@ApiModelProperty("房东联系电话")
private String landlordMobile;
@ApiModelProperty("预约量房日期")
private Date reservation;
@ApiModelProperty("门店月租金")
private Integer storeRent;
@ApiModelProperty("此店加盟费")
private Integer storeFranchiseFee;
@ApiModelProperty("此店保证金")
private Integer storeSecurityDeposit;
@ApiModelProperty("享受加盟费和保证金优惠原因")
private String reasons;
}
@Data
@ApiModel("督导相关信息")
public static class SupervisorDetail{
@ApiModelProperty("督导姓名")
private String supervisorName;
@ApiModelProperty("督导工号")
private String supervisorId;
@ApiModelProperty("大区总姓名")
private String regioGeneral;
@ApiModelProperty("大区总工号")
private String regioGeneralId;
}
}

View File

@@ -82,9 +82,7 @@ public class ShopRentInfoVO {
result.setSignTime(shopRentInfo.getSignTime());
if(RentTypeEnum.RENT.getCode().equals(shopRentInfo.getRentType())){
result.setContractStartTime(shopRentInfo.getContractStartTime());
LocalDate start = shopRentInfo.getContractStartTime().toInstant().atZone(java.time.ZoneId.systemDefault()).toLocalDate();
Instant instant = start.plusMonths(shopRentInfo.getContractMonths()).minusDays(1L).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant();
result.setContractEndTime(Date.from(instant));
result.setContractEndTime(shopRentInfo.getContractEndTime());
result.setContractMonths(shopRentInfo.getContractMonths());
}
result.setShopRentType(shopRentInfo.getShopRentType());

View File

@@ -1,7 +1,9 @@
package com.cool.store.service;
import com.cool.store.enums.IDCardSideEnum;
import com.cool.store.enums.SmsCodeTypeEnum;
import com.cool.store.exception.ApiException;
import com.cool.store.response.ResponseResult;
import com.cool.store.vo.BusinessLicenseInfoVO;
import com.cool.store.vo.IdentityCardInfoVO;
@@ -15,5 +17,21 @@ public interface AliyunService {
*/
IdentityCardInfoVO getIdentityCardInfo(String faceImageUrl, IDCardSideEnum sideEnum) throws ApiException;
/**
* ORC识别证照
* @param imageUrl
* @return
* @throws ApiException
*/
BusinessLicenseInfoVO getBusinessLicenseInfo(String imageUrl) throws ApiException;
/**
* 发送短信
* @param mobile
* @param codeType
* @return
*/
ResponseResult sendMessage(String mobile, SmsCodeTypeEnum codeType);
}

View File

@@ -0,0 +1,30 @@
package com.cool.store.service;
import com.cool.store.request.FranchiseAgreementRequest;
import com.cool.store.request.NewStoreRequest;
import com.cool.store.response.ResponseResult;
/**
* 鲜丰水果API筹备相关
* https://apifox.com/apidoc/shared-c48218f7-4a34-4422-8689-927502f171ff/api-164932487
* 密码aJJq9F7k
*/
public interface CoolStoreStartFlowService {
/**
* 新店开业流程
* @param request
* @return
*/
ResponseResult newStore(NewStoreRequest request);
/**
*特许经营合同
* @param request
* @param type 0个人 1企业
* @return
*/
ResponseResult franchiseAgreement(FranchiseAgreementRequest request,Integer type);
}

View File

@@ -1,7 +1,14 @@
package com.cool.store.service;
import com.cool.store.request.AuditResultRequest;
import com.cool.store.request.SysBuildResultRequest;
public interface KdzApiService {
/**
* API审批
* @param request
* @return
*/
boolean auditResult(AuditResultRequest request);
}

View File

@@ -36,7 +36,7 @@ public interface LineService {
* @param loginUserInfo
* @return
*/
PageInfo<PublicLineListVO> getPublicLineList(PublicLineListRequest publicLineListRequest, LoginUserInfo loginUserInfo);
PageInfo<PublicLineListVO> getPublicLineList(PublicLineListRequest publicLineListRequest, LoginUserInfo loginUserInfo ,Boolean publicFlag);
/**

View File

@@ -37,7 +37,7 @@ public interface PointService {
* @param shopPointDetailRequest
* @return
*/
Integer updatePointDetailInfo(UpdatePointDetailRequest shopPointDetailRequest);
Long updatePointDetailInfo(UpdatePointDetailRequest shopPointDetailRequest);
/**
* 生成铺位评估报告

View File

@@ -0,0 +1,18 @@
package com.cool.store.service;
import com.cool.store.request.SysStoreAppRequest;
import com.cool.store.response.ResponseResult;
import com.cool.store.response.SysStoreAppResponse;
public interface SysStoreAppService {
/**
* 提交系统建店申请
* @param request
* @return
*/
ResponseResult submitSysBuildStore(SysStoreAppRequest request);
SysStoreAppResponse getDefaultValueSysBuildStore(Long lineId, Long shopId);
}

View File

@@ -2,10 +2,14 @@ package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.aliyun.ocr20191230.models.*;
import com.aliyuncs.CommonRequest;
import com.aliyuncs.http.MethodType;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.IDCardSideEnum;
import com.cool.store.enums.SmsCodeTypeEnum;
import com.cool.store.exception.ApiException;
import com.cool.store.exception.ServiceException;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.AliyunService;
import com.cool.store.utils.poi.StringUtils;
import com.cool.store.vo.BusinessLicenseInfoVO;
@@ -33,6 +37,9 @@ public class AliyunServiceImpl implements AliyunService {
@Value("${aliyun.accessKeySecret:null}")
private String accessKeySecret;
// @Value("${aliyun.sms.domain}")
private String smsDomain;
@Override
@@ -133,4 +140,17 @@ public class AliyunServiceImpl implements AliyunService {
throw new ApiException(e.getMessage());
}
}
@Override
public ResponseResult sendMessage(String mobile, SmsCodeTypeEnum codeType) {
String msgKey = codeType + ":" + mobile;
CommonRequest request = new CommonRequest();
request.setSysMethod(MethodType.POST);
request.setSysDomain(smsDomain);
request.setSysVersion("2017-05-25");
request.setSysAction("SendSms");
return null;
}
}

View File

@@ -0,0 +1,10 @@
package com.cool.store.service.impl;
import com.cool.store.request.AuditResultRequest;
import org.springframework.stereotype.Service;
@Service("AuditResultService")
public interface AuditResultService {
Boolean auditResult(AuditResultRequest request);
}

View File

@@ -10,6 +10,7 @@ import com.cool.store.dao.EnterpriseUserDAO;
import com.cool.store.dto.message.SendMessageDTO;
import com.cool.store.enums.*;
import com.cool.store.mq.producer.SimpleMessageService;
import com.cool.store.request.AuditResultRequest;
import com.cool.store.utils.UUIDUtils;
import com.cool.store.utils.poi.constant.Constants;
import com.google.gson.Gson;
@@ -68,6 +69,12 @@ public class CommonService {
return (LineFlowService)applicationContext.getBean(workflowSubStageEnum.getClazz());
}
public AuditResultService getAuditService(AuditResultRequest request) {
String flag = splitMethod(request.getKdzBusinessId());
AuditEnum auditEnum = AuditEnum.getWorkflowSubStageEnum(flag);
return (AuditResultService) applicationContext.getBean(auditEnum.getClazz());
}
public void sendMessage(List<String> userIds, Long lineId, MessageEnum message, String... param){
if(CollectionUtils.isEmpty(userIds)){
return;
@@ -140,4 +147,13 @@ public class CommonService {
}
}
public static String splitMethod(String kdzBusinessId) {
String[] split = kdzBusinessId.split(Constants.D_LINE);
if (split.length >= 2) {
return split[0];
} else {
return null;
}
}
}

View File

@@ -0,0 +1,83 @@
package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.mq.util.HttpRestTemplateService;
import com.cool.store.request.FranchiseAgreementRequest;
import com.cool.store.request.NewStoreRequest;
import com.cool.store.response.InitiatingResponse;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.CoolStoreStartFlowService;
import com.cool.store.utils.SecureUtil;
import com.cool.store.utils.poi.constant.Constants;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@Service
@Slf4j
public class CoolStoreStartFlowServiceImpl implements CoolStoreStartFlowService {
@Value("${xfsg.url}")
private String xfsgUrl;
@Resource
private HttpRestTemplateService httpRestTemplateService;
@Override
public ResponseResult newStore(NewStoreRequest request) {
log.info("newStore param:{}", JSONObject.toJSONString(request));
if (Objects.isNull(request)) {
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
}
Map<String, Object> requestMap = new HashMap<>();
fillSignatureInfo(requestMap);
String url = xfsgUrl + Constants.NEW_STORE_URL + "?timestamp=" + requestMap.get("timestamp") + "&signature=" + requestMap.get("signature");
InitiatingResponse initiatingResponse = httpRestTemplateService.postForObject(url, request, InitiatingResponse.class);
log.info("newStore API response:{}",JSONObject.toJSONString(initiatingResponse));
if (initiatingResponse.getCode() != 0L){
return new ResponseResult(500,initiatingResponse.getMsg(),initiatingResponse.getData());
}else {
return new ResponseResult(200000,initiatingResponse.getMsg(),initiatingResponse.getData());
}
}
@Override
public ResponseResult franchiseAgreement(FranchiseAgreementRequest request, Integer type) {
log.info("newStore param:{}", JSONObject.toJSONString(request));
if (Objects.isNull(request)) {
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
}
Map<String, Object> requestMap = new HashMap<>();
fillSignatureInfo(requestMap);
String url = null;
if (Constants.ONE_INTEGER == type){
url = xfsgUrl + Constants.FRANCHISE_AGREEMENT_COMPANY + "?timestamp=" + requestMap.get("timestamp") + "&signature=" + requestMap.get("signature");
}else if (Constants.ZERO_INTEGER == type){
url = xfsgUrl + Constants.FRANCHISE_AGREEMENT_PERSON + "?timestamp=" + requestMap.get("timestamp") + "&signature=" + requestMap.get("signature");
}
InitiatingResponse initiatingResponse = httpRestTemplateService.postForObject(url, request, InitiatingResponse.class);
log.info("franchiseAgreement API response:{}",JSONObject.toJSONString(initiatingResponse));
if (initiatingResponse.getCode() != 0L){
return new ResponseResult(500,initiatingResponse.getMsg(),initiatingResponse.getData());
}else {
return new ResponseResult(200000,initiatingResponse.getMsg(),initiatingResponse.getData());
}
}
private void fillSignatureInfo(Map<String, Object> requestMap) {
long timestamp = System.currentTimeMillis();
String signature = SecureUtil.getSignature(timestamp);
requestMap.put("timestamp", timestamp);
requestMap.put("signature", signature);
}
}

View File

@@ -1,21 +1,15 @@
package com.cool.store.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dao.LineInfoDAO;
import com.cool.store.entity.*;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.ReceivingBankEnum;
import com.cool.store.enums.WorkflowSubStageEnum;
import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.enums.*;
import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.*;
import com.cool.store.mq.util.HttpRestTemplateService;
import com.cool.store.request.FranchiseeSaveRequest;
import com.cool.store.request.InitiatingRequest;
import com.cool.store.request.IntentAgreementSubmitRequest;
import com.cool.store.request.*;
import com.cool.store.response.InitiatingResponse;
import com.cool.store.response.ResponseResult;
import com.cool.store.response.SigningBaseInfoResponse;
@@ -39,7 +33,7 @@ import java.util.Objects;
@Service
@Slf4j
public class IntentAgreementServiceImpl extends LineFlowService implements IntentAgreementService {
public class IntentAgreementServiceImpl extends LineFlowService implements IntentAgreementService, AuditResultService {
@Resource
@@ -72,6 +66,9 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
@Resource
RedisUtilPool redisUtilPool;
@Resource
private CommonService commonService;
@Override
@Transactional(rollbackFor = Exception.class)
@@ -121,7 +118,7 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
}
@Override
protected Boolean auditPass(Long auditId, LineInfoDO lineInfo,String userId) {
protected Boolean auditPass(Long auditId, LineInfoDO lineInfo, String userId) {
//校验是否是审核节点
if (!lineInfo.getWorkflowSubStageStatus().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode()) &&
!lineInfo.getWorkflowSubStageStatus().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode())) {
@@ -137,7 +134,7 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
WorkflowSubStageEnum workflowSubStageEnum = WorkflowSubStageEnum.getWorkflowSubStageEnum(lineInfo.getWorkflowSubStage());
WorkflowSubStageEnum nextStage = workflowSubStageEnum.getNextStage();
//更新线索阶段
lineInfoDAO.updateWorkflowStage(lineInfo.getId(), nextStage, nextStage.getInitStatus(),userId);
lineInfoDAO.updateWorkflowStage(lineInfo.getId(), nextStage, nextStage.getInitStatus(), userId);
}
//更新auditId
SigningBaseInfoDO signingBaseInfoDO = intentAgreementMapper.selectByPartnerIdOrLineId(null, lineInfo.getId());
@@ -150,7 +147,7 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
}
@Override
protected Boolean auditReject(Long auditId, LineInfoDO lineInfo,String userId) {
protected Boolean auditReject(Long auditId, LineInfoDO lineInfo, String userId) {
if ((!lineInfo.getWorkflowSubStageStatus().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode()) &&
!lineInfo.getWorkflowSubStageStatus().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode()))) {
throw new ServiceException(ErrorCodeEnum.NOT_APPROVE_NODE);
@@ -185,24 +182,24 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
InitiatingDO initiatingDO = request.toInitiatingDO();
// LoginUserInfo user = CurrentUserHolder.getUser();
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(request.getLineId());
initiatingDO.setKdzBusinessId(lineInfoDO.getId() + "_" + lineInfoDO.getWorkflowSubStageStatus());
initiatingDO.setKdzBusinessId(AuditEnum.CONTRACT_INTENTION.getCode() + "_" + lineInfoDO.getId() + "_" + lineInfoDO.getWorkflowSubStageStatus());
InitiatingResponse initiatingResponse = httpRestTemplateService.postForObject(url, initiatingDO, InitiatingResponse.class);
if (initiatingResponse.getCode() != 0L){
return new ResponseResult(500,initiatingResponse.getMsg(),initiatingResponse.getData());
}else {
String redisKey = "OA:"+request.getMobile()+request.getIdCardNo();
redisUtilPool.setString(redisKey,JSONObject.toJSONString(request));
if (initiatingResponse.getCode() != 0L) {
return new ResponseResult(500, initiatingResponse.getMsg(), initiatingResponse.getData());
} else {
String redisKey = "OA:" + request.getMobile() + request.getIdCardNo();
redisUtilPool.setString(redisKey, JSONObject.toJSONString(request));
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode());
lineInfoMapper.updateByPrimaryKeySelective(lineInfoDO);
return new ResponseResult(200000,initiatingResponse.getMsg(),initiatingResponse.getData());
return new ResponseResult(200000, initiatingResponse.getMsg(), initiatingResponse.getData());
}
}
@Override
public InitiatingRequest getOaDetail(String mobile, String idCardNo) {
String redisKey = "OA:"+mobile+idCardNo;
String redisKey = "OA:" + mobile + idCardNo;
String responseString = redisUtilPool.getString(redisKey);
if (StringUtils.isNotBlank(responseString)){
if (StringUtils.isNotBlank(responseString)) {
InitiatingRequest initiatingRequest = JSONObject.parseObject(responseString, InitiatingRequest.class);
return initiatingRequest;
}
@@ -221,7 +218,7 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
FranchiseeDO franchiseeDO = request.toFranchiseeDO();
//查银行信息
LinePayDO linePayDO = linePayMapper.getLinePayByLineId(request.getLineId());
if (Objects.isNull(linePayDO)){
if (Objects.isNull(linePayDO)) {
throw new ServiceException(ErrorCodeEnum.LINE_PAY_FALSE);
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -232,7 +229,7 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
franchiseeDO.setBankSub(linePayDO.getBranchBankCode());
//查城市信息
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(request.getLineId());
if (Objects.isNull(lineInfoDO)){
if (Objects.isNull(lineInfoDO)) {
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
}
HyOpenAreaInfoDO openAreaInfoDO = openAreaInfoMapper.selectById(lineInfoDO.getWantShopAreaId());
@@ -243,7 +240,7 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
franchiseeDO.setOperator("22090043");
InitiatingResponse initiatingResponse = httpRestTemplateService.postForObject(url, franchiseeDO, InitiatingResponse.class);
//更新线索(进入蓄水池并回填加盟商编码)
if (initiatingResponse.getCode() == 0){
if (initiatingResponse.getCode() == 0) {
LineInfoDO lineInfoParam = new LineInfoDO();
lineInfoParam.setId(request.getLineId());
//蓄水池
@@ -251,15 +248,52 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
lineInfoParam.setPartnerNum(initiatingResponse.getData());
lineInfoMapper.updateByPrimaryKeySelective(lineInfoParam);
}
if (initiatingResponse.getCode() != 0){
if (initiatingResponse.getCode() != 0) {
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode());
lineInfoMapper.updateByPrimaryKeySelective(lineInfoDO);
return new ResponseResult(500,initiatingResponse.getMessage(),initiatingResponse.getData());
}else {
return new ResponseResult(200000,initiatingResponse.getMessage(),initiatingResponse.getData());
return new ResponseResult(500, initiatingResponse.getMessage(), initiatingResponse.getData());
} else {
return new ResponseResult(200000, initiatingResponse.getMessage(), initiatingResponse.getData());
}
}
@Override
public Boolean auditResult(AuditResultRequest request) {
try {
String kdzBusinessId = request.getKdzBusinessId();
String lineId = getLineId(kdzBusinessId);
if (StringUtil.isBlank(lineId)) {
throw new ServiceException(ErrorCodeEnum.BUSINESS_ID_NOT_EXIST);
}
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(Long.valueOf(lineId));
if (Objects.isNull(lineInfoDO)) {
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
}
if (request.getAuditResult() == 1) {
AuditPassRequest auditPassRequest = new AuditPassRequest();
auditPassRequest.setLineId(lineInfoDO.getId());
auditPassRequest.setPassReason(request.getCause());
auditPassRequest.setWorkflowSubStage(lineInfoDO.getWorkflowSubStage());
commonService.getLineFlowService(auditPassRequest.getWorkflowSubStage()).auditPass(auditPassRequest, null);
} else if (request.getAuditResult() == 0) {
AuditRejectRequest auditRejectRequest = new AuditRejectRequest();
auditRejectRequest.setLineId(lineInfoDO.getId());
auditRejectRequest.setWorkflowSubStage(lineInfoDO.getWorkflowSubStage());
auditRejectRequest.setRejectPublicReason(request.getCause());
auditRejectRequest.setRejectRealReason(request.getFailureCause());
commonService.getLineFlowService(auditRejectRequest.getWorkflowSubStage()).auditReject(auditRejectRequest, null);
}
} catch (Exception e) {
throw new ServiceException(ErrorCodeEnum.UNKNOWN);
}
return true;
}
private String getLineId(String kdzBusinessId) {
String lindId = kdzBusinessId.substring(kdzBusinessId.indexOf("_") + 1, kdzBusinessId.lastIndexOf("_"));
return lindId;
}
private void fillSignatureInfo(Map<String, Object> requestMap) {
long timestamp = System.currentTimeMillis();
String signature = SecureUtil.getSignature(timestamp);

View File

@@ -1,15 +1,10 @@
package com.cool.store.service.impl;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.LineInfoMapper;
import com.cool.store.request.AuditPassRequest;
import com.cool.store.request.AuditRejectRequest;
import com.cool.store.request.AuditResultRequest;
import com.cool.store.service.KdzApiService;
import com.cool.store.utils.StringUtil;
import com.cool.store.utils.poi.constant.Constants;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@@ -20,53 +15,16 @@ import java.util.Objects;
@Slf4j
public class KdzApiServiceImpl implements KdzApiService {
@Resource
LineInfoMapper lineInfoMapper;
@Resource
private CommonService commonService;
@Override
public boolean auditResult(AuditResultRequest request) {
if (Objects.isNull(request) || StringUtil.isBlank(request.getKdzBusinessId())){
if (Objects.isNull(request) || StringUtil.isBlank(request.getKdzBusinessId())) {
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
}
String kdzBusinessId = request.getKdzBusinessId();
String lineId = splitMethod(kdzBusinessId);
if (StringUtil.isBlank(lineId)){
throw new ServiceException(ErrorCodeEnum.BUSINESS_ID_NOT_EXIST);
}
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(Long.valueOf(lineId));
if (Objects.isNull(lineInfoDO)){
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
}
try {
if (request.getAuditResult() == 1){
AuditPassRequest auditPassRequest = new AuditPassRequest();
auditPassRequest.setLineId(lineInfoDO.getId());
auditPassRequest.setPassReason(request.getCause());
auditPassRequest.setWorkflowSubStage(lineInfoDO.getWorkflowSubStage());
commonService.getLineFlowService(auditPassRequest.getWorkflowSubStage()).auditPass(auditPassRequest,null);
}else if (request.getAuditResult() == 0){
AuditRejectRequest auditRejectRequest = new AuditRejectRequest();
auditRejectRequest.setLineId(lineInfoDO.getId());
auditRejectRequest.setWorkflowSubStage(lineInfoDO.getWorkflowSubStage());
auditRejectRequest.setRejectPublicReason(request.getCause());
auditRejectRequest.setRejectRealReason(request.getFailureCause());
commonService.getLineFlowService(auditRejectRequest.getWorkflowSubStage()).auditReject(auditRejectRequest,null);
}
}catch (Exception e){
throw new ServiceException(ErrorCodeEnum.UNKNOWN);
}
return true;
Boolean result = commonService.getAuditService(request).auditResult(request);
return result;
}
public static String splitMethod(String kdzBusinessId){
String[] split = kdzBusinessId.split(Constants.D_LINE);
if (split.length >= 2){
return split[0];
}else {
return null;
}
}
}

View File

@@ -168,9 +168,9 @@ public class LineServiceImpl implements LineService {
}
@Override
public PageInfo<PublicLineListVO> getPublicLineList(PublicLineListRequest publicLineListRequest, LoginUserInfo loginUserInfo) {
public PageInfo<PublicLineListVO> getPublicLineList(PublicLineListRequest publicLineListRequest, LoginUserInfo loginUserInfo, Boolean publicFlag) {
PageHelper.startPage(publicLineListRequest.getPageNum(), publicLineListRequest.getPageSize());
List<LineInfoDO> lineInfoDOS = lineInfoDAO.publicLineList(publicLineListRequest);
List<LineInfoDO> lineInfoDOS = lineInfoDAO.publicLineList(publicLineListRequest,publicFlag);
PageInfo page = new PageInfo(lineInfoDOS);
Map<Long, HyPartnerLabelDO> userPortraitMap = deskService.getUserPortraitMap(lineInfoDOS);
List<Long> wantShopAreaIdList = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getWantShopAreaId() != null).map(LineInfoDO::getWantShopAreaId).collect(Collectors.toList());
@@ -314,7 +314,7 @@ public class LineServiceImpl implements LineService {
return null;
}
//总天数
Integer totalDays = 20;
Integer totalDays = 10;
IntendProcessTotalVO intendProcessTotalVO = new IntendProcessTotalVO();
intendProcessTotalVO.setTotalDays(totalDays);
intendProcessTotalVO.setCompletionTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,DateUtils.addDays(memberQuestionDO.getCreateTime(),totalDays)));
@@ -365,7 +365,7 @@ public class LineServiceImpl implements LineService {
for (WorkflowSubStageEnum workflowSubStageEnum : WorkflowSubStageEnum.values()) {
IntendProcessVO intend = getIntend(memberQuestionDO.getCreateTime(), workflowSubStageEnum);
if (map.get(workflowSubStageEnum.getCode())!=null){
intend.setActualTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,DateUtils.addDays(map.get(workflowSubStageEnum.getCode()),workflowSubStageEnum.getProgress())));
intend.setActualTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,map.get(workflowSubStageEnum.getCode())));
}
list.add(intend);
}

View File

@@ -123,12 +123,13 @@ public class PointServiceImpl implements PointService {
@Override
@Transactional(rollbackFor = Exception.class)
public Integer updatePointDetailInfo(UpdatePointDetailRequest shopPointDetailRequest) {
public Long updatePointDetailInfo(UpdatePointDetailRequest shopPointDetailRequest) {
PointInfoDO shopPointInfo = UpdatePointDetailRequest.convertPointDO(shopPointDetailRequest);
PointDetailInfoDO shopPoint = UpdatePointDetailRequest.convertDO(shopPointDetailRequest);
shopPointInfo.setPointScore(shopPoint.getTotalPointScore());
pointInfoDAO.updatePointInfo(shopPointInfo);
return pointDetailInfoDAO.updatePointDetailInfo(shopPoint);
pointDetailInfoDAO.updatePointDetailInfo(shopPoint);
return shopPointDetailRequest.getPointId();
}
@Override
@@ -476,6 +477,9 @@ public class PointServiceImpl implements PointService {
request.setRegionIds(regionService.getSubRegionIdsByRegionIds(request.getRegionIds()));
}
}
if(Objects.nonNull(request.getPointStatus()) && PointStatusEnum.POINT_STATUS_3.getCode().equals(request.getPointStatus())){
request.setPointStatus(PointStatusEnum.POINT_STATUS_4.getCode());
}
List<PointPageVO> resultList = new ArrayList();
Page<PointInfoDO> pointPage = pointInfoDAO.getTeamPointPage(request);
if(Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())){

View File

@@ -0,0 +1,402 @@
package com.cool.store.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.entity.*;
import com.cool.store.enums.AuditEnum;
import com.cool.store.enums.AuditTypeEnum;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.UserRoleEnum;
import com.cool.store.enums.prepare.newStore.BusinessDistrictEnum;
import com.cool.store.enums.prepare.newStore.OfflineCompetitorEnum;
import com.cool.store.enums.prepare.newStore.PassengerFlowEnum;
import com.cool.store.enums.prepare.newStore.StoreOperatorEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.*;
import com.cool.store.request.AuditResultRequest;
import com.cool.store.request.NewStoreRequest;
import com.cool.store.request.SysStoreAppRequest;
import com.cool.store.response.ResponseResult;
import com.cool.store.response.SysStoreAppResponse;
import com.cool.store.service.CoolStoreStartFlowService;
import com.cool.store.service.PreparationService;
import com.cool.store.service.SysStoreAppService;
import com.cool.store.service.UserAuthMappingService;
import com.cool.store.utils.poi.constant.Constants;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@Service
@Slf4j
public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultService {
@Resource
private CoolStoreStartFlowService coolStoreStartFlowService;
@Resource
private SystemBuildingShopMapper systemBuildingShopMapper;
@Resource
private LineInfoMapper lineInfoMapper;
@Resource
PointInfoMapper pointInfoMapper;
@Resource
RegionMapper regionMapper;
@Resource
ThirdDepartmentMapper thirdDepartmentMapper;
@Resource
EnterpriseUserMapper enterpriseUserMapper;
@Resource
UserAuthMappingService userAuthMappingService;
@Resource
PreparationService preparationService;
@Resource
ShopAuditInfoMapper shopAuditInfoMapper;
@Resource
ShopInfoMapper shopInfoMapper;
@Override
@Transactional(rollbackFor = Exception.class)
public ResponseResult submitSysBuildStore(SysStoreAppRequest request) {
log.info("submitSysBuildStore request :{}", JSONObject.toJSONString(request));
if (Objects.isNull(request)) {
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
}
//1.操作数据库
SystemBuildingShopDO systemBuildingShopDO = SystemBuildingShopDO.convertToSystemBuildingShopDO(request);
if (request.getId() == null) {
systemBuildingShopMapper.insertSelective(systemBuildingShopDO);
} else {
systemBuildingShopDO.setId(request.getId());
systemBuildingShopMapper.updateByPrimaryKeySelective(systemBuildingShopDO);
}
//2.查找、组装数组
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(request.getLineId());//线索信息
PointInfoDO pointInfoDO = pointInfoMapper.getDataByShopIdAndLineId(request.getLineId(), request.getShopId());//查铺位信息确定铺位所在大区、战区、门店所在省市区街道地址
//3.请求鲜丰接口
NewStoreRequest apiRequest = convertToNewStoreRequest(request,lineInfoDO,pointInfoDO);
return coolStoreStartFlowService.newStore(apiRequest);
}
@Override
public SysStoreAppResponse getDefaultValueSysBuildStore(Long lineId, Long shopId) {
SysStoreAppResponse sysStoreAppResponse = new SysStoreAppResponse();
//1.查找数据
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(lineId);
SystemBuildingShopDO systemBuildingShopDO = SystemBuildingShopDO.builder().lineId(lineId).shopId(shopId).build();
systemBuildingShopDO = systemBuildingShopMapper.selectOne(systemBuildingShopDO);
PointInfoDO pointInfoDO = pointInfoMapper.getDataByShopIdAndLineId(lineId, shopId);
//2.组装数据并返回
sysStoreAppResponse = polymerization(sysStoreAppResponse,systemBuildingShopDO,lineInfoDO,pointInfoDO);
return sysStoreAppResponse;
}
/**
* 聚合返回体
* @param systemBuildingShopDO
* @param lineInfoDO
*/
private SysStoreAppResponse polymerization(SysStoreAppResponse sysStoreAppResponse,
SystemBuildingShopDO systemBuildingShopDO,
LineInfoDO lineInfoDO,
PointInfoDO pointInfoDO) {
sysStoreAppResponse = from(systemBuildingShopDO,lineInfoDO,pointInfoDO);
return sysStoreAppResponse;
}
public SysStoreAppResponse from(SystemBuildingShopDO systemBuildingShopDO,
LineInfoDO lineInfoDO,
PointInfoDO pointInfoDO) {
SysStoreAppResponse.FranInfo franInfo = new SysStoreAppResponse.FranInfo();
SysStoreAppResponse.StoreDetail storeDetail = new SysStoreAppResponse.StoreDetail();
SysStoreAppResponse.SupervisorDetail supervisorDetail = new SysStoreAppResponse.SupervisorDetail();
SysStoreAppResponse sysStoreAppResponse = new SysStoreAppResponse();
Long regionId = pointInfoDO.getRegionId();
RegionDO bigRegion = regionMapper.getBigRegionByRegionId(regionId);//大区
RegionDO fightRegion = regionMapper.getByRegionId(regionId);//战区
EnterpriseUserDO enterpriseUserDO = userAuthMappingService.getUserByRoleEnumAndRegionId(UserRoleEnum.REGION_MANAGER, bigRegion.getId());
if (Objects.nonNull(enterpriseUserDO)){
// supervisorName
supervisorDetail.setSupervisorName(enterpriseUserDO.getName());
// supervisorId
supervisorDetail.setSupervisorId(enterpriseUserDO.getUserId());
}
if (Objects.nonNull(bigRegion)){
storeDetail.setBigName(bigRegion.getName());
storeDetail.setBigCode(bigRegion.getSynDingDeptId());
}
if (Objects.nonNull(fightRegion)){
storeDetail.setFightName(fightRegion.getName());
storeDetail.setFightCode(fightRegion.getSynDingDeptId());
}
if (Objects.nonNull(systemBuildingShopDO)){
sysStoreAppResponse.setId(systemBuildingShopDO.getId());
sysStoreAppResponse.setLineId(systemBuildingShopDO.getLineId());
sysStoreAppResponse.setShopId(systemBuildingShopDO.getShopId());
sysStoreAppResponse.setAuditId(systemBuildingShopDO.getAuditId());
franInfo.setFranchiseeType(systemBuildingShopDO.getFranchiseeType());
franInfo.setStoreInviteesName(systemBuildingShopDO.getStoreInviteesName());
franInfo.setInviteUserId(systemBuildingShopDO.getStoreInviteesId());
storeDetail.setStoreNature(systemBuildingShopDO.getStoreNature());
storeDetail.setStoreOperator(systemBuildingShopDO.getStoreOperator());
// bigDesc
storeDetail.setBigDesc(systemBuildingShopDO.getBigDesc());
// fightDesc
storeDetail.setFightDesc(systemBuildingShopDO.getFightDesc());
// smallCode
storeDetail.setSmallCode(systemBuildingShopDO.getSmallCode());
// smallDesc
storeDetail.setSmallDesc(systemBuildingShopDO.getSmallDesc());
// smallName
storeDetail.setSmallName(systemBuildingShopDO.getSmallDesc());
// mainBusinessType
storeDetail.setMainBusinessType(systemBuildingShopDO.getMainBusinessType());
// subBusinessType
storeDetail.setSubBusinessType(systemBuildingShopDO.getSubBusinessType());
// offlineCompetitor
storeDetail.setOfflineCompetitor(systemBuildingShopDO.getOfflineCompetitor());
// offlineCompetingBrand
storeDetail.setOfflineCompetingBrand(systemBuildingShopDO.getOfflineCompetingBrand());
// averagePriceSh
storeDetail.setAveragePriceSh(systemBuildingShopDO.getAveragePriceSh());
// averageDailyRs
storeDetail.setAverageDailyRs(systemBuildingShopDO.getAverageDailyRs());
// businessStoreType
storeDetail.setBusinessStoreType(systemBuildingShopDO.getBusinessStoreType());
// estimatedTurnover
storeDetail.setEstimatedTurnover(systemBuildingShopDO.getEstimatedTurnover());
// signDate
storeDetail.setSignDate(systemBuildingShopDO.getSignDate());
// landlordName
storeDetail.setLandlordName(systemBuildingShopDO.getLandlordName());
// contractDeliveryDate
storeDetail.setContractDeliveryDate(systemBuildingShopDO.getContractDeliveryDate());
// landlordMobile
storeDetail.setLandlordMobile(systemBuildingShopDO.getLandlordMobile());
// reservation
storeDetail.setReservation(systemBuildingShopDO.getReservation());
// storeRent
storeDetail.setStoreRent(systemBuildingShopDO.getStoreRent());
// storeFranchiseFee
storeDetail.setStoreFranchiseFee(systemBuildingShopDO.getStoreFranchiseFee());
// storeSecurityDeposit
storeDetail.setStoreSecurityDeposit(systemBuildingShopDO.getStoreSecurityDeposit());
// reasons
storeDetail.setReasons(systemBuildingShopDO.getReasons());
// regioGeneral
supervisorDetail.setRegioGeneral(systemBuildingShopDO.getRegioGeneral());
// regioGeneralId
supervisorDetail.setRegioGeneralId(systemBuildingShopDO.getRegioGeneralId());
}
if (Objects.nonNull(lineInfoDO)){
RegionDO byRegionId = regionMapper.getByRegionId(lineInfoDO.getRegionId());
franInfo.setSubregion(byRegionId.getName());
franInfo.setPartnerNum(lineInfoDO.getPartnerNum());
franInfo.setFranchiseeMobile(lineInfoDO.getMobile());
franInfo.setFranchiseeName(lineInfoDO.getUsername());
}
sysStoreAppResponse.setStoreDetail(storeDetail);
sysStoreAppResponse.setSupervisorDetail(supervisorDetail);
sysStoreAppResponse.setFranInfo(franInfo);
return sysStoreAppResponse;
}
public NewStoreRequest convertToNewStoreRequest(
SysStoreAppRequest sysStoreAppRequest,
LineInfoDO lineInfoDO,
PointInfoDO pointInfoDO) {
NewStoreRequest newStoreRequest = new NewStoreRequest();
ArrayList<String> objects = new ArrayList<>();
objects.add("123");
// accessory_address
newStoreRequest.setAccessory_address(objects);
// apply_user
LoginUserInfo user = CurrentUserHolder.getUser();
//todo 写死
newStoreRequest.setApply_user("19110026");
// city1
newStoreRequest.setCity1(pointInfoDO.getCity());
// csgs
ThirdDepartmentDO thirdDepartmentDO = thirdDepartmentMapper.getByName(sysStoreAppRequest.getStoreDetail().getBigName());
newStoreRequest.setCsgs(thirdDepartmentDO.getDepartmentCode());
// csqmc
newStoreRequest.setCsqmc(BusinessDistrictEnum.getByCode(sysStoreAppRequest.getStoreDetail().getSubBusinessType()).getDesc());
// ddxm
EnterpriseUserDO ddxm = enterpriseUserMapper.getUserInfoById(sysStoreAppRequest.getSupervisorDetail().getSupervisorId());//督导
newStoreRequest.setDdxm("22090043");
// dpzlht
newStoreRequest.setDpzlht(objects);
// end_time
newStoreRequest.setEnd_time(null);
// forecast_turnover
newStoreRequest.setForecast_turnover(sysStoreAppRequest.getStoreDetail().getEstimatedTurnover());
// invite_people
//todo xiesi
EnterpriseUserDO invitePeople = enterpriseUserMapper.getUserInfoById(sysStoreAppRequest.getFranInfo().getInviteUserId());//邀约人
newStoreRequest.setInvite_people("21100037");
// jms_id
newStoreRequest.setJms_id(lineInfoDO.getPartnerNum());
// jmskhdjbwzjt
newStoreRequest.setJmskhdjbwzjt(objects);
// join_channel
newStoreRequest.setJoin_channel(sysStoreAppRequest.getFranInfo().getFranchiseeType());
// jzdsmc
newStoreRequest.setJzdsmc(OfflineCompetitorEnum.getByCode(sysStoreAppRequest.getStoreDetail().getOfflineCompetitor()).getDesc());
// kdzBusinessid
newStoreRequest.setKdzBusinessId(AuditEnum.SYS_BUILD.getCode() + "_" +sysStoreAppRequest.getShopId() + "_" +pointInfoDO.getId());
// kllzsmc
newStoreRequest.setKllzsmc(PassengerFlowEnum.getByCode(sysStoreAppRequest.getStoreDetail().getAverageDailyRs()).getDesc());
// landlord_name
newStoreRequest.setLandlord_name(sysStoreAppRequest.getStoreDetail().getLandlordName());
// landlord_tel
newStoreRequest.setLandlord_tel(sysStoreAppRequest.getStoreDetail().getLandlordMobile());
// location_people
EnterpriseUserDO locationPeople = enterpriseUserMapper.getUserInfoById(pointInfoDO.getDevelopmentManager());//门店选址人
//todo 写死
newStoreRequest.setLocation_people("21100037");
// mdyzj
newStoreRequest.setMdyzj(sysStoreAppRequest.getStoreDetail().getStoreRent());
// merchant_people
EnterpriseUserDO merchantPeople = enterpriseUserMapper.getUserInfoById(lineInfoDO.getInvestmentManager());//招商人工号
//todo 写死
newStoreRequest.setMerchant_people("22090043");
// name1
newStoreRequest.setName1(sysStoreAppRequest.getStoreDetail().getStoreName());
// regio
newStoreRequest.setRegio(pointInfoDO.getProvince());
// reservation_date
newStoreRequest.setReservation_date(DateUtil.format(sysStoreAppRequest.getStoreDetail().getReservation(), Constants.TIME_STAMP_FLAG));
// room_date
newStoreRequest.setRoom_date(DateUtil.format(sysStoreAppRequest.getStoreDetail().getContractDeliveryDate(), Constants.TIME_STAMP_FLAG));
// scjdxz
newStoreRequest.setScjdxz(objects);
// signing_date
newStoreRequest.setSigning_date(DateUtil.format(sysStoreAppRequest.getStoreDetail().getSignDate(), Constants.TIME_STAMP_FLAG));
// sqmdlx
newStoreRequest.setSqmdlx(sysStoreAppRequest.getStoreDetail().getBusinessStoreType());
// sqrq
newStoreRequest.setSqrq(DateUtil.today());
// ssdq
newStoreRequest.setSsdq(sysStoreAppRequest.getStoreDetail().getBigCode());
// ssxq
newStoreRequest.setSsxq(sysStoreAppRequest.getStoreDetail().getSmallCode());
// sszq
newStoreRequest.setSszq(sysStoreAppRequest.getStoreDetail().getFightCode());
// start_time
newStoreRequest.setStart_time(null);
// store_bzj
newStoreRequest.setStore_bzj(sysStoreAppRequest.getStoreDetail().getStoreSecurityDeposit());
// store_jmf
newStoreRequest.setStore_jmf(sysStoreAppRequest.getStoreDetail().getStoreFranchiseFee());
// store_reason
newStoreRequest.setStore_reason(sysStoreAppRequest.getStoreDetail().getReasons());
// street
newStoreRequest.setStreet(pointInfoDO.getTownship());
// title
newStoreRequest.setTitle("SAP-新店开业申请-" + lineInfoDO.getUsername() + "-" + DateUtil.today());
// zcsqlx
newStoreRequest.setZcsqlx(sysStoreAppRequest.getStoreDetail().getSubBusinessType());
// zdqms
newStoreRequest.setZdqms(sysStoreAppRequest.getStoreDetail().getBigName());
// zhkkz
newStoreRequest.setZhkkz("Y");
// zjmsbm
newStoreRequest.setZjmsbm(lineInfoDO.getPartnerNum());
// zmddh
newStoreRequest.setZmddh(lineInfoDO.getMobile());
// zmdjyz
newStoreRequest.setZmdjyz(sysStoreAppRequest.getStoreDetail().getStoreOperator());
// zmdjyz_name
newStoreRequest.setZmdjyz_name(StoreOperatorEnum.getByCode(sysStoreAppRequest.getStoreDetail().getStoreOperator()).getDesc());
// zmdxz
newStoreRequest.setZmdxz(20);
// zmdxz_name
newStoreRequest.setZmdxz_name("加盟");
// zmdzt
newStoreRequest.setZmdzt(10);
// zmrjkllzs1
newStoreRequest.setZmrjkllzs1(sysStoreAppRequest.getStoreDetail().getAverageDailyRs());
// zppsyfy
newStoreRequest.setZppsyfy(0.05);
// zq
newStoreRequest.setZq(pointInfoDO.getDistrict());
// zsqmc
newStoreRequest.setZsqmc(BusinessDistrictEnum.getByCode(sysStoreAppRequest.getStoreDetail().getMainBusinessType()).getDesc());
// zssgs
newStoreRequest.setZssgs("1060");
// ztype
newStoreRequest.setZtype("Z1");
// zwesfj
newStoreRequest.setZwesfj(sysStoreAppRequest.getStoreDetail().getAveragePriceSh());
// zxqms
newStoreRequest.setZxqms(sysStoreAppRequest.getStoreDetail().getSmallCode());
// zxszyjzds
newStoreRequest.setZxszyjzds(sysStoreAppRequest.getStoreDetail().getOfflineCompetingBrand());
// zxxdz
newStoreRequest.setZxxdz(pointInfoDO.getAddress());
// zxxzyjzds
newStoreRequest.setZxxzyjzds(sysStoreAppRequest.getStoreDetail().getOfflineCompetitor());
// zymdbm
newStoreRequest.setZymdbm(pointInfoDO.getPointCode());
// zzqms
newStoreRequest.setZzqms(sysStoreAppRequest.getStoreDetail().getFightName());
newStoreRequest.setZzsqlx(sysStoreAppRequest.getStoreDetail().getMainBusinessType());
// zzsqlx
return newStoreRequest;
}
@Override
public Boolean auditResult(AuditResultRequest request) {
String kdzBusinessId = request.getKdzBusinessId();
Long shopId = getShopId(kdzBusinessId);
ShopAuditInfoDO shopAuditInfoDO = new ShopAuditInfoDO();
//1.成功/失败原因
try {
shopAuditInfoDO.setShopId(shopId);
shopAuditInfoDO.setAuditType(AuditTypeEnum.SYS_BUILD.getCode());
LoginUserInfo user = CurrentUserHolder.getUser();
shopAuditInfoDO.setSubmittedUserId(user.getUserId());
shopAuditInfoDO.setSubmittedUserName(user.getName());
if (request.getAuditResult() == 0){
shopAuditInfoDO.setResultType(1);
shopAuditInfoDO.setRejectReason(request.getCause());
}else if (request.getAuditResult() == 1){
shopAuditInfoDO.setResultType(0);
shopAuditInfoDO.setPassReason(request.getCause());
}
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
}catch (Exception e){
throw new ServiceException(ErrorCodeEnum.UNKNOWN);
}finally {
//2.校验建店与加盟签约合同是否完成 并初始化后续流程数据
preparationService.contractAndBuildStoreCompletion(shopId);
ShopInfoDO shopInfoDO = new ShopInfoDO();
shopInfoDO.setId(shopId);
shopInfoDO.setStoreNum(request.getStoreNum());
shopInfoMapper.updateByPrimaryKeySelective(shopInfoDO);
}
return true;
}
private Long getShopId(String kdzBusinessId) {
String shopId = kdzBusinessId.substring(kdzBusinessId.indexOf("_") + 1,kdzBusinessId.lastIndexOf("_"));
return Long.valueOf(shopId);
}
}

View File

@@ -6,8 +6,7 @@ import com.cool.store.constants.CommonConstants;
import com.cool.store.dao.*;
import com.cool.store.dto.wx.*;
import com.cool.store.entity.*;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.UserChannelEnum;
import com.cool.store.enums.*;
import com.cool.store.exception.ServiceException;
import com.cool.store.http.WechatRest;
import com.cool.store.mapper.HyPartnerUserChannelMapper;
@@ -123,6 +122,15 @@ public class WechatMiniAppServiceImpl implements WechatMiniAppService {
}
hyPartnerUserInfoDO.setUserChannelId(channelId);
hyPartnerUserInfoDAO.insertSelective(hyPartnerUserInfoDO);
//授权的时候 新增线索 放到公海
LineInfoDO lineInfoDO = new LineInfoDO();
lineInfoDO.setLineStatus(LineStatusEnum.PUBLIC_SEAS.getCode());
lineInfoDO.setWorkflowSubStage(WorkflowSubStageEnum.INTEND.getCode());
lineInfoDO.setMobile(hyPartnerUserInfoDO.getMobile());
lineInfoDO.setWorkflowStage(WorkflowStageEnum.INTENT.getCode());
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.INTENT_0.getCode());
lineInfoDO.setPartnerId(hyPartnerUserInfoDO.getPartnerId());
lineInfoDAO.insertOrUpdate(lineInfoDO);
}else {
hyPartnerUserInfoDO.setOpenid(openid);
hyPartnerUserInfoDAO.updateByPrimaryKeySelective(hyPartnerUserInfoDO);

View File

@@ -172,8 +172,24 @@ public class Constants
public static final String FRANCHISEE_STORE_NUM = "/api/kdz/franchisee/save";
public static final String NEW_STORE_URL = "/api/coolstore/start-flow/new-store";
public static final String FRANCHISE_AGREEMENT_COMPANY = "/api/coolstore/start-flow/franchise-agreement-company";
public static final String FRANCHISE_AGREEMENT_PERSON = "/api/coolstore/start-flow/franchise-agreement-person";
public static final Integer ZERO_INTEGER = 0;
public static final Integer ONE_INTEGER = 1;
public static final String INSERT_FLAG = "insert";
public static final String UPDATE_FLAG = "update";
public static final String TIME_STAMP_FLAG = "yyyy-MM-dd";

View File

@@ -3,6 +3,7 @@ package com.cool.store.controller.webb;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.request.AuditResultRequest;
import com.cool.store.request.SysBuildResultRequest;
import com.cool.store.request.XfsgOpenApiRequest;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.KdzApiService;
@@ -25,7 +26,7 @@ public class KdzApiController {
@Resource
KdzApiService kdzApiService;
@ApiOperation("意向加盟合同审核结果")
@ApiOperation("审核结果")
@PostMapping("/audit/result")
public ResponseResult<Boolean> auditResult(@PathVariable(value = "enterprise-id") String eid,
@RequestBody XfsgOpenApiRequest request) {
@@ -41,6 +42,8 @@ public class KdzApiController {
return ResponseResult.success(kdzApiService.auditResult(auditResultRequest));
}
public static boolean verifyMD5(XfsgOpenApiRequest request, String eid){
//签名
StringBuffer sb = new StringBuffer();

View File

@@ -62,9 +62,16 @@ public class LineInfoController {
@ApiOperation("公海线索")
@PostMapping("/getPublicLineList")
public ResponseResult<PageInfo<PublicLineListVO>> getTeamLineList(@RequestBody PublicLineListRequest publicLineListRequest) {
public ResponseResult<PageInfo<PublicLineListVO>> getPublicLineList(@RequestBody PublicLineListRequest publicLineListRequest) {
LoginUserInfo user = CurrentUserHolder.getUser();
return ResponseResult.success(lineService.getPublicLineList(publicLineListRequest,user));
return ResponseResult.success(lineService.getPublicLineList(publicLineListRequest,user,Boolean.TRUE));
}
@ApiOperation("待分配线索")
@PostMapping("/getAssignedLineList")
public ResponseResult<PageInfo<PublicLineListVO>> getAssignedLineList(@RequestBody PublicLineListRequest publicLineListRequest) {
LoginUserInfo user = CurrentUserHolder.getUser();
return ResponseResult.success(lineService.getPublicLineList(publicLineListRequest,user,Boolean.FALSE));
}
@ApiOperation("我负责的加盟商")

View File

@@ -46,7 +46,7 @@ public class PointController {
@ApiOperation("完善铺位")
@PostMapping("/update")
public ResponseResult<Integer> updatePointDetailInfo(@RequestBody @Validated UpdatePointDetailRequest shopPointDetailRequest) {
public ResponseResult<Long> updatePointDetailInfo(@RequestBody @Validated UpdatePointDetailRequest shopPointDetailRequest) {
return ResponseResult.success(pointService.updatePointDetailInfo(shopPointDetailRequest));
}

View File

@@ -0,0 +1,39 @@
package com.cool.store.controller.webb;
import com.cool.store.request.SysStoreAppRequest;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.SysStoreAppService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Map;
@RestController
@RequestMapping("/pc/sysStore")
@Api(tags = "系统建店")
@Slf4j
public class SysStoreAppController {
@Resource
private SysStoreAppService sysStoreAppService;
@PostMapping(path = "/submit")
@ApiOperation("提交(更新) 系统建店申请")
public ResponseResult submitSysBuildStore(@RequestBody SysStoreAppRequest request) {
return sysStoreAppService.submitSysBuildStore(request);
}
@GetMapping(path = "/default/get")
@ApiOperation("获取系统建店默认值")
public ResponseResult getDefaultValueSysBuildStore(@RequestParam("lineId") Long lineId,
@RequestParam("shopId") Long shopId) {
return ResponseResult.success(sysStoreAppService.getDefaultValueSysBuildStore(lineId,shopId));
}
}

View File

@@ -0,0 +1,31 @@
package com.cool.store.controller.webc;
import com.cool.store.entity.BankdocDO;
import com.cool.store.request.BranchBankPageRequest;
import com.cool.store.response.ResponseResult;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 证照办理
*/
@RestController
@RequestMapping("/mini/license")
@Api(tags = "证照办理")
@Slf4j
public class ApplyLicenseController {
@ApiOperation("证照办理提交")
@PostMapping("/submit")
public ResponseResult submitLicense() {
return ResponseResult.success();
}
}

View File

@@ -60,8 +60,8 @@ trtc.sdkAppId=1600026212
trtc.secretKey=e036b654c665f649f053a01ff6f5652a826980027be298d4d49949f6e26434a5
trtc.video.callback.secretKey=ur4wq2iFbRI03Q35
weixin.appId=wx085c84fe42691bf1
weixin.appSecret=58e89c9ec4ade1d094bbe21836a19ec4
weixin.appId=wx997f2206e276e513
weixin.appSecret=2ddea4374abeace05e83c948392c2952
weixin.index.url=pages/index/index
signKey=77fea013c3a6459685b83c21a2fc3411

View File

@@ -49,8 +49,8 @@ trtc.sdkAppId=1600026212
trtc.secretKey=e036b654c665f649f053a01ff6f5652a826980027be298d4d49949f6e26434a5
trtc.video.callback.secretKey=ur4wq2iFbRI03Q35
weixin.appId=wx085c84fe42691bf1
weixin.appSecret=58e89c9ec4ade1d094bbe21836a19ec4
weixin.appId=wx997f2206e276e513
weixin.appSecret=2ddea4374abeace05e83c948392c2952
weixin.index.url=pages/index/index
signKey=77fea013c3a6459685b83c21a2fc3411

View File

@@ -61,7 +61,7 @@ trtc.secretKey=4854bab106c2ca2a2fda16a8c966933e28a078a34e458999d6227e8cd8ab8219
trtc.video.callback.secretKey=1ECEAD34DBD84E838BF07FC7360EA4D8
weixin.appId=wx997f2206e276e513
weixin.appSecret=90a51574dde00480316f81a552e6b5cb
weixin.appSecret=2ddea4374abeace05e83c948392c2952
weixin.index.url=pages/index/index
signKey=77fea013c3a6459685b83c21a2fc3411

View File

@@ -60,8 +60,8 @@ trtc.sdkAppId=1600026212
trtc.secretKey=e036b654c665f649f053a01ff6f5652a826980027be298d4d49949f6e26434a5
trtc.video.callback.secretKey=ur4wq2iFbRI03Q35
weixin.appId=wx085c84fe42691bf1
weixin.appSecret=58e89c9ec4ade1d094bbe21836a19ec4
weixin.appId=wx997f2206e276e513
weixin.appSecret=2ddea4374abeace05e83c948392c2952
weixin.index.url=pages/index/index
signKey=77fea013c3a6459685b83c21a2fc3411