记得上下班打卡 | git大法好,push需谨慎

Commit 590be50d authored by 姜秀龙's avatar 姜秀龙

店铺设置增加发货地址

parent b52ab451
...@@ -17,7 +17,7 @@ public class GoblinStoreMgtConfigEditParam implements Serializable { ...@@ -17,7 +17,7 @@ public class GoblinStoreMgtConfigEditParam implements Serializable {
@ApiModelProperty(position = 10, value = "店铺ID[64]") @ApiModelProperty(position = 10, value = "店铺ID[64]")
@NotBlank(message = "店铺ID不能为空") @Size(max = 64) @NotBlank(message = "店铺ID不能为空") @Size(max = 64)
private String storeId; private String storeId;
@ApiModelProperty(position = 11, value = "店铺配置集合[Map]", example = "{\"BUSINESS_STATUS\":\"5\",\"ONOFF_CUSTOMER_SEV\":\"ON\",\"ONOFF_SOLD_OUT_SHOW\":\"ON\",\"LIMIT_WARNING_STOCK\":\"5\"}") @ApiModelProperty(position = 11, value = "店铺配置集合[Map]", example = "{\"BUSINESS_STATUS\":\"5\",\"ONOFF_CUSTOMER_SEV\":\"ON\",\"ONOFF_SOLD_OUT_SHOW\":\"ON\",\"LIMIT_WARNING_STOCK\":\"5\",\"SHIP_FROM_ADDRESS\":\"北京市朝阳区\"}")
@NotNull(message = "店铺配置不能为空") @NotNull(message = "店铺配置不能为空")
private Map<String, String> confMap; private Map<String, String> confMap;
} }
...@@ -24,4 +24,8 @@ public enum GoblinStoreConf { ...@@ -24,4 +24,8 @@ public enum GoblinStoreConf {
* 指标:库存不足 * 指标:库存不足
*/ */
LIMIT_WARNING_STOCK, LIMIT_WARNING_STOCK,
/**
* 发货地址(快递100 from,空则用系统默认)
*/
SHIP_FROM_ADDRESS,
} }
...@@ -152,7 +152,8 @@ insert into goblin_store_config (store_id, config_name, config_key, config_val, ...@@ -152,7 +152,8 @@ insert into goblin_store_config (store_id, config_name, config_key, config_val,
values (0, '营业状态', 'BUSINESS_STATUS', '5', 'admin', sysdate()), values (0, '营业状态', 'BUSINESS_STATUS', '5', 'admin', sysdate()),
(0, '联系客服', 'ONOFF_CUSTOMER_SEV', 'OFF', 'admin', sysdate()), (0, '联系客服', 'ONOFF_CUSTOMER_SEV', 'OFF', 'admin', sysdate()),
(0, '售罄展示', 'ONOFF_SOLD_OUT_SHOW', 'OFF', 'admin', sysdate()), (0, '售罄展示', 'ONOFF_SOLD_OUT_SHOW', 'OFF', 'admin', sysdate()),
(0, '库存不足', 'LIMIT_WARNING_STOCK', '5', 'admin', sysdate()); (0, '库存不足', 'LIMIT_WARNING_STOCK', '5', 'admin', sysdate()),
(0, '发货地址', 'SHIP_FROM_ADDRESS', '', 'admin', sysdate());
# -- >>------------------------------------------------------------------------------------ # -- >>------------------------------------------------------------------------------------
drop table if exists goblin_store_notice; drop table if exists goblin_store_notice;
create table goblin_store_notice create table goblin_store_notice
......
...@@ -127,7 +127,7 @@ public class GoblinStoreMgtController { ...@@ -127,7 +127,7 @@ public class GoblinStoreMgtController {
} }
@ApiOperationSupport(order = 5) @ApiOperationSupport(order = 5)
@ApiOperation(value = "店铺管理:店铺设置:详情", notes = "BUSINESS_STATUS(状态:营业状态[4-停业|5-营业])、ONOFF_CUSTOMER_SEV(开关:联系客服)、ONOFF_SOLD_OUT_SHOW(开关:售罄展示)、LIMIT_WARNING_STOCK(指标:库存不足)") @ApiOperation(value = "店铺管理:店铺设置:详情", notes = "BUSINESS_STATUS(状态:营业状态[4-停业|5-营业])、ONOFF_CUSTOMER_SEV(开关:联系客服)、ONOFF_SOLD_OUT_SHOW(开关:售罄展示)、LIMIT_WARNING_STOCK(指标:库存不足)、SHIP_FROM_ADDRESS(发货地址,快递100用;空则用系统默认)")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "店铺ID[64]"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "店铺ID[64]"),
}) })
...@@ -180,6 +180,9 @@ public class GoblinStoreMgtController { ...@@ -180,6 +180,9 @@ public class GoblinStoreMgtController {
updateConfMap.put(ck, cv); updateConfMap.put(ck, cv);
} }
break; break;
case "SHIP_FROM_ADDRESS":
updateConfMap.put(ck, cv);
break;
} }
}); });
if (CollectionUtils.isEmpty(updateConfMap)) { if (CollectionUtils.isEmpty(updateConfMap)) {
......
...@@ -451,7 +451,7 @@ public class GoblinMailTrackServiceImpl implements IGoblinMailTrackService { ...@@ -451,7 +451,7 @@ public class GoblinMailTrackServiceImpl implements IGoblinMailTrackService {
GoblinStoreOrderVo orderVo = redisUtils.getGoblinOrder(orderId); GoblinStoreOrderVo orderVo = redisUtils.getGoblinOrder(orderId);
String phone = resolvePhone(orderVo); String phone = resolvePhone(orderVo);
String to = resolveTo(orderVo); String to = resolveTo(orderVo);
String from = kuaidi100Client.getDefaultFrom(); String from = resolveFrom(orderVo);
String callback = buildCallbackUrl(mailId, orderId); String callback = buildCallbackUrl(mailId, orderId);
try { try {
SubscribeResp resp = kuaidi100Client.subscribeWithMap(com, mailNo, phone, from, to, callback); SubscribeResp resp = kuaidi100Client.subscribeWithMap(com, mailNo, phone, from, to, callback);
...@@ -500,7 +500,7 @@ public class GoblinMailTrackServiceImpl implements IGoblinMailTrackService { ...@@ -500,7 +500,7 @@ public class GoblinMailTrackServiceImpl implements IGoblinMailTrackService {
GoblinStoreOrderVo orderVo = redisUtils.getGoblinOrder(orderId); GoblinStoreOrderVo orderVo = redisUtils.getGoblinOrder(orderId);
String phone = resolvePhone(orderVo); String phone = resolvePhone(orderVo);
String to = resolveTo(orderVo); String to = resolveTo(orderVo);
String from = kuaidi100Client.getDefaultFrom(); String from = resolveFrom(orderVo);
try { try {
QueryTrackMapResp resp = kuaidi100Client.queryMapTrack(com, mailNo, phone, from, to); QueryTrackMapResp resp = kuaidi100Client.queryMapTrack(com, mailNo, phone, from, to);
if (resp == null) { if (resp == null) {
...@@ -625,6 +625,22 @@ public class GoblinMailTrackServiceImpl implements IGoblinMailTrackService { ...@@ -625,6 +625,22 @@ public class GoblinMailTrackServiceImpl implements IGoblinMailTrackService {
return address == null ? "" : address; return address == null ? "" : address;
} }
/** 发货地:店铺设置 SHIP_FROM_ADDRESS,空则用配置文件 liquidnet.express.kuaidi100.from */
private String resolveFrom(GoblinStoreOrderVo orderVo) {
if (orderVo != null && StringUtils.isNotBlank(orderVo.getStoreId())) {
List<GoblinStoreConfigVo> configs = redisUtils.getStoreConfigVos(orderVo.getStoreId());
if (configs != null) {
for (GoblinStoreConfigVo conf : configs) {
if (GoblinStoreConf.SHIP_FROM_ADDRESS.name().equals(conf.getConfigKey())
&& StringUtils.isNotBlank(conf.getConfigVal())) {
return conf.getConfigVal().trim();
}
}
}
}
return kuaidi100Client.getDefaultFrom();
}
private String buildCallbackUrl(String mailId, String orderId) { private String buildCallbackUrl(String mailId, String orderId) {
String base = kuaidi100Client.getCallbackurl(); String base = kuaidi100Client.getCallbackurl();
String sep = base.contains("?") ? "&" : "?"; String sep = base.contains("?") ? "&" : "?";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment