Merge branch 'cc_20250902_caipin' into 'master'
Cc 20250902 caipin See merge request hangzhou/java/custom_zxjp!155
This commit is contained in:
@@ -52,6 +52,17 @@ public enum FranchiseBrandEnum {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static String getDescByCode(Integer code) {
|
||||
if (code==null){
|
||||
return null;
|
||||
}
|
||||
for (FranchiseBrandEnum e : FranchiseBrandEnum.values()) {
|
||||
if (code == e.getCode()) {
|
||||
return e.getDesc();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static FranchiseBrandEnum getEnumByCode(Integer code) {
|
||||
if (code == null){
|
||||
|
||||
@@ -36,6 +36,14 @@
|
||||
<result column="region_id" property="regionId" jdbcType="VARCHAR"/>
|
||||
<result column="store_status" property="storeStatus" jdbcType="VARCHAR"/>
|
||||
<result column="open_date" property="openDate" jdbcType="DATE"/>
|
||||
<result column="monthly_rent" property="monthlyRent"/>
|
||||
<result column="monthly_personnel_salary" property="monthlyPersonnelSalary"/>
|
||||
<result column="monthly_other_expenses" property="monthlyOtherExpenses"/>
|
||||
<result column="unified_management" property="unifiedManagement" jdbcType="TINYINT"/>
|
||||
<result column="join_model" property="joinModel" jdbcType="TINYINT"/>
|
||||
<result column="join_brand" property="joinBrand" jdbcType="TINYINT"/>
|
||||
<result column="store_type" property="storeType" jdbcType="TINYINT"/>
|
||||
<result column="mini_program_order_store_name" property="miniProgramOrderStoreName"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="getByStoreId" resultMap="BaseResultMap">
|
||||
@@ -171,5 +179,4 @@
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -17,16 +17,6 @@ public class StoreDTO {
|
||||
private String storeName;
|
||||
@ApiModelProperty("门店CODE")
|
||||
private String storeCode;
|
||||
@ApiModelProperty("店长手机号")
|
||||
private String managerPhone;
|
||||
@ApiModelProperty("签约人1姓名")
|
||||
private String signer1Name;
|
||||
@ApiModelProperty("签约人2手机号")
|
||||
private String signer1Phone;
|
||||
@ApiModelProperty("签约人2姓名")
|
||||
private String signer2Name;
|
||||
@ApiModelProperty("签约人2手机号")
|
||||
private String signer2Phone;
|
||||
@ApiModelProperty("订单小程序名称")
|
||||
private String orderMiniProgramName;
|
||||
@ApiModelProperty("加盟模式")
|
||||
@@ -47,5 +37,10 @@ public class StoreDTO {
|
||||
private BigDecimal monthlyPersonnelSalary;
|
||||
@ApiModelProperty("月水电费")
|
||||
private BigDecimal monthlyOtherExpenses;
|
||||
@ApiModelProperty("统管 1-统管 0-非统管")
|
||||
private Integer unifiedManagement;
|
||||
|
||||
private String longitude;
|
||||
|
||||
private String latitude;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@@ -220,4 +221,22 @@ public class StoreDO {
|
||||
* 距离我的距离
|
||||
*/
|
||||
private String distance;
|
||||
|
||||
private BigDecimal monthlyRent;
|
||||
|
||||
private BigDecimal monthlyPersonnelSalary;
|
||||
|
||||
private BigDecimal monthlyOtherExpenses;
|
||||
|
||||
private Integer unifiedManagement;
|
||||
|
||||
private Integer joinBrand;
|
||||
|
||||
private Integer joinModel;
|
||||
|
||||
private Integer storeType;
|
||||
|
||||
private String miniProgramOrderStoreName;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -95,6 +95,8 @@ public class StoreMasterDTO {
|
||||
private SignerInfo signerInfo;
|
||||
|
||||
private SettlerInfo settlerInfo;
|
||||
@ApiModelProperty("是否统管")
|
||||
private Integer unifiedManagement;
|
||||
|
||||
@Data
|
||||
public static class SignerInfo {
|
||||
|
||||
@@ -343,11 +343,6 @@ public class StoreServiceImpl implements StoreService {
|
||||
|
||||
|
||||
public static List<StoreDTO> processStores(List<StoreDO> stores) {
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
// 创建配置映射:key -> 枚举项
|
||||
Map<String, ExtendFieldTypeEnum> configMap = ExtendFieldTypeEnum.configMap();
|
||||
|
||||
// 处理每个门店
|
||||
return stores.stream().map(store -> {
|
||||
StoreDTO dto = new StoreDTO();
|
||||
@@ -356,65 +351,18 @@ public class StoreServiceImpl implements StoreService {
|
||||
dto.setStoreAddress(store.getStoreAddress());
|
||||
dto.setStoreAvatar(store.getAvatar());
|
||||
dto.setTelephone(store.getTelephone());
|
||||
try {
|
||||
// 解析门店的扩展字段
|
||||
Map<String, String> extendFields = objectMapper.readValue(
|
||||
store.getExtendField(),
|
||||
new TypeReference<Map<String, String>>() {}
|
||||
);
|
||||
|
||||
// 匹配并设置DTO字段
|
||||
for (Map.Entry<String, String> entry : extendFields.entrySet()) {
|
||||
ExtendFieldTypeEnum fieldEnum = configMap.get(entry.getKey());
|
||||
if (fieldEnum != null) {
|
||||
switch (fieldEnum) {
|
||||
case TEST_STORE_MANAGER_MOBILE:
|
||||
case ONLINE_STORE_MANAGER_MOBILE:
|
||||
dto.setManagerPhone(entry.getValue());
|
||||
break;
|
||||
case TEST_SIGNATORY_NAME_1:
|
||||
case ONLINE_SIGNATORY_NAME_1:
|
||||
dto.setSigner1Name(entry.getValue());
|
||||
break;
|
||||
case TEST_SIGNATORY_MOBILE_1:
|
||||
case ONLINE_SIGNATORY_MOBILE_1:
|
||||
dto.setSigner1Phone(entry.getValue());
|
||||
break;
|
||||
case TEST_SIGNATORY_NAME_2:
|
||||
case ONLINE_SIGNATORY_NAME_2:
|
||||
dto.setSigner2Name(entry.getValue());
|
||||
break;
|
||||
case TEST_SIGNATORY_MOBILE_2:
|
||||
case ONLINE_SIGNATORY_MOBILE_2:
|
||||
dto.setSigner2Phone(entry.getValue());
|
||||
break;
|
||||
case TEST_ORDER_NAME:
|
||||
case ONLINE_ORDER_NAME:
|
||||
dto.setOrderMiniProgramName(entry.getValue());
|
||||
break;
|
||||
case TEST_JOIN_MODE:
|
||||
case ONLINE_JOIN_MODE:
|
||||
dto.setJoinMode(entry.getValue());
|
||||
break;
|
||||
case TEST_STORE_TYPE:
|
||||
case ONLINE_STORE_TYPE:
|
||||
dto.setStoreType(entry.getValue());
|
||||
break;
|
||||
case TEST_BRAND:
|
||||
case ONLINE_BRAND:
|
||||
dto.setBrand(entry.getValue());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 处理JSON解析异常
|
||||
log.error("解析门店扩展字段失败: {} " + store.getStoreNum());
|
||||
e.printStackTrace();
|
||||
}
|
||||
dto.setMonthlyRent(store.getMonthlyRent());
|
||||
dto.setMonthlyPersonnelSalary(store.getMonthlyPersonnelSalary());
|
||||
dto.setMonthlyOtherExpenses(store.getMonthlyOtherExpenses());
|
||||
dto.setUnifiedManagement(store.getUnifiedManagement());
|
||||
dto.setStoreType(StoreTypeEnum.getMessage(store.getStoreType()));
|
||||
dto.setJoinMode(JoinModeEnum.getByCode(store.getJoinModel()));
|
||||
dto.setBrand(FranchiseBrandEnum.getDescByCode(store.getJoinBrand()));
|
||||
dto.setOrderMiniProgramName(store.getMiniProgramOrderStoreName());
|
||||
dto.setLongitude(store.getLongitude());
|
||||
dto.setLatitude(store.getLatitude());
|
||||
return dto;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -114,6 +114,7 @@ public class SyncMainSysServerImpl implements SyncMainSysServer {
|
||||
storeMasterDTO.setManageModel(signFranchiseDO.getBusinessModel());
|
||||
storeMasterDTO.setSignType(signFranchiseDO.getSignType());
|
||||
storeMasterDTO.setProtectiveDistance(signFranchiseDO.getProtectiveDistance());
|
||||
storeMasterDTO.setUnifiedManagement(signFranchiseDO.getUnifiedManagement());
|
||||
|
||||
BigRegionDO region = bigRegionDAO.getByRegionId(shopInfo.getRegionId());
|
||||
storeMasterDTO.setBloc(region.getGroupName());
|
||||
|
||||
Reference in New Issue
Block a user