order expiry setter

master
yixian 7 years ago
parent c6bd5aeea3
commit c7c42b064d

@ -241,7 +241,7 @@ public interface ClientManager {
void setCustomerSurchargeRate(String clientMoniker, BigDecimal customer_surcharge_rate); void setCustomerSurchargeRate(String clientMoniker, BigDecimal customer_surcharge_rate);
void setOrderExpiryConfig(String clientMoniker, String order_expiry_config); void setOrderExpiryConfig(String clientMoniker, String orderExpiryConfig);
void getAgreeFile(String clientMoniker, JSONObject manager) throws Exception; void getAgreeFile(String clientMoniker, JSONObject manager) throws Exception;

@ -1673,19 +1673,19 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
@Override @Override
public void setOrderExpiryConfig(String clientMoniker, String order_expiry_config) { public void setOrderExpiryConfig(String clientMoniker, String orderExpiryConfig) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) { if (client == null) {
throw new InvalidShortIdException(); throw new InvalidShortIdException();
} }
JSONObject update = new JSONObject(); JSONObject update = new JSONObject();
update.put("client_id", client.getIntValue("client_id")); update.put("client_id", client.getIntValue("client_id"));
if (order_expiry_config != null) { if (orderExpiryConfig != null) {
OrderExpiryRuleResolver.resolveExpiryTime("order_expiry_config", new Date()); OrderExpiryRuleResolver.resolveExpiryTime(orderExpiryConfig, new Date());
} update.put("order_expiry_config", orderExpiryConfig);
update.put("order_expiry_config", order_expiry_config == "" ? null : order_expiry_config);
clientMapper.update(update); clientMapper.update(update);
} }
}
@Override @Override
@Transactional @Transactional

Loading…
Cancel
Save