fix modify sur

master
luoyang 6 years ago
parent 6c616d5795
commit 9d0fb270fe

@ -17,6 +17,7 @@ import org.apache.commons.lang3.time.DateUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.util.Date; import java.util.Date;
@ -76,6 +77,20 @@ public class ManualServiceimpl implements ManualService {
cleanDays = wechatRate.getIntValue("c_clean_days"); cleanDays = wechatRate.getIntValue("c_clean_days");
} }
int finalCleanDays = cleanDays; int finalCleanDays = cleanDays;
modifyClientRates(finalCleanDays,clientRates,client_id,p.getString("client_moniker"));
});
});
logger.info("end doing client postpone");
}
@Transactional
public void modifyClientRates(int finalCleanDays,List<JSONObject> clientRates,int client_id,String client_moniker) {
Date now = new Date();
Date tomorrow = DateUtils.addDays(now, 1);
Date yearTomorrow = DateUtils.addYears(tomorrow, 1);
clientRates.forEach(o -> { clientRates.forEach(o -> {
JSONObject record = clientRateMapper.latestExpiryConfig(client_id, o.getString("rate_name")); JSONObject record = clientRateMapper.latestExpiryConfig(client_id, o.getString("rate_name"));
record.remove("client_rate_id"); record.remove("client_rate_id");
@ -93,10 +108,6 @@ public class ManualServiceimpl implements ManualService {
} }
}); });
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(null, p.getString("client_moniker"), "tax_in_surcharge", false)); clientModifySupport.processClientConfigModify(new SwitchPermissionModify(null, client_moniker, "tax_in_surcharge", false));
});
});
logger.info("end doing client postpone");
} }
} }

Loading…
Cancel
Save